avo 2.22.0 → 2.23.0
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -5
- data/app/controllers/avo/search_controller.rb +1 -1
- data/app/helpers/avo/application_helper.rb +1 -0
- data/app/javascript/js/controllers/search_controller.js +2 -3
- data/lib/avo/fields/date_time_field.rb +8 -1
- data/lib/avo/fields/time_field.rb +0 -8
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/resource_generator.rb +4 -4
- data/public/avo-assets/avo.base.js +1 -1
- data/public/avo-assets/avo.base.js.map +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e88a89c55dea0fd4c6decb58ca02d83afccf638c743651a29afa7ff60547884
|
4
|
+
data.tar.gz: 3b05ddd7330bbba0a6ce40797424ab214d8a2bf29e6bdcabce6fae2eea9c69db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98d2ee570fd69f75d48686560e5f42f88d7a1f88e6beab948aa62df3edfe1ab0a29953591fb894f123a55695568f9ae3d5acf3d151488a40c5fac3561c936bc9
|
7
|
+
data.tar.gz: 4c01539481c87fa3d5e796972d4527a5485ae4117ca7c32d57d0d5d704f5532435793acf8b0e6825be40ca78e34438ae7dd820a670e3fc8b2188e43b01066a24
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
avo (2.
|
4
|
+
avo (2.23.0)
|
5
5
|
actionview (>= 6.0)
|
6
6
|
active_link_to
|
7
7
|
activerecord (>= 6.0)
|
@@ -265,8 +265,7 @@ GEM
|
|
265
265
|
nokogiri (1.13.10-x86_64-linux)
|
266
266
|
racc (~> 1.4)
|
267
267
|
orm_adapter (0.5.0)
|
268
|
-
pagy (
|
269
|
-
activesupport
|
268
|
+
pagy (6.0.0)
|
270
269
|
parallel (1.22.1)
|
271
270
|
parser (3.1.2.1)
|
272
271
|
ast (~> 2.4.1)
|
@@ -409,8 +408,8 @@ GEM
|
|
409
408
|
tzinfo (2.0.5)
|
410
409
|
concurrent-ruby (~> 1.0)
|
411
410
|
unicode-display_width (2.2.0)
|
412
|
-
view_component (2.
|
413
|
-
activesupport (>= 5.
|
411
|
+
view_component (2.80.0)
|
412
|
+
activesupport (>= 5.2.0, < 8.0)
|
414
413
|
concurrent-ruby (~> 1.0)
|
415
414
|
method_source (~> 1.0)
|
416
415
|
warden (1.2.9)
|
@@ -211,19 +211,18 @@ export default class extends Controller {
|
|
211
211
|
searchUrl(query) {
|
212
212
|
const url = URI()
|
213
213
|
|
214
|
-
return url.segment(this.searchSegments()).search(this.searchParams(query)).toString()
|
214
|
+
return url.segment([window.Avo.configuration.root_path, ...this.searchSegments()]).search(this.searchParams(query)).readable().toString()
|
215
215
|
}
|
216
216
|
|
217
217
|
searchSegments() {
|
218
218
|
let segments = [
|
219
|
-
window.Avo.configuration.root_path,
|
220
219
|
'avo_api',
|
221
220
|
this.dataset.searchResource,
|
222
221
|
'search',
|
223
222
|
]
|
224
223
|
|
225
224
|
if (this.isGlobalSearch) {
|
226
|
-
segments = [
|
225
|
+
segments = ['avo_api', 'search']
|
227
226
|
}
|
228
227
|
|
229
228
|
return segments
|
@@ -4,7 +4,6 @@ module Avo
|
|
4
4
|
attr_reader :format
|
5
5
|
attr_reader :picker_format
|
6
6
|
attr_reader :time_24hr
|
7
|
-
attr_reader :timezone
|
8
7
|
attr_reader :relative
|
9
8
|
|
10
9
|
def initialize(id, **args, &block)
|
@@ -50,6 +49,14 @@ module Avo
|
|
50
49
|
value
|
51
50
|
end
|
52
51
|
end
|
52
|
+
|
53
|
+
def timezone
|
54
|
+
if @timezone.respond_to?(:call)
|
55
|
+
return Avo::Hosts::ResourceViewRecordHost.new(block: @timezone, record: resource.model, resource: resource, view: view).handle
|
56
|
+
end
|
57
|
+
|
58
|
+
@timezone
|
59
|
+
end
|
53
60
|
end
|
54
61
|
end
|
55
62
|
end
|
data/lib/avo/version.rb
CHANGED
@@ -62,7 +62,7 @@ module Generators
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def db_columns_to_ignore
|
65
|
-
%w[id encrypted_password reset_password_token reset_password_sent_at remember_created_at created_at updated_at]
|
65
|
+
%w[id encrypted_password reset_password_token reset_password_sent_at remember_created_at created_at updated_at password_digest]
|
66
66
|
end
|
67
67
|
|
68
68
|
def reflections
|
@@ -289,13 +289,13 @@ module Generators
|
|
289
289
|
field: "number"
|
290
290
|
},
|
291
291
|
datetime: {
|
292
|
-
field: "
|
292
|
+
field: "date_time"
|
293
293
|
},
|
294
294
|
timestamp: {
|
295
|
-
field: "
|
295
|
+
field: "date_time"
|
296
296
|
},
|
297
297
|
time: {
|
298
|
-
field: "
|
298
|
+
field: "date_time"
|
299
299
|
},
|
300
300
|
date: {
|
301
301
|
field: "date"
|
@@ -123,7 +123,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
123
123
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Stt(t,e){if(!!t){if(typeof t=="string")return WF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return WF(t,e)}}function ktt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Ett(t){if(Array.isArray(t))return WF(t)}function WF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Fue(t){var e=t.createElement,r=t.Fragment;return function(i){var o=i.hit,a=i.attribute,s=i.tagName,u=s===void 0?"mark":s;return e.apply(void 0,[r,{}].concat(wtt(qE({hit:o,attribute:a}).map(function(c,f){return c.isHighlighted?e(u,{key:f},c.value):c.value}))))}}var Nue=se(()=>{km()});function Ctt(t){return Ott(t)||Dtt(t)||Att(t)||Ttt()}function Ttt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
124
124
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Att(t,e){if(!!t){if(typeof t=="string")return UF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return UF(t,e)}}function Dtt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Ott(t){if(Array.isArray(t))return UF(t)}function UF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Bue(t){var e=t.createElement,r=t.Fragment;return function(i){var o=i.hit,a=i.attribute,s=i.tagName,u=s===void 0?"mark":s;return e.apply(void 0,[r,{}].concat(Ctt(xue({hit:o,attribute:a}).map(function(c,f){return c.isHighlighted?e(u,{key:f},c.value):c.value}))))}}var jue=se(()=>{km()});function Mtt(t){return Rtt(t)||Ptt(t)||Ltt(t)||Itt()}function Itt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
125
125
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ltt(t,e){if(!!t){if(typeof t=="string")return VF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return VF(t,e)}}function Ptt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Rtt(t){if(Array.isArray(t))return VF(t)}function VF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function zue(t){var e=t.createElement,r=t.Fragment;return function(i){var o=i.hit,a=i.attribute,s=i.tagName,u=s===void 0?"mark":s;return e.apply(void 0,[r,{}].concat(Mtt(_ue({hit:o,attribute:a}).map(function(c,f){return c.isHighlighted?e(u,{key:f},c.value):c.value}))))}}var Hue=se(()=>{km()});function qtt(t){return jtt(t)||Btt(t)||Ntt(t)||Ftt()}function Ftt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
126
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ntt(t,e){if(!!t){if(typeof t=="string")return $F(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $F(t,e)}}function Btt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function jtt(t){if(Array.isArray(t))return $F(t)}function $F(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Wue(t){var e=t.createElement,r=t.Fragment;return function(i){var o=i.hit,a=i.attribute,s=i.tagName,u=s===void 0?"mark":s;return e.apply(void 0,[r,{}].concat(qtt(BE({hit:o,attribute:a}).map(function(c,f){return c.isHighlighted?e(u,{key:f},c.value):c.value}))))}}var Uue=se(()=>{km()});var Vue=se(()=>{Nue();jue();Hue();Uue()});function $ue(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function HE(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$ue(Object(r),!0).forEach(function(n){ztt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$ue(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ztt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Htt(t,e){if(t==null)return{};var r=Wtt(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}function Wtt(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function Yue(t){var e,r=t.classNames,n=t.container,i=t.getEnvironmentProps,o=t.getFormProps,a=t.getInputProps,s=t.getItemProps,u=t.getLabelProps,c=t.getListProps,f=t.getPanelProps,p=t.getRootProps,g=t.panelContainer,m=t.panelPlacement,x=t.render,w=t.renderNoResults,A=t.renderer,k=t.detachedMediaQuery,T=t.components,D=Htt(t,["classNames","container","getEnvironmentProps","getFormProps","getInputProps","getItemProps","getLabelProps","getListProps","getPanelProps","getRootProps","panelContainer","panelPlacement","render","renderNoResults","renderer","detachedMediaQuery","components"]),M=wF(n);M.tagName;var P=typeof window<"u"?window:{},_=A??$tt,C={Highlight:Fue(_),ReverseHighlight:Bue(_),ReverseSnippet:zue(_),Snippet:Wue(_)};return{renderer:{classNames:Dle(Utt,r??{}),container:M,getEnvironmentProps:i??function(O){var F=O.props;return F},getFormProps:o??function(O){var F=O.props;return F},getInputProps:a??function(O){var F=O.props;return F},getItemProps:s??function(O){var F=O.props;return F},getLabelProps:u??function(O){var F=O.props;return F},getListProps:c??function(O){var F=O.props;return F},getPanelProps:f??function(O){var F=O.props;return F},getRootProps:p??function(O){var F=O.props;return F},panelContainer:g?wF(g):document.body,panelPlacement:m??"input-wrapper-width",render:x??Vtt,renderNoResults:w,renderer:_,detachedMediaQuery:k??getComputedStyle(P.document.documentElement).getPropertyValue("--aa-detached-media-query"),components:HE(HE({},C),T)},core:HE(HE({},D),{},{id:(e=D.id)!==null&&e!==void 0?e:wE(),environment:P})}}var Utt,Vtt,$tt,Kue=se(()=>{wh();pue();Vue();_m();Utt={clearButton:"aa-ClearButton",detachedCancelButton:"aa-DetachedCancelButton",detachedContainer:"aa-DetachedContainer",detachedFormContainer:"aa-DetachedFormContainer",detachedOverlay:"aa-DetachedOverlay",detachedSearchButton:"aa-DetachedSearchButton",detachedSearchButtonIcon:"aa-DetachedSearchButtonIcon",detachedSearchButtonPlaceholder:"aa-DetachedSearchButtonPlaceholder",form:"aa-Form",input:"aa-Input",inputWrapper:"aa-InputWrapper",inputWrapperPrefix:"aa-InputWrapperPrefix",inputWrapperSuffix:"aa-InputWrapperSuffix",item:"aa-Item",label:"aa-Label",list:"aa-List",loadingIndicator:"aa-LoadingIndicator",panel:"aa-Panel",panelLayout:"aa-PanelLayout",root:"aa-Autocomplete",source:"aa-Source",sourceFooter:"aa-SourceFooter",sourceHeader:"aa-SourceHeader",sourceNoResults:"aa-SourceNoResults",submitButton:"aa-SubmitButton"},Vtt=function(e,r){var n=e.children;hue(n,r)},$tt={createElement:OF,Fragment:Sm}});function Gue(t){var e=t.panelPlacement,r=t.container,n=t.form,i=t.environment,o=r.getBoundingClientRect(),a=o.top+o.height;switch(e){case"start":return{top:a,left:o.left};case"end":return{top:a,right:i.document.documentElement.clientWidth-(o.left+o.width)};case"full-width":return{top:a,left:0,right:0,width:"unset",maxWidth:"unset"};case"input-wrapper-width":{var s=n.getBoundingClientRect();return{top:a,left:s.left,right:i.document.documentElement.clientWidth-(s.left+s.width),width:"unset",maxWidth:"unset"}}default:throw new Error("[Autocomplete] The `panelPlacement` value ".concat(JSON.stringify(e)," is not valid."))}}var Xue=se(()=>{});function WE(){return WE=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},WE.apply(this,arguments)}function Que(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function UE(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Que(Object(r),!0).forEach(function(n){Ytt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Que(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ytt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zue(t){var e=t.autocomplete,r=t.autocompleteScopeApi,n=t.dom,i=t.propGetters,o=t.state;kF(n.root,i.getRootProps(UE({state:o,props:e.getRootProps({})},r))),kF(n.input,i.getInputProps(UE({state:o,props:e.getInputProps({inputElement:n.input}),inputElement:n.input},r))),os(n.label,{hidden:o.status==="stalled"}),os(n.loadingIndicator,{hidden:o.status!=="stalled"}),os(n.clearButton,{hidden:!o.query})}function Jue(t,e){var r=e.autocomplete,n=e.autocompleteScopeApi,i=e.classNames,o=e.createElement,a=e.dom,s=e.Fragment,u=e.panelContainer,c=e.propGetters,f=e.state,p=e.components;if(!f.isOpen){u.contains(a.panel)&&u.removeChild(a.panel);return}!u.contains(a.panel)&&f.status!=="loading"&&u.appendChild(a.panel),a.panel.classList.toggle("aa-Panel--stalled",f.status==="stalled");var g=f.collections.map(function(w,A){var k=w.source,T=w.items;return o("section",{key:A,className:i.source,"data-autocomplete-source-id":k.sourceId},k.templates.header&&o("div",{className:i.sourceHeader},k.templates.header({components:p,createElement:o,Fragment:s,items:T,source:k,state:f})),T.length===0&&k.templates.noResults&&f.query?o("div",{className:i.sourceNoResults},k.templates.noResults({components:p,createElement:o,Fragment:s,source:k,state:f})):o("ul",WE({className:i.list},c.getListProps(UE({state:f,props:r.getListProps({})},n))),T.map(function(D){var M=r.getItemProps({item:D,source:k});return o("li",WE({key:M.id,className:i.item},c.getItemProps(UE({state:f,props:M},n))),k.templates.item({components:p,createElement:o,Fragment:s,item:D,state:f}))})),k.templates.footer&&o("div",{className:i.sourceFooter},k.templates.footer({components:p,createElement:o,Fragment:s,items:T,source:k,state:f})))}),m=o(s,null,o("div",{className:"aa-PanelLayout aa-Panel--scrollable"},g),o("div",{className:"aa-GradientBottom"})),x=g.reduce(function(w,A){return w[A.props["data-autocomplete-source-id"]]=A,w},{});t({children:m,state:f,sections:g,elements:x,createElement:o,Fragment:s,components:p},a.panel)}var ece=se(()=>{_m()});function tce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Sh(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tce(Object(r),!0).forEach(function(n){rce(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tce(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function rce(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nce(t){var e=Gle(),r=e.runEffect,n=e.cleanupEffects,i=e.runEffects,o=Qle(),a=o.reactive,s=o.runReactives,u=q0(!1),c=q0(t),f=q0(void 0),p=a(function(){return Yue(c.current)}),g=a(function(){return p.value.core.environment.matchMedia(p.value.renderer.detachedMediaQuery).matches}),m=a(function(){return fle(Sh(Sh({},p.value.core),{},{onStateChange:function(C){var O,F,B;u.current=C.state.collections.some(function(V){return V.source.templates.noResults}),(O=f.current)===null||O===void 0||O.call(f,C),(F=(B=p.value.core).onStateChange)===null||F===void 0||F.call(B,C)},shouldPanelOpen:c.current.shouldPanelOpen||function(_){var C=_.state,O=If(C)>0;if(!p.value.core.openOnFocus&&!C.query)return O;var F=Boolean(u.current||p.value.renderer.renderNoResults);return!O&&F||O}}))}),x=q0(Sh({collections:[],completion:null,context:{},isOpen:!1,query:"",activeItemId:null,status:"idle"},p.value.core.initialState)),w={getEnvironmentProps:p.value.renderer.getEnvironmentProps,getFormProps:p.value.renderer.getFormProps,getInputProps:p.value.renderer.getInputProps,getItemProps:p.value.renderer.getItemProps,getLabelProps:p.value.renderer.getLabelProps,getListProps:p.value.renderer.getListProps,getPanelProps:p.value.renderer.getPanelProps,getRootProps:p.value.renderer.getRootProps},A={setActiveItemId:m.value.setActiveItemId,setQuery:m.value.setQuery,setCollections:m.value.setCollections,setIsOpen:m.value.setIsOpen,setStatus:m.value.setStatus,setContext:m.value.setContext,refresh:m.value.refresh},k=a(function(){return Yle({autocomplete:m.value,autocompleteScopeApi:A,classNames:p.value.renderer.classNames,isDetached:g.value,placeholder:p.value.core.placeholder,propGetters:w,state:x.current})});function T(){os(k.value.panel,{style:g.value?{}:Gue({panelPlacement:p.value.renderer.panelPlacement,container:k.value.root,form:k.value.form,environment:p.value.core.environment})})}function D(_){x.current=_;var C={autocomplete:m.value,autocompleteScopeApi:A,classNames:p.value.renderer.classNames,components:p.value.renderer.components,container:p.value.renderer.container,createElement:p.value.renderer.renderer.createElement,dom:k.value,Fragment:p.value.renderer.renderer.Fragment,panelContainer:g.value?k.value.detachedContainer:p.value.renderer.panelContainer,propGetters:w,state:x.current},O=!If(_)&&!u.current&&p.value.renderer.renderNoResults||p.value.renderer.render;Zue(C),Jue(O,C)}r(function(){var _=m.value.getEnvironmentProps({formElement:k.value.form,panelElement:k.value.panel,inputElement:k.value.input});return os(p.value.core.environment,_),function(){os(p.value.core.environment,Object.keys(_).reduce(function(C,O){return Sh(Sh({},C),{},rce({},O,void 0))},{}))}}),r(function(){var _=g.value?p.value.core.environment.document.body:p.value.renderer.panelContainer,C=g.value?k.value.detachedOverlay:k.value.panel;return g.value&&x.current.isOpen&&k.value.openDetachedOverlay(),D(x.current),function(){_.contains(C)&&_.removeChild(C)}}),r(function(){var _=p.value.renderer.container;return _.appendChild(k.value.root),function(){_.removeChild(k.value.root)}}),r(function(){var _=hF(function(C){var O=C.state;D(O)},0);return f.current=function(C){var O=C.state,F=C.prevState;if(O.isOpen&&!F.isOpen&&T(),O.query!==F.query){var B=document.querySelectorAll(".aa-Panel--scrollable");B.forEach(function(V){V.scrollTop!==0&&(V.scrollTop=0)})}_({state:O})},function(){f.current=void 0}}),r(function(){var _=hF(function(){var C=g.value;g.value=p.value.core.environment.matchMedia(p.value.renderer.detachedMediaQuery).matches,C!==g.value?P({}):requestAnimationFrame(T)},20);return p.value.core.environment.addEventListener("resize",_),function(){p.value.core.environment.removeEventListener("resize",_)}}),r(function(){if(!g.value)return function(){};function _(F){k.value.detachedContainer.classList.toggle("aa-DetachedContainer--modal",F)}function C(F){_(F.matches)}var O=p.value.core.environment.matchMedia(getComputedStyle(p.value.core.environment.document.documentElement).getPropertyValue("--aa-detached-modal-media-query"));return _(O.matches),O.addEventListener("change",C),function(){O.removeEventListener("change",C)}}),r(function(){return requestAnimationFrame(T),function(){}});function M(){n()}function P(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n(),c.current=SF(p.value.renderer,p.value.core,{initialState:x.current},_),s(),i(),m.value.refresh().then(function(){D(x.current)})}return Sh(Sh({},A),{},{update:P,destroy:M})}var ice=se(()=>{Tle();wh();Kle();Xle();Zle();Kue();Xue();ece();_m()});var oce,ace=se(()=>{oce="1.0.0-alpha.46"});function sce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function lce(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sce(Object(r),!0).forEach(function(n){Ktt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sce(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ktt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var uce,cce=se(()=>{km();ace();uce=jE(function(t){return zE(lce(lce({},t),{},{userAgents:[{segment:"autocomplete-js",version:oce}]}))})});var fce=se(()=>{});var MOt,dce=se(()=>{cce();MOt=uce({transformResponse:function(e){return e.hits}})});var hce=se(()=>{fce();dce()});var pce=se(()=>{});var gce=se(()=>{});var mce=se(()=>{});var vce=se(()=>{});var yce=se(()=>{});var bce=se(()=>{});var xce=se(()=>{});var wce=se(()=>{});var _ce=se(()=>{});var Sce=se(()=>{});var kce=se(()=>{});var Ece=se(()=>{});var Cce=se(()=>{});var Tce=se(()=>{pce();gce();mce();vce();yce();bce();xce();wce();_ce();Sce();kce();Ece();Cce()});var Ace=se(()=>{ice();hce();Tce()});var Dce,Oce=se(()=>{Dce=(t,e)=>{let r;return(...n)=>(r&&clearTimeout(r),new Promise(i=>{r=setTimeout(()=>i(t(...n)),e)}))}});var Mce,Ice,VE,Lce=se(()=>{Mce=qr(mL());Pr();FL();Ace();Ice=qr(g0());Oce();VE=class extends Ct{constructor(){super(...arguments);pt(this,"debouncedFetch",Dce(fetch,this.searchDebounce));pt(this,"destroyMethod")}get dataset(){return this.autocompleteTarget.dataset}get searchDebounce(){return window.Avo.configuration.search_debounce}get translationKeys(){let t;try{t=JSON.parse(this.dataset.translationKeys)}catch(e){t={}}return t}get isBelongsToSearch(){return this.dataset.viaAssociation==="belongs_to"}get isHasManySearch(){return this.dataset.viaAssociation==="has_many"}get isGlobalSearch(){return this.dataset.searchResource==="global"}connect(){let t=this;this.buttonTarget.onclick=()=>this.showSearchPanel(),this.clearValueTargets.forEach(r=>{r.getAttribute("value")&&this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")}),this.isGlobalSearch&&Mce.bind(["command+k","ctrl+k"],()=>this.showSearchPanel()),this.autocompleteTarget.innerHTML="";let{destroy:e}=nce({container:this.autocompleteTarget,placeholder:this.translationKeys.placeholder,translations:{detachedCancelButtonText:this.translationKeys.cancel_button},autoFocus:!0,openOnFocus:!0,detachedMediaQuery:"",getSources:({query:r})=>{document.body.classList.add("search-loading");let n=t.searchUrl(r);return t.debouncedFetch(n).then(i=>(document.body.classList.remove("search-loading"),i.json())).then(i=>Object.keys(i).map(o=>t.addSource(o,i[o])))}});this.destroyMethod=e,this.buttonTarget.dataset.shouldBeDisabled!=="true"&&this.buttonTarget.removeAttribute("disabled")}disconnect(){this.destroyMethod&&(this.destroyMethod(),this.destroyMethod=null)}addSource(t,e){let r=this;return{sourceId:t,getItems:()=>e.results,onSelect:r.handleOnSelect.bind(r),templates:{header(){return`${e.header.toUpperCase()} ${e.help}`},item({item:n,createElement:i}){let o=[];if(n._avatar){let s;switch(n._avatar_type){default:case"circle":s="rounded-full";break;case"rounded":s="rounded";break;case"square":s="rounded-none";break}o.push(i("img",{src:n._avatar,alt:n._label,class:`flex-shrink-0 w-8 h-8 my-[2px] inline mr-2 ${s}`}))}let a=[n._label];return n._description&&a.push(i("div",{class:"aa-ItemDescription"},n._description)),o.push(i("div",null,a)),i("div",{class:"flex"},o)},noResults(){return r.translationKeys.no_item_found.replace("%{item}",t)}}}}handleOnSelect({item:t}){this.isBelongsToSearch?(this.updateFieldAttribute(this.hiddenIdTarget,"value",t._id),this.updateFieldAttribute(this.buttonTarget,"value",t._label),document.querySelector(".aa-DetachedOverlay").remove(),this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")):Yd.visit(t._url,{action:"advance"}),document.body.classList.remove("aa-Detached")}searchUrl(t){return(0,Ice.default)().segment(this.searchSegments()).search(this.searchParams(t)).toString()}searchSegments(){let t=[window.Avo.configuration.root_path,"avo_api",this.dataset.searchResource,"search"];return this.isGlobalSearch&&(t=[window.Avo.configuration.root_path,"avo_api","search"]),t}searchParams(t){let e={q:t,global:!1};return this.isGlobalSearch&&(e.global=!0),(this.isBelongsToSearch||this.isHasManySearch)&&(e=this.addAssociationParams(e),e=this.addReflectionParams(e),this.isBelongsToSearch&&(e=zc(za({},e),{via_parent_resource_id:this.dataset.viaParentResourceId,via_parent_resource_class:this.dataset.viaParentResourceClass,via_relation:this.dataset.viaRelation}))),e}addAssociationParams(t){return t=zc(za({},t),{via_association:this.dataset.viaAssociation,via_association_id:this.dataset.viaAssociationId}),t}addReflectionParams(t){return t=zc(za({},t),{via_reflection_class:this.dataset.viaReflectionClass,via_reflection_id:this.dataset.viaReflectionId}),t}showSearchPanel(){this.autocompleteTarget.querySelector("button").click()}clearValue(){this.clearValueTargets.map(t=>this.updateFieldAttribute(t,"value","")),this.clearButtonTarget.classList.add("hidden")}updateFieldAttribute(t,e,r){t.setAttribute(e,r),t.dispatchEvent(new Event("input"))}};pt(VE,"targets",["autocomplete","button","hiddenId","visibleLabel","clearValue","clearButton"])});var Pce,$E,Rce=se(()=>{Pr();Pce=qr(g0()),$E=class extends Ct{get parentTurboFrame(){return this.context.scope.element.closest("turbo-frame")}onChange(t){if(!this.parentTurboFrame.src)return;let e=new Pce.default(this.parentTurboFrame.src);e.search(zc(za({},e.query(!0)),{range:t.currentTarget.value})),this.parentTurboFrame.src=e.toString(),this.parentTurboFrame.reload()}};pt($E,"targets",["select"])});var YE,qce=se(()=>{nm();YE=class extends Ca{getFilterValue(){return this.selectorTarget.value===""?null:this.selectorTarget.value}getFilterClass(){let{filterClass:t}=this.selectorTarget.dataset;return t}};pt(YE,"targets",["selector"])});async function GF(t,e=null){t.classList.remove("hidden"),await Nce("enter",t,e)}async function XF(t,e=null){await Nce("leave",t,e),t.classList.add("hidden")}async function Fce(t,e=null){t.classList.contains("hidden")?await GF(t,e):await XF(t,e)}async function Nce(t,e,r){let n=e.dataset,i=r?`${r}-${t}`:t,o=`transition${t.charAt(0).toUpperCase()+t.slice(1)}`,a=n[o]?n[o].split(" "):[i],s=n[`${o}Start`]?n[`${o}Start`].split(" "):[`${i}-start`],u=n[`${o}End`]?n[`${o}End`].split(" "):[`${i}-end`];YF(e,a),YF(e,s),await Gtt(),KF(e,s),YF(e,u),await Xtt(e),KF(e,u),KF(e,a)}function YF(t,e){t.classList.add(...e)}function KF(t,e){t.classList.remove(...e)}function Gtt(){return new Promise(t=>{requestAnimationFrame(()=>{requestAnimationFrame(t)})})}function Xtt(t){return new Promise(e=>{let r=getComputedStyle(t).transitionDuration.split(",")[0],n=Number(r.replace("s",""))*1e3;setTimeout(()=>{e()},n)})}var Bce=se(()=>{});function KE(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}function QF(t,e){function r(i,o,a){if(!(typeof document>"u")){a=KE({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var u in a)!a[u]||(s+="; "+u,a[u]!==!0&&(s+="="+a[u].split(";")[0]));return document.cookie=i+"="+t.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var u=o[s].split("="),c=u.slice(1).join("=");try{var f=decodeURIComponent(u[0]);if(a[f]=t.read(c,f),i===f)break}catch{}}return i?a[i]:a}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",KE({},o,{expires:-1}))},withAttributes:function(i){return QF(this.converter,KE({},this.attributes,i))},withConverter:function(i){return QF(KE({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var Qtt,Ztt,H0,jce=se(()=>{Qtt={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};Ztt=QF(Qtt,{path:"/"}),H0=Ztt});var W0,zce=se(()=>{Pr();Bce();jce();W0=class extends Ct{get cookieKey(){return`${window.Avo.configuration.cookies_key}.sidebar.open`}get sidebarOpen(){return H0.get(this.cookieKey)==="1"}set cookie(t){H0.set(this.cookieKey,t===!0?1:0)}markSidebarClosed(){H0.set(this.cookieKey,"0"),this.openValue=!1,XF(this.sidebarTarget),this.mainAreaTarget.classList.remove("sidebar-open")}markSidebarOpen(){H0.set(this.cookieKey,"1"),this.openValue=!0,GF(this.sidebarTarget),this.mainAreaTarget.classList.add("sidebar-open")}toggleSidebar(){this.openValue?this.markSidebarClosed():this.markSidebarOpen()}toggleSidebarOnMobile(){Fce(this.mobileSidebarTarget)}};pt(W0,"targets",["sidebar","mobileSidebar","mainArea"]),pt(W0,"values",{open:Boolean})});var Uce=Z((Hce,Wce)=>{(function(t){typeof Hce=="object"&&typeof Wce=="object"?t(jr()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)})(function(t){"use strict";var e=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,r=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,n=/[*+-]\s/;t.commands.newlineAndIndentContinueMarkdownList=function(o){if(o.getOption("disableInput"))return t.Pass;for(var a=o.listSelections(),s=[],u=0;u<a.length;u++){var c=a[u].head,f=o.getStateAfter(c.line),p=t.innerMode(o.getMode(),f);if(p.mode.name!=="markdown"){o.execCommand("newlineAndIndent");return}else f=p.state;var g=f.list!==!1,m=f.quote!==0,x=o.getLine(c.line),w=e.exec(x),A=/^\s*$/.test(x.slice(0,c.ch));if(!a[u].empty()||!g&&!m||!w||A){o.execCommand("newlineAndIndent");return}if(r.test(x)){var k=m&&/>\s*$/.test(x),T=!/>\s*$/.test(x);(k||T)&&o.replaceRange("",{line:c.line,ch:0},{line:c.line,ch:c.ch+1}),s[u]=`
|
126
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ntt(t,e){if(!!t){if(typeof t=="string")return $F(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $F(t,e)}}function Btt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function jtt(t){if(Array.isArray(t))return $F(t)}function $F(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Wue(t){var e=t.createElement,r=t.Fragment;return function(i){var o=i.hit,a=i.attribute,s=i.tagName,u=s===void 0?"mark":s;return e.apply(void 0,[r,{}].concat(qtt(BE({hit:o,attribute:a}).map(function(c,f){return c.isHighlighted?e(u,{key:f},c.value):c.value}))))}}var Uue=se(()=>{km()});var Vue=se(()=>{Nue();jue();Hue();Uue()});function $ue(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function HE(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$ue(Object(r),!0).forEach(function(n){ztt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$ue(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ztt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Htt(t,e){if(t==null)return{};var r=Wtt(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}function Wtt(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function Yue(t){var e,r=t.classNames,n=t.container,i=t.getEnvironmentProps,o=t.getFormProps,a=t.getInputProps,s=t.getItemProps,u=t.getLabelProps,c=t.getListProps,f=t.getPanelProps,p=t.getRootProps,g=t.panelContainer,m=t.panelPlacement,x=t.render,w=t.renderNoResults,A=t.renderer,k=t.detachedMediaQuery,T=t.components,D=Htt(t,["classNames","container","getEnvironmentProps","getFormProps","getInputProps","getItemProps","getLabelProps","getListProps","getPanelProps","getRootProps","panelContainer","panelPlacement","render","renderNoResults","renderer","detachedMediaQuery","components"]),M=wF(n);M.tagName;var P=typeof window<"u"?window:{},_=A??$tt,C={Highlight:Fue(_),ReverseHighlight:Bue(_),ReverseSnippet:zue(_),Snippet:Wue(_)};return{renderer:{classNames:Dle(Utt,r??{}),container:M,getEnvironmentProps:i??function(O){var F=O.props;return F},getFormProps:o??function(O){var F=O.props;return F},getInputProps:a??function(O){var F=O.props;return F},getItemProps:s??function(O){var F=O.props;return F},getLabelProps:u??function(O){var F=O.props;return F},getListProps:c??function(O){var F=O.props;return F},getPanelProps:f??function(O){var F=O.props;return F},getRootProps:p??function(O){var F=O.props;return F},panelContainer:g?wF(g):document.body,panelPlacement:m??"input-wrapper-width",render:x??Vtt,renderNoResults:w,renderer:_,detachedMediaQuery:k??getComputedStyle(P.document.documentElement).getPropertyValue("--aa-detached-media-query"),components:HE(HE({},C),T)},core:HE(HE({},D),{},{id:(e=D.id)!==null&&e!==void 0?e:wE(),environment:P})}}var Utt,Vtt,$tt,Kue=se(()=>{wh();pue();Vue();_m();Utt={clearButton:"aa-ClearButton",detachedCancelButton:"aa-DetachedCancelButton",detachedContainer:"aa-DetachedContainer",detachedFormContainer:"aa-DetachedFormContainer",detachedOverlay:"aa-DetachedOverlay",detachedSearchButton:"aa-DetachedSearchButton",detachedSearchButtonIcon:"aa-DetachedSearchButtonIcon",detachedSearchButtonPlaceholder:"aa-DetachedSearchButtonPlaceholder",form:"aa-Form",input:"aa-Input",inputWrapper:"aa-InputWrapper",inputWrapperPrefix:"aa-InputWrapperPrefix",inputWrapperSuffix:"aa-InputWrapperSuffix",item:"aa-Item",label:"aa-Label",list:"aa-List",loadingIndicator:"aa-LoadingIndicator",panel:"aa-Panel",panelLayout:"aa-PanelLayout",root:"aa-Autocomplete",source:"aa-Source",sourceFooter:"aa-SourceFooter",sourceHeader:"aa-SourceHeader",sourceNoResults:"aa-SourceNoResults",submitButton:"aa-SubmitButton"},Vtt=function(e,r){var n=e.children;hue(n,r)},$tt={createElement:OF,Fragment:Sm}});function Gue(t){var e=t.panelPlacement,r=t.container,n=t.form,i=t.environment,o=r.getBoundingClientRect(),a=o.top+o.height;switch(e){case"start":return{top:a,left:o.left};case"end":return{top:a,right:i.document.documentElement.clientWidth-(o.left+o.width)};case"full-width":return{top:a,left:0,right:0,width:"unset",maxWidth:"unset"};case"input-wrapper-width":{var s=n.getBoundingClientRect();return{top:a,left:s.left,right:i.document.documentElement.clientWidth-(s.left+s.width),width:"unset",maxWidth:"unset"}}default:throw new Error("[Autocomplete] The `panelPlacement` value ".concat(JSON.stringify(e)," is not valid."))}}var Xue=se(()=>{});function WE(){return WE=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},WE.apply(this,arguments)}function Que(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function UE(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Que(Object(r),!0).forEach(function(n){Ytt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Que(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ytt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zue(t){var e=t.autocomplete,r=t.autocompleteScopeApi,n=t.dom,i=t.propGetters,o=t.state;kF(n.root,i.getRootProps(UE({state:o,props:e.getRootProps({})},r))),kF(n.input,i.getInputProps(UE({state:o,props:e.getInputProps({inputElement:n.input}),inputElement:n.input},r))),os(n.label,{hidden:o.status==="stalled"}),os(n.loadingIndicator,{hidden:o.status!=="stalled"}),os(n.clearButton,{hidden:!o.query})}function Jue(t,e){var r=e.autocomplete,n=e.autocompleteScopeApi,i=e.classNames,o=e.createElement,a=e.dom,s=e.Fragment,u=e.panelContainer,c=e.propGetters,f=e.state,p=e.components;if(!f.isOpen){u.contains(a.panel)&&u.removeChild(a.panel);return}!u.contains(a.panel)&&f.status!=="loading"&&u.appendChild(a.panel),a.panel.classList.toggle("aa-Panel--stalled",f.status==="stalled");var g=f.collections.map(function(w,A){var k=w.source,T=w.items;return o("section",{key:A,className:i.source,"data-autocomplete-source-id":k.sourceId},k.templates.header&&o("div",{className:i.sourceHeader},k.templates.header({components:p,createElement:o,Fragment:s,items:T,source:k,state:f})),T.length===0&&k.templates.noResults&&f.query?o("div",{className:i.sourceNoResults},k.templates.noResults({components:p,createElement:o,Fragment:s,source:k,state:f})):o("ul",WE({className:i.list},c.getListProps(UE({state:f,props:r.getListProps({})},n))),T.map(function(D){var M=r.getItemProps({item:D,source:k});return o("li",WE({key:M.id,className:i.item},c.getItemProps(UE({state:f,props:M},n))),k.templates.item({components:p,createElement:o,Fragment:s,item:D,state:f}))})),k.templates.footer&&o("div",{className:i.sourceFooter},k.templates.footer({components:p,createElement:o,Fragment:s,items:T,source:k,state:f})))}),m=o(s,null,o("div",{className:"aa-PanelLayout aa-Panel--scrollable"},g),o("div",{className:"aa-GradientBottom"})),x=g.reduce(function(w,A){return w[A.props["data-autocomplete-source-id"]]=A,w},{});t({children:m,state:f,sections:g,elements:x,createElement:o,Fragment:s,components:p},a.panel)}var ece=se(()=>{_m()});function tce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Sh(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tce(Object(r),!0).forEach(function(n){rce(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tce(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function rce(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nce(t){var e=Gle(),r=e.runEffect,n=e.cleanupEffects,i=e.runEffects,o=Qle(),a=o.reactive,s=o.runReactives,u=q0(!1),c=q0(t),f=q0(void 0),p=a(function(){return Yue(c.current)}),g=a(function(){return p.value.core.environment.matchMedia(p.value.renderer.detachedMediaQuery).matches}),m=a(function(){return fle(Sh(Sh({},p.value.core),{},{onStateChange:function(C){var O,F,B;u.current=C.state.collections.some(function(V){return V.source.templates.noResults}),(O=f.current)===null||O===void 0||O.call(f,C),(F=(B=p.value.core).onStateChange)===null||F===void 0||F.call(B,C)},shouldPanelOpen:c.current.shouldPanelOpen||function(_){var C=_.state,O=If(C)>0;if(!p.value.core.openOnFocus&&!C.query)return O;var F=Boolean(u.current||p.value.renderer.renderNoResults);return!O&&F||O}}))}),x=q0(Sh({collections:[],completion:null,context:{},isOpen:!1,query:"",activeItemId:null,status:"idle"},p.value.core.initialState)),w={getEnvironmentProps:p.value.renderer.getEnvironmentProps,getFormProps:p.value.renderer.getFormProps,getInputProps:p.value.renderer.getInputProps,getItemProps:p.value.renderer.getItemProps,getLabelProps:p.value.renderer.getLabelProps,getListProps:p.value.renderer.getListProps,getPanelProps:p.value.renderer.getPanelProps,getRootProps:p.value.renderer.getRootProps},A={setActiveItemId:m.value.setActiveItemId,setQuery:m.value.setQuery,setCollections:m.value.setCollections,setIsOpen:m.value.setIsOpen,setStatus:m.value.setStatus,setContext:m.value.setContext,refresh:m.value.refresh},k=a(function(){return Yle({autocomplete:m.value,autocompleteScopeApi:A,classNames:p.value.renderer.classNames,isDetached:g.value,placeholder:p.value.core.placeholder,propGetters:w,state:x.current})});function T(){os(k.value.panel,{style:g.value?{}:Gue({panelPlacement:p.value.renderer.panelPlacement,container:k.value.root,form:k.value.form,environment:p.value.core.environment})})}function D(_){x.current=_;var C={autocomplete:m.value,autocompleteScopeApi:A,classNames:p.value.renderer.classNames,components:p.value.renderer.components,container:p.value.renderer.container,createElement:p.value.renderer.renderer.createElement,dom:k.value,Fragment:p.value.renderer.renderer.Fragment,panelContainer:g.value?k.value.detachedContainer:p.value.renderer.panelContainer,propGetters:w,state:x.current},O=!If(_)&&!u.current&&p.value.renderer.renderNoResults||p.value.renderer.render;Zue(C),Jue(O,C)}r(function(){var _=m.value.getEnvironmentProps({formElement:k.value.form,panelElement:k.value.panel,inputElement:k.value.input});return os(p.value.core.environment,_),function(){os(p.value.core.environment,Object.keys(_).reduce(function(C,O){return Sh(Sh({},C),{},rce({},O,void 0))},{}))}}),r(function(){var _=g.value?p.value.core.environment.document.body:p.value.renderer.panelContainer,C=g.value?k.value.detachedOverlay:k.value.panel;return g.value&&x.current.isOpen&&k.value.openDetachedOverlay(),D(x.current),function(){_.contains(C)&&_.removeChild(C)}}),r(function(){var _=p.value.renderer.container;return _.appendChild(k.value.root),function(){_.removeChild(k.value.root)}}),r(function(){var _=hF(function(C){var O=C.state;D(O)},0);return f.current=function(C){var O=C.state,F=C.prevState;if(O.isOpen&&!F.isOpen&&T(),O.query!==F.query){var B=document.querySelectorAll(".aa-Panel--scrollable");B.forEach(function(V){V.scrollTop!==0&&(V.scrollTop=0)})}_({state:O})},function(){f.current=void 0}}),r(function(){var _=hF(function(){var C=g.value;g.value=p.value.core.environment.matchMedia(p.value.renderer.detachedMediaQuery).matches,C!==g.value?P({}):requestAnimationFrame(T)},20);return p.value.core.environment.addEventListener("resize",_),function(){p.value.core.environment.removeEventListener("resize",_)}}),r(function(){if(!g.value)return function(){};function _(F){k.value.detachedContainer.classList.toggle("aa-DetachedContainer--modal",F)}function C(F){_(F.matches)}var O=p.value.core.environment.matchMedia(getComputedStyle(p.value.core.environment.document.documentElement).getPropertyValue("--aa-detached-modal-media-query"));return _(O.matches),O.addEventListener("change",C),function(){O.removeEventListener("change",C)}}),r(function(){return requestAnimationFrame(T),function(){}});function M(){n()}function P(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n(),c.current=SF(p.value.renderer,p.value.core,{initialState:x.current},_),s(),i(),m.value.refresh().then(function(){D(x.current)})}return Sh(Sh({},A),{},{update:P,destroy:M})}var ice=se(()=>{Tle();wh();Kle();Xle();Zle();Kue();Xue();ece();_m()});var oce,ace=se(()=>{oce="1.0.0-alpha.46"});function sce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function lce(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sce(Object(r),!0).forEach(function(n){Ktt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sce(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ktt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var uce,cce=se(()=>{km();ace();uce=jE(function(t){return zE(lce(lce({},t),{},{userAgents:[{segment:"autocomplete-js",version:oce}]}))})});var fce=se(()=>{});var MOt,dce=se(()=>{cce();MOt=uce({transformResponse:function(e){return e.hits}})});var hce=se(()=>{fce();dce()});var pce=se(()=>{});var gce=se(()=>{});var mce=se(()=>{});var vce=se(()=>{});var yce=se(()=>{});var bce=se(()=>{});var xce=se(()=>{});var wce=se(()=>{});var _ce=se(()=>{});var Sce=se(()=>{});var kce=se(()=>{});var Ece=se(()=>{});var Cce=se(()=>{});var Tce=se(()=>{pce();gce();mce();vce();yce();bce();xce();wce();_ce();Sce();kce();Ece();Cce()});var Ace=se(()=>{ice();hce();Tce()});var Dce,Oce=se(()=>{Dce=(t,e)=>{let r;return(...n)=>(r&&clearTimeout(r),new Promise(i=>{r=setTimeout(()=>i(t(...n)),e)}))}});var Mce,Ice,VE,Lce=se(()=>{Mce=qr(mL());Pr();FL();Ace();Ice=qr(g0());Oce();VE=class extends Ct{constructor(){super(...arguments);pt(this,"debouncedFetch",Dce(fetch,this.searchDebounce));pt(this,"destroyMethod")}get dataset(){return this.autocompleteTarget.dataset}get searchDebounce(){return window.Avo.configuration.search_debounce}get translationKeys(){let t;try{t=JSON.parse(this.dataset.translationKeys)}catch(e){t={}}return t}get isBelongsToSearch(){return this.dataset.viaAssociation==="belongs_to"}get isHasManySearch(){return this.dataset.viaAssociation==="has_many"}get isGlobalSearch(){return this.dataset.searchResource==="global"}connect(){let t=this;this.buttonTarget.onclick=()=>this.showSearchPanel(),this.clearValueTargets.forEach(r=>{r.getAttribute("value")&&this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")}),this.isGlobalSearch&&Mce.bind(["command+k","ctrl+k"],()=>this.showSearchPanel()),this.autocompleteTarget.innerHTML="";let{destroy:e}=nce({container:this.autocompleteTarget,placeholder:this.translationKeys.placeholder,translations:{detachedCancelButtonText:this.translationKeys.cancel_button},autoFocus:!0,openOnFocus:!0,detachedMediaQuery:"",getSources:({query:r})=>{document.body.classList.add("search-loading");let n=t.searchUrl(r);return t.debouncedFetch(n).then(i=>(document.body.classList.remove("search-loading"),i.json())).then(i=>Object.keys(i).map(o=>t.addSource(o,i[o])))}});this.destroyMethod=e,this.buttonTarget.dataset.shouldBeDisabled!=="true"&&this.buttonTarget.removeAttribute("disabled")}disconnect(){this.destroyMethod&&(this.destroyMethod(),this.destroyMethod=null)}addSource(t,e){let r=this;return{sourceId:t,getItems:()=>e.results,onSelect:r.handleOnSelect.bind(r),templates:{header(){return`${e.header.toUpperCase()} ${e.help}`},item({item:n,createElement:i}){let o=[];if(n._avatar){let s;switch(n._avatar_type){default:case"circle":s="rounded-full";break;case"rounded":s="rounded";break;case"square":s="rounded-none";break}o.push(i("img",{src:n._avatar,alt:n._label,class:`flex-shrink-0 w-8 h-8 my-[2px] inline mr-2 ${s}`}))}let a=[n._label];return n._description&&a.push(i("div",{class:"aa-ItemDescription"},n._description)),o.push(i("div",null,a)),i("div",{class:"flex"},o)},noResults(){return r.translationKeys.no_item_found.replace("%{item}",t)}}}}handleOnSelect({item:t}){this.isBelongsToSearch?(this.updateFieldAttribute(this.hiddenIdTarget,"value",t._id),this.updateFieldAttribute(this.buttonTarget,"value",t._label),document.querySelector(".aa-DetachedOverlay").remove(),this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")):Yd.visit(t._url,{action:"advance"}),document.body.classList.remove("aa-Detached")}searchUrl(t){return(0,Ice.default)().segment([window.Avo.configuration.root_path,...this.searchSegments()]).search(this.searchParams(t)).readable().toString()}searchSegments(){let t=["avo_api",this.dataset.searchResource,"search"];return this.isGlobalSearch&&(t=["avo_api","search"]),t}searchParams(t){let e={q:t,global:!1};return this.isGlobalSearch&&(e.global=!0),(this.isBelongsToSearch||this.isHasManySearch)&&(e=this.addAssociationParams(e),e=this.addReflectionParams(e),this.isBelongsToSearch&&(e=zc(za({},e),{via_parent_resource_id:this.dataset.viaParentResourceId,via_parent_resource_class:this.dataset.viaParentResourceClass,via_relation:this.dataset.viaRelation}))),e}addAssociationParams(t){return t=zc(za({},t),{via_association:this.dataset.viaAssociation,via_association_id:this.dataset.viaAssociationId}),t}addReflectionParams(t){return t=zc(za({},t),{via_reflection_class:this.dataset.viaReflectionClass,via_reflection_id:this.dataset.viaReflectionId}),t}showSearchPanel(){this.autocompleteTarget.querySelector("button").click()}clearValue(){this.clearValueTargets.map(t=>this.updateFieldAttribute(t,"value","")),this.clearButtonTarget.classList.add("hidden")}updateFieldAttribute(t,e,r){t.setAttribute(e,r),t.dispatchEvent(new Event("input"))}};pt(VE,"targets",["autocomplete","button","hiddenId","visibleLabel","clearValue","clearButton"])});var Pce,$E,Rce=se(()=>{Pr();Pce=qr(g0()),$E=class extends Ct{get parentTurboFrame(){return this.context.scope.element.closest("turbo-frame")}onChange(t){if(!this.parentTurboFrame.src)return;let e=new Pce.default(this.parentTurboFrame.src);e.search(zc(za({},e.query(!0)),{range:t.currentTarget.value})),this.parentTurboFrame.src=e.toString(),this.parentTurboFrame.reload()}};pt($E,"targets",["select"])});var YE,qce=se(()=>{nm();YE=class extends Ca{getFilterValue(){return this.selectorTarget.value===""?null:this.selectorTarget.value}getFilterClass(){let{filterClass:t}=this.selectorTarget.dataset;return t}};pt(YE,"targets",["selector"])});async function GF(t,e=null){t.classList.remove("hidden"),await Nce("enter",t,e)}async function XF(t,e=null){await Nce("leave",t,e),t.classList.add("hidden")}async function Fce(t,e=null){t.classList.contains("hidden")?await GF(t,e):await XF(t,e)}async function Nce(t,e,r){let n=e.dataset,i=r?`${r}-${t}`:t,o=`transition${t.charAt(0).toUpperCase()+t.slice(1)}`,a=n[o]?n[o].split(" "):[i],s=n[`${o}Start`]?n[`${o}Start`].split(" "):[`${i}-start`],u=n[`${o}End`]?n[`${o}End`].split(" "):[`${i}-end`];YF(e,a),YF(e,s),await Gtt(),KF(e,s),YF(e,u),await Xtt(e),KF(e,u),KF(e,a)}function YF(t,e){t.classList.add(...e)}function KF(t,e){t.classList.remove(...e)}function Gtt(){return new Promise(t=>{requestAnimationFrame(()=>{requestAnimationFrame(t)})})}function Xtt(t){return new Promise(e=>{let r=getComputedStyle(t).transitionDuration.split(",")[0],n=Number(r.replace("s",""))*1e3;setTimeout(()=>{e()},n)})}var Bce=se(()=>{});function KE(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}function QF(t,e){function r(i,o,a){if(!(typeof document>"u")){a=KE({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var u in a)!a[u]||(s+="; "+u,a[u]!==!0&&(s+="="+a[u].split(";")[0]));return document.cookie=i+"="+t.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var u=o[s].split("="),c=u.slice(1).join("=");try{var f=decodeURIComponent(u[0]);if(a[f]=t.read(c,f),i===f)break}catch{}}return i?a[i]:a}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",KE({},o,{expires:-1}))},withAttributes:function(i){return QF(this.converter,KE({},this.attributes,i))},withConverter:function(i){return QF(KE({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var Qtt,Ztt,H0,jce=se(()=>{Qtt={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};Ztt=QF(Qtt,{path:"/"}),H0=Ztt});var W0,zce=se(()=>{Pr();Bce();jce();W0=class extends Ct{get cookieKey(){return`${window.Avo.configuration.cookies_key}.sidebar.open`}get sidebarOpen(){return H0.get(this.cookieKey)==="1"}set cookie(t){H0.set(this.cookieKey,t===!0?1:0)}markSidebarClosed(){H0.set(this.cookieKey,"0"),this.openValue=!1,XF(this.sidebarTarget),this.mainAreaTarget.classList.remove("sidebar-open")}markSidebarOpen(){H0.set(this.cookieKey,"1"),this.openValue=!0,GF(this.sidebarTarget),this.mainAreaTarget.classList.add("sidebar-open")}toggleSidebar(){this.openValue?this.markSidebarClosed():this.markSidebarOpen()}toggleSidebarOnMobile(){Fce(this.mobileSidebarTarget)}};pt(W0,"targets",["sidebar","mobileSidebar","mainArea"]),pt(W0,"values",{open:Boolean})});var Uce=Z((Hce,Wce)=>{(function(t){typeof Hce=="object"&&typeof Wce=="object"?t(jr()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)})(function(t){"use strict";var e=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,r=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,n=/[*+-]\s/;t.commands.newlineAndIndentContinueMarkdownList=function(o){if(o.getOption("disableInput"))return t.Pass;for(var a=o.listSelections(),s=[],u=0;u<a.length;u++){var c=a[u].head,f=o.getStateAfter(c.line),p=t.innerMode(o.getMode(),f);if(p.mode.name!=="markdown"){o.execCommand("newlineAndIndent");return}else f=p.state;var g=f.list!==!1,m=f.quote!==0,x=o.getLine(c.line),w=e.exec(x),A=/^\s*$/.test(x.slice(0,c.ch));if(!a[u].empty()||!g&&!m||!w||A){o.execCommand("newlineAndIndent");return}if(r.test(x)){var k=m&&/>\s*$/.test(x),T=!/>\s*$/.test(x);(k||T)&&o.replaceRange("",{line:c.line,ch:0},{line:c.line,ch:c.ch+1}),s[u]=`
|
127
127
|
`}else{var D=w[1],M=w[5],P=!(n.test(w[2])||w[2].indexOf(">")>=0),_=P?parseInt(w[3],10)+1+w[4]:w[2].replace("x"," ");s[u]=`
|
128
128
|
`+D+_+M,P&&i(o,c)}}o.replaceSelections(s)};function i(o,a){var s=a.line,u=0,c=0,f=e.exec(o.getLine(s)),p=f[1];do{u+=1;var g=s+u,m=o.getLine(g),x=e.exec(m);if(x){var w=x[1],A=parseInt(f[3],10)+u-c,k=parseInt(x[3],10),T=k;if(p===w&&!isNaN(k))A===k&&(T=k+1),A>k&&(T=A+1),o.replaceRange(m.replace(e,w+T+x[4]+x[5]),{line:g,ch:0},{line:g,ch:m.length});else{if(p.length>w.length||p.length<w.length&&u===1)return;c+=1}}}while(x)}})});var $ce=Z(()=>{var Vce=jr();Vce.commands.tabAndIndentMarkdownList=function(t){var e=t.listSelections(),r=e[0].head,n=t.getStateAfter(r.line),i=n.list!==!1;if(i){t.execCommand("indentMore");return}if(t.options.indentWithTabs)t.execCommand("insertTab");else{var o=Array(t.options.tabSize+1).join(" ");t.replaceSelection(o)}};Vce.commands.shiftTabAndUnindentMarkdownList=function(t){var e=t.listSelections(),r=e[0].head,n=t.getStateAfter(r.line),i=n.list!==!1;if(i){t.execCommand("indentLess");return}if(t.options.indentWithTabs)t.execCommand("insertTab");else{var o=Array(t.options.tabSize+1).join(" ");t.replaceSelection(o)}}});var Gce=Z((Yce,Kce)=>{(function(t){typeof Yce=="object"&&typeof Kce=="object"?t(jr()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)})(function(t){"use strict";t.defineOption("fullScreen",!1,function(n,i,o){o==t.Init&&(o=!1),!o!=!i&&(i?e(n):r(n))});function e(n){var i=n.getWrapperElement();n.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:i.style.width,height:i.style.height},i.style.width="",i.style.height="auto",i.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",n.refresh()}function r(n){var i=n.getWrapperElement();i.className=i.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var o=n.state.fullScreenRestore;i.style.width=o.width,i.style.height=o.height,window.scrollTo(o.scrollLeft,o.scrollTop),n.refresh()}})});var Zce=Z((Xce,Qce)=>{(function(t){typeof Xce=="object"&&typeof Qce=="object"?t(jr()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)})(function(t){t.defineOption("placeholder","",function(s,u,c){var f=c&&c!=t.Init;if(u&&!f)s.on("blur",i),s.on("change",o),s.on("swapDoc",o),t.on(s.getInputField(),"compositionupdate",s.state.placeholderCompose=function(){n(s)}),o(s);else if(!u&&f){s.off("blur",i),s.off("change",o),s.off("swapDoc",o),t.off(s.getInputField(),"compositionupdate",s.state.placeholderCompose),e(s);var p=s.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}u&&!s.hasFocus()&&i(s)});function e(s){s.state.placeholder&&(s.state.placeholder.parentNode.removeChild(s.state.placeholder),s.state.placeholder=null)}function r(s){e(s);var u=s.state.placeholder=document.createElement("pre");u.style.cssText="height: 0; overflow: visible",u.style.direction=s.getOption("direction"),u.className="CodeMirror-placeholder CodeMirror-line-like";var c=s.getOption("placeholder");typeof c=="string"&&(c=document.createTextNode(c)),u.appendChild(c),s.display.lineSpace.insertBefore(u,s.display.lineSpace.firstChild)}function n(s){setTimeout(function(){var u=!1;if(s.lineCount()==1){var c=s.getInputField();u=c.nodeName=="TEXTAREA"?!s.getLine(0).length:!/[^\u200b]/.test(c.querySelector(".CodeMirror-line").textContent)}u?r(s):e(s)},20)}function i(s){a(s)&&r(s)}function o(s){var u=s.getWrapperElement(),c=a(s);u.className=u.className.replace(" CodeMirror-empty","")+(c?" CodeMirror-empty":""),c?r(s):e(s)}function a(s){return s.lineCount()===1&&s.getLine(0)===""}})});var tfe=Z((Jce,efe)=>{(function(t){typeof Jce=="object"&&typeof efe=="object"?t(jr()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)})(function(t){"use strict";t.defineOption("styleSelectedText",!1,function(f,p,g){var m=g&&g!=t.Init;p&&!m?(f.state.markedSelection=[],f.state.markedSelectionStyle=typeof p=="string"?p:"CodeMirror-selectedtext",u(f),f.on("cursorActivity",e),f.on("change",r)):!p&&m&&(f.off("cursorActivity",e),f.off("change",r),s(f),f.state.markedSelection=f.state.markedSelectionStyle=null)});function e(f){f.state.markedSelection&&f.operation(function(){c(f)})}function r(f){f.state.markedSelection&&f.state.markedSelection.length&&f.operation(function(){s(f)})}var n=8,i=t.Pos,o=t.cmpPos;function a(f,p,g,m){if(o(p,g)!=0)for(var x=f.state.markedSelection,w=f.state.markedSelectionStyle,A=p.line;;){var k=A==p.line?p:i(A,0),T=A+n,D=T>=g.line,M=D?g:i(T,0),P=f.markText(k,M,{className:w});if(m==null?x.push(P):x.splice(m++,0,P),D)break;A=T}}function s(f){for(var p=f.state.markedSelection,g=0;g<p.length;++g)p[g].clear();p.length=0}function u(f){s(f);for(var p=f.listSelections(),g=0;g<p.length;g++)a(f,p[g].from(),p[g].to())}function c(f){if(!f.somethingSelected())return s(f);if(f.listSelections().length>1)return u(f);var p=f.getCursor("start"),g=f.getCursor("end"),m=f.state.markedSelection;if(!m.length)return a(f,p,g);var x=m[0].find(),w=m[m.length-1].find();if(!x||!w||g.line-p.line<=n||o(p,w.to)>=0||o(g,x.from)<=0)return u(f);for(;o(p,x.from)>0;)m.shift().clear(),x=m[0].find();for(o(p,x.from)<0&&(x.to.line-p.line<n?(m.shift().clear(),a(f,p,x.to,0)):a(f,p,x.from,0));o(g,w.to)<0;)m.pop().clear(),w=m[m.length-1].find();o(g,w.to)>0&&(g.line-w.from.line<n?(m.pop().clear(),a(f,w.from,g)):a(f,w.to,g))}})});var ife=Z((rfe,nfe)=>{(function(t){typeof rfe=="object"&&typeof nfe=="object"?t(jr(),z1(),H1()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],t):t(CodeMirror)})(function(t){"use strict";var e=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;t.defineMode("gfm",function(r,n){var i=0;function o(c){return c.code=!1,null}var a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(c){return{code:c.code,codeBlock:c.codeBlock,ateSpace:c.ateSpace}},token:function(c,f){if(f.combineTokens=null,f.codeBlock)return c.match(/^```+/)?(f.codeBlock=!1,null):(c.skipToEnd(),null);if(c.sol()&&(f.code=!1),c.sol()&&c.match(/^```+/))return c.skipToEnd(),f.codeBlock=!0,null;if(c.peek()==="`"){c.next();var p=c.pos;c.eatWhile("`");var g=1+c.pos-p;return f.code?g===i&&(f.code=!1):(i=g,f.code=!0),null}else if(f.code)return c.next(),null;if(c.eatSpace())return f.ateSpace=!0,null;if((c.sol()||f.ateSpace)&&(f.ateSpace=!1,n.gitHubSpice!==!1)){if(c.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return f.combineTokens=!0,"link";if(c.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return f.combineTokens=!0,"link"}return c.match(e)&&c.string.slice(c.start-2,c.start)!="]("&&(c.start==0||/\W/.test(c.string.charAt(c.start-1)))?(f.combineTokens=!0,"link"):(c.next(),null)},blankLine:o},s={taskLists:!0,strikethrough:!0,emoji:!0};for(var u in n)s[u]=n[u];return s.name="markdown",t.overlayMode(t.getMode(r,s),a)},"markdown"),t.defineMIME("text/x-gfm","gfm")})});var ofe=Z(()=>{});var afe=Z((SMt,JF)=>{var ZF;(function(){"use strict";ZF=function(t,e,r,n){n=n||{},this.dictionary=null,this.rules={},this.dictionaryTable={},this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=n.flags||{},this.memoized={},this.loaded=!1;var i=this,o,a,s,u,c;t&&(i.dictionary=t,e&&r?m():typeof window<"u"&&"chrome"in window&&"extension"in window.chrome&&"getURL"in window.chrome.extension?(n.dictionaryPath?o=n.dictionaryPath:o="typo/dictionaries",e||f(chrome.extension.getURL(o+"/"+t+"/"+t+".aff"),p),r||f(chrome.extension.getURL(o+"/"+t+"/"+t+".dic"),g)):(n.dictionaryPath?o=n.dictionaryPath:typeof __dirname<"u"?o=__dirname+"/dictionaries":o="./dictionaries",e||f(o+"/"+t+"/"+t+".aff",p),r||f(o+"/"+t+"/"+t+".dic",g)));function f(x,w){var A=i._readFile(x,null,n.asyncLoad);n.asyncLoad?A.then(function(k){w(k)}):w(A)}function p(x){e=x,r&&m()}function g(x){r=x,e&&m()}function m(){for(i.rules=i._parseAFF(e),i.compoundRuleCodes={},a=0,u=i.compoundRules.length;a<u;a++){var x=i.compoundRules[a];for(s=0,c=x.length;s<c;s++)i.compoundRuleCodes[x[s]]=[]}"ONLYINCOMPOUND"in i.flags&&(i.compoundRuleCodes[i.flags.ONLYINCOMPOUND]=[]),i.dictionaryTable=i._parseDIC(r);for(a in i.compoundRuleCodes)i.compoundRuleCodes[a].length===0&&delete i.compoundRuleCodes[a];for(a=0,u=i.compoundRules.length;a<u;a++){var w=i.compoundRules[a],A="";for(s=0,c=w.length;s<c;s++){var k=w[s];k in i.compoundRuleCodes?A+="("+i.compoundRuleCodes[k].join("|")+")":A+=k}i.compoundRules[a]=new RegExp(A,"i")}i.loaded=!0,n.asyncLoad&&n.loadedCallback&&n.loadedCallback(i)}return this},ZF.prototype={load:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);return this},_readFile:function(t,e,r){if(e=e||"utf8",typeof XMLHttpRequest<"u"){var n,i=new XMLHttpRequest;return i.open("GET",t,r),r&&(n=new Promise(function(a,s){i.onload=function(){i.status===200?a(i.responseText):s(i.statusText)},i.onerror=function(){s(i.statusText)}})),i.overrideMimeType&&i.overrideMimeType("text/plain; charset="+e),i.send(null),r?n:i.responseText}else if(typeof XN<"u"){var o=ofe();try{if(o.existsSync(t))return o.readFileSync(t,e);console.log("Path "+t+" does not exist.")}catch(a){return console.log(a),""}}},_parseAFF:function(t){var e={},r,n,i,o,a,s,u,c;t=this._removeAffixComments(t);var f=t.split(/\r?\n/);for(a=0,u=f.length;a<u;a++){r=f[a];var p=r.split(/\s+/),g=p[0];if(g=="PFX"||g=="SFX"){var m=p[1],x=p[2];i=parseInt(p[3],10);var w=[];for(s=a+1,c=a+1+i;s<c;s++){n=f[s],o=n.split(/\s+/);var A=o[2],k=o[3].split("/"),T=k[0];T==="0"&&(T="");var D=this.parseRuleCodes(k[1]),M=o[4],P={};P.add=T,D.length>0&&(P.continuationClasses=D),M!=="."&&(g==="SFX"?P.match=new RegExp(M+"$"):P.match=new RegExp("^"+M)),A!="0"&&(g==="SFX"?P.remove=new RegExp(A+"$"):P.remove=A),w.push(P)}e[m]={type:g,combineable:x=="Y",entries:w},a+=i}else if(g==="COMPOUNDRULE"){for(i=parseInt(p[1],10),s=a+1,c=a+1+i;s<c;s++)r=f[s],o=r.split(/\s+/),this.compoundRules.push(o[1]);a+=i}else g==="REP"?(o=r.split(/\s+/),o.length===3&&this.replacementTable.push([o[1],o[2]])):this.flags[g]=p[1]}return e},_removeAffixComments:function(t){return t=t.replace(/^\s*#.*$/mg,""),t=t.replace(/^\s\s*/m,"").replace(/\s\s*$/m,""),t=t.replace(/\n{2,}/g,`
|
129
129
|
`),t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),t},_parseDIC:function(t){t=this._removeDicComments(t);var e=t.split(/\r?\n/),r={};function n(F,B){r.hasOwnProperty(F)||(r[F]=null),B.length>0&&(r[F]===null&&(r[F]=[]),r[F].push(B))}for(var i=1,o=e.length;i<o;i++){var a=e[i];if(!!a){var s=a.split("/",2),u=s[0];if(s.length>1){var c=this.parseRuleCodes(s[1]);(!("NEEDAFFIX"in this.flags)||c.indexOf(this.flags.NEEDAFFIX)==-1)&&n(u,c);for(var f=0,p=c.length;f<p;f++){var g=c[f],m=this.rules[g];if(m)for(var x=this._applyRule(u,m),w=0,A=x.length;w<A;w++){var k=x[w];if(n(k,[]),m.combineable)for(var T=f+1;T<p;T++){var D=c[T],M=this.rules[D];if(M&&M.combineable&&m.type!=M.type)for(var P=this._applyRule(k,M),_=0,C=P.length;_<C;_++){var O=P[_];n(O,[])}}}g in this.compoundRuleCodes&&this.compoundRuleCodes[g].push(u)}}else n(u.trim(),[])}}return r},_removeDicComments:function(t){return t=t.replace(/^\t.*$/mg,""),t},parseRuleCodes:function(t){if(t)if("FLAG"in this.flags){if(this.flags.FLAG==="long"){for(var e=[],r=0,n=t.length;r<n;r+=2)e.push(t.substr(r,2));return e}else if(this.flags.FLAG==="num")return t.split(",")}else return t.split("");else return[]},_applyRule:function(t,e){for(var r=e.entries,n=[],i=0,o=r.length;i<o;i++){var a=r[i];if(!a.match||t.match(a.match)){var s=t;if(a.remove&&(s=s.replace(a.remove,"")),e.type==="SFX"?s=s+a.add:s=a.add+s,n.push(s),"continuationClasses"in a)for(var u=0,c=a.continuationClasses.length;u<c;u++){var f=this.rules[a.continuationClasses[u]];f&&(n=n.concat(this._applyRule(s,f)))}}}return n},check:function(t){if(!this.loaded)throw"Dictionary not loaded.";var e=t.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(e))return!0;if(e.toUpperCase()===e){var r=e[0]+e.substring(1).toLowerCase();if(this.hasFlag(r,"KEEPCASE"))return!1;if(this.checkExact(r)||this.checkExact(e.toLowerCase()))return!0}var n=e[0].toLowerCase()+e.substring(1);if(n!==e){if(this.hasFlag(n,"KEEPCASE"))return!1;if(this.checkExact(n))return!0}return!1},checkExact:function(t){if(!this.loaded)throw"Dictionary not loaded.";var e=this.dictionaryTable[t],r,n;if(typeof e>"u"){if("COMPOUNDMIN"in this.flags&&t.length>=this.flags.COMPOUNDMIN){for(r=0,n=this.compoundRules.length;r<n;r++)if(t.match(this.compoundRules[r]))return!0}}else{if(e===null)return!0;if(typeof e=="object"){for(r=0,n=e.length;r<n;r++)if(!this.hasFlag(t,"ONLYINCOMPOUND",e[r]))return!0}}return!1},hasFlag:function(t,e,r){if(!this.loaded)throw"Dictionary not loaded.";return!!(e in this.flags&&(typeof r>"u"&&(r=Array.prototype.concat.apply([],this.dictionaryTable[t])),r&&r.indexOf(this.flags[e])!==-1))},alphabet:"",suggest:function(t,e){if(!this.loaded)throw"Dictionary not loaded.";if(e=e||5,this.memoized.hasOwnProperty(t)){var r=this.memoized[t].limit;if(e<=r||this.memoized[t].suggestions.length<r)return this.memoized[t].suggestions.slice(0,e)}if(this.check(t))return[];for(var n=0,i=this.replacementTable.length;n<i;n++){var o=this.replacementTable[n];if(t.indexOf(o[0])!==-1){var a=t.replace(o[0],o[1]);if(this.check(a))return[a]}}var s=this;s.alphabet="abcdefghijklmnopqrstuvwxyz";function u(f,p){var g={},m,x,w,A,k,T,D=s.alphabet.length;if(typeof f=="string"){var M=f;f={},f[M]=!0}for(var M in f)for(m=0,A=M.length+1;m<A;m++){var P=[M.substring(0,m),M.substring(m)];if(P[1]&&(T=P[0]+P[1].substring(1),(!p||s.check(T))&&(T in g?g[T]+=1:g[T]=1)),P[1].length>1&&P[1][1]!==P[1][0]&&(T=P[0]+P[1][1]+P[1][0]+P[1].substring(2),(!p||s.check(T))&&(T in g?g[T]+=1:g[T]=1)),P[1]){var _=P[1].substring(0,1).toUpperCase()===P[1].substring(0,1)?"uppercase":"lowercase";for(x=0;x<D;x++){var C=s.alphabet[x];_==="uppercase"&&(C=C.toUpperCase()),C!=P[1].substring(0,1)&&(T=P[0]+C+P[1].substring(1),(!p||s.check(T))&&(T in g?g[T]+=1:g[T]=1))}}if(P[1])for(x=0;x<D;x++){var _=P[0].substring(-1).toUpperCase()===P[0].substring(-1)&&P[1].substring(0,1).toUpperCase()===P[1].substring(0,1)?"uppercase":"lowercase",C=s.alphabet[x];_==="uppercase"&&(C=C.toUpperCase()),T=P[0]+C+P[1],(!p||s.check(T))&&(T in g?g[T]+=1:g[T]=1)}}return g}function c(f){var p=u(f),g=u(p,!0),m=g;for(var x in p)!s.check(x)||(x in m?m[x]+=p[x]:m[x]=p[x]);var w,A,k=[];for(w in m)m.hasOwnProperty(w)&&k.push([w,m[w]]);function T(_,C){var O=_[1],F=C[1];return O<F?-1:O>F?1:C[0].localeCompare(_[0])}k.sort(T).reverse();var D=[],M="lowercase";f.toUpperCase()===f?M="uppercase":f.substr(0,1).toUpperCase()+f.substr(1).toLowerCase()===f&&(M="capitalized");var P=e;for(w=0;w<Math.min(P,k.length);w++)M==="uppercase"?k[w][0]=k[w][0].toUpperCase():M==="capitalized"&&(k[w][0]=k[w][0].substr(0,1).toUpperCase()+k[w][0].substr(1)),!s.hasFlag(k[w][0],"NOSUGGEST")&&D.indexOf(k[w][0])==-1?D.push(k[w][0]):P++;return D}return this.memoized[t]={suggestions:c(t),limit:e},this.memoized[t].suggestions}}})();typeof JF<"u"&&(JF.exports=ZF)});var ufe=Z((kMt,lfe)=>{"use strict";var sfe=afe();function xn(t){if(t=t||{},typeof t.codeMirrorInstance!="function"||typeof t.codeMirrorInstance.defineMode!="function"){console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`");return}String.prototype.includes||(String.prototype.includes=function(){"use strict";return String.prototype.indexOf.apply(this,arguments)!==-1}),t.codeMirrorInstance.defineMode("spell-checker",function(e){if(!xn.aff_loading){xn.aff_loading=!0;var r=new XMLHttpRequest;r.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),r.onload=function(){r.readyState===4&&r.status===200&&(xn.aff_data=r.responseText,xn.num_loaded++,xn.num_loaded==2&&(xn.typo=new sfe("en_US",xn.aff_data,xn.dic_data,{platform:"any"})))},r.send(null)}if(!xn.dic_loading){xn.dic_loading=!0;var n=new XMLHttpRequest;n.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),n.onload=function(){n.readyState===4&&n.status===200&&(xn.dic_data=n.responseText,xn.num_loaded++,xn.num_loaded==2&&(xn.typo=new sfe("en_US",xn.aff_data,xn.dic_data,{platform:"any"})))},n.send(null)}var i='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',o={token:function(s){var u=s.peek(),c="";if(i.includes(u))return s.next(),null;for(;(u=s.peek())!=null&&!i.includes(u);)c+=u,s.next();return xn.typo&&!xn.typo.check(c)?"spell-error":null}},a=t.codeMirrorInstance.getMode(e,e.backdrop||"text/plain");return t.codeMirrorInstance.overlayMode(a,o,!0)})}xn.num_loaded=0;xn.aff_loading=!1;xn.dic_loading=!1;xn.aff_data="";xn.dic_data="";xn.typo;lfe.exports=xn});var xfe=Z(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});function cfe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Jtt(t,e,r){return e&&cfe(t.prototype,e),r&&cfe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ert(t,e){if(!!t){if(typeof t=="string")return ffe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ffe(t,e)}}function ffe(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function U0(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=ert(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|