/*! For license information please see vendor.js.LICENSE.txt */ (globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[]).push([[321],{2891:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Application:()=>Z,AttributeObserver:()=>w,Context:()=>j,Controller:()=>le,ElementObserver:()=>b,IndexedMultimap:()=>S,Multimap:()=>O,SelectorObserver:()=>C,StringMapObserver:()=>A,TokenListObserver:()=>N,ValueListObserver:()=>I,add:()=>E,defaultSchema:()=>Y,del:()=>k,fetch:()=>x,prune:()=>T});class r{constructor(e,t,n){this.eventTarget=e,this.eventName=t,this.eventOptions=n,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){const t=function(e){if("immediatePropagationStopped"in e)return e;{const{stopImmediatePropagation:t}=e;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}(e);for(const e of this.bindings){if(t.immediatePropagationStopped)break;e.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort(((e,t)=>{const n=e.index,r=t.index;return nr?1:0}))}}class i{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach((e=>e.connect())))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach((e=>e.disconnect())))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce(((e,t)=>e.concat(Array.from(t.values()))),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,n={}){this.application.handleError(e,`Error ${t}`,n)}clearEventListenersForBinding(e){const t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){const{eventTarget:t,eventName:n,eventOptions:r}=e,i=this.fetchEventListenerMapForEventTarget(t),o=this.cacheKey(n,r);i.delete(o),0==i.size&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){const{eventTarget:t,eventName:n,eventOptions:r}=e;return this.fetchEventListener(t,n,r)}fetchEventListener(e,t,n){const r=this.fetchEventListenerMapForEventTarget(e),i=this.cacheKey(t,n);let o=r.get(i);return o||(o=this.createEventListener(e,t,n),r.set(i,o)),o}createEventListener(e,t,n){const i=new r(e,t,n);return this.started&&i.connect(),i}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){const n=[e];return Object.keys(t).sort().forEach((e=>{n.push(`${t[e]?"":"!"}${e}`)})),n.join(":")}}const o={stop:({event:e,value:t})=>(t&&e.stopPropagation(),!0),prevent:({event:e,value:t})=>(t&&e.preventDefault(),!0),self:({event:e,value:t,element:n})=>!t||n===e.target},a=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function s(e){return e.replace(/(?:[_-])([a-z0-9])/g,((e,t)=>t.toUpperCase()))}function l(e){return s(e.replace(/--/g,"-").replace(/__/g,"_"))}function u(e){return e.charAt(0).toUpperCase()+e.slice(1)}function c(e){return e.replace(/([A-Z])/g,((e,t)=>`-${t.toLowerCase()}`))}function d(e){return null!=e}function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const p=/^(114|209)$/.test(n.j)?["meta","ctrl","alt","shift"]:null;class h{constructor(e,t,n,r){this.element=e,this.index=t,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||function(e){const t=e.tagName.toLowerCase();if(t in m)return m[t](e)}(e)||v("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||v("missing identifier"),this.methodName=n.methodName||v("missing method name"),this.keyFilter=n.keyFilter||"",this.schema=r}static forToken(e,t){return new this(e.element,e.index,function(e){const t=e.trim().match(a)||[];let n=t[2],r=t[3];return r&&!["keydown","keyup","keypress"].includes(n)&&(n+=`.${r}`,r=""),{eventTarget:(i=t[4],"window"==i?window:"document"==i?document:void 0),eventName:n,eventOptions:t[7]?(o=t[7],o.split(":").reduce(((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)})),{})):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||r};var i,o}(e.content),t)}toString(){const e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;const t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;const n=t.filter((e=>!p.includes(e)))[0];return!!n&&(f(this.keyMappings,n)||v(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[n].toLowerCase()!==e.key.toLowerCase())}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;const t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){const e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:n,value:r}of Array.from(this.element.attributes)){const i=n.match(t),o=i&&i[1];o&&(e[s(o)]=g(r))}return e}get eventTargetName(){return(e=this.eventTarget)==window?"window":e==document?"document":void 0;var e}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){const[n,r,i,o]=p.map((e=>t.includes(e)));return e.metaKey!==n||e.ctrlKey!==r||e.altKey!==i||e.shiftKey!==o}}const m={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:e=>"submit"==e.getAttribute("type")?"click":"input",select:()=>"change",textarea:()=>"input"};function v(e){throw new Error(e)}function g(e){try{return JSON.parse(e)}catch(t){return e}}class y{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){const t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){const e=this.controller[this.methodName];if("function"==typeof e)return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){const{element:t}=this.action,{actionDescriptorFilters:n}=this.context.application,{controller:r}=this.context;let i=!0;for(const[o,a]of Object.entries(this.eventOptions))if(o in n){const s=n[o];i=i&&s({name:o,value:a,event:e,element:t,controller:r})}return i}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){const{target:t,currentTarget:n}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:n,action:this.methodName})}catch(t){const{identifier:n,controller:r,element:i,index:o}=this,a={identifier:n,controller:r,element:i,index:o,event:e};this.context.handleError(t,`invoking action "${this.action}"`,a)}}willBeInvokedByEvent(e){const t=e.target;return!(e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e))&&!(e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e))&&(this.element===t||(t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element)))}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}}class b{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){const e=new Set(this.matchElementsInTree());for(const t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(const t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){"attributes"==e.type?this.processAttributeChange(e.target,e.attributeName):"childList"==e.type&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.processTree(e,this.removeElement)}}processAddedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.elementIsActive(e)&&this.processTree(e,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(const n of this.matchElementsInTree(e))t.call(this,n)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}}class w{constructor(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new b(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){const t=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector));return t.concat(n)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}}function E(e,t,n){x(e,t).add(n)}function k(e,t,n){x(e,t).delete(n),T(e,t)}function x(e,t){let n=e.get(t);return n||(n=new Set,e.set(t,n)),n}function T(e,t){const n=e.get(t);null!=n&&0==n.size&&e.delete(t)}class O{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce(((e,t)=>e.concat(Array.from(t))),[])}get size(){return Array.from(this.valuesByKey.values()).reduce(((e,t)=>e+t.size),0)}add(e,t){E(this.valuesByKey,e,t)}delete(e,t){k(this.valuesByKey,e,t)}has(e,t){const n=this.valuesByKey.get(e);return null!=n&&n.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some((t=>t.has(e)))}getValuesForKey(e){const t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter((([t,n])=>n.has(e))).map((([e,t])=>e))}}class S extends O{constructor(){super(),this.keysByValue=new Map}get values(){return Array.from(this.keysByValue.keys())}add(e,t){super.add(e,t),E(this.keysByValue,t,e)}delete(e,t){super.delete(e,t),k(this.keysByValue,t,e)}hasValue(e){return this.keysByValue.has(e)}getKeysForValue(e){const t=this.keysByValue.get(e);return t?Array.from(t):[]}}class C{constructor(e,t,n,r){this._selector=t,this.details=r,this.elementObserver=new b(e,this),this.delegate=n,this.matchesByElement=new O}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){const{selector:t}=this;if(t){const n=e.matches(t);return this.delegate.selectorMatchElement?n&&this.delegate.selectorMatchElement(e,this.details):n}return!1}matchElementsInTree(e){const{selector:t}=this;if(t){const n=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(t)).filter((e=>this.matchElement(e)));return n.concat(r)}return[]}elementMatched(e){const{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){const t=this.matchesByElement.getKeysForValue(e);for(const n of t)this.selectorUnmatched(e,n)}elementAttributeChanged(e,t){const{selector:n}=this;if(n){const t=this.matchElement(e),r=this.matchesByElement.has(n,e);t&&!r?this.selectorMatched(e,n):!t&&r&&this.selectorUnmatched(e,n)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}}class A{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(const e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){const t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){const n=this.delegate.getStringMapKeyForAttribute(e);if(null!=n){this.stringMap.has(e)||this.stringMapKeyAdded(n,e);const r=this.element.getAttribute(e);if(this.stringMap.get(e)!=r&&this.stringMapValueChanged(r,n,t),null==r){const t=this.stringMap.get(e);this.stringMap.delete(e),t&&this.stringMapKeyRemoved(n,e,t)}else this.stringMap.set(e,r)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,n){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,n)}stringMapKeyRemoved(e,t,n){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,n)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map((e=>e.name))}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class N{constructor(e,t,n){this.attributeObserver=new w(e,t,this),this.delegate=n,this.tokensByElement=new O}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){const[t,n]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(n)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach((e=>this.tokenMatched(e)))}tokensUnmatched(e){e.forEach((e=>this.tokenUnmatched(e)))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){const t=this.tokensByElement.getValuesForKey(e),n=this.readTokensForElement(e),r=function(e,t){const n=Math.max(e.length,t.length);return Array.from({length:n},((n,r)=>[e[r],t[r]]))}(t,n).findIndex((([e,t])=>{return r=t,!((n=e)&&r&&n.index==r.index&&n.content==r.content);var n,r}));return-1==r?[[],[]]:[t.slice(r),n.slice(r)]}readTokensForElement(e){const t=this.attributeName;return function(e,t,n){return e.trim().split(/\s+/).filter((e=>e.length)).map(((e,r)=>({element:t,attributeName:n,content:e,index:r})))}(e.getAttribute(t)||"",e,t)}}class I{constructor(e,t,n){this.tokenListObserver=new N(e,t,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).set(e,n),this.delegate.elementMatchedValue(t,n))}tokenUnmatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,n))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}}}class M{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new I(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){const t=new y(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){const t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach((e=>this.delegate.bindingDisconnected(e,!0))),this.bindingsByAction.clear()}parseValueForToken(e){const t=h.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}}class F{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new A(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){const n=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,n.writer(this.receiver[e]),n.writer(n.defaultValue))}stringMapValueChanged(e,t,n){const r=this.valueDescriptorNameMap[t];null!==e&&(null===n&&(n=r.writer(r.defaultValue)),this.invokeChangedCallback(t,e,n))}stringMapKeyRemoved(e,t,n){const r=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,r.writer(this.receiver[e]),n):this.invokeChangedCallback(e,r.writer(r.defaultValue),n)}invokeChangedCallbacksForDefaultValues(){for(const{key:e,name:t,defaultValue:n,writer:r}of this.valueDescriptors)null==n||this.controller.data.has(e)||this.invokeChangedCallback(t,r(n),void 0)}invokeChangedCallback(e,t,n){const r=`${e}Changed`,i=this.receiver[r];if("function"==typeof i){const r=this.valueDescriptorNameMap[e];try{const e=r.reader(t);let o=n;n&&(o=r.reader(n)),i.call(this.receiver,e,o)}catch(e){throw e instanceof TypeError&&(e.message=`Stimulus Value "${this.context.identifier}.${r.name}" - ${e.message}`),e}}}get valueDescriptors(){const{valueDescriptorMap:e}=this;return Object.keys(e).map((t=>e[t]))}get valueDescriptorNameMap(){const e={};return Object.keys(this.valueDescriptorMap).forEach((t=>{const n=this.valueDescriptorMap[t];e[n.name]=n})),e}hasValue(e){const t=`has${u(this.valueDescriptorNameMap[e].name)}`;return this.receiver[t]}}class P{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new O}start(){this.tokenListObserver||(this.tokenListObserver=new N(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var n;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause((()=>this.delegate.targetConnected(e,t))))}disconnectTarget(e,t){var n;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause((()=>this.delegate.targetDisconnected(e,t))))}disconnectAllTargets(){for(const e of this.targetsByName.keys)for(const t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function D(e,t){const n=L(e);return Array.from(n.reduce(((e,n)=>(function(e,t){const n=e[t];return Array.isArray(n)?n:[]}(n,t).forEach((t=>e.add(t))),e)),new Set))}function L(e){const t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}class _{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new O,this.outletElementsByName=new O,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach((e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)})),this.started=!0,this.dependentContexts.forEach((e=>e.refresh())))}refresh(){this.selectorObserverMap.forEach((e=>e.refresh())),this.attributeObserverMap.forEach((e=>e.refresh()))}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach((e=>e.stop())),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach((e=>e.stop())),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:n}){const r=this.getOutlet(e,n);r&&this.connectOutlet(r,e,n)}selectorUnmatched(e,t,{outletName:n}){const r=this.getOutletFromMap(e,n);r&&this.disconnectOutlet(r,e,n)}selectorMatchElement(e,{outletName:t}){const n=this.selector(t),r=this.hasOutlet(e,t),i=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return!!n&&r&&i&&e.matches(n)}elementMatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementAttributeValueChanged(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementUnmatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}connectOutlet(e,t,n){var r;this.outletElementsByName.has(n,t)||(this.outletsByName.add(n,e),this.outletElementsByName.add(n,t),null===(r=this.selectorObserverMap.get(n))||void 0===r||r.pause((()=>this.delegate.outletConnected(e,t,n))))}disconnectOutlet(e,t,n){var r;this.outletElementsByName.has(n,t)&&(this.outletsByName.delete(n,e),this.outletElementsByName.delete(n,t),null===(r=this.selectorObserverMap.get(n))||void 0===r||r.pause((()=>this.delegate.outletDisconnected(e,t,n))))}disconnectAllOutlets(){for(const e of this.outletElementsByName.keys)for(const t of this.outletElementsByName.getValuesForKey(e))for(const n of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(n,t,e)}updateSelectorObserverForOutlet(e){const t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){const t=this.selector(e),n=new C(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,n),n.start()}setupAttributeObserverForOutlet(e){const t=this.attributeNameForOutletName(e),n=new w(this.scope.element,t,this);this.attributeObserverMap.set(e,n),n.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find((t=>this.attributeNameForOutletName(t)===e))}get outletDependencies(){const e=new O;return this.router.modules.forEach((t=>{D(t.definition.controllerConstructor,"outlets").forEach((n=>e.add(n,t.identifier)))})),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const e=this.dependentControllerIdentifiers;return this.router.contexts.filter((t=>e.includes(t.identifier)))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find((t=>t.element===e))}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}}class j{constructor(e,t){this.logDebugActivity=(e,t={})=>{const{identifier:n,controller:r,element:i}=this;t=Object.assign({identifier:n,controller:r,element:i},t),this.application.logDebugActivity(this.identifier,e,t)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new M(this,this.dispatcher),this.valueObserver=new F(this,this.controller),this.targetObserver=new P(this,this),this.outletObserver=new _(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(e){this.handleError(e,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,n={}){const{identifier:r,controller:i,element:o}=this;n=Object.assign({identifier:r,controller:i,element:o},n),this.application.handleError(e,`Error ${t}`,n)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,n){this.invokeControllerMethod(`${l(n)}OutletConnected`,e,t)}outletDisconnected(e,t,n){this.invokeControllerMethod(`${l(n)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){const n=this.controller;"function"==typeof n[e]&&n[e](...t)}}const $="function"==typeof Object.getOwnPropertySymbols?e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]:Object.getOwnPropertyNames,R=(()=>{function e(e){function t(){return Reflect.construct(e,arguments,new.target)}return t.prototype=Object.create(e.prototype,{constructor:{value:t}}),Reflect.setPrototypeOf(t,e),t}try{return function(){const t=e((function(){this.a.call(this)}));t.prototype.a=function(){},new t}(),e}catch(e){return e=>class extends e{}}})();class B{constructor(e,t){this.application=e,this.definition=function(e){return{identifier:e.identifier,controllerConstructor:(t=e.controllerConstructor,function(e,t){const n=R(e),r=function(e,t){return $(t).reduce(((n,r)=>{const i=function(e,t,n){const r=Object.getOwnPropertyDescriptor(e,n);if(!r||!("value"in r)){const e=Object.getOwnPropertyDescriptor(t,n).value;return r&&(e.get=r.get||e.get,e.set=r.set||e.set),e}}(e,t,r);return i&&Object.assign(n,{[r]:i}),n}),{})}(e.prototype,t);return Object.defineProperties(n.prototype,r),n}(t,function(e){return D(e,"blessings").reduce(((t,n)=>{const r=n(e);for(const e in r){const n=t[e]||{};t[e]=Object.assign(n,r[e])}return t}),{})}(t)))};var t}(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){const t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){const t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new j(this,e),this.contextsByScope.set(e,t)),t}}class V{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){return(this.data.get(this.getDataKey(e))||"").match(/[^\s]+/g)||[]}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}}class z{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){const t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){const n=this.getAttributeNameForKey(e);return this.element.setAttribute(n,t),this.get(e)}has(e){const t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){const t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${c(e)}`}}class U{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,n){let r=this.warnedKeysByObject.get(e);r||(r=new Set,this.warnedKeysByObject.set(e,r)),r.has(t)||(r.add(t),this.logger.warn(n,e))}}function K(e,t){return`[${e}~="${t}"]`}class H{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findTarget(t)||this.findLegacyTarget(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllTargets(t),...this.findAllLegacyTargets(t)]),[])}findTarget(e){const t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){const t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){return K(this.schema.targetAttributeForScope(this.identifier),e)}findLegacyTarget(e){const t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){const t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map((t=>this.deprecate(t,e)))}getLegacySelectorForTargetName(e){const t=`${this.identifier}.${e}`;return K(this.schema.targetAttribute,t)}deprecate(e,t){if(e){const{identifier:n}=this,r=this.schema.targetAttribute,i=this.schema.targetAttributeForScope(n);this.guide.warn(e,`target:${t}`,`Please replace ${r}="${n}.${t}" with ${i}="${t}". The ${r} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}}class W{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findOutlet(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllOutlets(t)]),[])}getSelectorForOutletName(e){const t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){const t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){const t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter((n=>this.matchesElement(n,e,t)))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter((n=>this.matchesElement(n,e,t)))}matchesElement(e,t,n){const r=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&r.split(" ").includes(n)}}class q{constructor(e,t,n,r){this.targets=new H(this),this.classes=new V(this),this.data=new z(this),this.containsElement=e=>e.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=n,this.guide=new U(r),this.outlets=new W(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return K(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new q(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class Q{constructor(e,t,n){this.element=e,this.schema=t,this.delegate=n,this.valueListObserver=new I(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){const{element:t,content:n}=e;return this.parseValueForElementAndIdentifier(t,n)}parseValueForElementAndIdentifier(e,t){const n=this.fetchScopesByIdentifierForElement(e);let r=n.get(t);return r||(r=this.delegate.createScopeForElementAndIdentifier(e,t),n.set(t,r)),r}elementMatchedValue(e,t){const n=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,n),1==n&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){const n=this.scopeReferenceCounts.get(t);n&&(this.scopeReferenceCounts.set(t,n-1),1==n&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}}class G{constructor(e){this.application=e,this.scopeObserver=new Q(this.element,this.schema,this),this.scopesByIdentifier=new O,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce(((e,t)=>e.concat(t.contexts)),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);const t=new B(this.application,e);this.connectModule(t);const n=e.controllerConstructor.afterLoad;n&&n.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){const t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){const n=this.modulesByIdentifier.get(t);if(n)return n.contexts.find((t=>t.element==e))}proposeToConnectScopeForElementAndIdentifier(e,t){const n=this.scopeObserver.parseValueForElementAndIdentifier(e,t);n?this.scopeObserver.elementMatchedValue(n.element,n):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,n){this.application.handleError(e,t,n)}createScopeForElementAndIdentifier(e,t){return new q(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach((t=>e.connectContextForScope(t)))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach((t=>e.disconnectContextForScope(t)))}}const Y={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:e=>`data-${e}-target`,outletAttributeForScope:(e,t)=>`data-${e}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},X("abcdefghijklmnopqrstuvwxyz".split("").map((e=>[e,e])))),X("0123456789".split("").map((e=>[e,e]))))};function X(e){return e.reduce(((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n})),{})}class Z{constructor(e=document.documentElement,t=Y){this.logger=console,this.debug=!1,this.logDebugActivity=(e,t,n={})=>{this.debug&&this.logFormattedMessage(e,t,n)},this.element=e,this.schema=t,this.dispatcher=new i(this),this.router=new G(this),this.actionDescriptorFilters=Object.assign({},o)}static start(e,t){const n=new this(e,t);return n.start(),n}async start(){await new Promise((e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",(()=>e())):e()})),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach((e=>{e.controllerConstructor.shouldLoad&&this.router.loadDefinition(e)}))}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach((e=>this.router.unloadIdentifier(e)))}get controllers(){return this.router.contexts.map((e=>e.controller))}getControllerForElementAndIdentifier(e,t){const n=this.router.getContextForElementAndIdentifier(e,t);return n?n.controller:null}handleError(e,t,n){var r;this.logger.error("%s\n\n%o\n\n%o",t,e,n),null===(r=window.onerror)||void 0===r||r.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 J(e,t,n){return e.application.getControllerForElementAndIdentifier(t,n)}function ee(e,t,n){let r=J(e,t,n);return r||(e.application.router.proposeToConnectScopeForElementAndIdentifier(t,n),r=J(e,t,n),r||void 0)}function te([e,t],n){return function(e){const{token:t,typeDefinition:n}=e,r=`${c(t)}-value`,i=function(e){const{controller:t,token:n,typeDefinition:r}=e,i=function(e){const{controller:t,token:n,typeObject:r}=e,i=d(r.type),o=d(r.default),a=i&&o,s=i&&!o,l=!i&&o,u=ne(r.type),c=re(e.typeObject.default);if(s)return u;if(l)return c;if(u!==c)throw new Error(`The specified default value for the Stimulus Value "${t?`${t}.${n}`:n}" must match the defined type "${u}". The provided default value of "${r.default}" is of type "${c}".`);return a?u:void 0}({controller:t,token:n,typeObject:r}),o=re(r),a=ne(r),s=i||o||a;if(s)return s;throw new Error(`Unknown value type "${t?`${t}.${r}`:n}" for "${n}" value`)}(e);return{type:i,key:r,name:s(r),get defaultValue(){return function(e){const t=ne(e);if(t)return ie[t];const n=f(e,"default"),r=f(e,"type"),i=e;if(n)return i.default;if(r){const{type:e}=i,t=ne(e);if(t)return ie[t]}return e}(n)},get hasCustomDefaultValue(){return void 0!==re(n)},reader:oe[i],writer:ae[i]||ae.default}}({controller:n,token:e,typeDefinition:t})}function ne(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function re(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(e)?"array":"[object Object]"===Object.prototype.toString.call(e)?"object":void 0}const ie={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},oe={array(e){const t=JSON.parse(e);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${e}" of type "${re(t)}"`);return t},boolean:e=>!("0"==e||"false"==String(e).toLowerCase()),number:e=>Number(e.replace(/_/g,"")),object(e){const t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${e}" of type "${re(t)}"`);return t},string:e=>e},ae={default:function(e){return`${e}`},array:se,object:se};function se(e){return JSON.stringify(e)}class le{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:r=this.identifier,bubbles:i=!0,cancelable:o=!0}={}){const a=new CustomEvent(r?`${r}:${e}`:e,{detail:n,bubbles:i,cancelable:o});return t.dispatchEvent(a),a}}le.blessings=[function(e){return D(e,"classes").reduce(((e,t)=>{return Object.assign(e,{[`${n=t}Class`]:{get(){const{classes:e}=this;if(e.has(n))return e.get(n);{const t=e.getAttributeName(n);throw new Error(`Missing attribute "${t}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${u(n)}Class`]:{get(){return this.classes.has(n)}}});var n}),{})},function(e){return D(e,"targets").reduce(((e,t)=>{return Object.assign(e,{[`${n=t}Target`]:{get(){const e=this.targets.find(n);if(e)return e;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${u(n)}Target`]:{get(){return this.targets.has(n)}}});var n}),{})},function(e){const t=function(e,t){return L(e).reduce(((e,n)=>(e.push(...function(e,t){const n=e[t];return n?Object.keys(n).map((e=>[e,n[e]])):[]}(n,t)),e)),[])}(e,"values"),n={valueDescriptorMap:{get(){return t.reduce(((e,t)=>{const n=te(t,this.identifier),r=this.data.getAttributeNameForKey(n.key);return Object.assign(e,{[r]:n})}),{})}}};return t.reduce(((e,t)=>Object.assign(e,function(e,t){const n=te(e,void 0),{key:r,name:i,reader:o,writer:a}=n;return{[i]:{get(){const e=this.data.get(r);return null!==e?o(e):n.defaultValue},set(e){void 0===e?this.data.delete(r):this.data.set(r,a(e))}},[`has${u(i)}`]:{get(){return this.data.has(r)||n.hasCustomDefaultValue}}}}(t))),n)},function(e){return D(e,"outlets").reduce(((e,t)=>Object.assign(e,function(e){const t=l(e);return{[`${t}Outlet`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t){const n=ee(this,t,e);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}Outlets`]:{get(){const t=this.outlets.findAll(e);return t.length>0?t.map((t=>{const n=ee(this,t,e);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`,t)})).filter((e=>e)):[]}},[`${t}OutletElement`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t)return t;throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(e)}},[`has${u(t)}Outlet`]:{get(){return this.outlets.has(e)}}}}(t))),{})}],le.targets=[],le.outlets=[],le.values={}},5446:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>i}),/^(114|262|591|61)$/.test(n.j))var r=n(5581);function i(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&(0,r.Ng)(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}},6354:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>o}),/^(114|262|591|61)$/.test(n.j))var r=n(5581);if(/^(114|262|591|61)$/.test(n.j))var i=n(6906);function o(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),o=1,a=1;if((0,r.sb)(e)&&t){var s=e.offsetHeight,l=e.offsetWidth;l>0&&(o=(0,i.LI)(n.width)/l||1),s>0&&(a=(0,i.LI)(n.height)/s||1)}return{width:n.width/o,height:n.height/a,top:n.top/a,right:n.right/o,bottom:n.bottom/a,left:n.left/o,x:n.left/o,y:n.top/a}}},2883:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>y}),/^(114|262|591|61)$/.test(n.j))var r=n(4278);if(/^(114|262|591|61)$/.test(n.j))var i=n(5487);if(/^(114|262|591|61)$/.test(n.j))var o=n(8848);if(/^(114|262|591|61)$/.test(n.j))var a=n(3341);if(/^(114|262|591|61)$/.test(n.j))var s=n(5128);if(/^(114|262|591|61)$/.test(n.j))var l=n(9760);if(/^(114|262|591|61)$/.test(n.j))var u=n(271);if(/^(114|262|591|61)$/.test(n.j))var c=n(5581);if(/^(114|262|591|61)$/.test(n.j))var d=n(6354);if(/^(114|262|591|61)$/.test(n.j))var f=n(2083);if(/^(114|262|591|61)$/.test(n.j))var p=n(5446);if(/^(114|262|591|61)$/.test(n.j))var h=n(7604);if(/^(114|262|591|61)$/.test(n.j))var m=n(4426);if(/^(114|262|591|61)$/.test(n.j))var v=n(6906);function g(e,t){return t===r.R9?(0,m.A)((0,i.A)(e)):(0,c.vq)(t)?function(e){var t=(0,d.A)(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):(0,m.A)((0,o.A)((0,l.A)(e)))}function y(e,t,n){var r="clippingParents"===t?function(e){var t=(0,a.A)((0,f.A)(e)),n=["absolute","fixed"].indexOf((0,u.A)(e).position)>=0&&(0,c.sb)(e)?(0,s.A)(e):e;return(0,c.vq)(n)?t.filter((function(e){return(0,c.vq)(e)&&(0,p.A)(e,n)&&"body"!==(0,h.A)(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],l=i.reduce((function(t,n){var r=g(e,n);return t.top=(0,v.T9)(r.top,t.top),t.right=(0,v.jk)(r.right,t.right),t.bottom=(0,v.jk)(r.bottom,t.bottom),t.left=(0,v.T9)(r.left,t.left),t}),g(e,o));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}},7310:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>d}),/^(114|262|591|61)$/.test(n.j))var r=n(6354);if(/^(114|262|591|61)$/.test(n.j))var i=n(3318);if(/^(114|262|591|61)$/.test(n.j))var o=n(7604);if(/^(114|262|591|61)$/.test(n.j))var a=n(5581);if(/^(114|262|591|61)$/.test(n.j))var s=n(793);if(/^(114|262|591|61)$/.test(n.j))var l=n(9760);if(/^(114|262|591|61)$/.test(n.j))var u=n(134);if(/^(114|262|591|61)$/.test(n.j))var c=n(6906);function d(e,t,n){void 0===n&&(n=!1);var d=(0,a.sb)(t),f=(0,a.sb)(t)&&function(e){var t=e.getBoundingClientRect(),n=(0,c.LI)(t.width)/e.offsetWidth||1,r=(0,c.LI)(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),p=(0,l.A)(t),h=(0,r.A)(e,f),m={scrollLeft:0,scrollTop:0},v={x:0,y:0};return(d||!d&&!n)&&(("body"!==(0,o.A)(t)||(0,u.A)(p))&&(m=(0,i.A)(t)),(0,a.sb)(t)?((v=(0,r.A)(t,!0)).x+=t.clientLeft,v.y+=t.clientTop):p&&(v.x=(0,s.A)(p))),{x:h.left+m.scrollLeft-v.x,y:h.top+m.scrollTop-v.y,width:h.width,height:h.height}}},271:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>i}),/^(114|262|591|61)$/.test(n.j))var r=n(8979);function i(e){return(0,r.A)(e).getComputedStyle(e)}},9760:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>i}),/^(114|262|591|61)$/.test(n.j))var r=n(5581);function i(e){return(((0,r.vq)(e)?e.ownerDocument:e.document)||window.document).documentElement}},8848:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>l}),/^(114|262|591|61)$/.test(n.j))var r=n(9760);if(/^(114|262|591|61)$/.test(n.j))var i=n(271);if(/^(114|262|591|61)$/.test(n.j))var o=n(793);if(/^(114|262|591|61)$/.test(n.j))var a=n(222);if(/^(114|262|591|61)$/.test(n.j))var s=n(6906);function l(e){var t,n=(0,r.A)(e),l=(0,a.A)(e),u=null==(t=e.ownerDocument)?void 0:t.body,c=(0,s.T9)(n.scrollWidth,n.clientWidth,u?u.scrollWidth:0,u?u.clientWidth:0),d=(0,s.T9)(n.scrollHeight,n.clientHeight,u?u.scrollHeight:0,u?u.clientHeight:0),f=-l.scrollLeft+(0,o.A)(e),p=-l.scrollTop;return"rtl"===(0,i.A)(u||n).direction&&(f+=(0,s.T9)(n.clientWidth,u?u.clientWidth:0)-c),{width:c,height:d,x:f,y:p}}},6233:(e,t,n)=>{"use strict";function r(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}n.d(t,{A:()=>r})},6979:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>i}),/^(114|262|591|61)$/.test(n.j))var r=n(6354);function i(e){var t=(0,r.A)(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}},7604:(e,t,n)=>{"use strict";function r(e){return e?(e.nodeName||"").toLowerCase():null}n.d(t,{A:()=>r})},3318:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>s}),/^(114|262|591|61)$/.test(n.j))var r=n(222);if(/^(114|262|591|61)$/.test(n.j))var i=n(8979);if(/^(114|262|591|61)$/.test(n.j))var o=n(5581);if(/^(114|262|591|61)$/.test(n.j))var a=n(6233);function s(e){return e!==(0,i.A)(e)&&(0,o.sb)(e)?(0,a.A)(e):(0,r.A)(e)}},5128:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>c}),/^(114|262|591|61)$/.test(n.j))var r=n(8979);if(/^(114|262|591|61)$/.test(n.j))var i=n(7604);if(/^(114|262|591|61)$/.test(n.j))var o=n(271);if(/^(114|262|591|61)$/.test(n.j))var a=n(5581);if(/^(114|262|591|61)$/.test(n.j))var s=n(2063);if(/^(114|262|591|61)$/.test(n.j))var l=n(2083);function u(e){return(0,a.sb)(e)&&"fixed"!==(0,o.A)(e).position?e.offsetParent:null}function c(e){for(var t=(0,r.A)(e),n=u(e);n&&(0,s.A)(n)&&"static"===(0,o.A)(n).position;)n=u(n);return n&&("html"===(0,i.A)(n)||"body"===(0,i.A)(n)&&"static"===(0,o.A)(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&(0,a.sb)(e)&&"fixed"===(0,o.A)(e).position)return null;for(var n=(0,l.A)(e);(0,a.sb)(n)&&["html","body"].indexOf((0,i.A)(n))<0;){var r=(0,o.A)(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}},2083:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>a}),/^(114|262|591|61)$/.test(n.j))var r=n(7604);if(/^(114|262|591|61)$/.test(n.j))var i=n(9760);if(/^(114|262|591|61)$/.test(n.j))var o=n(5581);function a(e){return"html"===(0,r.A)(e)?e:e.assignedSlot||e.parentNode||((0,o.Ng)(e)?e.host:null)||(0,i.A)(e)}},9970:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>s}),/^(114|262|591|61)$/.test(n.j))var r=n(2083);if(/^(114|262|591|61)$/.test(n.j))var i=n(134);if(/^(114|262|591|61)$/.test(n.j))var o=n(7604);if(/^(114|262|591|61)$/.test(n.j))var a=n(5581);function s(e){return["html","body","#document"].indexOf((0,o.A)(e))>=0?e.ownerDocument.body:(0,a.sb)(e)&&(0,i.A)(e)?e:s((0,r.A)(e))}},5487:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>a}),/^(114|262|591|61)$/.test(n.j))var r=n(8979);if(/^(114|262|591|61)$/.test(n.j))var i=n(9760);if(/^(114|262|591|61)$/.test(n.j))var o=n(793);function a(e){var t=(0,r.A)(e),n=(0,i.A)(e),a=t.visualViewport,s=n.clientWidth,l=n.clientHeight,u=0,c=0;return a&&(s=a.width,l=a.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(u=a.offsetLeft,c=a.offsetTop)),{width:s,height:l,x:u+(0,o.A)(e),y:c}}},8979:(e,t,n)=>{"use strict";function r(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}n.d(t,{A:()=>r})},222:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>i}),/^(114|262|591|61)$/.test(n.j))var r=n(8979);function i(e){var t=(0,r.A)(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}},793:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>a}),/^(114|262|591|61)$/.test(n.j))var r=n(6354);if(/^(114|262|591|61)$/.test(n.j))var i=n(9760);if(/^(114|262|591|61)$/.test(n.j))var o=n(222);function a(e){return(0,r.A)((0,i.A)(e)).left+(0,o.A)(e).scrollLeft}},5581:(e,t,n)=>{"use strict";if(n.d(t,{Ng:()=>a,sb:()=>o,vq:()=>i}),/^(114|262|591|61)$/.test(n.j))var r=n(8979);function i(e){return e instanceof(0,r.A)(e).Element||e instanceof Element}function o(e){return e instanceof(0,r.A)(e).HTMLElement||e instanceof HTMLElement}function a(e){return"undefined"!=typeof ShadowRoot&&(e instanceof(0,r.A)(e).ShadowRoot||e instanceof ShadowRoot)}},134:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>i}),/^(114|262|591|61)$/.test(n.j))var r=n(271);function i(e){var t=(0,r.A)(e),n=t.overflow,i=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+i)}},2063:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>i}),/^(114|262|591|61)$/.test(n.j))var r=n(7604);function i(e){return["table","td","th"].indexOf((0,r.A)(e))>=0}},3341:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>s}),/^(114|262|591|61)$/.test(n.j))var r=n(9970);if(/^(114|262|591|61)$/.test(n.j))var i=n(2083);if(/^(114|262|591|61)$/.test(n.j))var o=n(8979);if(/^(114|262|591|61)$/.test(n.j))var a=n(134);function s(e,t){var n;void 0===t&&(t=[]);var l=(0,r.A)(e),u=l===(null==(n=e.ownerDocument)?void 0:n.body),c=(0,o.A)(l),d=u?[c].concat(c.visualViewport||[],(0,a.A)(l)?l:[]):l,f=t.concat(d);return u?f:f.concat(s((0,i.A)(d)))}},4278:(e,t,n)=>{"use strict";n.d(t,{DD:()=>v,GM:()=>g,Mn:()=>r,OM:()=>l,Ol:()=>m,R9:()=>f,WY:()=>d,_N:()=>c,ir:()=>h,kb:()=>a,ni:()=>u,pG:()=>o,qZ:()=>s,sQ:()=>i,xf:()=>p});var r="top",i="bottom",o="right",a="left",s="auto",l=[r,i,o,a],u="start",c="end",d="clippingParents",f="viewport",p="popper",h="reference",m=/^(114|262|591|61)$/.test(n.j)?l.reduce((function(e,t){return e.concat([t+"-"+u,t+"-"+c])}),[]):null,v=/^(114|262|591|61)$/.test(n.j)?[].concat(l,[s]).reduce((function(e,t){return e.concat([t,t+"-"+u,t+"-"+c])}),[]):null,g=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"]},1815:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>s}),/^(114|262|591|61)$/.test(n.j))var r=n(2632);if(/^(114|262|591|61)$/.test(n.j))var i=n(8101);if(/^(114|262|591|61)$/.test(n.j))var o=n(9703);if(/^(114|262|591|61)$/.test(n.j))var a=n(4278);function s(e){var t,n=e.reference,s=e.element,l=e.placement,u=l?(0,r.A)(l):null,c=l?(0,i.A)(l):null,d=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2;switch(u){case a.Mn:t={x:d,y:n.y-s.height};break;case a.sQ:t={x:d,y:n.y+n.height};break;case a.pG:t={x:n.x+n.width,y:f};break;case a.kb:t={x:n.x-s.width,y:f};break;default:t={x:n.x,y:n.y}}var p=u?(0,o.A)(u):null;if(null!=p){var h="y"===p?"height":"width";switch(c){case a.ni:t[p]=t[p]-(n[h]/2-s[h]/2);break;case a._N:t[p]=t[p]+(n[h]/2-s[h]/2)}}return t}},571:(e,t,n)=>{"use strict";function r(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}n.d(t,{A:()=>r})},9913:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>f}),/^(114|262|591|61)$/.test(n.j))var r=n(2883);if(/^(114|262|591|61)$/.test(n.j))var i=n(9760);if(/^(114|262|591|61)$/.test(n.j))var o=n(6354);if(/^(114|262|591|61)$/.test(n.j))var a=n(1815);if(/^(114|262|591|61)$/.test(n.j))var s=n(4426);if(/^(114|262|591|61)$/.test(n.j))var l=n(4278);if(/^(114|262|591|61)$/.test(n.j))var u=n(5581);if(/^(114|262|591|61)$/.test(n.j))var c=n(4318);if(/^(114|262|591|61)$/.test(n.j))var d=n(1007);function f(e,t){void 0===t&&(t={});var n=t,f=n.placement,p=void 0===f?e.placement:f,h=n.boundary,m=void 0===h?l.WY:h,v=n.rootBoundary,g=void 0===v?l.R9:v,y=n.elementContext,b=void 0===y?l.xf:y,w=n.altBoundary,E=void 0!==w&&w,k=n.padding,x=void 0===k?0:k,T=(0,c.A)("number"!=typeof x?x:(0,d.A)(x,l.OM)),O=b===l.xf?l.ir:l.xf,S=e.rects.popper,C=e.elements[E?O:b],A=(0,r.A)((0,u.vq)(C)?C:C.contextElement||(0,i.A)(e.elements.popper),m,g),N=(0,o.A)(e.elements.reference),I=(0,a.A)({reference:N,element:S,strategy:"absolute",placement:p}),M=(0,s.A)(Object.assign({},S,I)),F=b===l.xf?M:N,P={top:A.top-F.top+T.top,bottom:F.bottom-A.bottom+T.bottom,left:A.left-F.left+T.left,right:F.right-A.right+T.right},D=e.modifiersData.offset;if(b===l.xf&&D){var L=D[p];Object.keys(P).forEach((function(e){var t=[l.pG,l.sQ].indexOf(e)>=0?1:-1,n=[l.Mn,l.sQ].indexOf(e)>=0?"y":"x";P[e]+=L[n]*t}))}return P}},1007:(e,t,n)=>{"use strict";function r(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}n.d(t,{A:()=>r})},2632:(e,t,n)=>{"use strict";function r(e){return e.split("-")[0]}n.d(t,{A:()=>r})},7364:(e,t,n)=>{"use strict";function r(){return{top:0,right:0,bottom:0,left:0}}n.d(t,{A:()=>r})},9703:(e,t,n)=>{"use strict";function r(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}n.d(t,{A:()=>r})},8101:(e,t,n)=>{"use strict";function r(e){return e.split("-")[1]}n.d(t,{A:()=>r})},6906:(e,t,n)=>{"use strict";n.d(t,{LI:()=>o,T9:()=>r,jk:()=>i});var r=Math.max,i=Math.min,o=Math.round},844:(e,t,n)=>{"use strict";function r(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}n.d(t,{A:()=>r})},4318:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>i}),/^(114|262|591|61)$/.test(n.j))var r=n(7364);function i(e){return Object.assign({},(0,r.A)(),e)}},1206:(e,t,n)=>{"use strict";if(n.d(t,{A:()=>o}),/^(114|262|591|61)$/.test(n.j))var r=n(4278);function i(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}function o(e){var t=i(e);return r.GM.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}},4426:(e,t,n)=>{"use strict";function r(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}n.d(t,{A:()=>r})},1504:(e,t,n)=>{"use strict";if(n.d(t,{Ay:()=>b}),/^(262|61)$/.test(n.j))var r=n(7381);var i=n(2427),o=n.n(i),a=n(6931);function s(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}var l="undefined"!=typeof window&&"undefined"!=typeof document;function u(e,t){e&&("function"==typeof e&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function c(){return l&&document.createElement("div")}function d(e,t){if(e===t)return!0;if("object"==typeof e&&null!=e&&"object"==typeof t&&null!=t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e){if(!t.hasOwnProperty(n))return!1;if(!d(e[n],t[n]))return!1}return!0}return!1}function f(e){var t=[];return e.forEach((function(e){t.find((function(t){return d(e,t)}))||t.push(e)})),t}var p=/^(262|61)$/.test(n.j)?l?i.useLayoutEffect:i.useEffect:null;function h(e,t,n){n.split(/\s+/).forEach((function(n){n&&e.classList[t](n)}))}var m={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,n=function(){var t;return!!(null==(t=e.props.render)?void 0:t.$$tippy)};function r(){e.props.className&&!n()||h(t,"add",e.props.className)}return{onCreate:r,onBeforeUpdate:function(){n()&&h(t,"remove",e.props.className)},onAfterUpdate:r}}};function v(e){return function(t){var n,r,l=t.children,d=t.content,h=t.visible,v=t.singleton,g=t.render,y=t.reference,b=t.disabled,w=void 0!==b&&b,E=t.ignoreAttributes,k=void 0===E||E,x=(t.__source,t.__self,s(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),T=void 0!==h,O=void 0!==v,S=(0,i.useState)(!1),C=S[0],A=S[1],N=(0,i.useState)({}),I=N[0],M=N[1],F=(0,i.useState)(),P=F[0],D=F[1],L=(n=function(){return{container:c(),renders:1}},(r=(0,i.useRef)()).current||(r.current="function"==typeof n?n():n),r.current),_=Object.assign({ignoreAttributes:k},x,{content:L.container});T&&(_.trigger="manual",_.hideOnClick=!1),O&&(w=!0);var j=_,$=_.plugins||[];g&&(j=Object.assign({},_,{plugins:O&&null!=v.data?[].concat($,[{fn:function(){return{onTrigger:function(e,t){var n=v.data.children.find((function(e){return e.instance.reference===t.currentTarget}));e.state.$$activeSingletonInstance=n.instance,D(n.content)}}}}]):$,render:function(){return{popper:L.container}}}));var R=[y].concat(l?[l.type]:[]);return p((function(){var t=y;y&&y.hasOwnProperty("current")&&(t=y.current);var n=e(t||L.ref||c(),Object.assign({},j,{plugins:[m].concat(_.plugins||[])}));return L.instance=n,w&&n.disable(),h&&n.show(),O&&v.hook({instance:n,content:d,props:j,setSingletonContent:D}),A(!0),function(){n.destroy(),null==v||v.cleanup(n)}}),R),p((function(){var e,t,n,r,i;if(1!==L.renders){var o=L.instance;o.setProps((t=o.props,n=j,Object.assign({},n,{popperOptions:Object.assign({},t.popperOptions,n.popperOptions,{modifiers:f([].concat((null==(r=t.popperOptions)?void 0:r.modifiers)||[],(null==(i=n.popperOptions)?void 0:i.modifiers)||[]))})}))),null==(e=o.popperInstance)||e.forceUpdate(),w?o.disable():o.enable(),T&&(h?o.show():o.hide()),O&&v.hook({instance:o,content:d,props:j,setSingletonContent:D})}else L.renders++})),p((function(){var e;if(g){var t=L.instance;t.setProps({popperOptions:Object.assign({},t.props.popperOptions,{modifiers:[].concat(((null==(e=t.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t,n=e.state,r=null==(t=n.modifiersData)?void 0:t.hide;I.placement===n.placement&&I.referenceHidden===(null==r?void 0:r.isReferenceHidden)&&I.escaped===(null==r?void 0:r.hasPopperEscaped)||M({placement:n.placement,referenceHidden:null==r?void 0:r.isReferenceHidden,escaped:null==r?void 0:r.hasPopperEscaped}),n.attributes.popper={}}}])})})}}),[I.placement,I.referenceHidden,I.escaped].concat(R)),o().createElement(o().Fragment,null,l?(0,i.cloneElement)(l,{ref:function(e){L.ref=e,u(l.ref,e)}}):null,C&&(0,a.createPortal)(g?g(function(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}(I),P,L.instance):d,L.container))}}var g,y=/^(262|61)$/.test(n.j)?(g=v(r.Ay),(0,i.forwardRef)((function(e,t){var n=e.children,r=s(e,["children"]);return o().createElement(g,Object.assign({},undefined,r),n?(0,i.cloneElement)(n,{ref:function(e){u(t,e),u(n.ref,e)}}):null)}))):null;const b=/^(262|61)$/.test(n.j)?y:null},5533:e=>{e.exports=function(){for(var e=arguments.length,t=[],n=0;n{"use strict";var r=n(4994);t.__esModule=!0,t.default=function(e,t){e.classList?e.classList.add(t):(0,i.default)(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))};var i=r(n(598));e.exports=t.default},598:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")},e.exports=t.default},788:e=>{"use strict";function t(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}e.exports=function(e,n){e.classList?e.classList.remove(n):"string"==typeof e.className?e.className=t(e.className,n):e.setAttribute("class",t(e.className&&e.className.baseVal||"",n))}},4002:(e,t,n)=>{"use strict";var r=n(4994);t.__esModule=!0,t.default=t.animationEnd=t.animationDelay=t.animationTiming=t.animationDuration=t.animationName=t.transitionEnd=t.transitionDuration=t.transitionDelay=t.transitionTiming=t.transitionProperty=t.transform=void 0;var i,o,a,s,l,u,c,d,f,p,h,m=r(n(1833)),v="transform";if(t.transform=v,t.animationEnd=a,t.transitionEnd=o,t.transitionDelay=c,t.transitionTiming=u,t.transitionDuration=l,t.transitionProperty=s,t.animationDelay=h,t.animationTiming=p,t.animationDuration=f,t.animationName=d,m.default){var g=function(){for(var e,t,n=document.createElement("div").style,r={O:function(e){return"o"+e.toLowerCase()},Moz:function(e){return e.toLowerCase()},Webkit:function(e){return"webkit"+e},ms:function(e){return"MS"+e}},i=Object.keys(r),o="",a=0;a{"use strict";t.__esModule=!0,t.default=void 0;var n=!("undefined"==typeof window||!window.document||!window.document.createElement);t.default=n,e.exports=t.default},4602:(e,t,n)=>{"use strict";var r=n(4994);t.__esModule=!0,t.default=void 0;var i,o=r(n(1833)),a="clearTimeout",s=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-u)),r=setTimeout(e,n);return u=t,r},l=function(e,t){return e+(e?t[0].toUpperCase()+t.substr(1):t)+"AnimationFrame"};o.default&&["","webkit","moz","o","ms"].some((function(e){var t=l(e,"request");if(t in window)return a=l(e,"cancel"),s=function(e){return window[t](e)}}));var u=(new Date).getTime();(i=function(e){return s(e)}).cancel=function(e){window[a]&&"function"==typeof window[a]&&window[a](e)};var c=i;t.default=c,e.exports=t.default},4954:(e,t,n)=>{"use strict";n.d(t,{Bp:()=>we});var r=n(8587),i=n(8168),o=n(5556),a=n.n(o),s=n(2427);n(4363);let l=e=>"object"==typeof e&&null!=e&&1===e.nodeType,u=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,c=(e,t)=>{if(e.clientHeight{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeightot||o>e&&a=t&&s>=n?o-e-r:a>t&&sn?a-t+i:0,f=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t};var p=function(){return p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n1?n-1:0),i=1;i=n)&&(t=e>0?-1:o+1);var a=t+e;a<0?a=i?o:0:a>o&&(a=i?0:o);var s=x(e,a,n,r,i);return-1===s?t>=n?-1:t:s}function x(e,t,n,r,i){var o=r(t);if(!o||!o.hasAttribute("disabled"))return t;if(e>0){for(var a=t+1;a=0;s--)if(!r(s).hasAttribute("disabled"))return s;return i?e>0?x(1,0,n,r,!1):x(-1,n-1,n,r,!1):-1}function T(e,t,n,r){return void 0===r&&(r=!0),t.some((function(t){return t&&(v(t,e,n)||r&&v(t,n.document.activeElement,n))}))}var O=g((function(e){S(e).textContent=""}),500);function S(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var C=["isInitialMount","highlightedIndex","items","environment"],A={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};var N=g((function(e,t){var n,r,i;n=e(),i=S(r=t),n&&(i.textContent=n,O(r))}),200),I="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?s.useLayoutEffect:s.useEffect;function M(e){var t=e.id,n=void 0===t?"downshift-"+String(h++):t,r=e.labelId,i=e.menuId,o=e.getItemId,a=e.toggleButtonId,l=e.inputId;return(0,s.useRef)({labelId:r||n+"-label",menuId:i||n+"-menu",getItemId:o||function(e){return n+"-item-"+e},toggleButtonId:a||n+"-toggle-button",inputId:l||n+"-input"}).current}function F(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function P(e){var t=(0,s.useRef)(e);return t.current=e,t}function D(e,t,n){var r=(0,s.useRef)(),o=(0,s.useRef)(),a=(0,s.useCallback)((function(t,n){o.current=n,t=w(t,n.props);var r=e(t,n);return n.props.stateReducer(t,(0,i.A)({},n,{changes:r}))}),[e]),l=(0,s.useReducer)(a,t),u=l[0],c=l[1],d=P(n),f=(0,s.useCallback)((function(e){return c((0,i.A)({props:d.current},e))}),[d]),p=o.current;return(0,s.useEffect)((function(){p&&r.current&&r.current!==u&&function(e,t,n){var r=e.props,o=e.type,a={};Object.keys(t).forEach((function(r){!function(e,t,n,r){var o=t.props,a=t.type,s="on"+F(e)+"Change";o[s]&&void 0!==r[e]&&r[e]!==n[e]&&o[s]((0,i.A)({type:a},r))}(r,e,t,n),n[r]!==t[r]&&(a[r]=n[r])})),r.onStateChange&&Object.keys(a).length&&r.onStateChange((0,i.A)({type:o},a))}(p,w(r.current,p.props),u),r.current=u}),[u,n,p]),[u,f]}var L={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:function(e,t){if(e){var n=((e,t)=>{var n,r,i,o,a,s;if("undefined"==typeof document)return[];let{scrollMode:u,block:p,inline:h,boundary:m,skipOverflowHiddenElements:v}=t,g="function"==typeof m?m:e=>e!==m;if(!l(e))throw new TypeError("Invalid target");let y=document.scrollingElement||document.documentElement,b=[],w=e;for(;l(w)&&g(w);){if(w=f(w),w===y){b.push(w);break}null!=w&&w===document.body&&c(w)&&!c(document.documentElement)||null!=w&&c(w,v)&&b.push(w)}let E=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,k=null!=(o=null==(i=window.visualViewport)?void 0:i.height)?o:innerHeight,x=null!=(a=window.scrollX)?a:pageXOffset,T=null!=(s=window.scrollY)?s:pageYOffset,{height:O,width:S,top:C,right:A,bottom:N,left:I}=e.getBoundingClientRect(),M="start"===p||"nearest"===p?C:"end"===p?N:C+O/2,F="center"===h?I+S/2:"end"===h?A:I,P=[];for(let e=0;e=0&&I>=0&&N<=k&&A<=E&&C>=i&&N<=a&&I>=s&&A<=o)return P;let l=getComputedStyle(t),c=parseInt(l.borderLeftWidth,10),f=parseInt(l.borderTopWidth,10),m=parseInt(l.borderRightWidth,10),v=parseInt(l.borderBottomWidth,10),g=0,w=0,D="offsetWidth"in t?t.offsetWidth-t.clientWidth-c-m:0,L="offsetHeight"in t?t.offsetHeight-t.clientHeight-f-v:0,_="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,j="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(y===t)g="start"===p?M:"end"===p?M-k:"nearest"===p?d(T,T+k,k,f,v,T+M,T+M+O,O):M-k/2,w="start"===h?F:"center"===h?F-E/2:"end"===h?F-E:d(x,x+E,E,c,m,x+F,x+F+S,S),g=Math.max(0,g+T),w=Math.max(0,w+x);else{g="start"===p?M-i-f:"end"===p?M-a+v+L:"nearest"===p?d(i,a,n,f,v+L,M,M+O,O):M-(i+n/2)+L/2,w="start"===h?F-s-c:"center"===h?F-(s+r/2)+D/2:"end"===h?F-o+m+D:d(s,o,r,c,m+D,F,F+S,S);let{scrollLeft:e,scrollTop:l}=t;g=Math.max(0,Math.min(l+g/j,t.scrollHeight-n/j+L)),w=Math.max(0,Math.min(e+w/_,t.scrollWidth-r/_+D)),M+=l-g,F+=e-w}P.push({el:t,top:g,left:w})}return P})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r}))}},environment:"undefined"==typeof window?{}:window};function _(e,t,n){void 0===n&&(n=A);var r=e["default"+F(t)];return void 0!==r?r:n[t]}function j(e,t,n){void 0===n&&(n=A);var r=e[t];if(void 0!==r)return r;var i=e["initial"+F(t)];return void 0!==i?i:_(e,t,n)}function $(e,t,n){var r=e.items,i=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,a=t.selectedItem,s=t.highlightedIndex;return 0===r.length?-1:void 0!==i&&s===i?i:void 0!==o?o:a?r.indexOf(a):0===n?-1:n<0?r.length-1:0}var R=function(){return m};function B(e,t,n){var o=n.isInitialMount,a=n.highlightedIndex,l=n.items,u=n.environment,c=(0,r.A)(n,C);(0,s.useEffect)((function(){o||N((function(){return e((0,i.A)({highlightedIndex:a,highlightedItem:l[a],resultCount:l.length},c))}),u.document)}),t)}var V=m;function z(e,t,n){var r;void 0===n&&(n=!0);var o=(null==(r=e.items)?void 0:r.length)&&t>=0;return(0,i.A)({isOpen:!1,highlightedIndex:-1},o&&(0,i.A)({selectedItem:e.items[t],isOpen:_(e,"isOpen"),highlightedIndex:_(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}a().array.isRequired,a().func,a().func,a().func,a().number,a().number,a().number,a().bool,a().bool,a().bool,a().any,a().any,a().any,a().string,a().string,a().string,a().func,a().string,a().func,a().func,a().func,a().func,a().func,a().shape({addEventListener:a().func,removeEventListener:a().func,document:a().shape({getElementById:a().func,activeElement:a().any,body:a().any})}),p(p({},L),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?"".concat(n," result").concat(1===n?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}});var U=0,K=1,H=2,W=3,q=4,Q=5,G=6,Y=7,X=8,Z=9,J=10,ee=11,te=12,ne=13,re=14,ie=15,oe=16,ae=17,se=18,le=19,ue=20,ce=21,de=22,fe=Object.freeze({__proto__:null,InputKeyDownArrowDown:U,InputKeyDownArrowUp:K,InputKeyDownEscape:H,InputKeyDownHome:W,InputKeyDownEnd:q,InputKeyDownPageUp:Q,InputKeyDownPageDown:G,InputKeyDownEnter:Y,InputChange:X,InputBlur:Z,InputFocus:J,MenuMouseLeave:ee,ItemMouseMove:te,ItemClick:ne,ToggleButtonClick:re,FunctionToggleMenu:ie,FunctionOpenMenu:oe,FunctionCloseMenu:ae,FunctionSetHighlightedIndex:se,FunctionSelectItem:le,FunctionSetInputValue:ue,FunctionReset:ce,ControlledPropUpdatedSelectedItem:de});a().array.isRequired,a().func,a().func,a().func,a().func,a().number,a().number,a().number,a().bool,a().bool,a().bool,a().any,a().any,a().any,a().string,a().string,a().string,a().string,a().string,a().string,a().func,a().string,a().string,a().func,a().func,a().func,a().func,a().func,a().func,a().shape({addEventListener:a().func,removeEventListener:a().func,document:a().shape({getElementById:a().func,activeElement:a().any,body:a().any})});var pe=m,he=(0,i.A)({},L,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}});function me(e,t){var n,r,o=t.type,a=t.props,s=t.altKey;switch(o){case ne:r={isOpen:_(a,"isOpen"),highlightedIndex:_(a,"highlightedIndex"),selectedItem:a.items[t.index],inputValue:a.itemToString(a.items[t.index])};break;case U:r=e.isOpen?{highlightedIndex:k(1,e.highlightedIndex,a.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:s&&null==e.selectedItem?-1:$(a,e,1,t.getItemNodeFromIndex),isOpen:a.items.length>=0};break;case K:r=e.isOpen?s?z(a,e.highlightedIndex):{highlightedIndex:k(-1,e.highlightedIndex,a.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:$(a,e,-1,t.getItemNodeFromIndex),isOpen:a.items.length>=0};break;case Y:r=z(a,e.highlightedIndex);break;case H:r=(0,i.A)({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Q:r={highlightedIndex:k(-10,e.highlightedIndex,a.items.length,t.getItemNodeFromIndex,!1)};break;case G:r={highlightedIndex:k(10,e.highlightedIndex,a.items.length,t.getItemNodeFromIndex,!1)};break;case W:r={highlightedIndex:x(1,0,a.items.length,t.getItemNodeFromIndex,!1)};break;case q:r={highlightedIndex:x(-1,a.items.length-1,a.items.length,t.getItemNodeFromIndex,!1)};break;case Z:r=(0,i.A)({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=a.items)?void 0:n.length)&&t.selectItem&&{selectedItem:a.items[e.highlightedIndex],inputValue:a.itemToString(a.items[e.highlightedIndex])});break;case X:r={isOpen:!0,highlightedIndex:_(a,"highlightedIndex"),inputValue:t.inputValue};break;case J:r={isOpen:!0,highlightedIndex:$(a,e,0)};break;case le:r={selectedItem:t.selectedItem,inputValue:a.itemToString(t.selectedItem)};break;case de:r={inputValue:t.inputValue};break;default:return function(e,t,n){var r,o=t.type,a=t.props;switch(o){case n.ItemMouseMove:r={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:r={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:r={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:$(a,e,0)};break;case n.FunctionOpenMenu:r={isOpen:!0,highlightedIndex:$(a,e,0)};break;case n.FunctionCloseMenu:r={isOpen:!1};break;case n.FunctionSetHighlightedIndex:r={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:r={inputValue:t.inputValue};break;case n.FunctionReset:r={highlightedIndex:_(a,"highlightedIndex"),isOpen:_(a,"isOpen"),selectedItem:_(a,"selectedItem"),inputValue:_(a,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return(0,i.A)({},e,r)}(e,t,fe)}return(0,i.A)({},e,r)}var ve=["onMouseLeave","refKey","ref"],ge=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],ye=["onClick","onPress","refKey","ref"],be=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];function we(e){void 0===e&&(e={}),pe(e,we);var t=(0,i.A)({},he,e),n=t.initialIsOpen,o=t.defaultIsOpen,a=t.items,l=t.scrollIntoView,u=t.environment,c=t.getA11yStatusMessage,d=t.getA11ySelectionMessage,f=t.itemToString,p=function(e){var t=function(e){var t=j(e,"selectedItem"),n=j(e,"isOpen"),r=j(e,"highlightedIndex"),i=j(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:i}}(e),n=t.selectedItem,r=t.inputValue;return""===r&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(r=e.itemToString(n)),(0,i.A)({},t,{inputValue:r})}(t),h=function(e,t,n){var r=(0,s.useRef)(),i=D(e,t,n),o=i[0],a=i[1];return(0,s.useEffect)((function(){E(n,"selectedItem")&&(n.selectedItemChanged(r.current,n.selectedItem)&&a({type:de,inputValue:n.itemToString(n.selectedItem)}),r.current=o.selectedItem===r.current?n.selectedItem:o.selectedItem)}),[o.selectedItem,n.selectedItem]),[w(o,n),a]}(me,p,t),m=h[0],v=h[1],g=m.isOpen,k=m.highlightedIndex,x=m.selectedItem,O=m.inputValue,S=(0,s.useRef)(null),C=(0,s.useRef)({}),A=(0,s.useRef)(null),N=(0,s.useRef)(null),F=(0,s.useRef)(!0),L=M(t),_=(0,s.useRef)(),$=P({state:m,props:t}),z=(0,s.useCallback)((function(e){return C.current[L.getItemId(e)]}),[L]);B(c,[g,k,O,a],(0,i.A)({isInitialMount:F.current,previousResultCount:_.current,items:a,environment:u,itemToString:f},m)),B(d,[x],(0,i.A)({isInitialMount:F.current,previousResultCount:_.current,items:a,environment:u,itemToString:f},m));var fe=function(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,o=e.menuElement,a=e.scrollIntoView,l=(0,s.useRef)(!0);return I((function(){t<0||!n||!Object.keys(r.current).length||(!1===l.current?l.current=!0:a(i(t),o))}),[t]),l}({menuElement:S.current,highlightedIndex:k,isOpen:g,itemRefs:C,scrollIntoView:l,getItemNodeFromIndex:z});V({isInitialMount:F.current,props:t,state:m}),(0,s.useEffect)((function(){(n||o||g)&&A.current&&A.current.focus()}),[]),(0,s.useEffect)((function(){F.current||(_.current=a.length)}));var Ee=function(e,t,n,r){var i=(0,s.useRef)({isMouseDown:!1,isTouchMove:!1});return(0,s.useEffect)((function(){if(null!=(null==n?void 0:n.addEventListener)){var o=function(){i.current.isMouseDown=!0},a=function(o){i.current.isMouseDown=!1,e&&!T(o.target,t.map((function(e){return e.current})),n)&&r()},s=function(){i.current.isTouchMove=!1},l=function(){i.current.isTouchMove=!0},u=function(o){!e||i.current.isTouchMove||T(o.target,t.map((function(e){return e.current})),n,!1)||r()};return n.addEventListener("mousedown",o),n.addEventListener("mouseup",a),n.addEventListener("touchstart",s),n.addEventListener("touchmove",l),n.addEventListener("touchend",u),function(){n.removeEventListener("mousedown",o),n.removeEventListener("mouseup",a),n.removeEventListener("touchstart",s),n.removeEventListener("touchmove",l),n.removeEventListener("touchend",u)}}}),[e,n]),i}(g,[A,S,N],u,(function(){v({type:Z,selectItem:!1})})),ke=R("getInputProps","getMenuProps");(0,s.useEffect)((function(){return F.current=!1,function(){F.current=!0}}),[]),(0,s.useEffect)((function(){var e;if(g){if((null==(e=u.document)?void 0:e.activeElement)!==A.current){var t;null==A||null==(t=A.current)||t.focus()}}else C.current={}}),[g,u]);var xe=(0,s.useMemo)((function(){return{ArrowDown:function(e){e.preventDefault(),v({type:U,altKey:e.altKey,getItemNodeFromIndex:z})},ArrowUp:function(e){e.preventDefault(),v({type:K,altKey:e.altKey,getItemNodeFromIndex:z})},Home:function(e){$.current.state.isOpen&&(e.preventDefault(),v({type:W,getItemNodeFromIndex:z}))},End:function(e){$.current.state.isOpen&&(e.preventDefault(),v({type:q,getItemNodeFromIndex:z}))},Escape:function(e){var t=$.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),v({type:H}))},Enter:function(e){$.current.state.isOpen&&229!==e.which&&(e.preventDefault(),v({type:Y,getItemNodeFromIndex:z}))},PageUp:function(e){$.current.state.isOpen&&(e.preventDefault(),v({type:Q,getItemNodeFromIndex:z}))},PageDown:function(e){$.current.state.isOpen&&(e.preventDefault(),v({type:G,getItemNodeFromIndex:z}))}}}),[v,$,z]),Te=(0,s.useCallback)((function(e){return(0,i.A)({id:L.labelId,htmlFor:L.inputId},e)}),[L]),Oe=(0,s.useCallback)((function(e,t){var n,o=void 0===e?{}:e,a=o.onMouseLeave,s=o.refKey,l=void 0===s?"ref":s,u=o.ref,c=(0,r.A)(o,ve),d=(void 0===t?{}:t).suppressRefError;return ke("getMenuProps",void 0!==d&&d,l,S),(0,i.A)(((n={})[l]=b(u,(function(e){S.current=e})),n.id=L.menuId,n.role="listbox",n["aria-labelledby"]=c&&c["aria-label"]?void 0:""+L.labelId,n.onMouseLeave=y(a,(function(){v({type:ee})})),n),c)}),[v,ke,L]),Se=(0,s.useCallback)((function(e){var t,n,o=void 0===e?{}:e,a=o.item,s=o.index,l=o.refKey,u=void 0===l?"ref":l,c=o.ref,d=o.onMouseMove,f=o.onMouseDown,p=o.onClick;o.onPress;var h=o.disabled,m=(0,r.A)(o,ge),g=$.current,w=g.props,E=g.state,k=function(e,t,n,r){var i,o;if(void 0===e){if(void 0===t)throw new Error(r);i=n[t],o=t}else o=void 0===t?n.indexOf(e):t,i=e;return[i,o]}(a,s,w.items,"Pass either item or index to getItemProps!")[1],x=p;return(0,i.A)(((t={})[u]=b(c,(function(e){e&&(C.current[L.getItemId(k)]=e)})),t.disabled=h,t.role="option",t["aria-selected"]=""+(k===E.highlightedIndex),t.id=L.getItemId(k),t),!h&&((n={}).onClick=y(x,(function(){v({type:ne,index:k})})),n),{onMouseMove:y(d,(function(){k!==E.highlightedIndex&&(fe.current=!1,v({type:te,index:k,disabled:h}))})),onMouseDown:y(f,(function(e){return e.preventDefault()}))},m)}),[v,$,fe,L]),Ce=(0,s.useCallback)((function(e){var t,n=void 0===e?{}:e,o=n.onClick;n.onPress;var a=n.refKey,s=void 0===a?"ref":a,l=n.ref,u=(0,r.A)(n,ye),c=$.current.state;return(0,i.A)(((t={})[s]=b(l,(function(e){N.current=e})),t["aria-controls"]=L.menuId,t["aria-expanded"]=c.isOpen,t.id=L.toggleButtonId,t.tabIndex=-1,t),!u.disabled&&(0,i.A)({},{onClick:y(o,(function(){v({type:re})}))}),u)}),[v,$,L]),Ae=(0,s.useCallback)((function(e,t){var n,o=void 0===e?{}:e,a=o.onKeyDown,s=o.onChange,l=o.onInput,c=o.onFocus,d=o.onBlur;o.onChangeText;var f=o.refKey,p=void 0===f?"ref":f,h=o.ref,m=(0,r.A)(o,be),g=(void 0===t?{}:t).suppressRefError;ke("getInputProps",void 0!==g&&g,p,A);var w,E=$.current.state,k={};return m.disabled||((w={}).onChange=y(s,l,(function(e){v({type:X,inputValue:e.target.value})})),w.onKeyDown=y(a,(function(e){var t=function(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}(e);t&&xe[t]&&xe[t](e)})),w.onBlur=y(d,(function(e){if(E.isOpen&&!Ee.current.isMouseDown){var t=null===e.relatedTarget&&u.document.activeElement!==u.document.body;v({type:Z,selectItem:!t})}})),w.onFocus=y(c,(function(){E.isOpen||v({type:J})})),k=w),(0,i.A)(((n={})[p]=b(h,(function(e){A.current=e})),n["aria-activedescendant"]=E.isOpen&&E.highlightedIndex>-1?L.getItemId(E.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=L.menuId,n["aria-expanded"]=E.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:""+L.labelId,n.autoComplete="off",n.id=L.inputId,n.role="combobox",n.value=E.inputValue,n),k,m)}),[ke,$,L,xe,v,Ee,u]),Ne=(0,s.useCallback)((function(){v({type:ie})}),[v]),Ie=(0,s.useCallback)((function(){v({type:ae})}),[v]),Me=(0,s.useCallback)((function(){v({type:oe})}),[v]),Fe=(0,s.useCallback)((function(e){v({type:se,highlightedIndex:e})}),[v]),Pe=(0,s.useCallback)((function(e){v({type:le,selectedItem:e})}),[v]);return{getItemProps:Se,getLabelProps:Te,getMenuProps:Oe,getInputProps:Ae,getToggleButtonProps:Ce,toggleMenu:Ne,openMenu:Me,closeMenu:Ie,setHighlightedIndex:Fe,setInputValue:(0,s.useCallback)((function(e){v({type:ue,inputValue:e})}),[v]),selectItem:Pe,reset:(0,s.useCallback)((function(){v({type:ce})}),[v]),highlightedIndex:k,isOpen:g,selectedItem:x,inputValue:O}}we.stateChangeTypes=fe,a().array,a().array,a().array,a().func,a().func,a().func,a().number,a().number,a().number,a().func,a().func,a().string,a().string,a().shape({addEventListener:a().func,removeEventListener:a().func,document:a().shape({getElementById:a().func,activeElement:a().any,body:a().any})})},1688:(e,t,n)=>{var r=n(4708);n(4160).FocusTrapReact=r,e.exports=r},2427:(e,t,n)=>{var r=n(6540);n(4160).React=r,e.exports=r},6931:(e,t,n)=>{var r=n(961);n(4160).ReactDOM=r,e.exports=r},862:(e,t,n)=>{var r=n(1663);n(4160).CSSTransitionGroup=r,e.exports=r},4160:(e,t,n)=>{"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},4708:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n1?r-1:0),o=1;o element.");return l.cloneElement(t,{ref:function(n){var r=e.props.containerElements;t&&("function"==typeof t.ref?t.ref(n):t.ref&&(t.ref.current=n)),e.focusTrapElements=r||[n]}})}return null}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),h}(l.Component),h="undefined"==typeof Element?Function:Element;p.propTypes={active:c.bool,paused:c.bool,focusTrapOptions:c.shape({document:c.object,onActivate:c.func,onPostActivate:c.func,checkCanFocusTrap:c.func,onDeactivate:c.func,onPostDeactivate:c.func,checkCanReturnFocus:c.func,initialFocus:c.oneOfType([c.instanceOf(h),c.string,c.bool,c.func]),fallbackFocus:c.oneOfType([c.instanceOf(h),c.string,c.func]),escapeDeactivates:c.oneOfType([c.bool,c.func]),clickOutsideDeactivates:c.oneOfType([c.bool,c.func]),returnFocusOnDeactivate:c.bool,setReturnFocus:c.oneOfType([c.instanceOf(h),c.string,c.bool,c.func]),allowOutsideClick:c.oneOfType([c.bool,c.func]),preventScroll:c.bool,tabbableOptions:c.shape({displayCheck:c.oneOf(["full","non-zero-area","none"]),getShadowRoot:c.oneOfType([c.bool,c.func])})}),containerElements:c.arrayOf(c.instanceOf(h)),children:c.oneOfType([c.element,c.instanceOf(h)])},p.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:d},e.exports=p},2697:(e,t,n)=>{"use strict";if(n.r(t),n.d(t,{createFocusTrap:()=>p}),/^(125|61)$/.test(n.j))var r=n(9054);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t0){var t=s[s.length-1];t!==e&&t.pause()}var n=s.indexOf(e);-1===n||s.splice(n,1),s.push(e)},deactivateTrap:function(e){var t=s.indexOf(e);-1!==t&&s.splice(t,1),s.length>0&&s[s.length-1].unpause()}}),u=function(e){return setTimeout(e,0)},c=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},d=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?n-1:0),o=1;o=0)e=i.activeElement;else{var t=s.tabbableGroups[0];e=t&&t.firstTabbableNode||m("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},g=function(){if(s.containerGroups=s.containers.map((function(e){var t=(0,r.tabbable)(e,a.tabbableOptions),n=(0,r.focusable)(e,a.tabbableOptions);return{container:e,tabbableNodes:t,focusableNodes:n,firstTabbableNode:t.length>0?t[0]:null,lastTabbableNode:t.length>0?t[t.length-1]:null,nextTabbableNode:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=n.findIndex((function(t){return t===e}));if(!(i<0))return t?n.slice(i+1).find((function(e){return(0,r.isTabbable)(e,a.tabbableOptions)})):n.slice(0,i).reverse().find((function(e){return(0,r.isTabbable)(e,a.tabbableOptions)}))}}})),s.tabbableGroups=s.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),s.tabbableGroups.length<=0&&!m("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},y=function e(t){!1!==t&&t!==i.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!a.preventScroll}),s.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(v()))},b=function(e){var t=m("setReturnFocus",e);return t||!1!==t&&e},w=function(e){var t=f(e);h(t)>=0||(d(a.clickOutsideDeactivates,e)?n.deactivate({returnFocus:a.returnFocusOnDeactivate&&!(0,r.isFocusable)(t,a.tabbableOptions)}):d(a.allowOutsideClick,e)||e.preventDefault())},E=function(e){var t=f(e),n=h(t)>=0;n||t instanceof Document?n&&(s.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),y(s.mostRecentlyFocusedNode||v()))},k=function(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e)&&!1!==d(a.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){var t=f(e);g();var n=null;if(s.tabbableGroups.length>0){var i=h(t),o=i>=0?s.containerGroups[i]:void 0;if(i<0)n=e.shiftKey?s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:s.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var l=c(s.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(l<0&&(o.container===t||(0,r.isFocusable)(t,a.tabbableOptions)&&!(0,r.isTabbable)(t,a.tabbableOptions)&&!o.nextTabbableNode(t,!1))&&(l=i),l>=0){var u=0===l?s.tabbableGroups.length-1:l-1;n=s.tabbableGroups[u].lastTabbableNode}}else{var d=c(s.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(d<0&&(o.container===t||(0,r.isFocusable)(t,a.tabbableOptions)&&!(0,r.isTabbable)(t,a.tabbableOptions)&&!o.nextTabbableNode(t))&&(d=i),d>=0){var p=d===s.tabbableGroups.length-1?0:d+1;n=s.tabbableGroups[p].firstTabbableNode}}}else n=m("fallbackFocus");n&&(e.preventDefault(),y(n))}(e)},x=function(e){var t=f(e);h(t)>=0||d(a.clickOutsideDeactivates,e)||d(a.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},T=function(){if(s.active)return l.activateTrap(n),s.delayInitialFocusTimer=a.delayInitialFocus?u((function(){y(v())})):y(v()),i.addEventListener("focusin",E,!0),i.addEventListener("mousedown",w,{capture:!0,passive:!1}),i.addEventListener("touchstart",w,{capture:!0,passive:!1}),i.addEventListener("click",x,{capture:!0,passive:!1}),i.addEventListener("keydown",k,{capture:!0,passive:!1}),n},O=function(){if(s.active)return i.removeEventListener("focusin",E,!0),i.removeEventListener("mousedown",w,!0),i.removeEventListener("touchstart",w,!0),i.removeEventListener("click",x,!0),i.removeEventListener("keydown",k,!0),n};return(n={get active(){return s.active},get paused(){return s.paused},activate:function(e){if(s.active)return this;var t=p(e,"onActivate"),n=p(e,"onPostActivate"),r=p(e,"checkCanFocusTrap");r||g(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=i.activeElement,t&&t();var o=function(){r&&g(),T(),n&&n()};return r?(r(s.containers.concat()).then(o,o),this):(o(),this)},deactivate:function(e){if(!s.active)return this;var t=o({onDeactivate:a.onDeactivate,onPostDeactivate:a.onPostDeactivate,checkCanReturnFocus:a.checkCanReturnFocus},e);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,O(),s.active=!1,s.paused=!1,l.deactivateTrap(n);var r=p(t,"onDeactivate"),i=p(t,"onPostDeactivate"),c=p(t,"checkCanReturnFocus"),d=p(t,"returnFocus","returnFocusOnDeactivate");r&&r();var f=function(){u((function(){d&&y(b(s.nodeFocusedBeforeActivation)),i&&i()}))};return d&&c?(c(b(s.nodeFocusedBeforeActivation)).then(f,f),this):(f(),this)},pause:function(){return s.paused||!s.active||(s.paused=!0,O()),this},unpause:function(){return s.paused&&s.active?(s.paused=!1,g(),T(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return s.containers=t.map((function(e){return"string"==typeof e?i.querySelector(e):e})),s.active&&g(),this}}).updateContainerElements(e),n}},4146:(e,t,n)=>{"use strict";var r=n(3404),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var i=p(n);i&&i!==h&&e(t,i,r)}var a=c(n);d&&(a=a.concat(d(n)));for(var s=l(t),m=l(n),v=0;v{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,v=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function E(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case d:case o:case s:case a:case p:return e;default:switch(e=e&&e.$$typeof){case u:case f:case v:case m:case l:return e;default:return t}}case i:return t}}}function k(e){return E(e)===d}t.AsyncMode=c,t.ConcurrentMode=d,t.ContextConsumer=u,t.ContextProvider=l,t.Element=r,t.ForwardRef=f,t.Fragment=o,t.Lazy=v,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=a,t.Suspense=p,t.isAsyncMode=function(e){return k(e)||E(e)===c},t.isConcurrentMode=k,t.isContextConsumer=function(e){return E(e)===u},t.isContextProvider=function(e){return E(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return E(e)===f},t.isFragment=function(e){return E(e)===o},t.isLazy=function(e){return E(e)===v},t.isMemo=function(e){return E(e)===m},t.isPortal=function(e){return E(e)===i},t.isProfiler=function(e){return E(e)===s},t.isStrictMode=function(e){return E(e)===a},t.isSuspense=function(e){return E(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===s||e===a||e===p||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===l||e.$$typeof===u||e.$$typeof===f||e.$$typeof===y||e.$$typeof===b||e.$$typeof===w||e.$$typeof===g)},t.typeOf=E},3404:(e,t,n)=>{"use strict";e.exports=n(3072)},5228:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var o,a,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l{"use strict";var r=n(6925);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},5556:(e,t,n)=>{e.exports=n(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2551:(e,t,n)=>{"use strict";var r=n(2427),i=n(5228),o=n(9982);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n