avo 4.1.11 → 4.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b75d350bbabce26a04fbe5ff8967073b84ab93ffa6aa38033000c6cdf7023a08
4
- data.tar.gz: 491411e9d13ea7ee2e6bdc604424019e03540456303d8007fc2afe6b54371e27
3
+ metadata.gz: e5a2ce3cbdc44745b7b001541c688d79b7e9b94274f380e723d7d371a3ba1ff6
4
+ data.tar.gz: 673d27491303e7541cc7213583ced81bbf5f56b508293d53ce15f09109a7a93c
5
5
  SHA512:
6
- metadata.gz: d7a94a371d5c4efdc7ad152e57ffb46dcee355a349cf3873dde1aea54d5b628e1e4a2cb3f3565423847955a2a61bd7a5dcdd180b3f7f9e1c58e75dc9b4e35d65
7
- data.tar.gz: fb430818f2ed8b7ae860c05a1590ede18c292fc19a684405f52709673be20042da41d5764e78c28bf4f5abfc0209761ee7b12d5bc5d7f6681f4977ee199e1920
6
+ metadata.gz: 2a5e57fd65233186832a8cc87935111b79f91dfaeb037d2598644d90bb61c78046151effcd9212ea4afd7cdee6ad75d4906f2022456b132b0604b628f681413d
7
+ data.tar.gz: 3da06735410500961ef1af61b7806633863947354f2b188116111f34281e6cb2404696ab92285fa56718ae21a8178c0e46d217b22e4cd9a7bbc8e37f3ea4dd2f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (4.1.11)
4
+ avo (4.1.12)
5
5
  actionview (>= 6.1)
6
6
  active_link_to
7
7
  activerecord (>= 6.1)
@@ -653,7 +653,7 @@ function print() { __p += __j.call(arguments, '') }
653
653
 
654
654
  %o
655
655
 
656
- %o`,t,e,n),(i=window.onerror)===null||i===void 0||i.call(window,t,"",0,0,e)}logFormattedMessage(e,t,n={}){n=Object.assign({application:this},n),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},n)),this.logger.groupEnd()}};function CBt(){return new Promise(r=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>r()):r()})}function DBt(r){return sC(r,"classes").reduce((t,n)=>Object.assign(t,IBt(n)),{})}function IBt(r){return{[`${r}Class`]:{get(){let{classes:e}=this;if(e.has(r))return e.get(r);{let t=e.getAttributeName(r);throw new Error(`Missing attribute "${t}"`)}}},[`${r}Classes`]:{get(){return this.classes.getAll(r)}},[`has${aC(r)}Class`]:{get(){return this.classes.has(r)}}}}function OBt(r){return sC(r,"outlets").reduce((t,n)=>Object.assign(t,MBt(n)),{})}function PAe(r,e,t){return r.application.getControllerForElementAndIdentifier(e,t)}function RAe(r,e,t){let n=PAe(r,e,t);if(n||(r.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),n=PAe(r,e,t),n))return n}function MBt(r){let e=R9(r);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(r),n=this.outlets.getSelectorForOutletName(r);if(t){let i=RAe(this,t,r);if(i)return i;throw new Error(`The provided outlet element is missing an outlet controller "${r}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${r}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${e}Outlets`]:{get(){let t=this.outlets.findAll(r);return t.length>0?t.map(n=>{let i=RAe(this,n,r);if(i)return i;console.warn(`The provided outlet element is missing an outlet controller "${r}" instance for host controller "${this.identifier}"`,n)}).filter(n=>n):[]}},[`${e}OutletElement`]:{get(){let t=this.outlets.find(r),n=this.outlets.getSelectorForOutletName(r);if(t)return t;throw new Error(`Missing outlet element "${r}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(r)}},[`has${aC(e)}Outlet`]:{get(){return this.outlets.has(r)}}}}function LBt(r){return sC(r,"targets").reduce((t,n)=>Object.assign(t,PBt(n)),{})}function PBt(r){return{[`${r}Target`]:{get(){let e=this.targets.find(r);if(e)return e;throw new Error(`Missing target element "${r}" for "${this.identifier}" controller`)}},[`${r}Targets`]:{get(){return this.targets.findAll(r)}},[`has${aC(r)}Target`]:{get(){return this.targets.has(r)}}}}function RBt(r){let e=gBt(r,"values"),t={valueDescriptorMap:{get(){return e.reduce((n,i)=>{let o=jAe(i,this.identifier),a=this.data.getAttributeNameForKey(o.key);return Object.assign(n,{[a]:o})},{})}}};return e.reduce((n,i)=>Object.assign(n,FBt(i)),t)}function FBt(r,e){let t=jAe(r,e),{key:n,name:i,reader:o,writer:a}=t;return{[i]:{get(){let l=this.data.get(n);return l!==null?o(l):t.defaultValue},set(l){l===void 0?this.data.delete(n):this.data.set(n,a(l))}},[`has${aC(i)}`]:{get(){return this.data.has(n)||t.hasCustomDefaultValue}}}}function jAe([r,e],t){return zBt({controller:t,token:r,typeDefinition:e})}function U2(r){switch(r){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function oC(r){switch(typeof r){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(r))return"array";if(Object.prototype.toString.call(r)==="[object Object]")return"object"}function qBt(r){let{controller:e,token:t,typeObject:n}=r,i=IAe(n.type),o=IAe(n.default),a=i&&o,l=i&&!o,u=!i&&o,f=U2(n.type),p=oC(r.typeObject.default);if(l)return f;if(u)return p;if(f!==p){let b=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${b}" must match the defined type "${f}". The provided default value of "${n.default}" is of type "${p}".`)}if(a)return f}function NBt(r){let{controller:e,token:t,typeDefinition:n}=r,o=qBt({controller:e,token:t,typeObject:n}),a=oC(n),l=U2(n),u=o||a||l;if(u)return u;let f=e?`${e}.${n}`:t;throw new Error(`Unknown value type "${f}" for "${t}" value`)}function BBt(r){let e=U2(r);if(e)return FAe[e];let t=F9(r,"default"),n=F9(r,"type"),i=r;if(t)return i.default;if(n){let{type:o}=i,a=U2(o);if(a)return FAe[a]}return r}function zBt(r){let{token:e,typeDefinition:t}=r,n=`${BAe(e)}-value`,i=NBt(r);return{type:i,key:n,name:r7(n),get defaultValue(){return BBt(t)},get hasCustomDefaultValue(){return oC(t)!==void 0},reader:UBt[i],writer:qAe[i]||qAe.default}}var FAe={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},UBt={array(r){let e=JSON.parse(r);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${r}" of type "${oC(e)}"`);return e},boolean(r){return!(r=="0"||String(r).toLowerCase()=="false")},number(r){return Number(r.replace(/_/g,""))},object(r){let e=JSON.parse(r);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${r}" of type "${oC(e)}"`);return e},string(r){return r}},qAe={default:jBt,array:NAe,object:NAe};function NAe(r){return JSON.stringify(r)}function jBt(r){return`${r}`}var Gt=class{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:n={},prefix:i=this.identifier,bubbles:o=!0,cancelable:a=!0}={}){let l=i?`${i}:${e}`:e,u=new CustomEvent(l,{detail:n,bubbles:o,cancelable:a});return t.dispatchEvent(u),u}};Gt.blessings=[DBt,LBt,RBt,OBt];Gt.targets=[];Gt.outlets=[];Gt.values={};var aS=class extends Gt{initialize(){this.hide()}connect(){setTimeout(()=>{this.show()},this.showDelayValue),this.hasDismissAfterValue&&setTimeout(()=>{this.close()},this.dismissAfterValue)}close(){this.hide(),setTimeout(()=>{this.element.remove()},this.removeDelayValue)}show(){this.element.classList.add(...this.showClasses),this.element.classList.remove(...this.hideClasses)}hide(){this.element.classList.add(...this.hideClasses),this.element.classList.remove(...this.showClasses)}};aS.values={dismissAfter:Number,showDelay:{type:Number,default:200},removeDelay:{type:Number,default:1100}},aS.classes=["show","hide"];var n7=class extends Gt{connect(){this.timeout=null,this.duration=this.data.get("duration")||1e3}save(){clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.statusTarget.textContent="Saving...",Rails.fire(this.formTarget,"submit")},this.duration)}success(){this.setStatus("Saved!")}error(){this.setStatus("Unable to save!")}setStatus(e){this.statusTarget.textContent=e,this.timeout=setTimeout(()=>{this.statusTarget.textContent=""},2e3)}};n7.targets=["form","status"];var lC=class extends Gt{constructor(...e){super(...e),this._onMenuButtonKeydown=t=>{switch(t.keyCode){case 13:case 32:t.preventDefault(),this.toggle()}}}connect(){this.toggleClass=this.data.get("class")||"hidden",this.visibleClass=this.data.get("visibleClass")||null,this.invisibleClass=this.data.get("invisibleClass")||null,this.activeClass=this.data.get("activeClass")||null,this.enteringClass=this.data.get("enteringClass")||null,this.leavingClass=this.data.get("leavingClass")||null,this.hasButtonTarget&&this.buttonTarget.addEventListener("keydown",this._onMenuButtonKeydown),this.element.setAttribute("aria-haspopup","true")}disconnect(){this.hasButtonTarget&&this.buttonTarget.removeEventListener("keydown",this._onMenuButtonKeydown)}toggle(){this.openValue=!this.openValue}openValueChanged(){this.openValue?this._show():this._hide()}_show(e){setTimeout((()=>{this.menuTarget.classList.remove(this.toggleClass),this.element.setAttribute("aria-expanded","true"),this._enteringClassList[0].forEach((t=>{this.menuTarget.classList.add(t)}).bind(this)),this._activeClassList[0].forEach(t=>{this.activeTarget.classList.add(t)}),this._invisibleClassList[0].forEach(t=>this.menuTarget.classList.remove(t)),this._visibleClassList[0].forEach(t=>{this.menuTarget.classList.add(t)}),setTimeout((()=>{this._enteringClassList[0].forEach(t=>this.menuTarget.classList.remove(t))}).bind(this),this.enterTimeout[0]),typeof e=="function"&&e()}).bind(this))}_hide(e){setTimeout((()=>{this.element.setAttribute("aria-expanded","false"),this._invisibleClassList[0].forEach(t=>this.menuTarget.classList.add(t)),this._visibleClassList[0].forEach(t=>this.menuTarget.classList.remove(t)),this._activeClassList[0].forEach(t=>this.activeTarget.classList.remove(t)),this._leavingClassList[0].forEach(t=>this.menuTarget.classList.add(t)),setTimeout((()=>{this._leavingClassList[0].forEach(t=>this.menuTarget.classList.remove(t)),typeof e=="function"&&e(),this.menuTarget.classList.add(this.toggleClass)}).bind(this),this.leaveTimeout[0])}).bind(this))}show(){this.openValue=!0}hide(e){this.element.contains(e.target)===!1&&this.openValue&&(this.openValue=!1)}get activeTarget(){return this.data.has("activeTarget")?document.querySelector(this.data.get("activeTarget")):this.element}get _activeClassList(){return this.activeClass?this.activeClass.split(",").map(e=>e.split(" ")):[[],[]]}get _visibleClassList(){return this.visibleClass?this.visibleClass.split(",").map(e=>e.split(" ")):[[],[]]}get _invisibleClassList(){return this.invisibleClass?this.invisibleClass.split(",").map(e=>e.split(" ")):[[],[]]}get _enteringClassList(){return this.enteringClass?this.enteringClass.split(",").map(e=>e.split(" ")):[[],[]]}get _leavingClassList(){return this.leavingClass?this.leavingClass.split(",").map(e=>e.split(" ")):[[],[]]}get enterTimeout(){return(this.data.get("enterTimeout")||"0,0").split(",").map(e=>parseInt(e))}get leaveTimeout(){return(this.data.get("leaveTimeout")||"0,0").split(",").map(e=>parseInt(e))}};lC.targets=["menu","button"],lC.values={open:Boolean};var j2=class extends Gt{connect(){this.toggleClass=this.data.get("class")||"hidden",this.backgroundId=this.data.get("backgroundId")||"modal-background",this.backgroundHtml=this.data.get("backgroundHtml")||this._backgroundHTML(),this.allowBackgroundClose=(this.data.get("allowBackgroundClose")||"true")==="true",this.preventDefaultActionOpening=(this.data.get("preventDefaultActionOpening")||"true")==="true",this.preventDefaultActionClosing=(this.data.get("preventDefaultActionClosing")||"true")==="true"}disconnect(){this.close()}open(e){this.preventDefaultActionOpening&&e.preventDefault(),e.target.blur&&e.target.blur(),this.lockScroll(),this.containerTarget.classList.remove(this.toggleClass),this.data.get("disable-backdrop")||(document.body.insertAdjacentHTML("beforeend",this.backgroundHtml),this.background=document.querySelector(`#${this.backgroundId}`))}close(e){e&&this.preventDefaultActionClosing&&e.preventDefault(),this.unlockScroll(),this.containerTarget.classList.add(this.toggleClass),this.background&&this.background.remove()}closeBackground(e){this.allowBackgroundClose&&e.target===this.containerTarget&&this.close(e)}closeWithKeyboard(e){e.keyCode!==27||this.containerTarget.classList.contains(this.toggleClass)||this.close(e)}_backgroundHTML(){return`<div id="${this.backgroundId}" class="fixed top-0 left-0 w-full h-full" style="background-color: ${this.backdropColorValue}; z-index: 9998;"></div>`}lockScroll(){let e=window.innerWidth-document.documentElement.clientWidth;document.body.style.paddingRight=`${e}px`,this.saveScrollPosition(),document.body.classList.add("fixed","inset-x-0","overflow-hidden"),document.body.style.top=`-${this.scrollPosition}px`}unlockScroll(){document.body.style.paddingRight=null,document.body.classList.remove("fixed","inset-x-0","overflow-hidden"),this.restoreScrollValue&&this.restoreScrollPosition(),document.body.style.top=null}saveScrollPosition(){this.scrollPosition=window.pageYOffset||document.body.scrollTop}restoreScrollPosition(){this.scrollPosition!==void 0&&(document.documentElement.scrollTop=this.scrollPosition)}};j2.targets=["container"],j2.values={backdropColor:{type:String,default:"rgba(0, 0, 0, 0.8)"},restoreScroll:{type:Boolean,default:!0}};var i7=class extends Gt{connect(){this.activeTabClasses=(this.data.get("activeTab")||"active").split(" "),this.inactiveTabClasses=(this.data.get("inactiveTab")||"inactive").split(" "),this.anchor&&(this.index=this.tabTargets.findIndex(e=>e.id===this.anchor)),this.showTab()}change(e){e.preventDefault(),this.index=e.currentTarget.dataset.index?e.currentTarget.dataset.index:e.currentTarget.dataset.id?this.tabTargets.findIndex(t=>t.id==e.currentTarget.dataset.id):this.tabTargets.indexOf(e.currentTarget),window.dispatchEvent(new CustomEvent("tsc:tab-change"))}showTab(){this.tabTargets.forEach((e,t)=>{let n=this.panelTargets[t];t===this.index?(n.classList.remove("hidden"),e.classList.remove(...this.inactiveTabClasses),e.classList.add(...this.activeTabClasses),e.id&&(location.hash=e.id)):(n.classList.add("hidden"),e.classList.remove(...this.activeTabClasses),e.classList.add(...this.inactiveTabClasses))})}get index(){return parseInt(this.data.get("index")||0)}set index(e){this.data.set("index",e>=0?e:0),this.showTab()}get anchor(){return document.URL.split("#").length>1?document.URL.split("#")[1]:null}};i7.targets=["tab","panel"];var V2=class extends Gt{connect(){this.toggleClass=this.data.get("class")||"hidden"}toggle(e){e.preventDefault(),this.openValue=!this.openValue}hide(e){e.preventDefault(),this.openValue=!1}show(e){e.preventDefault(),this.openValue=!0}openValueChanged(){this.toggleClass&&this.toggleableTargets.forEach(e=>{e.classList.toggle(this.toggleClass)})}};V2.targets=["toggleable"],V2.values={open:Boolean};var uC=class extends Gt{initialize(){this.contentTarget.setAttribute("style",`transform:translate(${this.data.get("translateX")}, ${this.data.get("translateY")});`)}mouseOver(){this.contentTarget.classList.remove("hidden")}mouseOut(){this.contentTarget.classList.add("hidden")}toggle(){this.contentTarget.classList.contains("hidden")?this.contentTarget.classList.remove("hidden"):this.contentTarget.classList.add("hidden")}};uC.targets=["content"];var o7=class extends lC{_show(){this.overlayTarget.classList.remove(this.toggleClass),super._show((()=>{this._activeClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),this._invisibleClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this._visibleClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),setTimeout((()=>{this._enteringClassList[1].forEach(e=>this.overlayTarget.classList.remove(e))}).bind(this),this.enterTimeout[1])}).bind(this))}_hide(){this._leavingClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),super._hide((()=>{setTimeout((()=>{this._visibleClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this._invisibleClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),this._activeClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this._leavingClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this.overlayTarget.classList.add(this.toggleClass)}).bind(this),this.leaveTimeout[1])}).bind(this))}};o7.targets=["menu","overlay"];var a7=class extends Gt{connect(){this.styleProperty=this.data.get("style")||"backgroundColor"}update(){this.preview=this.color}set preview(e){this.previewTarget.style[this.styleProperty]=e;let t=this._getContrastYIQ(e);this.styleProperty==="color"?this.previewTarget.style.backgroundColor=t:this.previewTarget.style.color=t}get color(){return this.colorTarget.value}_getContrastYIQ(e){return e=e.replace("#",""),(299*parseInt(e.substr(0,2),16)+587*parseInt(e.substr(2,2),16)+114*parseInt(e.substr(4,2),16))/1e3>=128?"#000":"#fff"}};a7.targets=["preview","color"];var s7=class extends Gt{connect(){this.hasButtonTarget&&(this.originalContent=this.buttonTarget.innerHTML)}copy(e){e.preventDefault();let t=this.sourceTarget.innerHTML||this.sourceTarget.value;navigator.clipboard.writeText(t).then(()=>this.copied())}copied(){this.hasButtonTarget&&(this.timeout&&clearTimeout(this.timeout),this.buttonTarget.innerHTML=this.successContentValue,this.timeout=setTimeout(()=>{this.buttonTarget.innerHTML=this.originalContent},this.successDurationValue))}};s7.targets=["button","source"],s7.values={successContent:String,successDuration:{type:Number,default:2e3}};var VAe=s7;var l7=class extends Gt{connect(){this.hidden=this.inputTarget.type==="password",this.class=this.hasHiddenClass?this.hiddenClass:"hidden"}toggle(e){e.preventDefault(),this.inputTarget.type=this.hidden?"text":"password",this.hidden=!this.hidden,this.iconTargets.forEach(t=>t.classList.toggle(this.class))}};l7.targets=["input","icon"],l7.classes=["hidden"];var HAe=l7;var H2=class extends HAe{toggle(r){this.inputTarget.disabled||super.toggle(r)}};function VBt(r,e){let t;return(...n)=>{let i=this;clearTimeout(t),t=setTimeout(()=>r.apply(i,n),e)}}var cC=class extends Gt{initialize(){this.autogrow=this.autogrow.bind(this)}connect(){this.element.style.overflow="hidden";let e=this.resizeDebounceDelayValue;this.onResize=e>0?VBt(this.autogrow,e):this.autogrow,this.autogrow(),this.element.addEventListener("input",this.autogrow),window.addEventListener("resize",this.onResize)}disconnect(){window.removeEventListener("resize",this.onResize)}autogrow(){this.element.style.height="auto",this.element.style.height=`${this.element.scrollHeight}px`}};cC.values={resizeDebounceDelay:{type:Number,default:100}};var WAe=11;function HBt(r,e){var t=e.attributes,n,i,o,a,l;if(!(e.nodeType===WAe||r.nodeType===WAe)){for(var u=t.length-1;u>=0;u--)n=t[u],i=n.name,o=n.namespaceURI,a=n.value,o?(i=n.localName||i,l=r.getAttributeNS(o,i),l!==a&&(n.prefix==="xmlns"&&(i=n.name),r.setAttributeNS(o,i,a))):(l=r.getAttribute(i),l!==a&&r.setAttribute(i,a));for(var f=r.attributes,p=f.length-1;p>=0;p--)n=f[p],i=n.name,o=n.namespaceURI,o?(i=n.localName||i,e.hasAttributeNS(o,i)||r.removeAttributeNS(o,i)):e.hasAttribute(i)||r.removeAttribute(i)}}var W2,WBt="http://www.w3.org/1999/xhtml",_f=typeof document>"u"?void 0:document,$Bt=!!_f&&"content"in _f.createElement("template"),KBt=!!_f&&_f.createRange&&"createContextualFragment"in _f.createRange();function GBt(r){var e=_f.createElement("template");return e.innerHTML=r,e.content.childNodes[0]}function YBt(r){W2||(W2=_f.createRange(),W2.selectNode(_f.body));var e=W2.createContextualFragment(r);return e.childNodes[0]}function XBt(r){var e=_f.createElement("body");return e.innerHTML=r,e.childNodes[0]}function ZBt(r){return r=r.trim(),$Bt?GBt(r):KBt?YBt(r):XBt(r)}function $2(r,e){var t=r.nodeName,n=e.nodeName,i,o;return t===n?!0:(i=t.charCodeAt(0),o=n.charCodeAt(0),i<=90&&o>=97?t===n.toUpperCase():o<=90&&i>=97?n===t.toUpperCase():!1)}function JBt(r,e){return!e||e===WBt?_f.createElement(r):_f.createElementNS(e,r)}function QBt(r,e){for(var t=r.firstChild;t;){var n=t.nextSibling;e.appendChild(t),t=n}return e}function u7(r,e,t){r[t]!==e[t]&&(r[t]=e[t],r[t]?r.setAttribute(t,""):r.removeAttribute(t))}var $Ae={OPTION:function(r,e){var t=r.parentNode;if(t){var n=t.nodeName.toUpperCase();n==="OPTGROUP"&&(t=t.parentNode,n=t&&t.nodeName.toUpperCase()),n==="SELECT"&&!t.hasAttribute("multiple")&&(r.hasAttribute("selected")&&!e.selected&&(r.setAttribute("selected","selected"),r.removeAttribute("selected")),t.selectedIndex=-1)}u7(r,e,"selected")},INPUT:function(r,e){u7(r,e,"checked"),u7(r,e,"disabled"),r.value!==e.value&&(r.value=e.value),e.hasAttribute("value")||r.removeAttribute("value")},TEXTAREA:function(r,e){var t=e.value;r.value!==t&&(r.value=t);var n=r.firstChild;if(n){var i=n.nodeValue;if(i==t||!t&&i==r.placeholder)return;n.nodeValue=t}},SELECT:function(r,e){if(!e.hasAttribute("multiple")){for(var t=-1,n=0,i=r.firstChild,o,a;i;)if(a=i.nodeName&&i.nodeName.toUpperCase(),a==="OPTGROUP")o=i,i=o.firstChild;else{if(a==="OPTION"){if(i.hasAttribute("selected")){t=n;break}n++}i=i.nextSibling,!i&&o&&(i=o.nextSibling,o=null)}r.selectedIndex=t}}},hC=1,KAe=11,GAe=3,YAe=8;function Mb(){}function ezt(r){if(r)return r.getAttribute&&r.getAttribute("id")||r.id}function tzt(r){return function(t,n,i){if(i||(i={}),typeof n=="string")if(t.nodeName==="#document"||t.nodeName==="HTML"||t.nodeName==="BODY"){var o=n;n=_f.createElement("html"),n.innerHTML=o}else n=ZBt(n);else n.nodeType===KAe&&(n=n.firstElementChild);var a=i.getNodeKey||ezt,l=i.onBeforeNodeAdded||Mb,u=i.onNodeAdded||Mb,f=i.onBeforeElUpdated||Mb,p=i.onElUpdated||Mb,b=i.onBeforeNodeDiscarded||Mb,S=i.onNodeDiscarded||Mb,C=i.onBeforeElChildrenUpdated||Mb,M=i.skipFromChildren||Mb,L=i.addChild||function(ie,ue){return ie.appendChild(ue)},P=i.childrenOnly===!0,H=Object.create(null),$=[];function Q(ie){$.push(ie)}function K(ie,ue){if(ie.nodeType===hC)for(var Me=ie.firstChild;Me;){var ve=void 0;ue&&(ve=a(Me))?Q(ve):(S(Me),Me.firstChild&&K(Me,ue)),Me=Me.nextSibling}}function te(ie,ue,Me){b(ie)!==!1&&(ue&&ue.removeChild(ie),S(ie),K(ie,Me))}function pe(ie){if(ie.nodeType===hC||ie.nodeType===KAe)for(var ue=ie.firstChild;ue;){var Me=a(ue);Me&&(H[Me]=ue),pe(ue),ue=ue.nextSibling}}pe(t);function re(ie){u(ie);for(var ue=ie.firstChild;ue;){var Me=ue.nextSibling,ve=a(ue);if(ve){var le=H[ve];le&&$2(ue,le)?(ue.parentNode.replaceChild(le,ue),_e(le,ue)):re(ue)}else re(ue);ue=Me}}function ge(ie,ue,Me){for(;ue;){var ve=ue.nextSibling;(Me=a(ue))?Q(Me):te(ue,ie,!0),ue=ve}}function _e(ie,ue,Me){var ve=a(ue);ve&&delete H[ve],!(!Me&&(f(ie,ue)===!1||(r(ie,ue),p(ie),C(ie,ue)===!1)))&&(ie.nodeName!=="TEXTAREA"?Fe(ie,ue):$Ae.TEXTAREA(ie,ue))}function Fe(ie,ue){var Me=M(ie),ve=ue.firstChild,le=ie.firstChild,Ue,yt,it,bt,ct;e:for(;ve;){for(bt=ve.nextSibling,Ue=a(ve);!Me&&le;){if(it=le.nextSibling,ve.isSameNode&&ve.isSameNode(le)){ve=bt,le=it;continue e}yt=a(le);var Ot=le.nodeType,Wt=void 0;if(Ot===ve.nodeType&&(Ot===hC?(Ue?Ue!==yt&&((ct=H[Ue])?it===ct?Wt=!1:(ie.insertBefore(ct,le),yt?Q(yt):te(le,ie,!0),le=ct):Wt=!1):yt&&(Wt=!1),Wt=Wt!==!1&&$2(le,ve),Wt&&_e(le,ve)):(Ot===GAe||Ot==YAe)&&(Wt=!0,le.nodeValue!==ve.nodeValue&&(le.nodeValue=ve.nodeValue))),Wt){ve=bt,le=it;continue e}yt?Q(yt):te(le,ie,!0),le=it}if(Ue&&(ct=H[Ue])&&$2(ct,ve))L(ie,ct),_e(ct,ve);else{var qt=l(ve);qt!==!1&&(qt&&(ve=qt),ve.actualize&&(ve=ve.actualize(ie.ownerDocument||_f)),L(ie,ve),re(ve))}ve=bt,le=it}ge(ie,le,yt);var pr=$Ae[ie.nodeName];pr&&pr(ie,ue)}var ke=t,V=ke.nodeType,z=n.nodeType;if(!P){if(V===hC)z===hC?$2(t,n)||(S(t),ke=QBt(t,JBt(n.nodeName,n.namespaceURI))):ke=n;else if(V===GAe||V===YAe){if(z===V)return ke.nodeValue!==n.nodeValue&&(ke.nodeValue=n.nodeValue),ke;ke=n}}if(ke===n)S(t);else{if(n.isSameNode&&n.isSameNode(ke))return;if(_e(ke,n,P),$)for(var xe=0,Ie=$.length;xe<Ie;xe++){var he=H[$[xe]];he&&te(he,he.parentNode,!1)}}return!P&&ke!==t&&t.parentNode&&(ke.actualize&&(ke=ke.actualize(t.ownerDocument||_f)),t.parentNode.replaceChild(ke,t)),ke}}var rzt=tzt(HBt);function nzt(){let r={childrenOnly:this.hasAttribute("children-only")};this.targetElements.forEach((e=>{rzt(e,r.childrenOnly?this.templateContent:this.templateElement.innerHTML,r)}))}var izt=r=>{r.morph=nzt};function h7(r){return r.replace(/(?:[_-])([a-z0-9])/g,((e,t)=>t.toUpperCase()))}function ozt(r){return r.charAt(0).toUpperCase()+r.slice(1)}function azt(r){return r.replace(/([A-Z])/g,((e,t)=>`-${t.toLowerCase()}`))}function K2(r){return r?r.match(/[^\s]+/g)||[]:[]}function f7(r){try{return JSON.parse(r)}catch{return r}}var szt=Object.freeze({__proto__:null,camelize:h7,capitalize:ozt,dasherize:azt,tokenize:K2,typecast:f7});function ZAe(){let r=K2(this.getAttribute("classes"));r.length>0?this.targetElements.forEach((e=>e.classList.add(...r))):console.warn('[TurboPower] no "classes" provided for Turbo Streams operation "add_css_class"')}function JAe(){let r=this.getAttribute("attribute");r?this.targetElements.forEach((e=>e.removeAttribute(r))):console.warn('[TurboPower] no "attribute" provided for Turbo Streams operation "remove_attribute"')}function QAe(){let r=K2(this.getAttribute("classes"));r.length>0?this.targetElements.forEach((e=>e.classList.remove(...r))):console.warn('[TurboPower] no "classes" provided for Turbo Streams operation "remove_css_class"')}function eCe(){let r=this.getAttribute("attribute"),e=this.getAttribute("value")||"";r?this.targetElements.forEach((t=>t.setAttribute(r,e))):console.warn('[TurboPower] no "attribute" provided for Turbo Streams operation "set_attribute"')}function tCe(){let r=this.getAttribute("attribute"),e=this.getAttribute("value")||"";r?this.targetElements.forEach((t=>t.dataset[h7(r)]=e)):console.warn('[TurboPower] no "attribute" provided for Turbo Streams operation "set_dataset_attribute"')}function rCe(){let r=this.getAttribute("name"),e=f7(this.getAttribute("value")||"");r?this.targetElements.forEach((t=>t[r]=e)):console.error('[TurboPower] no "name" provided for Turbo Streams operation "set_property"')}function nCe(){let r=this.getAttribute("name"),e=this.getAttribute("value")||"";r?this.targetElements.forEach((t=>t.style[r]=e)):console.error('[TurboPower] no "name" provided for Turbo Streams operation "set_style"')}function iCe(){let r=this.getAttribute("styles")||"";this.targetElements.forEach((e=>e.setAttribute("style",r)))}function oCe(){let r=this.getAttribute("value")||"";this.targetElements.forEach((e=>e.value=r))}function aCe(){let r=K2(this.getAttribute("classes"));r.length>0?this.targetElements.forEach((e=>{r.forEach((t=>e.classList.toggle(t)))})):console.warn('[TurboPower] no "classes" provided for Turbo Streams operation "toggle_css_class"')}function sCe(){let r=this.getAttribute("from")||"",e=this.getAttribute("to")||"";r&&e?this.targetElements.forEach((t=>{t.classList.replace(r,e)||console.warn(`[TurboPower] The "${r}" CSS class provided in the "from" attribute for the "replace_css_class" action was not found on the target element. No replacements made.`,t)})):console.warn('[TurboPower] no "from" or "to" class provided for Turbo Streams operation "replace_css_class"')}function lCe(r){r.add_css_class=ZAe,r.remove_css_class=QAe,r.remove_attribute=JAe,r.set_attribute=eCe,r.set_dataset_attribute=tCe,r.set_property=rCe,r.set_style=nCe,r.set_styles=iCe,r.set_value=oCe,r.toggle_css_class=aCe,r.replace_css_class=sCe}function uCe(){window.location.reload()}function cCe(){let r=this.getAttribute("align-to-top"),e=this.getAttribute("block"),t=this.getAttribute("inline"),n=this.getAttribute("behavior");if(r)this.targetElements.forEach((i=>i.scrollIntoView(r==="true")));else if(e||t||n){let i={};e&&(i.block=e),t&&(i.inline=t),n&&(i.behavior=n),this.targetElements.forEach((o=>o.scrollIntoView(i)))}else this.targetElements.forEach((i=>i.scrollIntoView()))}function hCe(){this.targetElements.forEach((r=>r.focus()))}function fCe(){let r=this.getAttribute("title")||"",e=document.head.querySelector("title");e||(e=document.createElement("title"),document.head.appendChild(e)),e.textContent=r}function dCe(r){r.reload=uCe,r.scroll_into_view=cCe,r.set_focus=hCe,r.set_title=fCe}function pCe(){let r=this.getAttribute("message"),e=this.getAttribute("level")||"log";console[e](r)}function mCe(){let r=JSON.parse(this.getAttribute("data")||"[]"),e=JSON.parse(this.getAttribute("columns")||"[]");console.table(r,e)}function gCe(r){r.console_log=pCe,r.console_table=mCe}function vCe(){console.warn("[TurboPower] The `invoke` Turbo Stream Action was removed from TurboPower. If you'd like to continue using this action please use the successor library instead. Read more here: https://github.com/hopsoft/turbo_boost-streams")}function yCe(r){r.invoke||(r.invoke=vCe)}var c7=class{constructor(e){this.ATTRIBUTE_TO_COOKIE_KEY_MAPPING=[["domain","Domain",!1],["path","Path",!1],["expires","Expires",!1],["max-age","Max-Age",!1],["http-only","HttpOnly",!0],["secure","Secure",!0],["same-site","SameSite",!1]],this.streamElement=e}build(){let e=`${this.streamElement.getAttribute("name")}=${this.streamElement.getAttribute("value")}`;return this.ATTRIBUTE_TO_COOKIE_KEY_MAPPING.forEach((([t,n,i])=>{let o=this.streamElement.getAttribute(t);if(o!==null){let a=i?n:`${n}=${o}`;e=`${e}; ${a}`}})),e}};function bCe(){let r=this.getAttribute("cookie")||"";document.cookie=r}function xCe(){let r=new c7(this);document.cookie=r.build()}function _Ce(r){r.set_cookie=bCe,r.set_cookie_item=xCe}function wCe(){let r=this.getAttribute("parent");if(r){let e=document.querySelector(r);e?this.targetElements.forEach((t=>e.appendChild(t))):console.error(`[TurboPower] couldn't find parent element using selector "${r}" for Turbo Streams operation "graft"`)}else console.error('[TurboPower] no "parent" selector provided for Turbo Streams operation "graft"')}function SCe(){let r=this.templateContent.textContent||"";this.targetElements.forEach((e=>e.innerHTML=r))}function TCe(){let r=this.getAttribute("position")||"beforebegin",e=this.templateContent.textContent||"";this.targetElements.forEach((t=>t.insertAdjacentHTML(r,e)))}function ECe(){let r=this.getAttribute("position")||"beforebegin",e=this.getAttribute("text")||"";this.targetElements.forEach((t=>t.insertAdjacentText(r,e)))}function kCe(){let r=this.templateContent.textContent||"";this.targetElements.forEach((e=>e.outerHTML=r))}function ACe(){let r=this.getAttribute("name"),e=this.getAttribute("content")||"";if(r){let t=document.head.querySelector(`meta[name='${r}']`);t||(t=document.createElement("meta"),t.name=r,document.head.appendChild(t)),t.content=e}else console.error('[TurboPower] no "name" provided for Turbo Streams operation "set_meta"')}function CCe(){let r=this.getAttribute("text")||"";this.targetElements.forEach((e=>e.textContent=r))}function DCe(r){r.graft=wCe,r.inner_html=SCe,r.insert_adjacent_html=TCe,r.insert_adjacent_text=ECe,r.outer_html=kCe,r.text_content=CCe,r.set_meta=ACe}function ICe(){let r=this.getAttribute("name"),e=null;try{e=this.templateContent.textContent}catch{}try{let t=e?JSON.parse(e):{};if(r){let n={bubbles:!0,cancelable:!0,detail:t},i=new CustomEvent(r,n);this.targetElements.forEach((o=>o.dispatchEvent(i)))}else console.warn('[TurboPower] no "name" provided for Turbo Streams operation "dispatch_event"')}catch(t){console.error(`[TurboPower] error proccessing provided "detail" in "<template>" ("${e}") for Turbo Streams operation "dispatch_event".`,`Error: "${t.message}"`)}}function OCe(r){r.dispatch_event=ICe}function MCe(){this.targetElements.forEach((r=>r.reset()))}function LCe(r){r.reset_form=MCe}function PCe(){let r=this.getAttribute("url"),e=this.getAttribute("state"),t=this.getAttribute("title")||"";window.history.pushState(e,t,r)}function RCe(){let r=this.getAttribute("url"),e=this.getAttribute("state"),t=this.getAttribute("title")||"";window.history.replaceState(e,t,r)}function FCe(){window.history.back()}function lzt(){window.history.forward()}function qCe(){let r=Number(this.getAttribute("delta"))||0;window.history.go(r)}function NCe(r){r.push_state=PCe,r.replace_state=RCe,r.history_back=FCe,r.history_go=qCe}var uzt=["dir","lang","badge","body","tag","icon","image","data","vibrate","renotify","require-interaction","actions","silent"],XAe=r=>{let e=r.getAttribute("title")||"",t=Array.from(r.attributes).filter((i=>uzt.includes(i.name))).map((i=>[h7(i.name),f7(i.value)])),n=Object.fromEntries(t);new Notification(e,n)};function BCe(){window.Notification?Notification.permission==="granted"?XAe(this):Notification.permission!=="denied"&&Notification.requestPermission().then((r=>{r==="granted"&&XAe(this)})):alert("This browser does not support desktop notification")}function zCe(r){r.notification=BCe}function d7(r){return r==="session"?window.sessionStorage:window.localStorage}function UCe(){let r=this.getAttribute("type");d7(r).clear()}function jCe(){let r=this.getAttribute("key"),e=this.getAttribute("value")||"",t=this.getAttribute("type");r?d7(t).setItem(r,e):console.warn('[TurboPower] no "key" provided for Turbo Streams operation "set_storage_item"')}function VCe(){let r=this.getAttribute("key"),e=this.getAttribute("type");r?d7(e).removeItem(r):console.warn('[TurboPower] no "key" provided for Turbo Streams operation "remove_storage_item"')}function HCe(r){r.clear_storage=UCe,r.set_storage_item=jCe,r.remove_storage_item=VCe}var czt={get location(){return window.TurboPowerLocation||window.location}};function WCe(){let r=this.getAttribute("url")||"/",e=this.getAttribute("turbo-action")||"advance",t=this.getAttribute("turbo-frame"),n=this.getAttribute("turbo")!=="false",i={action:e};t&&(i.frame=t),n&&window.Turbo?window.Turbo.visit(r,i):czt.location.assign(r)}function $Ce(){window.Turbo.cache.clear()}function KCe(r){r.redirect_to=WCe,r.turbo_clear_cache=$Ce}function GCe(){let r=this.getAttribute("value")||0;window.Turbo.navigator.adapter.progressBar.setValue(Number(r))}function YCe(){window.Turbo.navigator.adapter.progressBar.show()}function XCe(){window.Turbo.navigator.adapter.progressBar.hide()}function ZCe(r){r.turbo_progress_bar_set_value=GCe,r.turbo_progress_bar_show=YCe,r.turbo_progress_bar_hide=XCe}function JCe(){this.targetElements.forEach((r=>r.reload()))}function QCe(){let r=this.getAttribute("src");this.targetElements.forEach((e=>e.src=r))}function eDe(r){r.turbo_frame_reload=JCe,r.turbo_frame_set_src=QCe}function tDe(r){lCe(r),dCe(r),gCe(r),yCe(r),_Ce(r),DCe(r),OCe(r),LCe(r),NCe(r),zCe(r),HCe(r),KCe(r),ZCe(r),eDe(r)}var hzt=Object.freeze({__proto__:null,add_css_class:ZAe,clear_storage:UCe,console_log:pCe,console_table:mCe,dispatch_event:ICe,graft:wCe,history_back:FCe,history_forward:lzt,history_go:qCe,inner_html:SCe,insert_adjacent_html:TCe,insert_adjacent_text:ECe,invoke:vCe,notification:BCe,outer_html:kCe,push_state:PCe,redirect_to:WCe,register:tDe,registerAttributesActions:lCe,registerBrowserActions:dCe,registerDOMActions:DCe,registerDebugActions:gCe,registerDeprecatedActions:yCe,registerDocumentActions:_Ce,registerEventsActions:OCe,registerFormActions:LCe,registerHistoryActions:NCe,registerNotificationActions:zCe,registerStorageActions:HCe,registerTurboActions:KCe,registerTurboFrameActions:eDe,registerTurboProgressBarActions:ZCe,reload:uCe,remove_attribute:JAe,remove_css_class:QAe,remove_storage_item:VCe,replace_css_class:sCe,replace_state:RCe,reset_form:MCe,scroll_into_view:cCe,set_attribute:eCe,set_cookie:bCe,set_cookie_item:xCe,set_dataset_attribute:tCe,set_focus:hCe,set_meta:ACe,set_property:rCe,set_storage_item:jCe,set_style:nCe,set_styles:iCe,set_title:fCe,set_value:oCe,text_content:CCe,toggle_css_class:aCe,turbo_clear_cache:$Ce,turbo_frame_reload:JCe,turbo_frame_set_src:QCe,turbo_progress_bar_hide:XCe,turbo_progress_bar_set_value:GCe,turbo_progress_bar_show:YCe});function fzt(r){izt(r),tDe(r)}function dzt(r,e,t){t[r]=e}var rDe={initialize:fzt,register:dzt,Actions:hzt,Utils:szt};rDe.initialize(window.Turbo.StreamActions);var cn=z2.start();cn.debug=window?.localStorage.getItem("avo.debug");window.Stimulus=cn;window.FakeStimulus={Controller:Gt};cn.register("alert",aS);cn.register("popover",uC);cn.register("clipboard",VAe);cn.register("password-visibility",H2);cn.register("textarea-autogrow",cC);var G2=class extends Gt{static targets=["resourceIds","form","selectedAll","indexQuery"];static values={confirmation:Boolean,resourceName:String};connect(){this.resourceIdsTarget.value===""&&(this.resourceIdsTarget.value=this.resourceIds),this.selectedAllTarget.value=this.selectionOptions.itemSelectAllSelectedAllValue,this.selectionOptions.itemSelectAllSelectedAllQueryValue&&(this.indexQueryTarget.value=this.selectionOptions.itemSelectAllSelectedAllQueryValue),this.confirmationValue?this.element.classList.remove("hidden"):this.formTarget.requestSubmit()}get resourceIds(){try{return JSON.parse(this.selectionOptions.selectedResources)}catch{return[]}}get selectionOptions(){try{return document.querySelector(`[data-selected-resources-name="${this.resourceNameValue}"]`).dataset}catch{return[]}}};var Y2=class extends Gt{static targets=["content"];static values={panelList:Boolean};get parentTarget(){return document.querySelector('[data-component-name="avo/view_types/table_component"]')||document.querySelector('[data-component-name="avo/view_types/grid_component"]')||document.querySelector("#main-content")}get visibleParentDimensions(){let r=this.parentTarget;if(!r)return{top:0,left:0,right:window.innerWidth,bottom:window.innerHeight};let e=r.getBoundingClientRect();return{top:e.top,left:e.left,right:e.right,bottom:Math.min(e.bottom,window.innerHeight)}}get isRTL(){return document.documentElement.dir==="rtl"}childDimensions=null;parentDimensions=null;connect(){this.element.style.display="block",this.childDimensions=this.contentTarget.getBoundingClientRect(),this.element.style.display="",this.parentDimensions=this.visibleParentDimensions,this.adjustOverflow()}adjustOverflow(){this.adjustVerticalOverflow(),this.adjustHorizontalOverflow()}adjustVerticalOverflow(){this.contentBottomOverflow&&(this.contentTarget.classList.remove("top-full","mt-2"),this.contentTarget.classList.add("bottom-full","mb-2"))}adjustHorizontalOverflow(){this.isRTL?this.contentRightOverflow&&(this.contentTarget.classList.remove("xl:start-0","sm:start-0"),this.contentTarget.classList.add("xl:end-0","sm:end-0")):this.contentLeftOverflow&&(this.contentTarget.classList.remove("xl:end-0","sm:end-0"),this.contentTarget.classList.add("xl:start-0","sm:start-0"))}get contentBottomOverflow(){return this.panelListValue===!0?!1:this.parentDimensions.bottom<this.childDimensions.bottom}get contentLeftOverflow(){return this.parentDimensions.left>this.childDimensions.left}get contentRightOverflow(){return this.parentDimensions.right<this.childDimensions.right}};var X2=class extends Gt{static targets=["resourceAction","standaloneAction"];static classes=["enabled","disabled"];target={};get targetIsDisabled(){return this.target.dataset.disabled==="true"}get actionsShowTurboFrame(){return document.querySelector(`turbo-frame#${window.Avo.configuration.modal_frame_id}`)}enableTarget(){this.targetIsDisabled&&(this.target.classList.remove(...this.disabledClasses),this.target.classList.add(...this.enabledClasses),this.target.dataset.disabled=!1)}disableTarget(){this.target.classList.remove(...this.enabledClasses),this.target.classList.add(...this.disabledClasses),this.target.dataset.disabled=!0}visitAction(r){if(this.target=r.target,this.targetIsDisabled){r.preventDefault();return}this.disableTarget();let e=this;setTimeout(()=>{this.actionsShowTurboFrame.loaded.then(()=>e.enableTarget(e.target))},1)}};var Z2=class extends Gt{static targets=["form"];connect(){this.formTarget.submit()}};var J2=class extends Gt{static values={threshold:{type:Number,default:400}};connect(){this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll,{passive:!0}),this.onScroll()}disconnect(){window.removeEventListener("scroll",this.onScroll)}get scrollTop(){return window.pageYOffset||document.documentElement.scrollTop}onScroll(){this.scrollTop>=this.thresholdValue?this.show():this.hide()}scrollToTop(r){r.preventDefault(),window.scrollTo({top:0,behavior:"smooth"})}show(){this.element.classList.add("back-to-top--visible")}hide(){this.element.classList.remove("back-to-top--visible")}};var Q2=class extends Gt{static targets=["select","type","container"];connect(){this.changeType()}changeType(){this.#e(),this.#t(this.selectTarget.value)}#e(){this.containerTarget.innerHTML="",this.containerTarget.classList.add("hidden")}#t(r){let e=this.typeTargets.find(t=>t.dataset.type===r);e&&(this.containerTarget.classList.remove("hidden"),this.containerTarget.appendChild(e.content.cloneNode(!0)))}};var p7=Jo(fC()),wf=class extends Gt{static targets=["urlRedirect"];static values={keepFiltersPanelOpen:Boolean};PARAM_KEY="encoded_filters";uriParams(){let r=this.urlRedirectTarget.dataset.turboFrame;return(0,p7.default)(r?this.element.closest(`turbo-frame#${r}`)?.src:window.location.toString()).query(!0)}viaResourceName(){return this.uriParams().via_resource_name}uriParam(r){return this.viaResourceName()?`${this.viaResourceName}_${r}`:r}decode(r){return JSON.parse(new TextDecoder().decode(Uint8Array.from(atob(decodeURIComponent(r)),e=>e.codePointAt(0))))}encode(r){return encodeURIComponent(btoa(String.fromCodePoint(...new TextEncoder().encode(JSON.stringify(r)))))}changeFilter(){let r=this.getFilterValue(),e=this.getFilterClass(),t=this.uriParams()[this.uriParam(this.PARAM_KEY)];t?t=this.decode(t):t={},t[e]=r;let n=Object.keys(t).filter(o=>t[o]!==null).reduce((o,a)=>(o[a]=t[a],o),{}),i;n&&Object.keys(n).length>0&&(i=this.encode(n)),this.navigateToURLWithFilters(i)}navigateToURLWithFilters(r){let e=new p7.default(this.urlRedirectTarget.href),t={...e.query(!0)};this.keepFiltersPanelOpenValue&&(t.keep_filters_panel_open=this.keepFiltersPanelOpenValue?1:null),t.page=1,r?t[this.PARAM_KEY]=r:delete t[this.PARAM_KEY],e.query(t),this.urlRedirectTarget.href=e.readable().toString(),this.urlRedirectTarget.click()}};var nF=class extends wf{static targets=["option"];getFilterValue(){let r={};return this.optionTargets.forEach(e=>{r[e.value]=e.checked}),r}getFilterClass(){let{filterClass:r}=this.optionTarget.dataset;return r}};function iF(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)n!=="__proto__"&&(r[n]=t[n])}return r}var pzt={read:function(r){return r[0]==='"'&&(r=r.slice(1,-1)),r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(r){return encodeURIComponent(r).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function m7(r,e){function t(i,o,a){if(!(typeof document>"u")){a=iF({},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 l="";for(var u in a)a[u]&&(l+="; "+u,a[u]!==!0&&(l+="="+a[u].split(";")[0]));return document.cookie=i+"="+r.write(o,i)+l}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},l=0;l<o.length;l++){var u=o[l].split("="),f=u.slice(1).join("=");try{var p=decodeURIComponent(u[0]);if(p in a||(a[p]=r.read(f,p)),i===p)break}catch{}}return i?a[i]:a}}return Object.create({set:t,get:n,remove:function(i,o){t(i,"",iF({},o,{expires:-1}))},withAttributes:function(i){return m7(this.converter,iF({},this.attributes,i))},withConverter:function(i){return m7(iF({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(r)}})}var Pu=m7(pzt,{path:"/"});var oF=class extends Gt{connect(){let r=Intl.DateTimeFormat().resolvedOptions().timeZone;!r||Pu.get(this.cookieKey)===r||(Pu.set(this.cookieKey,r,{expires:365,sameSite:"Lax"}),Pu.get(this.cookieKey)===r&&(Pu.set(this.changedCookieKey,"1",{sameSite:"Lax"}),window.Turbo.visit(window.location.href,{action:"replace"})))}get cookieKey(){return`${window.Avo.configuration.cookies_key}.browser_timezone`}get changedCookieKey(){return`${window.Avo.configuration.cookies_key}.timezone_changed`}};function aF(r){r.hasAttribute("hidden")?r.removeAttribute("hidden"):r.setAttribute("hidden","")}var g7='input[type="checkbox"]',sF=class extends Gt{static targets=["input","row","empty","hiddenSelections"];static values={hiddenSelectionsOne:String,hiddenSelectionsOther:String};filter(r){if(r&&r.target!==this.inputTarget)return;let e=this.normalize(this.inputTarget.value),t=0,n=0;this.rowTargets.forEach(i=>{let o=e.length===0||this.normalize(i.dataset.checkboxListFieldSearchText).includes(e),a=i.querySelector(g7);this.setHidden(i,!o),a&&(a.disabled=a.defaultDisabled,!o&&a.checked&&(n+=1)),o&&(t+=1)}),this.hasEmptyTarget&&this.setHidden(this.emptyTarget,t>0),this.updateHiddenSelections(n)}handleKeydown(r){r.key!=="ArrowDown"&&r.key!=="ArrowUp"||(r.target===this.inputTarget?this.moveFromInput(r):r.target.matches(g7)&&this.moveBetweenRows(r))}moveFromInput(r){let e=this.visibleRows;e.length!==0&&(r.preventDefault(),this.focusRow(r.key==="ArrowDown"?e[0]:e[e.length-1]))}moveBetweenRows(r){let e=this.visibleRows,t=r.target.closest('[data-checkbox-list-field-target~="row"]'),n=e.indexOf(t);if(n===-1)return;r.preventDefault();let i=r.key==="ArrowDown"?1:-1,o=n+i;o<0&&(o=e.length-1),o>=e.length&&(o=0),this.focusRow(e[o])}get visibleRows(){return this.rowTargets.filter(r=>!r.hasAttribute("hidden"))}focusRow(r){r.querySelector(g7)?.focus(),r.scrollIntoView({block:"nearest"})}setHidden(r,e){r.hasAttribute("hidden")!==e&&aF(r)}updateHiddenSelections(r){if(this.hasHiddenSelectionsTarget){if(r===0){this.setHidden(this.hiddenSelectionsTarget,!0),this.hiddenSelectionsTarget.textContent="";return}this.hiddenSelectionsTarget.textContent=this.hiddenSelectionsLabel(r),this.setHidden(this.hiddenSelectionsTarget,!1)}}hiddenSelectionsLabel(r){return r===1&&this.hasHiddenSelectionsOneValue?this.hiddenSelectionsOneValue:this.hasHiddenSelectionsOtherValue?this.hiddenSelectionsOtherValue.replace("%{count}",r):`${r} selected options hidden by search`}normalize(r){return(r||"").toString().trim().toLowerCase()}};var lF=class extends Gt{static targets=["input","clearButton"];showClearButton(){this.clearButtonTarget.classList.remove("hidden")}clearInput(){this.inputTarget.value="",this.clearButtonTarget.classList.add("hidden")}};var ckr=Jo(uS()),hkr=Jo(mDe()),fkr=Jo(uF()),dkr=Jo(dC()),pkr=Jo(cF()),mkr=Jo(DDe()),gkr=Jo(RDe()),vkr=Jo(NDe()),ykr=Jo(x7()),bkr=Jo(VDe()),xkr=Jo($De()),_kr=Jo(fIe()),wkr=Jo(cS()),Skr=Jo(mIe());var gIe=Jo(qo());var hS=r=>r=="true";var fF=class extends Gt{static targets=["element"];get isDark(){return document.documentElement.classList.contains("dark")}get resolvedTheme(){return this.isDark?"monokai":this.elementTarget.dataset.theme||"default"}connect(){let r={readOnly:hS(this.elementTarget.dataset.readOnly),mode:this.elementTarget.dataset.language,theme:this.resolvedTheme,tabSize:this.elementTarget.dataset.tabSize,indentWithTabs:hS(this.elementTarget.dataset.indentWithTabs),lineWrapping:hS(this.elementTarget.dataset.lineWrapping),lineNumbers:!0,extraKeys:{Esc:t=>t.getInputField().blur()}},e=this;setTimeout(()=>{e.cm=gIe.default.fromTextArea(e.elementTarget,r),e.cm.on("change",t=>{e.elementTarget.innerText=t.getValue(),e.elementTarget.dispatchEvent(new Event("input"))})},1),this.observer=new MutationObserver(()=>{e.cm&&e.cm.setOption("theme",e.resolvedTheme)}),this.observer.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})}disconnect(){this.observer&&this.observer.disconnect(),this.element.querySelector(".CodeMirror").CodeMirror.toTextArea()}};var pC=class{constructor(e){this.response=e}get statusCode(){return this.response.status}get redirected(){return this.response.redirected}get ok(){return this.response.ok}get unauthenticated(){return this.statusCode===401}get unprocessableEntity(){return this.statusCode===422}get authenticationURL(){return this.response.headers.get("WWW-Authenticate")}get contentType(){return(this.response.headers.get("Content-Type")||"").replace(/;.*$/,"")}get headers(){return this.response.headers}get html(){return this.contentType.match(/^(application|text)\/(html|xhtml\+xml)$/)?this.text:Promise.reject(new Error(`Expected an HTML response but got "${this.contentType}" instead`))}get json(){return this.contentType.match(/^application\/.*json$/)?this.responseJson||(this.responseJson=this.response.json()):Promise.reject(new Error(`Expected a JSON response but got "${this.contentType}" instead`))}get text(){return this.responseText||(this.responseText=this.response.text())}get isTurboStream(){return this.contentType.match(/^text\/vnd\.turbo-stream\.html/)}get isScript(){return this.contentType.match(/\b(?:java|ecma)script\b/)}async renderTurboStream(){if(this.isTurboStream)window.Turbo?await window.Turbo.renderStreamMessage(await this.text):console.warn("You must set `window.Turbo = Turbo` to automatically process Turbo Stream events with request.js");else return Promise.reject(new Error(`Expected a Turbo Stream response but got "${this.contentType}" instead`))}async activeScript(){if(this.isScript){let e=document.createElement("script"),t=document.querySelector("meta[name=csp-nonce]"),n=t&&t.content;n&&e.setAttribute("nonce",n),e.innerHTML=await this.text,document.body.appendChild(e)}else return Promise.reject(new Error(`Expected a Script response but got "${this.contentType}" instead`))}};var mC=class{static register(e){this.interceptor=e}static get(){return this.interceptor}static reset(){this.interceptor=void 0}};function vIe(r){let e=document.cookie?document.cookie.split("; "):[],t=`${encodeURIComponent(r)}=`,n=e.find(i=>i.startsWith(t));if(n){let i=n.split("=").slice(1).join("=");if(i)return decodeURIComponent(i)}}function yIe(r){let e={};for(let t in r){let n=r[t];n!==void 0&&(e[t]=n)}return e}function _7(r){let e=document.head.querySelector(`meta[name="${r}"]`);return e&&e.content}function bIe(r){return[...r].reduce((e,[t,n])=>e.concat(typeof n=="string"?[[t,n]]:[]),[])}function xIe(r,e){for(let[t,n]of e)n instanceof window.File||(r.has(t)&&!t.includes("[]")?(r.delete(t),r.set(t,n)):r.append(t,n))}var fS=class{constructor(e,t,n={}){this.method=e,this.options=n,this.originalUrl=t.toString()}async perform(){try{let i=mC.get();i&&await i(this)}catch(i){console.error(i)}let e=this.responseKind==="turbo-stream"&&window.Turbo?window.Turbo.fetch:window.fetch,t=new pC(await e(this.url,this.fetchOptions));return t.unauthenticated&&t.authenticationURL?Promise.reject(window.location.href=t.authenticationURL):(t.isScript&&await t.activeScript(),(t.ok||t.unprocessableEntity)&&t.isTurboStream&&await t.renderTurboStream(),t)}addHeader(e,t){let n=this.additionalHeaders;n[e]=t,this.options.headers=n}sameHostname(){if(!this.originalUrl.startsWith("http:"))return!0;try{return new URL(this.originalUrl).hostname===window.location.hostname}catch{return!0}}get fetchOptions(){return{method:this.method.toUpperCase(),headers:this.headers,body:this.formattedBody,signal:this.signal,credentials:this.credentials,redirect:this.redirect}}get headers(){let e={"X-Requested-With":"XMLHttpRequest","Content-Type":this.contentType,Accept:this.accept};return this.sameHostname()&&(e["X-CSRF-Token"]=this.csrfToken),yIe(Object.assign(e,this.additionalHeaders))}get csrfToken(){return vIe(_7("csrf-param"))||_7("csrf-token")}get contentType(){return this.options.contentType?this.options.contentType:this.body==null||this.body instanceof window.FormData?void 0:this.body instanceof window.File?this.body.type:"application/json"}get accept(){switch(this.responseKind){case"html":return"text/html, application/xhtml+xml";case"turbo-stream":return"text/vnd.turbo-stream.html, text/html, application/xhtml+xml";case"json":return"application/json, application/vnd.api+json";case"script":return"text/javascript, application/javascript";default:return"*/*"}}get body(){return this.options.body}get query(){let e=(this.originalUrl.split("?")[1]||"").split("#")[0],t=new URLSearchParams(e),n=this.options.query;n instanceof window.FormData?n=bIe(n):n instanceof window.URLSearchParams?n=n.entries():n=Object.entries(n||{}),xIe(t,n);let i=t.toString();return i.length>0?`?${i}`:""}get url(){return this.originalUrl.split("?")[0].split("#")[0]+this.query}get responseKind(){return this.options.responseKind||"html"}get signal(){return this.options.signal}get redirect(){return this.options.redirect||"follow"}get credentials(){return this.options.credentials||"same-origin"}get additionalHeaders(){return this.options.headers||{}}get formattedBody(){let e=Object.prototype.toString.call(this.body)==="[object String]";return this.headers["Content-Type"]==="application/json"&&!e?JSON.stringify(this.body):this.body}};async function w7(r,e){return new fS("get",r,e).perform()}async function S7(r,e){return new fS("patch",r,e).perform()}var dF=class extends Gt{static targets=["button","accentOption","themeLabel","themeOption"];static values={themeLabels:Object};connect(){this.appearance=window.Avo?.configuration?.appearance||{},this.lockedNeutral=this.appearance.neutralLocked?this.appearance.neutral:null,this.lockedAccent=this.appearance.accentLocked?this.appearance.accent:null,this.lockedScheme=this.appearance.schemeLocked?this.appearance.scheme:null,this.currentSchemeValue=this.readCurrentScheme(),this.currentThemeValue=this.readCurrentNeutral(),this.currentAccentValue=this.readCurrentAccent(),this.updateThemeLabel(),this.updateActiveThemeOption(),this.updateActiveAccentOption(),this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQueryListener=()=>{this.currentSchemeValue==="auto"&&this.applyScheme()},this.mediaQuery.addEventListener("change",this.mediaQueryListener)}readCurrentScheme(){let r=document.documentElement;return r.classList.contains("scheme-dark")?"dark":r.classList.contains("scheme-light")?"light":"auto"}readCurrentNeutral(){let r=Array.from(document.documentElement.classList).find(e=>e.startsWith("neutral-theme-"));return r?r.replace("neutral-theme-",""):"brand"}readCurrentAccent(){let r=Array.from(document.documentElement.classList).find(e=>e.startsWith("accent-theme-"));return r?r.replace("accent-theme-",""):"brand"}disconnect(){this.mediaQuery&&this.mediaQueryListener&&this.mediaQuery.removeEventListener("change",this.mediaQueryListener)}setScheme(r){if(r.preventDefault(),this.lockedScheme)return;let{scheme:e}=r.currentTarget.dataset;!e||!["auto","light","dark"].includes(e)||(this.currentSchemeValue=e,this.persistPreferences("scheme"),this.applyScheme())}setTheme(r){if(r.preventDefault(),this.lockedNeutral)return;let{theme:e}=r.currentTarget.dataset,t=this.appearance.neutrals||[];!e||!t.includes(e)||(this.currentThemeValue=e,this.persistPreferences("theme"),this.applyTheme(),this.updateThemeLabel(),this.updateActiveThemeOption())}previewTheme(r){let{theme:e}=r.currentTarget.dataset;e&&(this.applyThemeClass(e),this.updateActiveThemeOptionFor(e))}revertTheme(){this.applyTheme(),this.updateActiveThemeOption()}setAccent(r){if(r.preventDefault(),this.lockedAccent)return;let{accent:e}=r.currentTarget.dataset,t=this.appearance.accents||[];!e||!t.includes(e)||(this.currentAccentValue=e,this.persistPreferences("accent"),this.applyAccent())}previewAccent(r){let{accent:e}=r.currentTarget.dataset;e&&(this.applyAccentClass(e),this.updateActiveAccentOptionFor(e))}revertAccent(){this.applyAccent(),this.updateActiveAccentOption()}cycleScheme(){this.lockedScheme||(this.currentSchemeValue=this.nextValue(["auto","light","dark"],this.currentSchemeValue),this.persistPreferences("scheme"),this.applyScheme())}cycleNeutral(){if(this.lockedNeutral)return;let r=this.appearance.neutrals||[];r.length!==0&&(this.currentThemeValue=this.nextValue(r,this.currentThemeValue||"brand"),this.persistPreferences("theme"),this.applyTheme(),this.updateThemeLabel(),this.updateActiveThemeOption())}cycleAccent(){if(this.lockedAccent)return;let r=this.appearance.accents||[];r.length!==0&&(this.currentAccentValue=this.nextValue(r,this.currentAccentValue||"brand"),this.persistPreferences("accent"),this.applyAccent(),this.updateActiveAccentOption())}nextValue(r,e){let t=r.indexOf(e);return r[(t+1)%r.length]}persistPreferences(r){if(this.appearance.persistence==="database"){this.patchAppearanceSettings(r);return}this.writePreferenceCookie(r)}writePreferenceCookie(r){switch(r){case"scheme":this.setPreferenceCookie("color_scheme",this.currentSchemeValue,this.appearanceDefaultScheme());break;case"theme":this.setPreferenceCookie("theme",this.currentThemeValue,this.appearanceDefaultNeutral());break;case"accent":this.setPreferenceCookie("accent_color",this.currentAccentValue,this.appearanceDefaultAccent());break;default:break}}appearanceDefaultScheme(){let r=this.appearance.scheme;return r!=null&&r!==""?String(r):"auto"}appearanceDefaultNeutral(){let r=this.appearance.neutral;return r!=null&&r!==""?String(r):"brand"}appearanceDefaultAccent(){let r=this.appearance.accent;return r!=null&&r!==""?String(r):"brand"}setPreferenceCookie(r,e,t){e===t?Pu.remove(r):Pu.set(r,e)}patchAppearanceSettings(r){let e=this.appearanceSettingsPayload(r);e&&S7(`${window.Avo.configuration.root_path}/appearance_settings`,{responseKind:"json",contentType:"application/json",body:e})}appearanceSettingsPayload(r){switch(r){case"scheme":return{color_scheme:this.currentSchemeValue};case"theme":return{neutral:this.currentThemeValue};case"accent":return{accent:this.currentAccentValue};default:return null}}applyScheme(){let r=this.currentSchemeValue||"auto";document.documentElement.classList.remove("scheme-light","scheme-dark","scheme-auto"),r==="light"?(document.documentElement.classList.add("scheme-light"),document.documentElement.classList.remove("dark")):r==="dark"?(document.documentElement.classList.add("scheme-dark"),document.documentElement.classList.add("dark")):r==="auto"&&(document.documentElement.classList.add("scheme-auto"),window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"))}applyTheme(){this.applyThemeClass(this.currentThemeValue||"brand")}applyThemeClass(r){let e=document.documentElement;Array.from(e.classList).forEach(t=>{t.startsWith("neutral-theme-")&&e.classList.remove(t)}),r!=="brand"&&e.classList.add(`neutral-theme-${r}`)}updateActiveThemeOption(){this.updateActiveThemeOptionFor(this.currentThemeValue||"brand")}updateActiveThemeOptionFor(r){this.hasThemeOptionTarget&&this.themeOptionTargets.forEach(e=>{let{theme:t}=e.dataset;t&&e.classList.toggle("color-scheme-switcher__theme-option--active",t===r)})}applyAccent(){this.applyAccentClass(this.currentAccentValue||"brand")}applyAccentClass(r){let e=document.documentElement;Array.from(e.classList).forEach(t=>{t.startsWith("accent-theme-")&&e.classList.remove(t)}),r!=="brand"&&e.classList.add(`accent-theme-${r}`)}updateActiveAccentOption(){this.updateActiveAccentOptionFor(this.currentAccentValue||"brand")}updateActiveAccentOptionFor(r){this.hasAccentOptionTarget&&this.accentOptionTargets.forEach(e=>{let{accent:t}=e.dataset;t&&e.classList.toggle("color-scheme-switcher__accent-option--active",t===r)})}updateThemeLabel(){this.updateThemeLabelText(this.currentThemeValue||"brand")}updateThemeLabelText(r){if(!this.hasThemeLabelTarget)return;let t=(this.hasThemeLabelsValue?this.themeLabelsValue:{})[r]||r.charAt(0).toUpperCase()+r.slice(1);this.themeLabelTarget.textContent=t}setKeyBadges(r){r.preventDefault();let{keyBadges:e}=r.currentTarget.dataset;if(e!=="show"&&e!=="hide")return;let t=e==="hide";document.documentElement.classList.toggle("hotkeys-hide-badges",t);try{t?localStorage.setItem("avo:hotkeys:hide_badges","1"):localStorage.removeItem("avo:hotkeys:hide_badges")}catch{}}};var pF=class extends Gt{static targets=["indicator"];switchTab(r){r.preventDefault();let e=r.currentTarget,t=e.closest(".tabs");t.parentElement.querySelectorAll(".tab-content").forEach(i=>i.classList.remove("active")),t.querySelectorAll(".tab-button").forEach(i=>i.classList.remove("active")),document.getElementById(e.dataset.tab)?.classList.add("active"),e.classList.add("active")}copy(r){let{copyText:e}=r.currentTarget.dataset;e&&navigator.clipboard.writeText(e).then(()=>{this.hasIndicatorTarget&&(this.indicatorTarget.classList.add("show"),setTimeout(()=>this.indicatorTarget.classList.remove("show"),2e3))})}};var mF=class extends Gt{static targets=["option"];navigate(r){if(!["ArrowDown","ArrowUp"].includes(r.key))return;r.preventDefault();let e=this.optionTargets,t=e.indexOf(document.activeElement),n=r.key==="ArrowDown"?(t+1)%e.length:(t-1+e.length)%e.length;e[n]?.focus()}};var gF=class extends Gt{copy(r){r.preventDefault();let e=this.context.element.dataset.text,t=document.createElement("textarea"),n=t.contentEditable,i=t.readOnly;t.value=e,t.contentEditable=!0,t.readOnly=!1,t.setAttribute("readonly",!1),t.setAttribute("contenteditable",!0),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t);let o=document.getSelection().rangeCount>0?document.getSelection().getRangeAt(0):!1;t.select(),t.setSelectionRange(0,999999),document.execCommand("copy"),document.body.removeChild(t),o&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(o)),t.contentEditable=n,t.readOnly=i;let a=this.element,l=a.innerHTML;a.innerHTML="Copied \u{1F44C}",a.classList.add("transition","opacity-80","bg-success/15","text-success-content"),setTimeout(()=>{a.innerHTML=l,a.classList.remove("opacity-80","bg-success/15","text-success-content")},1500)}};var vF=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Lb={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(r){return typeof console<"u"&&console.warn(r)},getWeek:function(r){var e=new Date(r.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};var yF={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(r){var e=r%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},bF=yF;var Uc=function(r,e){return e===void 0&&(e=2),("000"+r).slice(e*-1)},Sf=function(r){return r===!0?1:0};function T7(r,e){var t;return function(){var n=this,i=arguments;clearTimeout(t),t=setTimeout(function(){return r.apply(n,i)},e)}}var xF=function(r){return r instanceof Array?r:[r]};function jc(r,e,t){if(t===!0)return r.classList.add(e);r.classList.remove(e)}function ta(r,e,t){var n=window.document.createElement(r);return e=e||"",t=t||"",n.className=e,t!==void 0&&(n.textContent=t),n}function gC(r){for(;r.firstChild;)r.removeChild(r.firstChild)}function E7(r,e){if(e(r))return r;if(r.parentNode)return E7(r.parentNode,e)}function vC(r,e){var t=ta("div","numInputWrapper"),n=ta("input","numInput "+r),i=ta("span","arrowUp"),o=ta("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?n.type="number":(n.type="text",n.pattern="\\d*"),e!==void 0)for(var a in e)n.setAttribute(a,e[a]);return t.appendChild(n),t.appendChild(i),t.appendChild(o),t}function Tf(r){try{if(typeof r.composedPath=="function"){var e=r.composedPath();return e[0]}return r.target}catch{return r.target}}var k7=function(){},yC=function(r,e,t){return t.months[e?"shorthand":"longhand"][r]},_Ie={D:k7,F:function(r,e,t){r.setMonth(t.months.longhand.indexOf(e))},G:function(r,e){r.setHours((r.getHours()>=12?12:0)+parseFloat(e))},H:function(r,e){r.setHours(parseFloat(e))},J:function(r,e){r.setDate(parseFloat(e))},K:function(r,e,t){r.setHours(r.getHours()%12+12*Sf(new RegExp(t.amPM[1],"i").test(e)))},M:function(r,e,t){r.setMonth(t.months.shorthand.indexOf(e))},S:function(r,e){r.setSeconds(parseFloat(e))},U:function(r,e){return new Date(parseFloat(e)*1e3)},W:function(r,e,t){var n=parseInt(e),i=new Date(r.getFullYear(),0,2+(n-1)*7,0,0,0,0);return i.setDate(i.getDate()-i.getDay()+t.firstDayOfWeek),i},Y:function(r,e){r.setFullYear(parseFloat(e))},Z:function(r,e){return new Date(e)},d:function(r,e){r.setDate(parseFloat(e))},h:function(r,e){r.setHours((r.getHours()>=12?12:0)+parseFloat(e))},i:function(r,e){r.setMinutes(parseFloat(e))},j:function(r,e){r.setDate(parseFloat(e))},l:k7,m:function(r,e){r.setMonth(parseFloat(e)-1)},n:function(r,e){r.setMonth(parseFloat(e)-1)},s:function(r,e){r.setSeconds(parseFloat(e))},u:function(r,e){return new Date(parseFloat(e))},w:k7,y:function(r,e){r.setFullYear(2e3+parseFloat(e))}},Rv={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},dS={Z:function(r){return r.toISOString()},D:function(r,e,t){return e.weekdays.shorthand[dS.w(r,e,t)]},F:function(r,e,t){return yC(dS.n(r,e,t)-1,!1,e)},G:function(r,e,t){return Uc(dS.h(r,e,t))},H:function(r){return Uc(r.getHours())},J:function(r,e){return e.ordinal!==void 0?r.getDate()+e.ordinal(r.getDate()):r.getDate()},K:function(r,e){return e.amPM[Sf(r.getHours()>11)]},M:function(r,e){return yC(r.getMonth(),!0,e)},S:function(r){return Uc(r.getSeconds())},U:function(r){return r.getTime()/1e3},W:function(r,e,t){return t.getWeek(r)},Y:function(r){return Uc(r.getFullYear(),4)},d:function(r){return Uc(r.getDate())},h:function(r){return r.getHours()%12?r.getHours()%12:12},i:function(r){return Uc(r.getMinutes())},j:function(r){return r.getDate()},l:function(r,e){return e.weekdays.longhand[r.getDay()]},m:function(r){return Uc(r.getMonth()+1)},n:function(r){return r.getMonth()+1},s:function(r){return r.getSeconds()},u:function(r){return r.getTime()},w:function(r){return r.getDay()},y:function(r){return String(r.getFullYear()).substring(2)}};var A7=function(r){var e=r.config,t=e===void 0?Lb:e,n=r.l10n,i=n===void 0?yF:n,o=r.isMobile,a=o===void 0?!1:o;return function(l,u,f){var p=f||i;return t.formatDate!==void 0&&!a?t.formatDate(l,u,p):u.split("").map(function(b,S,C){return dS[b]&&C[S-1]!=="\\"?dS[b](l,p,t):b!=="\\"?b:""}).join("")}},_F=function(r){var e=r.config,t=e===void 0?Lb:e,n=r.l10n,i=n===void 0?yF:n;return function(o,a,l,u){if(!(o!==0&&!o)){var f=u||i,p,b=o;if(o instanceof Date)p=new Date(o.getTime());else if(typeof o!="string"&&o.toFixed!==void 0)p=new Date(o);else if(typeof o=="string"){var S=a||(t||Lb).dateFormat,C=String(o).trim();if(C==="today")p=new Date,l=!0;else if(t&&t.parseDate)p=t.parseDate(o,S);else if(/Z$/.test(C)||/GMT$/.test(C))p=new Date(o);else{for(var M=void 0,L=[],P=0,H=0,$="";P<S.length;P++){var Q=S[P],K=Q==="\\",te=S[P-1]==="\\"||K;if(Rv[Q]&&!te){$+=Rv[Q];var pe=new RegExp($).exec(o);pe&&(M=!0)&&L[Q!=="Y"?"push":"unshift"]({fn:_Ie[Q],val:pe[++H]})}else K||($+=".")}p=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),L.forEach(function(re){var ge=re.fn,_e=re.val;return p=ge(p,_e,f)||p}),p=M?p:void 0}}if(!(p instanceof Date&&!isNaN(p.getTime()))){t.errorHandler(new Error("Invalid date provided: "+b));return}return l===!0&&p.setHours(0,0,0,0),p}}};function Ef(r,e,t){return t===void 0&&(t=!0),t!==!1?new Date(r.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):r.getTime()-e.getTime()}var wIe=function(r,e,t){return r>Math.min(e,t)&&r<Math.max(e,t)},wF=function(r,e,t){return r*3600+e*60+t},SIe=function(r){var e=Math.floor(r/3600),t=(r-e*3600)/60;return[e,t,r-e*3600-t*60]},TIe={DAY:864e5};function SF(r){var e=r.defaultHour,t=r.defaultMinute,n=r.defaultSeconds;if(r.minDate!==void 0){var i=r.minDate.getHours(),o=r.minDate.getMinutes(),a=r.minDate.getSeconds();e<i&&(e=i),e===i&&t<o&&(t=o),e===i&&t===o&&n<a&&(n=r.minDate.getSeconds())}if(r.maxDate!==void 0){var l=r.maxDate.getHours(),u=r.maxDate.getMinutes();e=Math.min(e,l),e===l&&(t=Math.min(u,t)),e===l&&t===u&&(n=r.maxDate.getSeconds())}return{hours:e,minutes:t,seconds:n}}typeof Object.assign!="function"&&(Object.assign=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!r)throw TypeError("Cannot convert undefined or null to object");for(var n=function(l){l&&Object.keys(l).forEach(function(u){return r[u]=l[u]})},i=0,o=e;i<o.length;i++){var a=o[i];n(a)}return r});var Vc=function(){return Vc=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Vc.apply(this,arguments)},EIe=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var o=arguments[e],a=0,l=o.length;a<l;a++,i++)n[i]=o[a];return n},mzt=300;function gzt(r,e){var t={config:Vc(Vc({},Lb),Hl.defaultConfig),l10n:bF};t.parseDate=_F({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=L,t._setHoursFromDate=S,t._positionCalendar=ur,t.changeMonth=le,t.changeYear=Ot,t.clear=Ue,t.close=yt,t.onMouseOver=Ft,t._createElement=ta,t.createDay=pe,t.destroy=it,t.isEnabled=Wt,t.jumpToDate=$,t.updateValue=jn,t.open=dt,t.redraw=Et,t.set=_r,t.setDate=rt,t.toggle=$t;function n(){t.utils={getDaysInMonth:function(G,X){return G===void 0&&(G=t.currentMonth),X===void 0&&(X=t.currentYear),G===1&&(X%4===0&&X%100!==0||X%400===0)?29:t.l10n.daysInMonth[G]}}}function i(){t.element=t.input=r,t.isOpen=!1,fe(),ze(),si(),Zr(),n(),t.isMobile||te(),H(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&S(t.config.noCalendar?t.latestSelectedDateObj:void 0),jn(!1)),l();var G=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&G&&ur(),Nt("onReady")}function o(){var G;return((G=t.calendarContainer)===null||G===void 0?void 0:G.getRootNode()).activeElement||document.activeElement}function a(G){return G.bind(t)}function l(){var G=t.config;G.weekNumbers===!1&&G.showMonths===1||G.noCalendar!==!0&&window.requestAnimationFrame(function(){if(t.calendarContainer!==void 0&&(t.calendarContainer.style.visibility="hidden",t.calendarContainer.style.display="block"),t.daysContainer!==void 0){var X=(t.days.offsetWidth+1)*G.showMonths;t.daysContainer.style.width=X+"px",t.calendarContainer.style.width=X+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function u(G){if(t.selectedDates.length===0){var X=t.config.minDate===void 0||Ef(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),oe=SF(t.config);X.setHours(oe.hours,oe.minutes,oe.seconds,X.getMilliseconds()),t.selectedDates=[X],t.latestSelectedDateObj=X}G!==void 0&&G.type!=="blur"&&Qn(G);var be=t._input.value;b(),jn(),t._input.value!==be&&t._debouncedChange()}function f(G,X){return G%12+12*Sf(X===t.l10n.amPM[1])}function p(G){switch(G%24){case 0:case 12:return 12;default:return G%12}}function b(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var G=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,X=(parseInt(t.minuteElement.value,10)||0)%60,oe=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(G=f(G,t.amPM.textContent));var be=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Ef(t.latestSelectedDateObj,t.config.minDate,!0)===0,Oe=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Ef(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Ve=wF(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Qe=wF(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Ee=wF(G,X,oe);if(Ee>Qe&&Ee<Ve){var je=SIe(Ve);G=je[0],X=je[1],oe=je[2]}}else{if(Oe){var ot=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;G=Math.min(G,ot.getHours()),G===ot.getHours()&&(X=Math.min(X,ot.getMinutes())),X===ot.getMinutes()&&(oe=Math.min(oe,ot.getSeconds()))}if(be){var Dt=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;G=Math.max(G,Dt.getHours()),G===Dt.getHours()&&X<Dt.getMinutes()&&(X=Dt.getMinutes()),X===Dt.getMinutes()&&(oe=Math.max(oe,Dt.getSeconds()))}}C(G,X,oe)}}function S(G){var X=G||t.latestSelectedDateObj;X&&X instanceof Date&&C(X.getHours(),X.getMinutes(),X.getSeconds())}function C(G,X,oe){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(G%24,X,oe||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=Uc(t.config.time_24hr?G:(12+G)%12+12*Sf(G%12===0)),t.minuteElement.value=Uc(X),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Sf(G>=12)]),t.secondElement!==void 0&&(t.secondElement.value=Uc(oe)))}function M(G){var X=Tf(G),oe=parseInt(X.value)+(G.delta||0);(oe/1e3>1||G.key==="Enter"&&!/[^\d]/.test(oe.toString()))&&Ot(oe)}function L(G,X,oe,be){if(X instanceof Array)return X.forEach(function(Oe){return L(G,Oe,oe,be)});if(G instanceof Array)return G.forEach(function(Oe){return L(Oe,X,oe,be)});G.addEventListener(X,oe,be),t._handlers.push({remove:function(){return G.removeEventListener(X,oe,be)}})}function P(){Nt("onChange")}function H(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(oe){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+oe+"]"),function(be){return L(be,"click",t[oe])})}),t.isMobile){Pi();return}var G=T7(St,50);if(t._debouncedChange=T7(P,mzt),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&L(t.daysContainer,"mouseover",function(oe){t.config.mode==="range"&&Ft(Tf(oe))}),L(t._input,"keydown",tr),t.calendarContainer!==void 0&&L(t.calendarContainer,"keydown",tr),!t.config.inline&&!t.config.static&&L(window,"resize",G),window.ontouchstart!==void 0?L(window.document,"touchstart",ct):L(window.document,"mousedown",ct),L(window.document,"focus",ct,{capture:!0}),t.config.clickOpens===!0&&(L(t._input,"focus",t.open),L(t._input,"click",t.open)),t.daysContainer!==void 0&&(L(t.monthNav,"click",mo),L(t.monthNav,["keyup","increment"],M),L(t.daysContainer,"click",lr)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var X=function(oe){return Tf(oe).select()};L(t.timeContainer,["increment"],u),L(t.timeContainer,"blur",u,{capture:!0}),L(t.timeContainer,"click",Q),L([t.hourElement,t.minuteElement],["focus","click"],X),t.secondElement!==void 0&&L(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&L(t.amPM,"click",function(oe){u(oe)})}t.config.allowInput&&L(t._input,"blur",pr)}function $(G,X){var oe=G!==void 0?t.parseDate(G):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate<t.now?t.config.maxDate:t.now),be=t.currentYear,Oe=t.currentMonth;try{oe!==void 0&&(t.currentYear=oe.getFullYear(),t.currentMonth=oe.getMonth())}catch(Ve){Ve.message="Invalid date supplied: "+oe,t.config.errorHandler(Ve)}X&&t.currentYear!==be&&(Nt("onYearChange"),z()),X&&(t.currentYear!==be||t.currentMonth!==Oe)&&Nt("onMonthChange"),t.redraw()}function Q(G){var X=Tf(G);~X.className.indexOf("arrow")&&K(G,X.classList.contains("arrowUp")?1:-1)}function K(G,X,oe){var be=G&&Tf(G),Oe=oe||be&&be.parentNode&&be.parentNode.firstChild,Ve=Rr("increment");Ve.delta=X,Oe&&Oe.dispatchEvent(Ve)}function te(){var G=window.document.createDocumentFragment();if(t.calendarContainer=ta("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(G.appendChild(he()),t.innerContainer=ta("div","flatpickr-innerContainer"),t.config.weekNumbers){var X=ve(),oe=X.weekWrapper,be=X.weekNumbers;t.innerContainer.appendChild(oe),t.weekNumbers=be,t.weekWrapper=oe}t.rContainer=ta("div","flatpickr-rContainer"),t.rContainer.appendChild(ue()),t.daysContainer||(t.daysContainer=ta("div","flatpickr-days"),t.daysContainer.tabIndex=-1),V(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),G.appendChild(t.innerContainer)}t.config.enableTime&&G.appendChild(ie()),jc(t.calendarContainer,"rangeMode",t.config.mode==="range"),jc(t.calendarContainer,"animate",t.config.animate===!0),jc(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(G);var Oe=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Oe&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Ve=ta("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ve,t.element),Ve.appendChild(t.element),t.altInput&&Ve.appendChild(t.altInput),Ve.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function pe(G,X,oe,be){var Oe=Wt(X,!0),Ve=ta("span",G,X.getDate().toString());return Ve.dateObj=X,Ve.$i=be,Ve.setAttribute("aria-label",t.formatDate(X,t.config.ariaDateFormat)),G.indexOf("hidden")===-1&&Ef(X,t.now)===0&&(t.todayDateElem=Ve,Ve.classList.add("today"),Ve.setAttribute("aria-current","date")),Oe?(Ve.tabIndex=-1,br(X)&&(Ve.classList.add("selected"),t.selectedDateElem=Ve,t.config.mode==="range"&&(jc(Ve,"startRange",t.selectedDates[0]&&Ef(X,t.selectedDates[0],!0)===0),jc(Ve,"endRange",t.selectedDates[1]&&Ef(X,t.selectedDates[1],!0)===0),G==="nextMonthDay"&&Ve.classList.add("inRange")))):Ve.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Cn(X)&&!br(X)&&Ve.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&G!=="prevMonthDay"&&be%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(X)+"</span>"),Nt("onDayCreate",Ve),Ve}function re(G){G.focus(),t.config.mode==="range"&&Ft(G)}function ge(G){for(var X=G>0?0:t.config.showMonths-1,oe=G>0?t.config.showMonths:-1,be=X;be!=oe;be+=G)for(var Oe=t.daysContainer.children[be],Ve=G>0?0:Oe.children.length-1,Qe=G>0?Oe.children.length:-1,Ee=Ve;Ee!=Qe;Ee+=G){var je=Oe.children[Ee];if(je.className.indexOf("hidden")===-1&&Wt(je.dateObj))return je}}function _e(G,X){for(var oe=G.className.indexOf("Month")===-1?G.dateObj.getMonth():t.currentMonth,be=X>0?t.config.showMonths:-1,Oe=X>0?1:-1,Ve=oe-t.currentMonth;Ve!=be;Ve+=Oe)for(var Qe=t.daysContainer.children[Ve],Ee=oe-t.currentMonth===Ve?G.$i+X:X<0?Qe.children.length-1:0,je=Qe.children.length,ot=Ee;ot>=0&&ot<je&&ot!=(X>0?je:-1);ot+=Oe){var Dt=Qe.children[ot];if(Dt.className.indexOf("hidden")===-1&&Wt(Dt.dateObj)&&Math.abs(G.$i-ot)>=Math.abs(X))return re(Dt)}t.changeMonth(Oe),Fe(ge(Oe),0)}function Fe(G,X){var oe=o(),be=qt(oe||document.body),Oe=G!==void 0?G:be?oe:t.selectedDateElem!==void 0&&qt(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&qt(t.todayDateElem)?t.todayDateElem:ge(X>0?1:-1);Oe===void 0?t._input.focus():be?_e(Oe,X):re(Oe)}function ke(G,X){for(var oe=(new Date(G,X,1).getDay()-t.l10n.firstDayOfWeek+7)%7,be=t.utils.getDaysInMonth((X-1+12)%12,G),Oe=t.utils.getDaysInMonth(X,G),Ve=window.document.createDocumentFragment(),Qe=t.config.showMonths>1,Ee=Qe?"prevMonthDay hidden":"prevMonthDay",je=Qe?"nextMonthDay hidden":"nextMonthDay",ot=be+1-oe,Dt=0;ot<=be;ot++,Dt++)Ve.appendChild(pe("flatpickr-day "+Ee,new Date(G,X-1,ot),ot,Dt));for(ot=1;ot<=Oe;ot++,Dt++)Ve.appendChild(pe("flatpickr-day",new Date(G,X,ot),ot,Dt));for(var Vt=Oe+1;Vt<=42-oe&&(t.config.showMonths===1||Dt%7!==0);Vt++,Dt++)Ve.appendChild(pe("flatpickr-day "+je,new Date(G,X+1,Vt%Oe),Vt,Dt));var Ct=ta("div","dayContainer");return Ct.appendChild(Ve),Ct}function V(){if(t.daysContainer!==void 0){gC(t.daysContainer),t.weekNumbers&&gC(t.weekNumbers);for(var G=document.createDocumentFragment(),X=0;X<t.config.showMonths;X++){var oe=new Date(t.currentYear,t.currentMonth,1);oe.setMonth(t.currentMonth+X),G.appendChild(ke(oe.getFullYear(),oe.getMonth()))}t.daysContainer.appendChild(G),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&Ft()}}function z(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var G=function(be){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&be<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&be>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var X=0;X<12;X++)if(G(X)){var oe=ta("option","flatpickr-monthDropdown-month");oe.value=new Date(t.currentYear,X).getMonth().toString(),oe.textContent=yC(X,t.config.shorthandCurrentMonth,t.l10n),oe.tabIndex=-1,t.currentMonth===X&&(oe.selected=!0),t.monthsDropdownContainer.appendChild(oe)}}}function xe(){var G=ta("div","flatpickr-month"),X=window.document.createDocumentFragment(),oe;t.config.showMonths>1||t.config.monthSelectorType==="static"?oe=ta("span","cur-month"):(t.monthsDropdownContainer=ta("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),L(t.monthsDropdownContainer,"change",function(Qe){var Ee=Tf(Qe),je=parseInt(Ee.value,10);t.changeMonth(je-t.currentMonth),Nt("onMonthChange")}),z(),oe=t.monthsDropdownContainer);var be=vC("cur-year",{tabindex:"-1"}),Oe=be.getElementsByTagName("input")[0];Oe.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Oe.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Oe.setAttribute("max",t.config.maxDate.getFullYear().toString()),Oe.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ve=ta("div","flatpickr-current-month");return Ve.appendChild(oe),Ve.appendChild(be),X.appendChild(Ve),G.appendChild(X),{container:G,yearElement:Oe,monthElement:oe}}function Ie(){gC(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var G=t.config.showMonths;G--;){var X=xe();t.yearElements.push(X.yearElement),t.monthElements.push(X.monthElement),t.monthNav.appendChild(X.container)}t.monthNav.appendChild(t.nextMonthNav)}function he(){return t.monthNav=ta("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ta("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ta("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,Ie(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(G){t.__hidePrevMonthArrow!==G&&(jc(t.prevMonthNav,"flatpickr-disabled",G),t.__hidePrevMonthArrow=G)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(G){t.__hideNextMonthArrow!==G&&(jc(t.nextMonthNav,"flatpickr-disabled",G),t.__hideNextMonthArrow=G)}}),t.currentYearElement=t.yearElements[0],Fn(),t.monthNav}function ie(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var G=SF(t.config);t.timeContainer=ta("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var X=ta("span","flatpickr-time-separator",":"),oe=vC("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=oe.getElementsByTagName("input")[0];var be=vC("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=be.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Uc(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?G.hours:p(G.hours)),t.minuteElement.value=Uc(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():G.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(oe),t.timeContainer.appendChild(X),t.timeContainer.appendChild(be),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Oe=vC("flatpickr-second");t.secondElement=Oe.getElementsByTagName("input")[0],t.secondElement.value=Uc(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():G.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ta("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Oe)}return t.config.time_24hr||(t.amPM=ta("span","flatpickr-am-pm",t.l10n.amPM[Sf((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function ue(){t.weekdayContainer?gC(t.weekdayContainer):t.weekdayContainer=ta("div","flatpickr-weekdays");for(var G=t.config.showMonths;G--;){var X=ta("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(X)}return Me(),t.weekdayContainer}function Me(){if(t.weekdayContainer){var G=t.l10n.firstDayOfWeek,X=EIe(t.l10n.weekdays.shorthand);G>0&&G<X.length&&(X=EIe(X.splice(G,X.length),X.splice(0,G)));for(var oe=t.config.showMonths;oe--;)t.weekdayContainer.children[oe].innerHTML=`
656
+ %o`,t,e,n),(i=window.onerror)===null||i===void 0||i.call(window,t,"",0,0,e)}logFormattedMessage(e,t,n={}){n=Object.assign({application:this},n),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},n)),this.logger.groupEnd()}};function CBt(){return new Promise(r=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>r()):r()})}function DBt(r){return sC(r,"classes").reduce((t,n)=>Object.assign(t,IBt(n)),{})}function IBt(r){return{[`${r}Class`]:{get(){let{classes:e}=this;if(e.has(r))return e.get(r);{let t=e.getAttributeName(r);throw new Error(`Missing attribute "${t}"`)}}},[`${r}Classes`]:{get(){return this.classes.getAll(r)}},[`has${aC(r)}Class`]:{get(){return this.classes.has(r)}}}}function OBt(r){return sC(r,"outlets").reduce((t,n)=>Object.assign(t,MBt(n)),{})}function PAe(r,e,t){return r.application.getControllerForElementAndIdentifier(e,t)}function RAe(r,e,t){let n=PAe(r,e,t);if(n||(r.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),n=PAe(r,e,t),n))return n}function MBt(r){let e=R9(r);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(r),n=this.outlets.getSelectorForOutletName(r);if(t){let i=RAe(this,t,r);if(i)return i;throw new Error(`The provided outlet element is missing an outlet controller "${r}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${r}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${e}Outlets`]:{get(){let t=this.outlets.findAll(r);return t.length>0?t.map(n=>{let i=RAe(this,n,r);if(i)return i;console.warn(`The provided outlet element is missing an outlet controller "${r}" instance for host controller "${this.identifier}"`,n)}).filter(n=>n):[]}},[`${e}OutletElement`]:{get(){let t=this.outlets.find(r),n=this.outlets.getSelectorForOutletName(r);if(t)return t;throw new Error(`Missing outlet element "${r}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(r)}},[`has${aC(e)}Outlet`]:{get(){return this.outlets.has(r)}}}}function LBt(r){return sC(r,"targets").reduce((t,n)=>Object.assign(t,PBt(n)),{})}function PBt(r){return{[`${r}Target`]:{get(){let e=this.targets.find(r);if(e)return e;throw new Error(`Missing target element "${r}" for "${this.identifier}" controller`)}},[`${r}Targets`]:{get(){return this.targets.findAll(r)}},[`has${aC(r)}Target`]:{get(){return this.targets.has(r)}}}}function RBt(r){let e=gBt(r,"values"),t={valueDescriptorMap:{get(){return e.reduce((n,i)=>{let o=jAe(i,this.identifier),a=this.data.getAttributeNameForKey(o.key);return Object.assign(n,{[a]:o})},{})}}};return e.reduce((n,i)=>Object.assign(n,FBt(i)),t)}function FBt(r,e){let t=jAe(r,e),{key:n,name:i,reader:o,writer:a}=t;return{[i]:{get(){let l=this.data.get(n);return l!==null?o(l):t.defaultValue},set(l){l===void 0?this.data.delete(n):this.data.set(n,a(l))}},[`has${aC(i)}`]:{get(){return this.data.has(n)||t.hasCustomDefaultValue}}}}function jAe([r,e],t){return zBt({controller:t,token:r,typeDefinition:e})}function U2(r){switch(r){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function oC(r){switch(typeof r){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(r))return"array";if(Object.prototype.toString.call(r)==="[object Object]")return"object"}function qBt(r){let{controller:e,token:t,typeObject:n}=r,i=IAe(n.type),o=IAe(n.default),a=i&&o,l=i&&!o,u=!i&&o,f=U2(n.type),p=oC(r.typeObject.default);if(l)return f;if(u)return p;if(f!==p){let b=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${b}" must match the defined type "${f}". The provided default value of "${n.default}" is of type "${p}".`)}if(a)return f}function NBt(r){let{controller:e,token:t,typeDefinition:n}=r,o=qBt({controller:e,token:t,typeObject:n}),a=oC(n),l=U2(n),u=o||a||l;if(u)return u;let f=e?`${e}.${n}`:t;throw new Error(`Unknown value type "${f}" for "${t}" value`)}function BBt(r){let e=U2(r);if(e)return FAe[e];let t=F9(r,"default"),n=F9(r,"type"),i=r;if(t)return i.default;if(n){let{type:o}=i,a=U2(o);if(a)return FAe[a]}return r}function zBt(r){let{token:e,typeDefinition:t}=r,n=`${BAe(e)}-value`,i=NBt(r);return{type:i,key:n,name:r7(n),get defaultValue(){return BBt(t)},get hasCustomDefaultValue(){return oC(t)!==void 0},reader:UBt[i],writer:qAe[i]||qAe.default}}var FAe={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},UBt={array(r){let e=JSON.parse(r);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${r}" of type "${oC(e)}"`);return e},boolean(r){return!(r=="0"||String(r).toLowerCase()=="false")},number(r){return Number(r.replace(/_/g,""))},object(r){let e=JSON.parse(r);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${r}" of type "${oC(e)}"`);return e},string(r){return r}},qAe={default:jBt,array:NAe,object:NAe};function NAe(r){return JSON.stringify(r)}function jBt(r){return`${r}`}var Gt=class{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:n={},prefix:i=this.identifier,bubbles:o=!0,cancelable:a=!0}={}){let l=i?`${i}:${e}`:e,u=new CustomEvent(l,{detail:n,bubbles:o,cancelable:a});return t.dispatchEvent(u),u}};Gt.blessings=[DBt,LBt,RBt,OBt];Gt.targets=[];Gt.outlets=[];Gt.values={};var aS=class extends Gt{initialize(){this.hide()}connect(){setTimeout(()=>{this.show()},this.showDelayValue),this.hasDismissAfterValue&&setTimeout(()=>{this.close()},this.dismissAfterValue)}close(){this.hide(),setTimeout(()=>{this.element.remove()},this.removeDelayValue)}show(){this.element.classList.add(...this.showClasses),this.element.classList.remove(...this.hideClasses)}hide(){this.element.classList.add(...this.hideClasses),this.element.classList.remove(...this.showClasses)}};aS.values={dismissAfter:Number,showDelay:{type:Number,default:200},removeDelay:{type:Number,default:1100}},aS.classes=["show","hide"];var n7=class extends Gt{connect(){this.timeout=null,this.duration=this.data.get("duration")||1e3}save(){clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.statusTarget.textContent="Saving...",Rails.fire(this.formTarget,"submit")},this.duration)}success(){this.setStatus("Saved!")}error(){this.setStatus("Unable to save!")}setStatus(e){this.statusTarget.textContent=e,this.timeout=setTimeout(()=>{this.statusTarget.textContent=""},2e3)}};n7.targets=["form","status"];var lC=class extends Gt{constructor(...e){super(...e),this._onMenuButtonKeydown=t=>{switch(t.keyCode){case 13:case 32:t.preventDefault(),this.toggle()}}}connect(){this.toggleClass=this.data.get("class")||"hidden",this.visibleClass=this.data.get("visibleClass")||null,this.invisibleClass=this.data.get("invisibleClass")||null,this.activeClass=this.data.get("activeClass")||null,this.enteringClass=this.data.get("enteringClass")||null,this.leavingClass=this.data.get("leavingClass")||null,this.hasButtonTarget&&this.buttonTarget.addEventListener("keydown",this._onMenuButtonKeydown),this.element.setAttribute("aria-haspopup","true")}disconnect(){this.hasButtonTarget&&this.buttonTarget.removeEventListener("keydown",this._onMenuButtonKeydown)}toggle(){this.openValue=!this.openValue}openValueChanged(){this.openValue?this._show():this._hide()}_show(e){setTimeout((()=>{this.menuTarget.classList.remove(this.toggleClass),this.element.setAttribute("aria-expanded","true"),this._enteringClassList[0].forEach((t=>{this.menuTarget.classList.add(t)}).bind(this)),this._activeClassList[0].forEach(t=>{this.activeTarget.classList.add(t)}),this._invisibleClassList[0].forEach(t=>this.menuTarget.classList.remove(t)),this._visibleClassList[0].forEach(t=>{this.menuTarget.classList.add(t)}),setTimeout((()=>{this._enteringClassList[0].forEach(t=>this.menuTarget.classList.remove(t))}).bind(this),this.enterTimeout[0]),typeof e=="function"&&e()}).bind(this))}_hide(e){setTimeout((()=>{this.element.setAttribute("aria-expanded","false"),this._invisibleClassList[0].forEach(t=>this.menuTarget.classList.add(t)),this._visibleClassList[0].forEach(t=>this.menuTarget.classList.remove(t)),this._activeClassList[0].forEach(t=>this.activeTarget.classList.remove(t)),this._leavingClassList[0].forEach(t=>this.menuTarget.classList.add(t)),setTimeout((()=>{this._leavingClassList[0].forEach(t=>this.menuTarget.classList.remove(t)),typeof e=="function"&&e(),this.menuTarget.classList.add(this.toggleClass)}).bind(this),this.leaveTimeout[0])}).bind(this))}show(){this.openValue=!0}hide(e){this.element.contains(e.target)===!1&&this.openValue&&(this.openValue=!1)}get activeTarget(){return this.data.has("activeTarget")?document.querySelector(this.data.get("activeTarget")):this.element}get _activeClassList(){return this.activeClass?this.activeClass.split(",").map(e=>e.split(" ")):[[],[]]}get _visibleClassList(){return this.visibleClass?this.visibleClass.split(",").map(e=>e.split(" ")):[[],[]]}get _invisibleClassList(){return this.invisibleClass?this.invisibleClass.split(",").map(e=>e.split(" ")):[[],[]]}get _enteringClassList(){return this.enteringClass?this.enteringClass.split(",").map(e=>e.split(" ")):[[],[]]}get _leavingClassList(){return this.leavingClass?this.leavingClass.split(",").map(e=>e.split(" ")):[[],[]]}get enterTimeout(){return(this.data.get("enterTimeout")||"0,0").split(",").map(e=>parseInt(e))}get leaveTimeout(){return(this.data.get("leaveTimeout")||"0,0").split(",").map(e=>parseInt(e))}};lC.targets=["menu","button"],lC.values={open:Boolean};var j2=class extends Gt{connect(){this.toggleClass=this.data.get("class")||"hidden",this.backgroundId=this.data.get("backgroundId")||"modal-background",this.backgroundHtml=this.data.get("backgroundHtml")||this._backgroundHTML(),this.allowBackgroundClose=(this.data.get("allowBackgroundClose")||"true")==="true",this.preventDefaultActionOpening=(this.data.get("preventDefaultActionOpening")||"true")==="true",this.preventDefaultActionClosing=(this.data.get("preventDefaultActionClosing")||"true")==="true"}disconnect(){this.close()}open(e){this.preventDefaultActionOpening&&e.preventDefault(),e.target.blur&&e.target.blur(),this.lockScroll(),this.containerTarget.classList.remove(this.toggleClass),this.data.get("disable-backdrop")||(document.body.insertAdjacentHTML("beforeend",this.backgroundHtml),this.background=document.querySelector(`#${this.backgroundId}`))}close(e){e&&this.preventDefaultActionClosing&&e.preventDefault(),this.unlockScroll(),this.containerTarget.classList.add(this.toggleClass),this.background&&this.background.remove()}closeBackground(e){this.allowBackgroundClose&&e.target===this.containerTarget&&this.close(e)}closeWithKeyboard(e){e.keyCode!==27||this.containerTarget.classList.contains(this.toggleClass)||this.close(e)}_backgroundHTML(){return`<div id="${this.backgroundId}" class="fixed top-0 left-0 w-full h-full" style="background-color: ${this.backdropColorValue}; z-index: 9998;"></div>`}lockScroll(){let e=window.innerWidth-document.documentElement.clientWidth;document.body.style.paddingRight=`${e}px`,this.saveScrollPosition(),document.body.classList.add("fixed","inset-x-0","overflow-hidden"),document.body.style.top=`-${this.scrollPosition}px`}unlockScroll(){document.body.style.paddingRight=null,document.body.classList.remove("fixed","inset-x-0","overflow-hidden"),this.restoreScrollValue&&this.restoreScrollPosition(),document.body.style.top=null}saveScrollPosition(){this.scrollPosition=window.pageYOffset||document.body.scrollTop}restoreScrollPosition(){this.scrollPosition!==void 0&&(document.documentElement.scrollTop=this.scrollPosition)}};j2.targets=["container"],j2.values={backdropColor:{type:String,default:"rgba(0, 0, 0, 0.8)"},restoreScroll:{type:Boolean,default:!0}};var i7=class extends Gt{connect(){this.activeTabClasses=(this.data.get("activeTab")||"active").split(" "),this.inactiveTabClasses=(this.data.get("inactiveTab")||"inactive").split(" "),this.anchor&&(this.index=this.tabTargets.findIndex(e=>e.id===this.anchor)),this.showTab()}change(e){e.preventDefault(),this.index=e.currentTarget.dataset.index?e.currentTarget.dataset.index:e.currentTarget.dataset.id?this.tabTargets.findIndex(t=>t.id==e.currentTarget.dataset.id):this.tabTargets.indexOf(e.currentTarget),window.dispatchEvent(new CustomEvent("tsc:tab-change"))}showTab(){this.tabTargets.forEach((e,t)=>{let n=this.panelTargets[t];t===this.index?(n.classList.remove("hidden"),e.classList.remove(...this.inactiveTabClasses),e.classList.add(...this.activeTabClasses),e.id&&(location.hash=e.id)):(n.classList.add("hidden"),e.classList.remove(...this.activeTabClasses),e.classList.add(...this.inactiveTabClasses))})}get index(){return parseInt(this.data.get("index")||0)}set index(e){this.data.set("index",e>=0?e:0),this.showTab()}get anchor(){return document.URL.split("#").length>1?document.URL.split("#")[1]:null}};i7.targets=["tab","panel"];var V2=class extends Gt{connect(){this.toggleClass=this.data.get("class")||"hidden"}toggle(e){e.preventDefault(),this.openValue=!this.openValue}hide(e){e.preventDefault(),this.openValue=!1}show(e){e.preventDefault(),this.openValue=!0}openValueChanged(){this.toggleClass&&this.toggleableTargets.forEach(e=>{e.classList.toggle(this.toggleClass)})}};V2.targets=["toggleable"],V2.values={open:Boolean};var uC=class extends Gt{initialize(){this.contentTarget.setAttribute("style",`transform:translate(${this.data.get("translateX")}, ${this.data.get("translateY")});`)}mouseOver(){this.contentTarget.classList.remove("hidden")}mouseOut(){this.contentTarget.classList.add("hidden")}toggle(){this.contentTarget.classList.contains("hidden")?this.contentTarget.classList.remove("hidden"):this.contentTarget.classList.add("hidden")}};uC.targets=["content"];var o7=class extends lC{_show(){this.overlayTarget.classList.remove(this.toggleClass),super._show((()=>{this._activeClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),this._invisibleClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this._visibleClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),setTimeout((()=>{this._enteringClassList[1].forEach(e=>this.overlayTarget.classList.remove(e))}).bind(this),this.enterTimeout[1])}).bind(this))}_hide(){this._leavingClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),super._hide((()=>{setTimeout((()=>{this._visibleClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this._invisibleClassList[1].forEach(e=>this.overlayTarget.classList.add(e)),this._activeClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this._leavingClassList[1].forEach(e=>this.overlayTarget.classList.remove(e)),this.overlayTarget.classList.add(this.toggleClass)}).bind(this),this.leaveTimeout[1])}).bind(this))}};o7.targets=["menu","overlay"];var a7=class extends Gt{connect(){this.styleProperty=this.data.get("style")||"backgroundColor"}update(){this.preview=this.color}set preview(e){this.previewTarget.style[this.styleProperty]=e;let t=this._getContrastYIQ(e);this.styleProperty==="color"?this.previewTarget.style.backgroundColor=t:this.previewTarget.style.color=t}get color(){return this.colorTarget.value}_getContrastYIQ(e){return e=e.replace("#",""),(299*parseInt(e.substr(0,2),16)+587*parseInt(e.substr(2,2),16)+114*parseInt(e.substr(4,2),16))/1e3>=128?"#000":"#fff"}};a7.targets=["preview","color"];var s7=class extends Gt{connect(){this.hasButtonTarget&&(this.originalContent=this.buttonTarget.innerHTML)}copy(e){e.preventDefault();let t=this.sourceTarget.innerHTML||this.sourceTarget.value;navigator.clipboard.writeText(t).then(()=>this.copied())}copied(){this.hasButtonTarget&&(this.timeout&&clearTimeout(this.timeout),this.buttonTarget.innerHTML=this.successContentValue,this.timeout=setTimeout(()=>{this.buttonTarget.innerHTML=this.originalContent},this.successDurationValue))}};s7.targets=["button","source"],s7.values={successContent:String,successDuration:{type:Number,default:2e3}};var VAe=s7;var l7=class extends Gt{connect(){this.hidden=this.inputTarget.type==="password",this.class=this.hasHiddenClass?this.hiddenClass:"hidden"}toggle(e){e.preventDefault(),this.inputTarget.type=this.hidden?"text":"password",this.hidden=!this.hidden,this.iconTargets.forEach(t=>t.classList.toggle(this.class))}};l7.targets=["input","icon"],l7.classes=["hidden"];var HAe=l7;var H2=class extends HAe{toggle(r){this.inputTarget.disabled||super.toggle(r)}};function VBt(r,e){let t;return(...n)=>{let i=this;clearTimeout(t),t=setTimeout(()=>r.apply(i,n),e)}}var cC=class extends Gt{initialize(){this.autogrow=this.autogrow.bind(this)}connect(){this.element.style.overflow="hidden";let e=this.resizeDebounceDelayValue;this.onResize=e>0?VBt(this.autogrow,e):this.autogrow,this.autogrow(),this.element.addEventListener("input",this.autogrow),window.addEventListener("resize",this.onResize)}disconnect(){window.removeEventListener("resize",this.onResize)}autogrow(){this.element.style.height="auto",this.element.style.height=`${this.element.scrollHeight}px`}};cC.values={resizeDebounceDelay:{type:Number,default:100}};var WAe=11;function HBt(r,e){var t=e.attributes,n,i,o,a,l;if(!(e.nodeType===WAe||r.nodeType===WAe)){for(var u=t.length-1;u>=0;u--)n=t[u],i=n.name,o=n.namespaceURI,a=n.value,o?(i=n.localName||i,l=r.getAttributeNS(o,i),l!==a&&(n.prefix==="xmlns"&&(i=n.name),r.setAttributeNS(o,i,a))):(l=r.getAttribute(i),l!==a&&r.setAttribute(i,a));for(var f=r.attributes,p=f.length-1;p>=0;p--)n=f[p],i=n.name,o=n.namespaceURI,o?(i=n.localName||i,e.hasAttributeNS(o,i)||r.removeAttributeNS(o,i)):e.hasAttribute(i)||r.removeAttribute(i)}}var W2,WBt="http://www.w3.org/1999/xhtml",_f=typeof document>"u"?void 0:document,$Bt=!!_f&&"content"in _f.createElement("template"),KBt=!!_f&&_f.createRange&&"createContextualFragment"in _f.createRange();function GBt(r){var e=_f.createElement("template");return e.innerHTML=r,e.content.childNodes[0]}function YBt(r){W2||(W2=_f.createRange(),W2.selectNode(_f.body));var e=W2.createContextualFragment(r);return e.childNodes[0]}function XBt(r){var e=_f.createElement("body");return e.innerHTML=r,e.childNodes[0]}function ZBt(r){return r=r.trim(),$Bt?GBt(r):KBt?YBt(r):XBt(r)}function $2(r,e){var t=r.nodeName,n=e.nodeName,i,o;return t===n?!0:(i=t.charCodeAt(0),o=n.charCodeAt(0),i<=90&&o>=97?t===n.toUpperCase():o<=90&&i>=97?n===t.toUpperCase():!1)}function JBt(r,e){return!e||e===WBt?_f.createElement(r):_f.createElementNS(e,r)}function QBt(r,e){for(var t=r.firstChild;t;){var n=t.nextSibling;e.appendChild(t),t=n}return e}function u7(r,e,t){r[t]!==e[t]&&(r[t]=e[t],r[t]?r.setAttribute(t,""):r.removeAttribute(t))}var $Ae={OPTION:function(r,e){var t=r.parentNode;if(t){var n=t.nodeName.toUpperCase();n==="OPTGROUP"&&(t=t.parentNode,n=t&&t.nodeName.toUpperCase()),n==="SELECT"&&!t.hasAttribute("multiple")&&(r.hasAttribute("selected")&&!e.selected&&(r.setAttribute("selected","selected"),r.removeAttribute("selected")),t.selectedIndex=-1)}u7(r,e,"selected")},INPUT:function(r,e){u7(r,e,"checked"),u7(r,e,"disabled"),r.value!==e.value&&(r.value=e.value),e.hasAttribute("value")||r.removeAttribute("value")},TEXTAREA:function(r,e){var t=e.value;r.value!==t&&(r.value=t);var n=r.firstChild;if(n){var i=n.nodeValue;if(i==t||!t&&i==r.placeholder)return;n.nodeValue=t}},SELECT:function(r,e){if(!e.hasAttribute("multiple")){for(var t=-1,n=0,i=r.firstChild,o,a;i;)if(a=i.nodeName&&i.nodeName.toUpperCase(),a==="OPTGROUP")o=i,i=o.firstChild;else{if(a==="OPTION"){if(i.hasAttribute("selected")){t=n;break}n++}i=i.nextSibling,!i&&o&&(i=o.nextSibling,o=null)}r.selectedIndex=t}}},hC=1,KAe=11,GAe=3,YAe=8;function Mb(){}function ezt(r){if(r)return r.getAttribute&&r.getAttribute("id")||r.id}function tzt(r){return function(t,n,i){if(i||(i={}),typeof n=="string")if(t.nodeName==="#document"||t.nodeName==="HTML"||t.nodeName==="BODY"){var o=n;n=_f.createElement("html"),n.innerHTML=o}else n=ZBt(n);else n.nodeType===KAe&&(n=n.firstElementChild);var a=i.getNodeKey||ezt,l=i.onBeforeNodeAdded||Mb,u=i.onNodeAdded||Mb,f=i.onBeforeElUpdated||Mb,p=i.onElUpdated||Mb,b=i.onBeforeNodeDiscarded||Mb,S=i.onNodeDiscarded||Mb,C=i.onBeforeElChildrenUpdated||Mb,M=i.skipFromChildren||Mb,L=i.addChild||function(ie,ue){return ie.appendChild(ue)},P=i.childrenOnly===!0,H=Object.create(null),$=[];function Q(ie){$.push(ie)}function K(ie,ue){if(ie.nodeType===hC)for(var Me=ie.firstChild;Me;){var ve=void 0;ue&&(ve=a(Me))?Q(ve):(S(Me),Me.firstChild&&K(Me,ue)),Me=Me.nextSibling}}function te(ie,ue,Me){b(ie)!==!1&&(ue&&ue.removeChild(ie),S(ie),K(ie,Me))}function pe(ie){if(ie.nodeType===hC||ie.nodeType===KAe)for(var ue=ie.firstChild;ue;){var Me=a(ue);Me&&(H[Me]=ue),pe(ue),ue=ue.nextSibling}}pe(t);function re(ie){u(ie);for(var ue=ie.firstChild;ue;){var Me=ue.nextSibling,ve=a(ue);if(ve){var le=H[ve];le&&$2(ue,le)?(ue.parentNode.replaceChild(le,ue),_e(le,ue)):re(ue)}else re(ue);ue=Me}}function ge(ie,ue,Me){for(;ue;){var ve=ue.nextSibling;(Me=a(ue))?Q(Me):te(ue,ie,!0),ue=ve}}function _e(ie,ue,Me){var ve=a(ue);ve&&delete H[ve],!(!Me&&(f(ie,ue)===!1||(r(ie,ue),p(ie),C(ie,ue)===!1)))&&(ie.nodeName!=="TEXTAREA"?Fe(ie,ue):$Ae.TEXTAREA(ie,ue))}function Fe(ie,ue){var Me=M(ie),ve=ue.firstChild,le=ie.firstChild,Ue,yt,it,bt,ct;e:for(;ve;){for(bt=ve.nextSibling,Ue=a(ve);!Me&&le;){if(it=le.nextSibling,ve.isSameNode&&ve.isSameNode(le)){ve=bt,le=it;continue e}yt=a(le);var Ot=le.nodeType,Wt=void 0;if(Ot===ve.nodeType&&(Ot===hC?(Ue?Ue!==yt&&((ct=H[Ue])?it===ct?Wt=!1:(ie.insertBefore(ct,le),yt?Q(yt):te(le,ie,!0),le=ct):Wt=!1):yt&&(Wt=!1),Wt=Wt!==!1&&$2(le,ve),Wt&&_e(le,ve)):(Ot===GAe||Ot==YAe)&&(Wt=!0,le.nodeValue!==ve.nodeValue&&(le.nodeValue=ve.nodeValue))),Wt){ve=bt,le=it;continue e}yt?Q(yt):te(le,ie,!0),le=it}if(Ue&&(ct=H[Ue])&&$2(ct,ve))L(ie,ct),_e(ct,ve);else{var qt=l(ve);qt!==!1&&(qt&&(ve=qt),ve.actualize&&(ve=ve.actualize(ie.ownerDocument||_f)),L(ie,ve),re(ve))}ve=bt,le=it}ge(ie,le,yt);var pr=$Ae[ie.nodeName];pr&&pr(ie,ue)}var ke=t,V=ke.nodeType,z=n.nodeType;if(!P){if(V===hC)z===hC?$2(t,n)||(S(t),ke=QBt(t,JBt(n.nodeName,n.namespaceURI))):ke=n;else if(V===GAe||V===YAe){if(z===V)return ke.nodeValue!==n.nodeValue&&(ke.nodeValue=n.nodeValue),ke;ke=n}}if(ke===n)S(t);else{if(n.isSameNode&&n.isSameNode(ke))return;if(_e(ke,n,P),$)for(var xe=0,Ie=$.length;xe<Ie;xe++){var he=H[$[xe]];he&&te(he,he.parentNode,!1)}}return!P&&ke!==t&&t.parentNode&&(ke.actualize&&(ke=ke.actualize(t.ownerDocument||_f)),t.parentNode.replaceChild(ke,t)),ke}}var rzt=tzt(HBt);function nzt(){let r={childrenOnly:this.hasAttribute("children-only")};this.targetElements.forEach((e=>{rzt(e,r.childrenOnly?this.templateContent:this.templateElement.innerHTML,r)}))}var izt=r=>{r.morph=nzt};function h7(r){return r.replace(/(?:[_-])([a-z0-9])/g,((e,t)=>t.toUpperCase()))}function ozt(r){return r.charAt(0).toUpperCase()+r.slice(1)}function azt(r){return r.replace(/([A-Z])/g,((e,t)=>`-${t.toLowerCase()}`))}function K2(r){return r?r.match(/[^\s]+/g)||[]:[]}function f7(r){try{return JSON.parse(r)}catch{return r}}var szt=Object.freeze({__proto__:null,camelize:h7,capitalize:ozt,dasherize:azt,tokenize:K2,typecast:f7});function ZAe(){let r=K2(this.getAttribute("classes"));r.length>0?this.targetElements.forEach((e=>e.classList.add(...r))):console.warn('[TurboPower] no "classes" provided for Turbo Streams operation "add_css_class"')}function JAe(){let r=this.getAttribute("attribute");r?this.targetElements.forEach((e=>e.removeAttribute(r))):console.warn('[TurboPower] no "attribute" provided for Turbo Streams operation "remove_attribute"')}function QAe(){let r=K2(this.getAttribute("classes"));r.length>0?this.targetElements.forEach((e=>e.classList.remove(...r))):console.warn('[TurboPower] no "classes" provided for Turbo Streams operation "remove_css_class"')}function eCe(){let r=this.getAttribute("attribute"),e=this.getAttribute("value")||"";r?this.targetElements.forEach((t=>t.setAttribute(r,e))):console.warn('[TurboPower] no "attribute" provided for Turbo Streams operation "set_attribute"')}function tCe(){let r=this.getAttribute("attribute"),e=this.getAttribute("value")||"";r?this.targetElements.forEach((t=>t.dataset[h7(r)]=e)):console.warn('[TurboPower] no "attribute" provided for Turbo Streams operation "set_dataset_attribute"')}function rCe(){let r=this.getAttribute("name"),e=f7(this.getAttribute("value")||"");r?this.targetElements.forEach((t=>t[r]=e)):console.error('[TurboPower] no "name" provided for Turbo Streams operation "set_property"')}function nCe(){let r=this.getAttribute("name"),e=this.getAttribute("value")||"";r?this.targetElements.forEach((t=>t.style[r]=e)):console.error('[TurboPower] no "name" provided for Turbo Streams operation "set_style"')}function iCe(){let r=this.getAttribute("styles")||"";this.targetElements.forEach((e=>e.setAttribute("style",r)))}function oCe(){let r=this.getAttribute("value")||"";this.targetElements.forEach((e=>e.value=r))}function aCe(){let r=K2(this.getAttribute("classes"));r.length>0?this.targetElements.forEach((e=>{r.forEach((t=>e.classList.toggle(t)))})):console.warn('[TurboPower] no "classes" provided for Turbo Streams operation "toggle_css_class"')}function sCe(){let r=this.getAttribute("from")||"",e=this.getAttribute("to")||"";r&&e?this.targetElements.forEach((t=>{t.classList.replace(r,e)||console.warn(`[TurboPower] The "${r}" CSS class provided in the "from" attribute for the "replace_css_class" action was not found on the target element. No replacements made.`,t)})):console.warn('[TurboPower] no "from" or "to" class provided for Turbo Streams operation "replace_css_class"')}function lCe(r){r.add_css_class=ZAe,r.remove_css_class=QAe,r.remove_attribute=JAe,r.set_attribute=eCe,r.set_dataset_attribute=tCe,r.set_property=rCe,r.set_style=nCe,r.set_styles=iCe,r.set_value=oCe,r.toggle_css_class=aCe,r.replace_css_class=sCe}function uCe(){window.location.reload()}function cCe(){let r=this.getAttribute("align-to-top"),e=this.getAttribute("block"),t=this.getAttribute("inline"),n=this.getAttribute("behavior");if(r)this.targetElements.forEach((i=>i.scrollIntoView(r==="true")));else if(e||t||n){let i={};e&&(i.block=e),t&&(i.inline=t),n&&(i.behavior=n),this.targetElements.forEach((o=>o.scrollIntoView(i)))}else this.targetElements.forEach((i=>i.scrollIntoView()))}function hCe(){this.targetElements.forEach((r=>r.focus()))}function fCe(){let r=this.getAttribute("title")||"",e=document.head.querySelector("title");e||(e=document.createElement("title"),document.head.appendChild(e)),e.textContent=r}function dCe(r){r.reload=uCe,r.scroll_into_view=cCe,r.set_focus=hCe,r.set_title=fCe}function pCe(){let r=this.getAttribute("message"),e=this.getAttribute("level")||"log";console[e](r)}function mCe(){let r=JSON.parse(this.getAttribute("data")||"[]"),e=JSON.parse(this.getAttribute("columns")||"[]");console.table(r,e)}function gCe(r){r.console_log=pCe,r.console_table=mCe}function vCe(){console.warn("[TurboPower] The `invoke` Turbo Stream Action was removed from TurboPower. If you'd like to continue using this action please use the successor library instead. Read more here: https://github.com/hopsoft/turbo_boost-streams")}function yCe(r){r.invoke||(r.invoke=vCe)}var c7=class{constructor(e){this.ATTRIBUTE_TO_COOKIE_KEY_MAPPING=[["domain","Domain",!1],["path","Path",!1],["expires","Expires",!1],["max-age","Max-Age",!1],["http-only","HttpOnly",!0],["secure","Secure",!0],["same-site","SameSite",!1]],this.streamElement=e}build(){let e=`${this.streamElement.getAttribute("name")}=${this.streamElement.getAttribute("value")}`;return this.ATTRIBUTE_TO_COOKIE_KEY_MAPPING.forEach((([t,n,i])=>{let o=this.streamElement.getAttribute(t);if(o!==null){let a=i?n:`${n}=${o}`;e=`${e}; ${a}`}})),e}};function bCe(){let r=this.getAttribute("cookie")||"";document.cookie=r}function xCe(){let r=new c7(this);document.cookie=r.build()}function _Ce(r){r.set_cookie=bCe,r.set_cookie_item=xCe}function wCe(){let r=this.getAttribute("parent");if(r){let e=document.querySelector(r);e?this.targetElements.forEach((t=>e.appendChild(t))):console.error(`[TurboPower] couldn't find parent element using selector "${r}" for Turbo Streams operation "graft"`)}else console.error('[TurboPower] no "parent" selector provided for Turbo Streams operation "graft"')}function SCe(){let r=this.templateContent.textContent||"";this.targetElements.forEach((e=>e.innerHTML=r))}function TCe(){let r=this.getAttribute("position")||"beforebegin",e=this.templateContent.textContent||"";this.targetElements.forEach((t=>t.insertAdjacentHTML(r,e)))}function ECe(){let r=this.getAttribute("position")||"beforebegin",e=this.getAttribute("text")||"";this.targetElements.forEach((t=>t.insertAdjacentText(r,e)))}function kCe(){let r=this.templateContent.textContent||"";this.targetElements.forEach((e=>e.outerHTML=r))}function ACe(){let r=this.getAttribute("name"),e=this.getAttribute("content")||"";if(r){let t=document.head.querySelector(`meta[name='${r}']`);t||(t=document.createElement("meta"),t.name=r,document.head.appendChild(t)),t.content=e}else console.error('[TurboPower] no "name" provided for Turbo Streams operation "set_meta"')}function CCe(){let r=this.getAttribute("text")||"";this.targetElements.forEach((e=>e.textContent=r))}function DCe(r){r.graft=wCe,r.inner_html=SCe,r.insert_adjacent_html=TCe,r.insert_adjacent_text=ECe,r.outer_html=kCe,r.text_content=CCe,r.set_meta=ACe}function ICe(){let r=this.getAttribute("name"),e=null;try{e=this.templateContent.textContent}catch{}try{let t=e?JSON.parse(e):{};if(r){let n={bubbles:!0,cancelable:!0,detail:t},i=new CustomEvent(r,n);this.targetElements.forEach((o=>o.dispatchEvent(i)))}else console.warn('[TurboPower] no "name" provided for Turbo Streams operation "dispatch_event"')}catch(t){console.error(`[TurboPower] error proccessing provided "detail" in "<template>" ("${e}") for Turbo Streams operation "dispatch_event".`,`Error: "${t.message}"`)}}function OCe(r){r.dispatch_event=ICe}function MCe(){this.targetElements.forEach((r=>r.reset()))}function LCe(r){r.reset_form=MCe}function PCe(){let r=this.getAttribute("url"),e=this.getAttribute("state"),t=this.getAttribute("title")||"";window.history.pushState(e,t,r)}function RCe(){let r=this.getAttribute("url"),e=this.getAttribute("state"),t=this.getAttribute("title")||"";window.history.replaceState(e,t,r)}function FCe(){window.history.back()}function lzt(){window.history.forward()}function qCe(){let r=Number(this.getAttribute("delta"))||0;window.history.go(r)}function NCe(r){r.push_state=PCe,r.replace_state=RCe,r.history_back=FCe,r.history_go=qCe}var uzt=["dir","lang","badge","body","tag","icon","image","data","vibrate","renotify","require-interaction","actions","silent"],XAe=r=>{let e=r.getAttribute("title")||"",t=Array.from(r.attributes).filter((i=>uzt.includes(i.name))).map((i=>[h7(i.name),f7(i.value)])),n=Object.fromEntries(t);new Notification(e,n)};function BCe(){window.Notification?Notification.permission==="granted"?XAe(this):Notification.permission!=="denied"&&Notification.requestPermission().then((r=>{r==="granted"&&XAe(this)})):alert("This browser does not support desktop notification")}function zCe(r){r.notification=BCe}function d7(r){return r==="session"?window.sessionStorage:window.localStorage}function UCe(){let r=this.getAttribute("type");d7(r).clear()}function jCe(){let r=this.getAttribute("key"),e=this.getAttribute("value")||"",t=this.getAttribute("type");r?d7(t).setItem(r,e):console.warn('[TurboPower] no "key" provided for Turbo Streams operation "set_storage_item"')}function VCe(){let r=this.getAttribute("key"),e=this.getAttribute("type");r?d7(e).removeItem(r):console.warn('[TurboPower] no "key" provided for Turbo Streams operation "remove_storage_item"')}function HCe(r){r.clear_storage=UCe,r.set_storage_item=jCe,r.remove_storage_item=VCe}var czt={get location(){return window.TurboPowerLocation||window.location}};function WCe(){let r=this.getAttribute("url")||"/",e=this.getAttribute("turbo-action")||"advance",t=this.getAttribute("turbo-frame"),n=this.getAttribute("turbo")!=="false",i={action:e};t&&(i.frame=t),n&&window.Turbo?window.Turbo.visit(r,i):czt.location.assign(r)}function $Ce(){window.Turbo.cache.clear()}function KCe(r){r.redirect_to=WCe,r.turbo_clear_cache=$Ce}function GCe(){let r=this.getAttribute("value")||0;window.Turbo.navigator.adapter.progressBar.setValue(Number(r))}function YCe(){window.Turbo.navigator.adapter.progressBar.show()}function XCe(){window.Turbo.navigator.adapter.progressBar.hide()}function ZCe(r){r.turbo_progress_bar_set_value=GCe,r.turbo_progress_bar_show=YCe,r.turbo_progress_bar_hide=XCe}function JCe(){this.targetElements.forEach((r=>r.reload()))}function QCe(){let r=this.getAttribute("src");this.targetElements.forEach((e=>e.src=r))}function eDe(r){r.turbo_frame_reload=JCe,r.turbo_frame_set_src=QCe}function tDe(r){lCe(r),dCe(r),gCe(r),yCe(r),_Ce(r),DCe(r),OCe(r),LCe(r),NCe(r),zCe(r),HCe(r),KCe(r),ZCe(r),eDe(r)}var hzt=Object.freeze({__proto__:null,add_css_class:ZAe,clear_storage:UCe,console_log:pCe,console_table:mCe,dispatch_event:ICe,graft:wCe,history_back:FCe,history_forward:lzt,history_go:qCe,inner_html:SCe,insert_adjacent_html:TCe,insert_adjacent_text:ECe,invoke:vCe,notification:BCe,outer_html:kCe,push_state:PCe,redirect_to:WCe,register:tDe,registerAttributesActions:lCe,registerBrowserActions:dCe,registerDOMActions:DCe,registerDebugActions:gCe,registerDeprecatedActions:yCe,registerDocumentActions:_Ce,registerEventsActions:OCe,registerFormActions:LCe,registerHistoryActions:NCe,registerNotificationActions:zCe,registerStorageActions:HCe,registerTurboActions:KCe,registerTurboFrameActions:eDe,registerTurboProgressBarActions:ZCe,reload:uCe,remove_attribute:JAe,remove_css_class:QAe,remove_storage_item:VCe,replace_css_class:sCe,replace_state:RCe,reset_form:MCe,scroll_into_view:cCe,set_attribute:eCe,set_cookie:bCe,set_cookie_item:xCe,set_dataset_attribute:tCe,set_focus:hCe,set_meta:ACe,set_property:rCe,set_storage_item:jCe,set_style:nCe,set_styles:iCe,set_title:fCe,set_value:oCe,text_content:CCe,toggle_css_class:aCe,turbo_clear_cache:$Ce,turbo_frame_reload:JCe,turbo_frame_set_src:QCe,turbo_progress_bar_hide:XCe,turbo_progress_bar_set_value:GCe,turbo_progress_bar_show:YCe});function fzt(r){izt(r),tDe(r)}function dzt(r,e,t){t[r]=e}var rDe={initialize:fzt,register:dzt,Actions:hzt,Utils:szt};rDe.initialize(window.Turbo.StreamActions);var cn=z2.start();cn.debug=window?.localStorage.getItem("avo.debug");window.Stimulus=cn;window.FakeStimulus={Controller:Gt};cn.register("alert",aS);cn.register("popover",uC);cn.register("clipboard",VAe);cn.register("password-visibility",H2);cn.register("textarea-autogrow",cC);var G2=class extends Gt{static targets=["resourceIds","form","selectedAll","indexQuery"];static values={confirmation:Boolean,resourceName:String};connect(){this.resourceIdsTarget.value===""&&(this.resourceIdsTarget.value=this.resourceIds),this.selectedAllTarget.value=this.selectionOptions.itemSelectAllSelectedAllValue,this.selectionOptions.itemSelectAllSelectedAllQueryValue&&(this.indexQueryTarget.value=this.selectionOptions.itemSelectAllSelectedAllQueryValue),this.confirmationValue?this.element.classList.remove("hidden"):this.formTarget.requestSubmit()}get resourceIds(){try{return JSON.parse(this.selectionOptions.selectedResources)}catch{return[]}}get selectionOptions(){try{return document.querySelector(`[data-selected-resources-name="${this.resourceNameValue}"]`).dataset}catch{return[]}}};var Y2=class extends Gt{static targets=["content"];static values={panelList:Boolean};get parentTarget(){return document.querySelector('[data-component-name="avo/view_types/table_component"]')||document.querySelector('[data-component-name="avo/view_types/grid_component"]')||document.querySelector("#main-content")}get visibleParentDimensions(){let r=this.parentTarget;if(!r)return{top:0,left:0,right:window.innerWidth,bottom:window.innerHeight};let e=r.getBoundingClientRect();return{top:e.top,left:e.left,right:e.right,bottom:Math.min(e.bottom,window.innerHeight)}}get isRTL(){return document.documentElement.dir==="rtl"}childDimensions=null;parentDimensions=null;connect(){this.element.style.display="block",this.childDimensions=this.contentTarget.getBoundingClientRect(),this.element.style.display="",this.parentDimensions=this.visibleParentDimensions,this.adjustOverflow()}adjustOverflow(){this.adjustVerticalOverflow(),this.adjustHorizontalOverflow()}adjustVerticalOverflow(){this.contentBottomOverflow&&(this.contentTarget.classList.remove("top-full","mt-2"),this.contentTarget.classList.add("bottom-full","mb-2"))}adjustHorizontalOverflow(){this.isRTL?this.contentRightOverflow&&(this.contentTarget.classList.remove("xl:start-0","sm:start-0"),this.contentTarget.classList.add("xl:end-0","sm:end-0")):this.contentLeftOverflow&&(this.contentTarget.classList.remove("xl:end-0","sm:end-0"),this.contentTarget.classList.add("xl:start-0","sm:start-0"))}get contentBottomOverflow(){return this.panelListValue===!0?!1:this.parentDimensions.bottom<this.childDimensions.bottom}get contentLeftOverflow(){return this.parentDimensions.left>this.childDimensions.left}get contentRightOverflow(){return this.parentDimensions.right<this.childDimensions.right}};var X2=class extends Gt{static targets=["resourceAction","standaloneAction"];static classes=["enabled","disabled"];target={};get targetIsDisabled(){return this.target.dataset.disabled==="true"}get actionsShowTurboFrame(){return document.querySelector(`turbo-frame#${window.Avo.configuration.modal_frame_id}`)}enableTarget(){this.targetIsDisabled&&(this.target.classList.remove(...this.disabledClasses),this.target.classList.add(...this.enabledClasses),this.target.dataset.disabled=!1)}disableTarget(){this.target.classList.remove(...this.enabledClasses),this.target.classList.add(...this.disabledClasses),this.target.dataset.disabled=!0}visitAction(r){if(this.target=r.target,this.targetIsDisabled){r.preventDefault();return}this.disableTarget();let e=this;setTimeout(()=>{this.actionsShowTurboFrame.loaded.then(()=>e.enableTarget(e.target))},1)}};var Z2=class extends Gt{static targets=["form"];connect(){this.formTarget.submit()}};var J2=class extends Gt{static values={threshold:{type:Number,default:400}};connect(){this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll,{passive:!0}),this.onScroll()}disconnect(){window.removeEventListener("scroll",this.onScroll)}get scrollTop(){return window.pageYOffset||document.documentElement.scrollTop}onScroll(){this.scrollTop>=this.thresholdValue?this.show():this.hide()}scrollToTop(r){r.preventDefault(),window.scrollTo({top:0,behavior:"smooth"})}show(){this.element.classList.add("back-to-top--visible")}hide(){this.element.classList.remove("back-to-top--visible")}};var Q2=class extends Gt{static targets=["select","type","container"];connect(){this.changeType()}changeType(){this.#e(),this.#t(this.selectTarget.value)}#e(){this.containerTarget.innerHTML="",this.containerTarget.classList.add("hidden")}#t(r){let e=this.typeTargets.find(t=>t.dataset.type===r);e&&(this.containerTarget.classList.remove("hidden"),this.containerTarget.appendChild(e.content.cloneNode(!0)))}};var p7=Jo(fC()),wf=class extends Gt{static targets=["urlRedirect"];static values={keepFiltersPanelOpen:Boolean};PARAM_KEY="encoded_filters";uriParams(){let r=this.urlRedirectTarget.dataset.turboFrame;return(0,p7.default)(r?this.element.closest(`turbo-frame#${r}`)?.src:window.location.toString()).query(!0)}viaResourceName(){return this.uriParams().via_resource_name}uriParam(r){return this.viaResourceName()?`${this.viaResourceName}_${r}`:r}decode(r){return JSON.parse(new TextDecoder().decode(Uint8Array.from(atob(decodeURIComponent(r)),e=>e.codePointAt(0))))}encode(r){return encodeURIComponent(btoa(String.fromCodePoint(...new TextEncoder().encode(JSON.stringify(r)))))}changeFilter(){let r=this.getFilterValue(),e=this.getFilterClass(),t=this.uriParams()[this.uriParam(this.PARAM_KEY)];t?t=this.decode(t):t={},t[e]=r;let n=Object.keys(t).filter(o=>t[o]!==null).reduce((o,a)=>(o[a]=t[a],o),{}),i=this.encode(n);this.navigateToURLWithFilters(i)}navigateToURLWithFilters(r){let e=new p7.default(this.urlRedirectTarget.href),t={...e.query(!0)};this.keepFiltersPanelOpenValue&&(t.keep_filters_panel_open=this.keepFiltersPanelOpenValue?1:null),t.page=1,r?t[this.PARAM_KEY]=r:delete t[this.PARAM_KEY],e.query(t),this.urlRedirectTarget.href=e.readable().toString(),this.urlRedirectTarget.click()}};var nF=class extends wf{static targets=["option"];getFilterValue(){let r={};return this.optionTargets.forEach(e=>{r[e.value]=e.checked}),r}getFilterClass(){let{filterClass:r}=this.optionTarget.dataset;return r}};function iF(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)n!=="__proto__"&&(r[n]=t[n])}return r}var pzt={read:function(r){return r[0]==='"'&&(r=r.slice(1,-1)),r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(r){return encodeURIComponent(r).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function m7(r,e){function t(i,o,a){if(!(typeof document>"u")){a=iF({},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 l="";for(var u in a)a[u]&&(l+="; "+u,a[u]!==!0&&(l+="="+a[u].split(";")[0]));return document.cookie=i+"="+r.write(o,i)+l}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},l=0;l<o.length;l++){var u=o[l].split("="),f=u.slice(1).join("=");try{var p=decodeURIComponent(u[0]);if(p in a||(a[p]=r.read(f,p)),i===p)break}catch{}}return i?a[i]:a}}return Object.create({set:t,get:n,remove:function(i,o){t(i,"",iF({},o,{expires:-1}))},withAttributes:function(i){return m7(this.converter,iF({},this.attributes,i))},withConverter:function(i){return m7(iF({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(r)}})}var Pu=m7(pzt,{path:"/"});var oF=class extends Gt{connect(){let r=Intl.DateTimeFormat().resolvedOptions().timeZone;!r||Pu.get(this.cookieKey)===r||(Pu.set(this.cookieKey,r,{expires:365,sameSite:"Lax"}),Pu.get(this.cookieKey)===r&&(Pu.set(this.changedCookieKey,"1",{sameSite:"Lax"}),window.Turbo.visit(window.location.href,{action:"replace"})))}get cookieKey(){return`${window.Avo.configuration.cookies_key}.browser_timezone`}get changedCookieKey(){return`${window.Avo.configuration.cookies_key}.timezone_changed`}};function aF(r){r.hasAttribute("hidden")?r.removeAttribute("hidden"):r.setAttribute("hidden","")}var g7='input[type="checkbox"]',sF=class extends Gt{static targets=["input","row","empty","hiddenSelections"];static values={hiddenSelectionsOne:String,hiddenSelectionsOther:String};filter(r){if(r&&r.target!==this.inputTarget)return;let e=this.normalize(this.inputTarget.value),t=0,n=0;this.rowTargets.forEach(i=>{let o=e.length===0||this.normalize(i.dataset.checkboxListFieldSearchText).includes(e),a=i.querySelector(g7);this.setHidden(i,!o),a&&(a.disabled=a.defaultDisabled,!o&&a.checked&&(n+=1)),o&&(t+=1)}),this.hasEmptyTarget&&this.setHidden(this.emptyTarget,t>0),this.updateHiddenSelections(n)}handleKeydown(r){r.key!=="ArrowDown"&&r.key!=="ArrowUp"||(r.target===this.inputTarget?this.moveFromInput(r):r.target.matches(g7)&&this.moveBetweenRows(r))}moveFromInput(r){let e=this.visibleRows;e.length!==0&&(r.preventDefault(),this.focusRow(r.key==="ArrowDown"?e[0]:e[e.length-1]))}moveBetweenRows(r){let e=this.visibleRows,t=r.target.closest('[data-checkbox-list-field-target~="row"]'),n=e.indexOf(t);if(n===-1)return;r.preventDefault();let i=r.key==="ArrowDown"?1:-1,o=n+i;o<0&&(o=e.length-1),o>=e.length&&(o=0),this.focusRow(e[o])}get visibleRows(){return this.rowTargets.filter(r=>!r.hasAttribute("hidden"))}focusRow(r){r.querySelector(g7)?.focus(),r.scrollIntoView({block:"nearest"})}setHidden(r,e){r.hasAttribute("hidden")!==e&&aF(r)}updateHiddenSelections(r){if(this.hasHiddenSelectionsTarget){if(r===0){this.setHidden(this.hiddenSelectionsTarget,!0),this.hiddenSelectionsTarget.textContent="";return}this.hiddenSelectionsTarget.textContent=this.hiddenSelectionsLabel(r),this.setHidden(this.hiddenSelectionsTarget,!1)}}hiddenSelectionsLabel(r){return r===1&&this.hasHiddenSelectionsOneValue?this.hiddenSelectionsOneValue:this.hasHiddenSelectionsOtherValue?this.hiddenSelectionsOtherValue.replace("%{count}",r):`${r} selected options hidden by search`}normalize(r){return(r||"").toString().trim().toLowerCase()}};var lF=class extends Gt{static targets=["input","clearButton"];showClearButton(){this.clearButtonTarget.classList.remove("hidden")}clearInput(){this.inputTarget.value="",this.clearButtonTarget.classList.add("hidden")}};var ckr=Jo(uS()),hkr=Jo(mDe()),fkr=Jo(uF()),dkr=Jo(dC()),pkr=Jo(cF()),mkr=Jo(DDe()),gkr=Jo(RDe()),vkr=Jo(NDe()),ykr=Jo(x7()),bkr=Jo(VDe()),xkr=Jo($De()),_kr=Jo(fIe()),wkr=Jo(cS()),Skr=Jo(mIe());var gIe=Jo(qo());var hS=r=>r=="true";var fF=class extends Gt{static targets=["element"];get isDark(){return document.documentElement.classList.contains("dark")}get resolvedTheme(){return this.isDark?"monokai":this.elementTarget.dataset.theme||"default"}connect(){let r={readOnly:hS(this.elementTarget.dataset.readOnly),mode:this.elementTarget.dataset.language,theme:this.resolvedTheme,tabSize:this.elementTarget.dataset.tabSize,indentWithTabs:hS(this.elementTarget.dataset.indentWithTabs),lineWrapping:hS(this.elementTarget.dataset.lineWrapping),lineNumbers:!0,extraKeys:{Esc:t=>t.getInputField().blur()}},e=this;setTimeout(()=>{e.cm=gIe.default.fromTextArea(e.elementTarget,r),e.cm.on("change",t=>{e.elementTarget.innerText=t.getValue(),e.elementTarget.dispatchEvent(new Event("input"))})},1),this.observer=new MutationObserver(()=>{e.cm&&e.cm.setOption("theme",e.resolvedTheme)}),this.observer.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})}disconnect(){this.observer&&this.observer.disconnect(),this.element.querySelector(".CodeMirror").CodeMirror.toTextArea()}};var pC=class{constructor(e){this.response=e}get statusCode(){return this.response.status}get redirected(){return this.response.redirected}get ok(){return this.response.ok}get unauthenticated(){return this.statusCode===401}get unprocessableEntity(){return this.statusCode===422}get authenticationURL(){return this.response.headers.get("WWW-Authenticate")}get contentType(){return(this.response.headers.get("Content-Type")||"").replace(/;.*$/,"")}get headers(){return this.response.headers}get html(){return this.contentType.match(/^(application|text)\/(html|xhtml\+xml)$/)?this.text:Promise.reject(new Error(`Expected an HTML response but got "${this.contentType}" instead`))}get json(){return this.contentType.match(/^application\/.*json$/)?this.responseJson||(this.responseJson=this.response.json()):Promise.reject(new Error(`Expected a JSON response but got "${this.contentType}" instead`))}get text(){return this.responseText||(this.responseText=this.response.text())}get isTurboStream(){return this.contentType.match(/^text\/vnd\.turbo-stream\.html/)}get isScript(){return this.contentType.match(/\b(?:java|ecma)script\b/)}async renderTurboStream(){if(this.isTurboStream)window.Turbo?await window.Turbo.renderStreamMessage(await this.text):console.warn("You must set `window.Turbo = Turbo` to automatically process Turbo Stream events with request.js");else return Promise.reject(new Error(`Expected a Turbo Stream response but got "${this.contentType}" instead`))}async activeScript(){if(this.isScript){let e=document.createElement("script"),t=document.querySelector("meta[name=csp-nonce]"),n=t&&t.content;n&&e.setAttribute("nonce",n),e.innerHTML=await this.text,document.body.appendChild(e)}else return Promise.reject(new Error(`Expected a Script response but got "${this.contentType}" instead`))}};var mC=class{static register(e){this.interceptor=e}static get(){return this.interceptor}static reset(){this.interceptor=void 0}};function vIe(r){let e=document.cookie?document.cookie.split("; "):[],t=`${encodeURIComponent(r)}=`,n=e.find(i=>i.startsWith(t));if(n){let i=n.split("=").slice(1).join("=");if(i)return decodeURIComponent(i)}}function yIe(r){let e={};for(let t in r){let n=r[t];n!==void 0&&(e[t]=n)}return e}function _7(r){let e=document.head.querySelector(`meta[name="${r}"]`);return e&&e.content}function bIe(r){return[...r].reduce((e,[t,n])=>e.concat(typeof n=="string"?[[t,n]]:[]),[])}function xIe(r,e){for(let[t,n]of e)n instanceof window.File||(r.has(t)&&!t.includes("[]")?(r.delete(t),r.set(t,n)):r.append(t,n))}var fS=class{constructor(e,t,n={}){this.method=e,this.options=n,this.originalUrl=t.toString()}async perform(){try{let i=mC.get();i&&await i(this)}catch(i){console.error(i)}let e=this.responseKind==="turbo-stream"&&window.Turbo?window.Turbo.fetch:window.fetch,t=new pC(await e(this.url,this.fetchOptions));return t.unauthenticated&&t.authenticationURL?Promise.reject(window.location.href=t.authenticationURL):(t.isScript&&await t.activeScript(),(t.ok||t.unprocessableEntity)&&t.isTurboStream&&await t.renderTurboStream(),t)}addHeader(e,t){let n=this.additionalHeaders;n[e]=t,this.options.headers=n}sameHostname(){if(!this.originalUrl.startsWith("http:"))return!0;try{return new URL(this.originalUrl).hostname===window.location.hostname}catch{return!0}}get fetchOptions(){return{method:this.method.toUpperCase(),headers:this.headers,body:this.formattedBody,signal:this.signal,credentials:this.credentials,redirect:this.redirect}}get headers(){let e={"X-Requested-With":"XMLHttpRequest","Content-Type":this.contentType,Accept:this.accept};return this.sameHostname()&&(e["X-CSRF-Token"]=this.csrfToken),yIe(Object.assign(e,this.additionalHeaders))}get csrfToken(){return vIe(_7("csrf-param"))||_7("csrf-token")}get contentType(){return this.options.contentType?this.options.contentType:this.body==null||this.body instanceof window.FormData?void 0:this.body instanceof window.File?this.body.type:"application/json"}get accept(){switch(this.responseKind){case"html":return"text/html, application/xhtml+xml";case"turbo-stream":return"text/vnd.turbo-stream.html, text/html, application/xhtml+xml";case"json":return"application/json, application/vnd.api+json";case"script":return"text/javascript, application/javascript";default:return"*/*"}}get body(){return this.options.body}get query(){let e=(this.originalUrl.split("?")[1]||"").split("#")[0],t=new URLSearchParams(e),n=this.options.query;n instanceof window.FormData?n=bIe(n):n instanceof window.URLSearchParams?n=n.entries():n=Object.entries(n||{}),xIe(t,n);let i=t.toString();return i.length>0?`?${i}`:""}get url(){return this.originalUrl.split("?")[0].split("#")[0]+this.query}get responseKind(){return this.options.responseKind||"html"}get signal(){return this.options.signal}get redirect(){return this.options.redirect||"follow"}get credentials(){return this.options.credentials||"same-origin"}get additionalHeaders(){return this.options.headers||{}}get formattedBody(){let e=Object.prototype.toString.call(this.body)==="[object String]";return this.headers["Content-Type"]==="application/json"&&!e?JSON.stringify(this.body):this.body}};async function w7(r,e){return new fS("get",r,e).perform()}async function S7(r,e){return new fS("patch",r,e).perform()}var dF=class extends Gt{static targets=["button","accentOption","themeLabel","themeOption"];static values={themeLabels:Object};connect(){this.appearance=window.Avo?.configuration?.appearance||{},this.lockedNeutral=this.appearance.neutralLocked?this.appearance.neutral:null,this.lockedAccent=this.appearance.accentLocked?this.appearance.accent:null,this.lockedScheme=this.appearance.schemeLocked?this.appearance.scheme:null,this.currentSchemeValue=this.readCurrentScheme(),this.currentThemeValue=this.readCurrentNeutral(),this.currentAccentValue=this.readCurrentAccent(),this.updateThemeLabel(),this.updateActiveThemeOption(),this.updateActiveAccentOption(),this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQueryListener=()=>{this.currentSchemeValue==="auto"&&this.applyScheme()},this.mediaQuery.addEventListener("change",this.mediaQueryListener)}readCurrentScheme(){let r=document.documentElement;return r.classList.contains("scheme-dark")?"dark":r.classList.contains("scheme-light")?"light":"auto"}readCurrentNeutral(){let r=Array.from(document.documentElement.classList).find(e=>e.startsWith("neutral-theme-"));return r?r.replace("neutral-theme-",""):"brand"}readCurrentAccent(){let r=Array.from(document.documentElement.classList).find(e=>e.startsWith("accent-theme-"));return r?r.replace("accent-theme-",""):"brand"}disconnect(){this.mediaQuery&&this.mediaQueryListener&&this.mediaQuery.removeEventListener("change",this.mediaQueryListener)}setScheme(r){if(r.preventDefault(),this.lockedScheme)return;let{scheme:e}=r.currentTarget.dataset;!e||!["auto","light","dark"].includes(e)||(this.currentSchemeValue=e,this.persistPreferences("scheme"),this.applyScheme())}setTheme(r){if(r.preventDefault(),this.lockedNeutral)return;let{theme:e}=r.currentTarget.dataset,t=this.appearance.neutrals||[];!e||!t.includes(e)||(this.currentThemeValue=e,this.persistPreferences("theme"),this.applyTheme(),this.updateThemeLabel(),this.updateActiveThemeOption())}previewTheme(r){let{theme:e}=r.currentTarget.dataset;e&&(this.applyThemeClass(e),this.updateActiveThemeOptionFor(e))}revertTheme(){this.applyTheme(),this.updateActiveThemeOption()}setAccent(r){if(r.preventDefault(),this.lockedAccent)return;let{accent:e}=r.currentTarget.dataset,t=this.appearance.accents||[];!e||!t.includes(e)||(this.currentAccentValue=e,this.persistPreferences("accent"),this.applyAccent())}previewAccent(r){let{accent:e}=r.currentTarget.dataset;e&&(this.applyAccentClass(e),this.updateActiveAccentOptionFor(e))}revertAccent(){this.applyAccent(),this.updateActiveAccentOption()}cycleScheme(){this.lockedScheme||(this.currentSchemeValue=this.nextValue(["auto","light","dark"],this.currentSchemeValue),this.persistPreferences("scheme"),this.applyScheme())}cycleNeutral(){if(this.lockedNeutral)return;let r=this.appearance.neutrals||[];r.length!==0&&(this.currentThemeValue=this.nextValue(r,this.currentThemeValue||"brand"),this.persistPreferences("theme"),this.applyTheme(),this.updateThemeLabel(),this.updateActiveThemeOption())}cycleAccent(){if(this.lockedAccent)return;let r=this.appearance.accents||[];r.length!==0&&(this.currentAccentValue=this.nextValue(r,this.currentAccentValue||"brand"),this.persistPreferences("accent"),this.applyAccent(),this.updateActiveAccentOption())}nextValue(r,e){let t=r.indexOf(e);return r[(t+1)%r.length]}persistPreferences(r){if(this.appearance.persistence==="database"){this.patchAppearanceSettings(r);return}this.writePreferenceCookie(r)}writePreferenceCookie(r){switch(r){case"scheme":this.setPreferenceCookie("color_scheme",this.currentSchemeValue,this.appearanceDefaultScheme());break;case"theme":this.setPreferenceCookie("theme",this.currentThemeValue,this.appearanceDefaultNeutral());break;case"accent":this.setPreferenceCookie("accent_color",this.currentAccentValue,this.appearanceDefaultAccent());break;default:break}}appearanceDefaultScheme(){let r=this.appearance.scheme;return r!=null&&r!==""?String(r):"auto"}appearanceDefaultNeutral(){let r=this.appearance.neutral;return r!=null&&r!==""?String(r):"brand"}appearanceDefaultAccent(){let r=this.appearance.accent;return r!=null&&r!==""?String(r):"brand"}setPreferenceCookie(r,e,t){e===t?Pu.remove(r):Pu.set(r,e)}patchAppearanceSettings(r){let e=this.appearanceSettingsPayload(r);e&&S7(`${window.Avo.configuration.root_path}/appearance_settings`,{responseKind:"json",contentType:"application/json",body:e})}appearanceSettingsPayload(r){switch(r){case"scheme":return{color_scheme:this.currentSchemeValue};case"theme":return{neutral:this.currentThemeValue};case"accent":return{accent:this.currentAccentValue};default:return null}}applyScheme(){let r=this.currentSchemeValue||"auto";document.documentElement.classList.remove("scheme-light","scheme-dark","scheme-auto"),r==="light"?(document.documentElement.classList.add("scheme-light"),document.documentElement.classList.remove("dark")):r==="dark"?(document.documentElement.classList.add("scheme-dark"),document.documentElement.classList.add("dark")):r==="auto"&&(document.documentElement.classList.add("scheme-auto"),window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"))}applyTheme(){this.applyThemeClass(this.currentThemeValue||"brand")}applyThemeClass(r){let e=document.documentElement;Array.from(e.classList).forEach(t=>{t.startsWith("neutral-theme-")&&e.classList.remove(t)}),r!=="brand"&&e.classList.add(`neutral-theme-${r}`)}updateActiveThemeOption(){this.updateActiveThemeOptionFor(this.currentThemeValue||"brand")}updateActiveThemeOptionFor(r){this.hasThemeOptionTarget&&this.themeOptionTargets.forEach(e=>{let{theme:t}=e.dataset;t&&e.classList.toggle("color-scheme-switcher__theme-option--active",t===r)})}applyAccent(){this.applyAccentClass(this.currentAccentValue||"brand")}applyAccentClass(r){let e=document.documentElement;Array.from(e.classList).forEach(t=>{t.startsWith("accent-theme-")&&e.classList.remove(t)}),r!=="brand"&&e.classList.add(`accent-theme-${r}`)}updateActiveAccentOption(){this.updateActiveAccentOptionFor(this.currentAccentValue||"brand")}updateActiveAccentOptionFor(r){this.hasAccentOptionTarget&&this.accentOptionTargets.forEach(e=>{let{accent:t}=e.dataset;t&&e.classList.toggle("color-scheme-switcher__accent-option--active",t===r)})}updateThemeLabel(){this.updateThemeLabelText(this.currentThemeValue||"brand")}updateThemeLabelText(r){if(!this.hasThemeLabelTarget)return;let t=(this.hasThemeLabelsValue?this.themeLabelsValue:{})[r]||r.charAt(0).toUpperCase()+r.slice(1);this.themeLabelTarget.textContent=t}setKeyBadges(r){r.preventDefault();let{keyBadges:e}=r.currentTarget.dataset;if(e!=="show"&&e!=="hide")return;let t=e==="hide";document.documentElement.classList.toggle("hotkeys-hide-badges",t);try{t?localStorage.setItem("avo:hotkeys:hide_badges","1"):localStorage.removeItem("avo:hotkeys:hide_badges")}catch{}}};var pF=class extends Gt{static targets=["indicator"];switchTab(r){r.preventDefault();let e=r.currentTarget,t=e.closest(".tabs");t.parentElement.querySelectorAll(".tab-content").forEach(i=>i.classList.remove("active")),t.querySelectorAll(".tab-button").forEach(i=>i.classList.remove("active")),document.getElementById(e.dataset.tab)?.classList.add("active"),e.classList.add("active")}copy(r){let{copyText:e}=r.currentTarget.dataset;e&&navigator.clipboard.writeText(e).then(()=>{this.hasIndicatorTarget&&(this.indicatorTarget.classList.add("show"),setTimeout(()=>this.indicatorTarget.classList.remove("show"),2e3))})}};var mF=class extends Gt{static targets=["option"];navigate(r){if(!["ArrowDown","ArrowUp"].includes(r.key))return;r.preventDefault();let e=this.optionTargets,t=e.indexOf(document.activeElement),n=r.key==="ArrowDown"?(t+1)%e.length:(t-1+e.length)%e.length;e[n]?.focus()}};var gF=class extends Gt{copy(r){r.preventDefault();let e=this.context.element.dataset.text,t=document.createElement("textarea"),n=t.contentEditable,i=t.readOnly;t.value=e,t.contentEditable=!0,t.readOnly=!1,t.setAttribute("readonly",!1),t.setAttribute("contenteditable",!0),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t);let o=document.getSelection().rangeCount>0?document.getSelection().getRangeAt(0):!1;t.select(),t.setSelectionRange(0,999999),document.execCommand("copy"),document.body.removeChild(t),o&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(o)),t.contentEditable=n,t.readOnly=i;let a=this.element,l=a.innerHTML;a.innerHTML="Copied \u{1F44C}",a.classList.add("transition","opacity-80","bg-success/15","text-success-content"),setTimeout(()=>{a.innerHTML=l,a.classList.remove("opacity-80","bg-success/15","text-success-content")},1500)}};var vF=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Lb={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(r){return typeof console<"u"&&console.warn(r)},getWeek:function(r){var e=new Date(r.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};var yF={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(r){var e=r%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},bF=yF;var Uc=function(r,e){return e===void 0&&(e=2),("000"+r).slice(e*-1)},Sf=function(r){return r===!0?1:0};function T7(r,e){var t;return function(){var n=this,i=arguments;clearTimeout(t),t=setTimeout(function(){return r.apply(n,i)},e)}}var xF=function(r){return r instanceof Array?r:[r]};function jc(r,e,t){if(t===!0)return r.classList.add(e);r.classList.remove(e)}function ta(r,e,t){var n=window.document.createElement(r);return e=e||"",t=t||"",n.className=e,t!==void 0&&(n.textContent=t),n}function gC(r){for(;r.firstChild;)r.removeChild(r.firstChild)}function E7(r,e){if(e(r))return r;if(r.parentNode)return E7(r.parentNode,e)}function vC(r,e){var t=ta("div","numInputWrapper"),n=ta("input","numInput "+r),i=ta("span","arrowUp"),o=ta("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?n.type="number":(n.type="text",n.pattern="\\d*"),e!==void 0)for(var a in e)n.setAttribute(a,e[a]);return t.appendChild(n),t.appendChild(i),t.appendChild(o),t}function Tf(r){try{if(typeof r.composedPath=="function"){var e=r.composedPath();return e[0]}return r.target}catch{return r.target}}var k7=function(){},yC=function(r,e,t){return t.months[e?"shorthand":"longhand"][r]},_Ie={D:k7,F:function(r,e,t){r.setMonth(t.months.longhand.indexOf(e))},G:function(r,e){r.setHours((r.getHours()>=12?12:0)+parseFloat(e))},H:function(r,e){r.setHours(parseFloat(e))},J:function(r,e){r.setDate(parseFloat(e))},K:function(r,e,t){r.setHours(r.getHours()%12+12*Sf(new RegExp(t.amPM[1],"i").test(e)))},M:function(r,e,t){r.setMonth(t.months.shorthand.indexOf(e))},S:function(r,e){r.setSeconds(parseFloat(e))},U:function(r,e){return new Date(parseFloat(e)*1e3)},W:function(r,e,t){var n=parseInt(e),i=new Date(r.getFullYear(),0,2+(n-1)*7,0,0,0,0);return i.setDate(i.getDate()-i.getDay()+t.firstDayOfWeek),i},Y:function(r,e){r.setFullYear(parseFloat(e))},Z:function(r,e){return new Date(e)},d:function(r,e){r.setDate(parseFloat(e))},h:function(r,e){r.setHours((r.getHours()>=12?12:0)+parseFloat(e))},i:function(r,e){r.setMinutes(parseFloat(e))},j:function(r,e){r.setDate(parseFloat(e))},l:k7,m:function(r,e){r.setMonth(parseFloat(e)-1)},n:function(r,e){r.setMonth(parseFloat(e)-1)},s:function(r,e){r.setSeconds(parseFloat(e))},u:function(r,e){return new Date(parseFloat(e))},w:k7,y:function(r,e){r.setFullYear(2e3+parseFloat(e))}},Rv={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},dS={Z:function(r){return r.toISOString()},D:function(r,e,t){return e.weekdays.shorthand[dS.w(r,e,t)]},F:function(r,e,t){return yC(dS.n(r,e,t)-1,!1,e)},G:function(r,e,t){return Uc(dS.h(r,e,t))},H:function(r){return Uc(r.getHours())},J:function(r,e){return e.ordinal!==void 0?r.getDate()+e.ordinal(r.getDate()):r.getDate()},K:function(r,e){return e.amPM[Sf(r.getHours()>11)]},M:function(r,e){return yC(r.getMonth(),!0,e)},S:function(r){return Uc(r.getSeconds())},U:function(r){return r.getTime()/1e3},W:function(r,e,t){return t.getWeek(r)},Y:function(r){return Uc(r.getFullYear(),4)},d:function(r){return Uc(r.getDate())},h:function(r){return r.getHours()%12?r.getHours()%12:12},i:function(r){return Uc(r.getMinutes())},j:function(r){return r.getDate()},l:function(r,e){return e.weekdays.longhand[r.getDay()]},m:function(r){return Uc(r.getMonth()+1)},n:function(r){return r.getMonth()+1},s:function(r){return r.getSeconds()},u:function(r){return r.getTime()},w:function(r){return r.getDay()},y:function(r){return String(r.getFullYear()).substring(2)}};var A7=function(r){var e=r.config,t=e===void 0?Lb:e,n=r.l10n,i=n===void 0?yF:n,o=r.isMobile,a=o===void 0?!1:o;return function(l,u,f){var p=f||i;return t.formatDate!==void 0&&!a?t.formatDate(l,u,p):u.split("").map(function(b,S,C){return dS[b]&&C[S-1]!=="\\"?dS[b](l,p,t):b!=="\\"?b:""}).join("")}},_F=function(r){var e=r.config,t=e===void 0?Lb:e,n=r.l10n,i=n===void 0?yF:n;return function(o,a,l,u){if(!(o!==0&&!o)){var f=u||i,p,b=o;if(o instanceof Date)p=new Date(o.getTime());else if(typeof o!="string"&&o.toFixed!==void 0)p=new Date(o);else if(typeof o=="string"){var S=a||(t||Lb).dateFormat,C=String(o).trim();if(C==="today")p=new Date,l=!0;else if(t&&t.parseDate)p=t.parseDate(o,S);else if(/Z$/.test(C)||/GMT$/.test(C))p=new Date(o);else{for(var M=void 0,L=[],P=0,H=0,$="";P<S.length;P++){var Q=S[P],K=Q==="\\",te=S[P-1]==="\\"||K;if(Rv[Q]&&!te){$+=Rv[Q];var pe=new RegExp($).exec(o);pe&&(M=!0)&&L[Q!=="Y"?"push":"unshift"]({fn:_Ie[Q],val:pe[++H]})}else K||($+=".")}p=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),L.forEach(function(re){var ge=re.fn,_e=re.val;return p=ge(p,_e,f)||p}),p=M?p:void 0}}if(!(p instanceof Date&&!isNaN(p.getTime()))){t.errorHandler(new Error("Invalid date provided: "+b));return}return l===!0&&p.setHours(0,0,0,0),p}}};function Ef(r,e,t){return t===void 0&&(t=!0),t!==!1?new Date(r.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):r.getTime()-e.getTime()}var wIe=function(r,e,t){return r>Math.min(e,t)&&r<Math.max(e,t)},wF=function(r,e,t){return r*3600+e*60+t},SIe=function(r){var e=Math.floor(r/3600),t=(r-e*3600)/60;return[e,t,r-e*3600-t*60]},TIe={DAY:864e5};function SF(r){var e=r.defaultHour,t=r.defaultMinute,n=r.defaultSeconds;if(r.minDate!==void 0){var i=r.minDate.getHours(),o=r.minDate.getMinutes(),a=r.minDate.getSeconds();e<i&&(e=i),e===i&&t<o&&(t=o),e===i&&t===o&&n<a&&(n=r.minDate.getSeconds())}if(r.maxDate!==void 0){var l=r.maxDate.getHours(),u=r.maxDate.getMinutes();e=Math.min(e,l),e===l&&(t=Math.min(u,t)),e===l&&t===u&&(n=r.maxDate.getSeconds())}return{hours:e,minutes:t,seconds:n}}typeof Object.assign!="function"&&(Object.assign=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!r)throw TypeError("Cannot convert undefined or null to object");for(var n=function(l){l&&Object.keys(l).forEach(function(u){return r[u]=l[u]})},i=0,o=e;i<o.length;i++){var a=o[i];n(a)}return r});var Vc=function(){return Vc=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Vc.apply(this,arguments)},EIe=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var o=arguments[e],a=0,l=o.length;a<l;a++,i++)n[i]=o[a];return n},mzt=300;function gzt(r,e){var t={config:Vc(Vc({},Lb),Hl.defaultConfig),l10n:bF};t.parseDate=_F({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=L,t._setHoursFromDate=S,t._positionCalendar=ur,t.changeMonth=le,t.changeYear=Ot,t.clear=Ue,t.close=yt,t.onMouseOver=Ft,t._createElement=ta,t.createDay=pe,t.destroy=it,t.isEnabled=Wt,t.jumpToDate=$,t.updateValue=jn,t.open=dt,t.redraw=Et,t.set=_r,t.setDate=rt,t.toggle=$t;function n(){t.utils={getDaysInMonth:function(G,X){return G===void 0&&(G=t.currentMonth),X===void 0&&(X=t.currentYear),G===1&&(X%4===0&&X%100!==0||X%400===0)?29:t.l10n.daysInMonth[G]}}}function i(){t.element=t.input=r,t.isOpen=!1,fe(),ze(),si(),Zr(),n(),t.isMobile||te(),H(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&S(t.config.noCalendar?t.latestSelectedDateObj:void 0),jn(!1)),l();var G=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&G&&ur(),Nt("onReady")}function o(){var G;return((G=t.calendarContainer)===null||G===void 0?void 0:G.getRootNode()).activeElement||document.activeElement}function a(G){return G.bind(t)}function l(){var G=t.config;G.weekNumbers===!1&&G.showMonths===1||G.noCalendar!==!0&&window.requestAnimationFrame(function(){if(t.calendarContainer!==void 0&&(t.calendarContainer.style.visibility="hidden",t.calendarContainer.style.display="block"),t.daysContainer!==void 0){var X=(t.days.offsetWidth+1)*G.showMonths;t.daysContainer.style.width=X+"px",t.calendarContainer.style.width=X+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function u(G){if(t.selectedDates.length===0){var X=t.config.minDate===void 0||Ef(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),oe=SF(t.config);X.setHours(oe.hours,oe.minutes,oe.seconds,X.getMilliseconds()),t.selectedDates=[X],t.latestSelectedDateObj=X}G!==void 0&&G.type!=="blur"&&Qn(G);var be=t._input.value;b(),jn(),t._input.value!==be&&t._debouncedChange()}function f(G,X){return G%12+12*Sf(X===t.l10n.amPM[1])}function p(G){switch(G%24){case 0:case 12:return 12;default:return G%12}}function b(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var G=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,X=(parseInt(t.minuteElement.value,10)||0)%60,oe=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(G=f(G,t.amPM.textContent));var be=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Ef(t.latestSelectedDateObj,t.config.minDate,!0)===0,Oe=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Ef(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Ve=wF(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Qe=wF(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Ee=wF(G,X,oe);if(Ee>Qe&&Ee<Ve){var je=SIe(Ve);G=je[0],X=je[1],oe=je[2]}}else{if(Oe){var ot=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;G=Math.min(G,ot.getHours()),G===ot.getHours()&&(X=Math.min(X,ot.getMinutes())),X===ot.getMinutes()&&(oe=Math.min(oe,ot.getSeconds()))}if(be){var Dt=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;G=Math.max(G,Dt.getHours()),G===Dt.getHours()&&X<Dt.getMinutes()&&(X=Dt.getMinutes()),X===Dt.getMinutes()&&(oe=Math.max(oe,Dt.getSeconds()))}}C(G,X,oe)}}function S(G){var X=G||t.latestSelectedDateObj;X&&X instanceof Date&&C(X.getHours(),X.getMinutes(),X.getSeconds())}function C(G,X,oe){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(G%24,X,oe||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=Uc(t.config.time_24hr?G:(12+G)%12+12*Sf(G%12===0)),t.minuteElement.value=Uc(X),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Sf(G>=12)]),t.secondElement!==void 0&&(t.secondElement.value=Uc(oe)))}function M(G){var X=Tf(G),oe=parseInt(X.value)+(G.delta||0);(oe/1e3>1||G.key==="Enter"&&!/[^\d]/.test(oe.toString()))&&Ot(oe)}function L(G,X,oe,be){if(X instanceof Array)return X.forEach(function(Oe){return L(G,Oe,oe,be)});if(G instanceof Array)return G.forEach(function(Oe){return L(Oe,X,oe,be)});G.addEventListener(X,oe,be),t._handlers.push({remove:function(){return G.removeEventListener(X,oe,be)}})}function P(){Nt("onChange")}function H(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(oe){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+oe+"]"),function(be){return L(be,"click",t[oe])})}),t.isMobile){Pi();return}var G=T7(St,50);if(t._debouncedChange=T7(P,mzt),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&L(t.daysContainer,"mouseover",function(oe){t.config.mode==="range"&&Ft(Tf(oe))}),L(t._input,"keydown",tr),t.calendarContainer!==void 0&&L(t.calendarContainer,"keydown",tr),!t.config.inline&&!t.config.static&&L(window,"resize",G),window.ontouchstart!==void 0?L(window.document,"touchstart",ct):L(window.document,"mousedown",ct),L(window.document,"focus",ct,{capture:!0}),t.config.clickOpens===!0&&(L(t._input,"focus",t.open),L(t._input,"click",t.open)),t.daysContainer!==void 0&&(L(t.monthNav,"click",mo),L(t.monthNav,["keyup","increment"],M),L(t.daysContainer,"click",lr)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var X=function(oe){return Tf(oe).select()};L(t.timeContainer,["increment"],u),L(t.timeContainer,"blur",u,{capture:!0}),L(t.timeContainer,"click",Q),L([t.hourElement,t.minuteElement],["focus","click"],X),t.secondElement!==void 0&&L(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&L(t.amPM,"click",function(oe){u(oe)})}t.config.allowInput&&L(t._input,"blur",pr)}function $(G,X){var oe=G!==void 0?t.parseDate(G):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate<t.now?t.config.maxDate:t.now),be=t.currentYear,Oe=t.currentMonth;try{oe!==void 0&&(t.currentYear=oe.getFullYear(),t.currentMonth=oe.getMonth())}catch(Ve){Ve.message="Invalid date supplied: "+oe,t.config.errorHandler(Ve)}X&&t.currentYear!==be&&(Nt("onYearChange"),z()),X&&(t.currentYear!==be||t.currentMonth!==Oe)&&Nt("onMonthChange"),t.redraw()}function Q(G){var X=Tf(G);~X.className.indexOf("arrow")&&K(G,X.classList.contains("arrowUp")?1:-1)}function K(G,X,oe){var be=G&&Tf(G),Oe=oe||be&&be.parentNode&&be.parentNode.firstChild,Ve=Rr("increment");Ve.delta=X,Oe&&Oe.dispatchEvent(Ve)}function te(){var G=window.document.createDocumentFragment();if(t.calendarContainer=ta("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(G.appendChild(he()),t.innerContainer=ta("div","flatpickr-innerContainer"),t.config.weekNumbers){var X=ve(),oe=X.weekWrapper,be=X.weekNumbers;t.innerContainer.appendChild(oe),t.weekNumbers=be,t.weekWrapper=oe}t.rContainer=ta("div","flatpickr-rContainer"),t.rContainer.appendChild(ue()),t.daysContainer||(t.daysContainer=ta("div","flatpickr-days"),t.daysContainer.tabIndex=-1),V(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),G.appendChild(t.innerContainer)}t.config.enableTime&&G.appendChild(ie()),jc(t.calendarContainer,"rangeMode",t.config.mode==="range"),jc(t.calendarContainer,"animate",t.config.animate===!0),jc(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(G);var Oe=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Oe&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Ve=ta("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ve,t.element),Ve.appendChild(t.element),t.altInput&&Ve.appendChild(t.altInput),Ve.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function pe(G,X,oe,be){var Oe=Wt(X,!0),Ve=ta("span",G,X.getDate().toString());return Ve.dateObj=X,Ve.$i=be,Ve.setAttribute("aria-label",t.formatDate(X,t.config.ariaDateFormat)),G.indexOf("hidden")===-1&&Ef(X,t.now)===0&&(t.todayDateElem=Ve,Ve.classList.add("today"),Ve.setAttribute("aria-current","date")),Oe?(Ve.tabIndex=-1,br(X)&&(Ve.classList.add("selected"),t.selectedDateElem=Ve,t.config.mode==="range"&&(jc(Ve,"startRange",t.selectedDates[0]&&Ef(X,t.selectedDates[0],!0)===0),jc(Ve,"endRange",t.selectedDates[1]&&Ef(X,t.selectedDates[1],!0)===0),G==="nextMonthDay"&&Ve.classList.add("inRange")))):Ve.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Cn(X)&&!br(X)&&Ve.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&G!=="prevMonthDay"&&be%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(X)+"</span>"),Nt("onDayCreate",Ve),Ve}function re(G){G.focus(),t.config.mode==="range"&&Ft(G)}function ge(G){for(var X=G>0?0:t.config.showMonths-1,oe=G>0?t.config.showMonths:-1,be=X;be!=oe;be+=G)for(var Oe=t.daysContainer.children[be],Ve=G>0?0:Oe.children.length-1,Qe=G>0?Oe.children.length:-1,Ee=Ve;Ee!=Qe;Ee+=G){var je=Oe.children[Ee];if(je.className.indexOf("hidden")===-1&&Wt(je.dateObj))return je}}function _e(G,X){for(var oe=G.className.indexOf("Month")===-1?G.dateObj.getMonth():t.currentMonth,be=X>0?t.config.showMonths:-1,Oe=X>0?1:-1,Ve=oe-t.currentMonth;Ve!=be;Ve+=Oe)for(var Qe=t.daysContainer.children[Ve],Ee=oe-t.currentMonth===Ve?G.$i+X:X<0?Qe.children.length-1:0,je=Qe.children.length,ot=Ee;ot>=0&&ot<je&&ot!=(X>0?je:-1);ot+=Oe){var Dt=Qe.children[ot];if(Dt.className.indexOf("hidden")===-1&&Wt(Dt.dateObj)&&Math.abs(G.$i-ot)>=Math.abs(X))return re(Dt)}t.changeMonth(Oe),Fe(ge(Oe),0)}function Fe(G,X){var oe=o(),be=qt(oe||document.body),Oe=G!==void 0?G:be?oe:t.selectedDateElem!==void 0&&qt(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&qt(t.todayDateElem)?t.todayDateElem:ge(X>0?1:-1);Oe===void 0?t._input.focus():be?_e(Oe,X):re(Oe)}function ke(G,X){for(var oe=(new Date(G,X,1).getDay()-t.l10n.firstDayOfWeek+7)%7,be=t.utils.getDaysInMonth((X-1+12)%12,G),Oe=t.utils.getDaysInMonth(X,G),Ve=window.document.createDocumentFragment(),Qe=t.config.showMonths>1,Ee=Qe?"prevMonthDay hidden":"prevMonthDay",je=Qe?"nextMonthDay hidden":"nextMonthDay",ot=be+1-oe,Dt=0;ot<=be;ot++,Dt++)Ve.appendChild(pe("flatpickr-day "+Ee,new Date(G,X-1,ot),ot,Dt));for(ot=1;ot<=Oe;ot++,Dt++)Ve.appendChild(pe("flatpickr-day",new Date(G,X,ot),ot,Dt));for(var Vt=Oe+1;Vt<=42-oe&&(t.config.showMonths===1||Dt%7!==0);Vt++,Dt++)Ve.appendChild(pe("flatpickr-day "+je,new Date(G,X+1,Vt%Oe),Vt,Dt));var Ct=ta("div","dayContainer");return Ct.appendChild(Ve),Ct}function V(){if(t.daysContainer!==void 0){gC(t.daysContainer),t.weekNumbers&&gC(t.weekNumbers);for(var G=document.createDocumentFragment(),X=0;X<t.config.showMonths;X++){var oe=new Date(t.currentYear,t.currentMonth,1);oe.setMonth(t.currentMonth+X),G.appendChild(ke(oe.getFullYear(),oe.getMonth()))}t.daysContainer.appendChild(G),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&Ft()}}function z(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var G=function(be){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&be<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&be>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var X=0;X<12;X++)if(G(X)){var oe=ta("option","flatpickr-monthDropdown-month");oe.value=new Date(t.currentYear,X).getMonth().toString(),oe.textContent=yC(X,t.config.shorthandCurrentMonth,t.l10n),oe.tabIndex=-1,t.currentMonth===X&&(oe.selected=!0),t.monthsDropdownContainer.appendChild(oe)}}}function xe(){var G=ta("div","flatpickr-month"),X=window.document.createDocumentFragment(),oe;t.config.showMonths>1||t.config.monthSelectorType==="static"?oe=ta("span","cur-month"):(t.monthsDropdownContainer=ta("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),L(t.monthsDropdownContainer,"change",function(Qe){var Ee=Tf(Qe),je=parseInt(Ee.value,10);t.changeMonth(je-t.currentMonth),Nt("onMonthChange")}),z(),oe=t.monthsDropdownContainer);var be=vC("cur-year",{tabindex:"-1"}),Oe=be.getElementsByTagName("input")[0];Oe.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Oe.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Oe.setAttribute("max",t.config.maxDate.getFullYear().toString()),Oe.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ve=ta("div","flatpickr-current-month");return Ve.appendChild(oe),Ve.appendChild(be),X.appendChild(Ve),G.appendChild(X),{container:G,yearElement:Oe,monthElement:oe}}function Ie(){gC(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var G=t.config.showMonths;G--;){var X=xe();t.yearElements.push(X.yearElement),t.monthElements.push(X.monthElement),t.monthNav.appendChild(X.container)}t.monthNav.appendChild(t.nextMonthNav)}function he(){return t.monthNav=ta("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ta("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ta("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,Ie(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(G){t.__hidePrevMonthArrow!==G&&(jc(t.prevMonthNav,"flatpickr-disabled",G),t.__hidePrevMonthArrow=G)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(G){t.__hideNextMonthArrow!==G&&(jc(t.nextMonthNav,"flatpickr-disabled",G),t.__hideNextMonthArrow=G)}}),t.currentYearElement=t.yearElements[0],Fn(),t.monthNav}function ie(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var G=SF(t.config);t.timeContainer=ta("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var X=ta("span","flatpickr-time-separator",":"),oe=vC("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=oe.getElementsByTagName("input")[0];var be=vC("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=be.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Uc(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?G.hours:p(G.hours)),t.minuteElement.value=Uc(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():G.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(oe),t.timeContainer.appendChild(X),t.timeContainer.appendChild(be),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Oe=vC("flatpickr-second");t.secondElement=Oe.getElementsByTagName("input")[0],t.secondElement.value=Uc(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():G.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ta("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Oe)}return t.config.time_24hr||(t.amPM=ta("span","flatpickr-am-pm",t.l10n.amPM[Sf((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function ue(){t.weekdayContainer?gC(t.weekdayContainer):t.weekdayContainer=ta("div","flatpickr-weekdays");for(var G=t.config.showMonths;G--;){var X=ta("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(X)}return Me(),t.weekdayContainer}function Me(){if(t.weekdayContainer){var G=t.l10n.firstDayOfWeek,X=EIe(t.l10n.weekdays.shorthand);G>0&&G<X.length&&(X=EIe(X.splice(G,X.length),X.splice(0,G)));for(var oe=t.config.showMonths;oe--;)t.weekdayContainer.children[oe].innerHTML=`
657
657
  <span class='flatpickr-weekday'>
658
658
  `+X.join("</span><span class='flatpickr-weekday'>")+`
659
659
  </span>