plutonium 0.15.24 → 0.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/plutonium.css +1 -1
- data/app/assets/plutonium.js +43 -9
- data/app/assets/plutonium.js.map +3 -3
- data/app/assets/plutonium.min.js +14 -14
- data/app/assets/plutonium.min.js.map +4 -4
- data/lib/plutonium/core/controllers/authorizable.rb +5 -3
- data/lib/plutonium/ui/component/methods.rb +1 -0
- data/lib/plutonium/ui/display/theme.rb +1 -0
- data/lib/plutonium/ui/form/base.rb +19 -5
- data/lib/plutonium/ui/form/components/belongs_to.rb +22 -0
- data/lib/plutonium/ui/form/components/has_many.rb +22 -0
- data/lib/plutonium/ui/form/components/intl_tel_input.rb +24 -0
- data/lib/plutonium/ui/form/options/inferred_types.rb +7 -4
- data/lib/plutonium/ui/form/theme.rb +6 -1
- data/lib/plutonium/ui/layout/base.rb +11 -0
- data/lib/plutonium/ui/table/display_theme.rb +1 -0
- data/lib/plutonium/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- data/src/css/slim_select.css +4 -4
- data/src/js/controllers/easymde_controller.js +3 -3
- data/src/js/controllers/flatpickr_controller.js +3 -3
- data/src/js/controllers/intl_tel_input_controller.js +39 -0
- data/src/js/controllers/register_controllers.js +2 -0
- data/src/js/controllers/slim_select_controller.js +3 -3
- metadata +6 -2
data/app/assets/plutonium.min.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
(()=>{var Il=Object.create;var Ao=Object.defineProperty;var Ol=Object.getOwnPropertyDescriptor;var Rl=Object.getOwnPropertyNames;var Ml=Object.getPrototypeOf,Pl=Object.prototype.hasOwnProperty;var Dl=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Fl=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Rl(e))!Pl.call(i,n)&&n!==t&&Ao(i,n,{get:()=>e[n],enumerable:!(r=Ol(e,n))||r.enumerable});return i};var Bl=(i,e,t)=>(t=i!=null?Il(Ml(i)):{},Fl(e||!i||!i.__esModule?Ao(t,"default",{value:i,enumerable:!0}):t,i));var qo=Dl((rp,Ho)=>{var xc="Expected a function",Bo=NaN,Lc="[object Symbol]",Cc=/^\s+|\s+$/g,Ic=/^[-+]0x[0-9a-f]+$/i,Oc=/^0b[01]+$/i,Rc=/^0o[0-7]+$/i,Mc=parseInt,Pc=typeof global=="object"&&global&&global.Object===Object&&global,Dc=typeof self=="object"&&self&&self.Object===Object&&self,Fc=Pc||Dc||Function("return this")(),Bc=Object.prototype,Nc=Bc.toString,Hc=Math.max,qc=Math.min,Wn=function(){return Fc.Date.now()};function zc(i,e,t){var r,n,s,o,a,l,f=0,u=!1,g=!1,w=!0;if(typeof i!="function")throw new TypeError(xc);e=No(e)||0,Kn(t)&&(u=!!t.leading,g="maxWait"in t,s=g?Hc(No(t.maxWait)||0,e):s,w="trailing"in t?!!t.trailing:w);function y(x){var F=r,j=n;return r=n=void 0,f=x,o=i.apply(j,F),o}function _(x){return f=x,a=setTimeout(P,e),u?y(x):o}function L(x){var F=x-l,j=x-f,U=e-F;return g?qc(U,s-j):U}function k(x){var F=x-l,j=x-f;return l===void 0||F>=e||F<0||g&&j>=s}function P(){var x=Wn();if(k(x))return q(x);a=setTimeout(P,L(x))}function q(x){return a=void 0,w&&r?y(x):(r=n=void 0,o)}function B(){a!==void 0&&clearTimeout(a),f=0,r=l=n=a=void 0}function T(){return a===void 0?o:q(Wn())}function O(){var x=Wn(),F=k(x);if(r=arguments,n=this,l=x,F){if(a===void 0)return _(l);if(g)return a=setTimeout(P,e),y(l)}return a===void 0&&(a=setTimeout(P,e)),o}return O.cancel=B,O.flush=T,O}function Kn(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function Vc(i){return!!i&&typeof i=="object"}function $c(i){return typeof i=="symbol"||Vc(i)&&Nc.call(i)==Lc}function No(i){if(typeof i=="number")return i;if($c(i))return Bo;if(Kn(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=Kn(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(Cc,"");var t=Oc.test(i);return t||Rc.test(i)?Mc(i.slice(2),t?2:8):Ic.test(i)?Bo:+i}Ho.exports=zc});var _n=class{constructor(e,t,r){this.eventTarget=e,this.eventName=t,this.eventOptions=r,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){let t=Nl(e);for(let r of this.bindings){if(t.immediatePropagationStopped)break;r.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{let r=e.index,n=t.index;return r<n?-1:r>n?1:0})}};function Nl(i){if("immediatePropagationStopped"in i)return i;{let{stopImmediatePropagation:e}=i;return Object.assign(i,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,e.call(this)}})}}var An=class{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,r={}){this.application.handleError(e,`Error ${t}`,r)}clearEventListenersForBinding(e){let t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){let{eventTarget:t,eventName:r,eventOptions:n}=e,s=this.fetchEventListenerMapForEventTarget(t),o=this.cacheKey(r,n);s.delete(o),s.size==0&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){let{eventTarget:t,eventName:r,eventOptions:n}=e;return this.fetchEventListener(t,r,n)}fetchEventListener(e,t,r){let n=this.fetchEventListenerMapForEventTarget(e),s=this.cacheKey(t,r),o=n.get(s);return o||(o=this.createEventListener(e,t,r),n.set(s,o)),o}createEventListener(e,t,r){let n=new _n(e,t,r);return this.started&&n.connect(),n}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){let r=[e];return Object.keys(t).sort().forEach(n=>{r.push(`${t[n]?"":"!"}${n}`)}),r.join(":")}},Hl={stop({event:i,value:e}){return e&&i.stopPropagation(),!0},prevent({event:i,value:e}){return e&&i.preventDefault(),!0},self({event:i,value:e,element:t}){return e?t===i.target:!0}},ql=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function zl(i){let t=i.trim().match(ql)||[],r=t[2],n=t[3];return n&&!["keydown","keyup","keypress"].includes(r)&&(r+=`.${n}`,n=""),{eventTarget:Vl(t[4]),eventName:r,eventOptions:t[7]?$l(t[7]):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||n}}function Vl(i){if(i=="window")return window;if(i=="document")return document}function $l(i){return i.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})}function jl(i){if(i==window)return"window";if(i==document)return"document"}function Un(i){return i.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function Tn(i){return Un(i.replace(/--/g,"-").replace(/__/g,"_"))}function yi(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Mo(i){return i.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function Ul(i){return i.match(/[^\s]+/g)||[]}function To(i){return i!=null}function Sn(i,e){return Object.prototype.hasOwnProperty.call(i,e)}var So=["meta","ctrl","alt","shift"],kn=class{constructor(e,t,r,n){this.element=e,this.index=t,this.eventTarget=r.eventTarget||e,this.eventName=r.eventName||Wl(e)||Zi("missing event name"),this.eventOptions=r.eventOptions||{},this.identifier=r.identifier||Zi("missing identifier"),this.methodName=r.methodName||Zi("missing method name"),this.keyFilter=r.keyFilter||"",this.schema=n}static forToken(e,t){return new this(e.element,e.index,zl(e.content),t)}toString(){let 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;let t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;let r=t.filter(n=>!So.includes(n))[0];return r?(Sn(this.keyMappings,r)||Zi(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[r].toLowerCase()!==e.key.toLowerCase()):!1}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;let t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){let e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(let{name:r,value:n}of Array.from(this.element.attributes)){let s=r.match(t),o=s&&s[1];o&&(e[Un(o)]=Kl(n))}return e}get eventTargetName(){return jl(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){let[r,n,s,o]=So.map(a=>t.includes(a));return e.metaKey!==r||e.ctrlKey!==n||e.altKey!==s||e.shiftKey!==o}},ko={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:i=>i.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function Wl(i){let e=i.tagName.toLowerCase();if(e in ko)return ko[e](i)}function Zi(i){throw new Error(i)}function Kl(i){try{return JSON.parse(i)}catch{return i}}var xn=class{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){let t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){let e=this.controller[this.methodName];if(typeof e=="function")return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){let{element:t}=this.action,{actionDescriptorFilters:r}=this.context.application,{controller:n}=this.context,s=!0;for(let[o,a]of Object.entries(this.eventOptions))if(o in r){let l=r[o];s=s&&l({name:o,value:a,event:e,element:t,controller:n})}else continue;return s}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){let{target:t,currentTarget:r}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:r,action:this.methodName})}catch(n){let{identifier:s,controller:o,element:a,index:l}=this,f={identifier:s,controller:o,element:a,index:l,event:e};this.context.handleError(n,`invoking action "${this.action}"`,f)}}willBeInvokedByEvent(e){let t=e.target;return e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e)||e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e)?!1:this.element===t?!0: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}},Qi=class{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(r=>this.processMutations(r))}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){let e=new Set(this.matchElementsInTree());for(let t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(let t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(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(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.processTree(r,this.removeElement)}}processAddedNodes(e){for(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.elementIsActive(r)&&this.processTree(r,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(let r of this.matchElementsInTree(e))t.call(this,r)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected!=this.element.isConnected?!1: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))}},Ji=class{constructor(e,t,r){this.attributeName=t,this.delegate=r,this.elementObserver=new Qi(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){let t=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(this.selector));return t.concat(r)}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 Gl(i,e,t){Po(i,e).add(t)}function Yl(i,e,t){Po(i,e).delete(t),Xl(i,e)}function Po(i,e){let t=i.get(e);return t||(t=new Set,i.set(e,t)),t}function Xl(i,e){let t=i.get(e);t!=null&&t.size==0&&i.delete(e)}var Ue=class{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t.concat(Array.from(r)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t+r.size,0)}add(e,t){Gl(this.valuesByKey,e,t)}delete(e,t){Yl(this.valuesByKey,e,t)}has(e,t){let r=this.valuesByKey.get(e);return r!=null&&r.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(r=>r.has(e))}getValuesForKey(e){let t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,r])=>r.has(e)).map(([t,r])=>t)}};var Ln=class{constructor(e,t,r,n){this._selector=t,this.details=n,this.elementObserver=new Qi(e,this),this.delegate=r,this.matchesByElement=new Ue}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){let{selector:t}=this;if(t){let r=e.matches(t);return this.delegate.selectorMatchElement?r&&this.delegate.selectorMatchElement(e,this.details):r}else return!1}matchElementsInTree(e){let{selector:t}=this;if(t){let r=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(t)).filter(s=>this.matchElement(s));return r.concat(n)}else return[]}elementMatched(e){let{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){let t=this.matchesByElement.getKeysForValue(e);for(let r of t)this.selectorUnmatched(e,r)}elementAttributeChanged(e,t){let{selector:r}=this;if(r){let n=this.matchElement(e),s=this.matchesByElement.has(r,e);n&&!s?this.selectorMatched(e,r):!n&&s&&this.selectorUnmatched(e,r)}}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)}},Cn=class{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(r=>this.processMutations(r))}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(let e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){let t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){let r=this.delegate.getStringMapKeyForAttribute(e);if(r!=null){this.stringMap.has(e)||this.stringMapKeyAdded(r,e);let n=this.element.getAttribute(e);if(this.stringMap.get(e)!=n&&this.stringMapValueChanged(n,r,t),n==null){let s=this.stringMap.get(e);this.stringMap.delete(e),s&&this.stringMapKeyRemoved(r,e,s)}else this.stringMap.set(e,n)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,r){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,r)}stringMapKeyRemoved(e,t,r){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,r)}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())}},er=class{constructor(e,t,r){this.attributeObserver=new Ji(e,t,this),this.delegate=r,this.tokensByElement=new Ue}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){let[t,r]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(r)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(t=>this.tokenMatched(t))}tokensUnmatched(e){e.forEach(t=>this.tokenUnmatched(t))}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){let t=this.tokensByElement.getValuesForKey(e),r=this.readTokensForElement(e),n=Ql(t,r).findIndex(([s,o])=>!Jl(s,o));return n==-1?[[],[]]:[t.slice(n),r.slice(n)]}readTokensForElement(e){let t=this.attributeName,r=e.getAttribute(t)||"";return Zl(r,e,t)}};function Zl(i,e,t){return i.trim().split(/\s+/).filter(r=>r.length).map((r,n)=>({element:e,attributeName:t,content:r,index:n}))}function Ql(i,e){let t=Math.max(i.length,e.length);return Array.from({length:t},(r,n)=>[i[n],e[n]])}function Jl(i,e){return i&&e&&i.index==e.index&&i.content==e.content}var tr=class{constructor(e,t,r){this.tokenListObserver=new er(e,t,this),this.delegate=r,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){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).set(e,r),this.delegate.elementMatchedValue(t,r))}tokenUnmatched(e){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,r))}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(t){return{error:t}}}},In=class{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new tr(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){let t=new xn(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){let 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){let t=kn.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},On=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new Cn(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){let r=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,r.writer(this.receiver[e]),r.writer(r.defaultValue))}stringMapValueChanged(e,t,r){let n=this.valueDescriptorNameMap[t];e!==null&&(r===null&&(r=n.writer(n.defaultValue)),this.invokeChangedCallback(t,e,r))}stringMapKeyRemoved(e,t,r){let n=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,n.writer(this.receiver[e]),r):this.invokeChangedCallback(e,n.writer(n.defaultValue),r)}invokeChangedCallbacksForDefaultValues(){for(let{key:e,name:t,defaultValue:r,writer:n}of this.valueDescriptors)r!=null&&!this.controller.data.has(e)&&this.invokeChangedCallback(t,n(r),void 0)}invokeChangedCallback(e,t,r){let n=`${e}Changed`,s=this.receiver[n];if(typeof s=="function"){let o=this.valueDescriptorNameMap[e];try{let a=o.reader(t),l=r;r&&(l=o.reader(r)),s.call(this.receiver,a,l)}catch(a){throw a instanceof TypeError&&(a.message=`Stimulus Value "${this.context.identifier}.${o.name}" - ${a.message}`),a}}}get valueDescriptors(){let{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){let e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{let r=this.valueDescriptorMap[t];e[r.name]=r}),e}hasValue(e){let t=this.valueDescriptorNameMap[e],r=`has${yi(t.name)}`;return this.receiver[r]}},Rn=class{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new Ue}start(){this.tokenListObserver||(this.tokenListObserver=new er(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 r;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var r;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(let e of this.targetsByName.keys)for(let 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 wi(i,e){let t=Do(i);return Array.from(t.reduce((r,n)=>(tc(n,e).forEach(s=>r.add(s)),r),new Set))}function ec(i,e){return Do(i).reduce((r,n)=>(r.push(...ic(n,e)),r),[])}function Do(i){let e=[];for(;i;)e.push(i),i=Object.getPrototypeOf(i);return e.reverse()}function tc(i,e){let t=i[e];return Array.isArray(t)?t:[]}function ic(i,e){let t=i[e];return t?Object.keys(t).map(r=>[r,t[r]]):[]}var Mn=class{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new Ue,this.outletElementsByName=new Ue,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:r}){let n=this.getOutlet(e,r);n&&this.connectOutlet(n,e,r)}selectorUnmatched(e,t,{outletName:r}){let n=this.getOutletFromMap(e,r);n&&this.disconnectOutlet(n,e,r)}selectorMatchElement(e,{outletName:t}){let r=this.selector(t),n=this.hasOutlet(e,t),s=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return r?n&&s&&e.matches(r):!1}elementMatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementAttributeValueChanged(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementUnmatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}connectOutlet(e,t,r){var n;this.outletElementsByName.has(r,t)||(this.outletsByName.add(r,e),this.outletElementsByName.add(r,t),(n=this.selectorObserverMap.get(r))===null||n===void 0||n.pause(()=>this.delegate.outletConnected(e,t,r)))}disconnectOutlet(e,t,r){var n;this.outletElementsByName.has(r,t)&&(this.outletsByName.delete(r,e),this.outletElementsByName.delete(r,t),(n=this.selectorObserverMap.get(r))===null||n===void 0||n.pause(()=>this.delegate.outletDisconnected(e,t,r)))}disconnectAllOutlets(){for(let e of this.outletElementsByName.keys)for(let t of this.outletElementsByName.getValuesForKey(e))for(let r of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(r,t,e)}updateSelectorObserverForOutlet(e){let t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){let t=this.selector(e),r=new Ln(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,r),r.start()}setupAttributeObserverForOutlet(e){let t=this.attributeNameForOutletName(e),r=new Ji(this.scope.element,t,this);this.attributeObserverMap.set(e,r),r.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(){let e=new Ue;return this.router.modules.forEach(t=>{let r=t.definition.controllerConstructor;wi(r,"outlets").forEach(s=>e.add(s,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){let 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(r=>r.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}},Pn=class{constructor(e,t){this.logDebugActivity=(r,n={})=>{let{identifier:s,controller:o,element:a}=this;n=Object.assign({identifier:s,controller:o,element:a},n),this.application.logDebugActivity(this.identifier,r,n)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new In(this,this.dispatcher),this.valueObserver=new On(this,this.controller),this.targetObserver=new Rn(this,this),this.outletObserver=new Mn(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(r){this.handleError(r,"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,r={}){let{identifier:n,controller:s,element:o}=this;r=Object.assign({identifier:n,controller:s,element:o},r),this.application.handleError(e,`Error ${t}`,r)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,r){this.invokeControllerMethod(`${Tn(r)}OutletConnected`,e,t)}outletDisconnected(e,t,r){this.invokeControllerMethod(`${Tn(r)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){let r=this.controller;typeof r[e]=="function"&&r[e](...t)}};function rc(i){return nc(i,sc(i))}function nc(i,e){let t=cc(i),r=oc(i.prototype,e);return Object.defineProperties(t.prototype,r),t}function sc(i){return wi(i,"blessings").reduce((t,r)=>{let n=r(i);for(let s in n){let o=t[s]||{};t[s]=Object.assign(o,n[s])}return t},{})}function oc(i,e){return lc(e).reduce((t,r)=>{let n=ac(i,e,r);return n&&Object.assign(t,{[r]:n}),t},{})}function ac(i,e,t){let r=Object.getOwnPropertyDescriptor(i,t);if(!(r&&"value"in r)){let s=Object.getOwnPropertyDescriptor(e,t).value;return r&&(s.get=r.get||s.get,s.set=r.set||s.set),s}}var lc=typeof Object.getOwnPropertySymbols=="function"?i=>[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)]:Object.getOwnPropertyNames,cc=(()=>{function i(t){function r(){return Reflect.construct(t,arguments,new.target)}return r.prototype=Object.create(t.prototype,{constructor:{value:r}}),Reflect.setPrototypeOf(r,t),r}function e(){let r=i(function(){this.a.call(this)});return r.prototype.a=function(){},new r}try{return e(),i}catch{return r=>class extends r{}}})();function uc(i){return{identifier:i.identifier,controllerConstructor:rc(i.controllerConstructor)}}var Dn=class{constructor(e,t){this.application=e,this.definition=uc(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){let t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){let t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new Pn(this,e),this.contextsByScope.set(e,t)),t}},Fn=class{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){let t=this.data.get(this.getDataKey(e))||"";return Ul(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},Bn=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){let t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){let r=this.getAttributeNameForKey(e);return this.element.setAttribute(r,t),this.get(e)}has(e){let t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){let t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}else return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${Mo(e)}`}},Nn=class{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,r){let n=this.warnedKeysByObject.get(e);n||(n=new Set,this.warnedKeysByObject.set(e,n)),n.has(t)||(n.add(t),this.logger.warn(r,e))}};function Hn(i,e){return`[${i}~="${e}"]`}var qn=class{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 this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findTarget(r)||this.findLegacyTarget(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllTargets(r),...this.findAllLegacyTargets(r)],[])}findTarget(e){let t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){let t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){let t=this.schema.targetAttributeForScope(this.identifier);return Hn(t,e)}findLegacyTarget(e){let t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){let t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(r=>this.deprecate(r,e))}getLegacySelectorForTargetName(e){let t=`${this.identifier}.${e}`;return Hn(this.schema.targetAttribute,t)}deprecate(e,t){if(e){let{identifier:r}=this,n=this.schema.targetAttribute,s=this.schema.targetAttributeForScope(r);this.guide.warn(e,`target:${t}`,`Please replace ${n}="${r}.${t}" with ${s}="${t}". The ${n} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}},zn=class{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 this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findOutlet(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllOutlets(r)],[])}getSelectorForOutletName(e){let t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){let t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){let 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,r){let n=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&n.split(" ").includes(r)}},Vn=class i{constructor(e,t,r,n){this.targets=new qn(this),this.classes=new Fn(this),this.data=new Bn(this),this.containsElement=s=>s.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=r,this.guide=new Nn(n),this.outlets=new zn(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 Hn(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new i(this.schema,document.documentElement,this.identifier,this.guide.logger)}},$n=class{constructor(e,t,r){this.element=e,this.schema=t,this.delegate=r,this.valueListObserver=new tr(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){let{element:t,content:r}=e;return this.parseValueForElementAndIdentifier(t,r)}parseValueForElementAndIdentifier(e,t){let r=this.fetchScopesByIdentifierForElement(e),n=r.get(t);return n||(n=this.delegate.createScopeForElementAndIdentifier(e,t),r.set(t,n)),n}elementMatchedValue(e,t){let r=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,r),r==1&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){let r=this.scopeReferenceCounts.get(t);r&&(this.scopeReferenceCounts.set(t,r-1),r==1&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}},jn=class{constructor(e){this.application=e,this.scopeObserver=new $n(this.element,this.schema,this),this.scopesByIdentifier=new Ue,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);let t=new Dn(this.application,e);this.connectModule(t);let r=e.controllerConstructor.afterLoad;r&&r.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){let t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){let r=this.modulesByIdentifier.get(t);if(r)return r.contexts.find(n=>n.element==e)}proposeToConnectScopeForElementAndIdentifier(e,t){let r=this.scopeObserver.parseValueForElementAndIdentifier(e,t);r?this.scopeObserver.elementMatchedValue(r.element,r):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,r){this.application.handleError(e,t,r)}createScopeForElementAndIdentifier(e,t){return new Vn(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.connectContextForScope(r))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.disconnectContextForScope(r))}},hc={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:i=>`data-${i}-target`,outletAttributeForScope:(i,e)=>`data-${i}-${e}-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"},xo("abcdefghijklmnopqrstuvwxyz".split("").map(i=>[i,i]))),xo("0123456789".split("").map(i=>[i,i])))};function xo(i){return i.reduce((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r}),{})}var ir=class{constructor(e=document.documentElement,t=hc){this.logger=console,this.debug=!1,this.logDebugActivity=(r,n,s={})=>{this.debug&&this.logFormattedMessage(r,n,s)},this.element=e,this.schema=t,this.dispatcher=new An(this),this.router=new jn(this),this.actionDescriptorFilters=Object.assign({},Hl)}static start(e,t){let r=new this(e,t);return r.start(),r}async start(){await dc(),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(n=>{n.controllerConstructor.shouldLoad&&this.router.loadDefinition(n)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(n=>this.router.unloadIdentifier(n))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){let r=this.router.getContextForElementAndIdentifier(e,t);return r?r.controller:null}handleError(e,t,r){var n;this.logger.error(`%s
|
1
|
+
(()=>{var Ol=Object.create;var To=Object.defineProperty;var Rl=Object.getOwnPropertyDescriptor;var Ml=Object.getOwnPropertyNames;var Pl=Object.getPrototypeOf,Dl=Object.prototype.hasOwnProperty;var Fl=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Bl=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ml(e))!Dl.call(i,n)&&n!==t&&To(i,n,{get:()=>e[n],enumerable:!(r=Rl(e,n))||r.enumerable});return i};var Nl=(i,e,t)=>(t=i!=null?Ol(Pl(i)):{},Bl(e||!i||!i.__esModule?To(t,"default",{value:i,enumerable:!0}):t,i));var zo=Fl((np,qo)=>{var Lc="Expected a function",No=NaN,Cc="[object Symbol]",Ic=/^\s+|\s+$/g,Oc=/^[-+]0x[0-9a-f]+$/i,Rc=/^0b[01]+$/i,Mc=/^0o[0-7]+$/i,Pc=parseInt,Dc=typeof global=="object"&&global&&global.Object===Object&&global,Fc=typeof self=="object"&&self&&self.Object===Object&&self,Bc=Dc||Fc||Function("return this")(),Nc=Object.prototype,Hc=Nc.toString,qc=Math.max,zc=Math.min,Kn=function(){return Bc.Date.now()};function Vc(i,e,t){var r,n,s,o,a,l,f=0,u=!1,g=!1,w=!0;if(typeof i!="function")throw new TypeError(Lc);e=Ho(e)||0,Gn(t)&&(u=!!t.leading,g="maxWait"in t,s=g?qc(Ho(t.maxWait)||0,e):s,w="trailing"in t?!!t.trailing:w);function y(x){var F=r,j=n;return r=n=void 0,f=x,o=i.apply(j,F),o}function _(x){return f=x,a=setTimeout(P,e),u?y(x):o}function L(x){var F=x-l,j=x-f,U=e-F;return g?zc(U,s-j):U}function k(x){var F=x-l,j=x-f;return l===void 0||F>=e||F<0||g&&j>=s}function P(){var x=Kn();if(k(x))return q(x);a=setTimeout(P,L(x))}function q(x){return a=void 0,w&&r?y(x):(r=n=void 0,o)}function B(){a!==void 0&&clearTimeout(a),f=0,r=l=n=a=void 0}function T(){return a===void 0?o:q(Kn())}function O(){var x=Kn(),F=k(x);if(r=arguments,n=this,l=x,F){if(a===void 0)return _(l);if(g)return a=setTimeout(P,e),y(l)}return a===void 0&&(a=setTimeout(P,e)),o}return O.cancel=B,O.flush=T,O}function Gn(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function $c(i){return!!i&&typeof i=="object"}function jc(i){return typeof i=="symbol"||$c(i)&&Hc.call(i)==Cc}function Ho(i){if(typeof i=="number")return i;if(jc(i))return No;if(Gn(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=Gn(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(Ic,"");var t=Rc.test(i);return t||Mc.test(i)?Pc(i.slice(2),t?2:8):Oc.test(i)?No:+i}qo.exports=Vc});var An=class{constructor(e,t,r){this.eventTarget=e,this.eventName=t,this.eventOptions=r,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){let t=Hl(e);for(let r of this.bindings){if(t.immediatePropagationStopped)break;r.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{let r=e.index,n=t.index;return r<n?-1:r>n?1:0})}};function Hl(i){if("immediatePropagationStopped"in i)return i;{let{stopImmediatePropagation:e}=i;return Object.assign(i,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,e.call(this)}})}}var Tn=class{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,r={}){this.application.handleError(e,`Error ${t}`,r)}clearEventListenersForBinding(e){let t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){let{eventTarget:t,eventName:r,eventOptions:n}=e,s=this.fetchEventListenerMapForEventTarget(t),o=this.cacheKey(r,n);s.delete(o),s.size==0&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){let{eventTarget:t,eventName:r,eventOptions:n}=e;return this.fetchEventListener(t,r,n)}fetchEventListener(e,t,r){let n=this.fetchEventListenerMapForEventTarget(e),s=this.cacheKey(t,r),o=n.get(s);return o||(o=this.createEventListener(e,t,r),n.set(s,o)),o}createEventListener(e,t,r){let n=new An(e,t,r);return this.started&&n.connect(),n}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){let r=[e];return Object.keys(t).sort().forEach(n=>{r.push(`${t[n]?"":"!"}${n}`)}),r.join(":")}},ql={stop({event:i,value:e}){return e&&i.stopPropagation(),!0},prevent({event:i,value:e}){return e&&i.preventDefault(),!0},self({event:i,value:e,element:t}){return e?t===i.target:!0}},zl=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function Vl(i){let t=i.trim().match(zl)||[],r=t[2],n=t[3];return n&&!["keydown","keyup","keypress"].includes(r)&&(r+=`.${n}`,n=""),{eventTarget:$l(t[4]),eventName:r,eventOptions:t[7]?jl(t[7]):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||n}}function $l(i){if(i=="window")return window;if(i=="document")return document}function jl(i){return i.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})}function Ul(i){if(i==window)return"window";if(i==document)return"document"}function Wn(i){return i.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function Sn(i){return Wn(i.replace(/--/g,"-").replace(/__/g,"_"))}function yi(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Po(i){return i.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function Wl(i){return i.match(/[^\s]+/g)||[]}function So(i){return i!=null}function kn(i,e){return Object.prototype.hasOwnProperty.call(i,e)}var ko=["meta","ctrl","alt","shift"],xn=class{constructor(e,t,r,n){this.element=e,this.index=t,this.eventTarget=r.eventTarget||e,this.eventName=r.eventName||Kl(e)||Zi("missing event name"),this.eventOptions=r.eventOptions||{},this.identifier=r.identifier||Zi("missing identifier"),this.methodName=r.methodName||Zi("missing method name"),this.keyFilter=r.keyFilter||"",this.schema=n}static forToken(e,t){return new this(e.element,e.index,Vl(e.content),t)}toString(){let 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;let t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;let r=t.filter(n=>!ko.includes(n))[0];return r?(kn(this.keyMappings,r)||Zi(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[r].toLowerCase()!==e.key.toLowerCase()):!1}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;let t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){let e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(let{name:r,value:n}of Array.from(this.element.attributes)){let s=r.match(t),o=s&&s[1];o&&(e[Wn(o)]=Gl(n))}return e}get eventTargetName(){return Ul(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){let[r,n,s,o]=ko.map(a=>t.includes(a));return e.metaKey!==r||e.ctrlKey!==n||e.altKey!==s||e.shiftKey!==o}},xo={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:i=>i.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function Kl(i){let e=i.tagName.toLowerCase();if(e in xo)return xo[e](i)}function Zi(i){throw new Error(i)}function Gl(i){try{return JSON.parse(i)}catch{return i}}var Ln=class{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){let t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){let e=this.controller[this.methodName];if(typeof e=="function")return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){let{element:t}=this.action,{actionDescriptorFilters:r}=this.context.application,{controller:n}=this.context,s=!0;for(let[o,a]of Object.entries(this.eventOptions))if(o in r){let l=r[o];s=s&&l({name:o,value:a,event:e,element:t,controller:n})}else continue;return s}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){let{target:t,currentTarget:r}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:r,action:this.methodName})}catch(n){let{identifier:s,controller:o,element:a,index:l}=this,f={identifier:s,controller:o,element:a,index:l,event:e};this.context.handleError(n,`invoking action "${this.action}"`,f)}}willBeInvokedByEvent(e){let t=e.target;return e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e)||e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e)?!1:this.element===t?!0: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}},Qi=class{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(r=>this.processMutations(r))}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){let e=new Set(this.matchElementsInTree());for(let t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(let t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(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(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.processTree(r,this.removeElement)}}processAddedNodes(e){for(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.elementIsActive(r)&&this.processTree(r,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(let r of this.matchElementsInTree(e))t.call(this,r)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected!=this.element.isConnected?!1: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))}},Ji=class{constructor(e,t,r){this.attributeName=t,this.delegate=r,this.elementObserver=new Qi(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){let t=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(this.selector));return t.concat(r)}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 Yl(i,e,t){Do(i,e).add(t)}function Xl(i,e,t){Do(i,e).delete(t),Zl(i,e)}function Do(i,e){let t=i.get(e);return t||(t=new Set,i.set(e,t)),t}function Zl(i,e){let t=i.get(e);t!=null&&t.size==0&&i.delete(e)}var Ue=class{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t.concat(Array.from(r)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t+r.size,0)}add(e,t){Yl(this.valuesByKey,e,t)}delete(e,t){Xl(this.valuesByKey,e,t)}has(e,t){let r=this.valuesByKey.get(e);return r!=null&&r.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(r=>r.has(e))}getValuesForKey(e){let t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,r])=>r.has(e)).map(([t,r])=>t)}};var Cn=class{constructor(e,t,r,n){this._selector=t,this.details=n,this.elementObserver=new Qi(e,this),this.delegate=r,this.matchesByElement=new Ue}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){let{selector:t}=this;if(t){let r=e.matches(t);return this.delegate.selectorMatchElement?r&&this.delegate.selectorMatchElement(e,this.details):r}else return!1}matchElementsInTree(e){let{selector:t}=this;if(t){let r=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(t)).filter(s=>this.matchElement(s));return r.concat(n)}else return[]}elementMatched(e){let{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){let t=this.matchesByElement.getKeysForValue(e);for(let r of t)this.selectorUnmatched(e,r)}elementAttributeChanged(e,t){let{selector:r}=this;if(r){let n=this.matchElement(e),s=this.matchesByElement.has(r,e);n&&!s?this.selectorMatched(e,r):!n&&s&&this.selectorUnmatched(e,r)}}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)}},In=class{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(r=>this.processMutations(r))}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(let e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){let t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){let r=this.delegate.getStringMapKeyForAttribute(e);if(r!=null){this.stringMap.has(e)||this.stringMapKeyAdded(r,e);let n=this.element.getAttribute(e);if(this.stringMap.get(e)!=n&&this.stringMapValueChanged(n,r,t),n==null){let s=this.stringMap.get(e);this.stringMap.delete(e),s&&this.stringMapKeyRemoved(r,e,s)}else this.stringMap.set(e,n)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,r){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,r)}stringMapKeyRemoved(e,t,r){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,r)}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())}},er=class{constructor(e,t,r){this.attributeObserver=new Ji(e,t,this),this.delegate=r,this.tokensByElement=new Ue}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){let[t,r]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(r)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(t=>this.tokenMatched(t))}tokensUnmatched(e){e.forEach(t=>this.tokenUnmatched(t))}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){let t=this.tokensByElement.getValuesForKey(e),r=this.readTokensForElement(e),n=Jl(t,r).findIndex(([s,o])=>!ec(s,o));return n==-1?[[],[]]:[t.slice(n),r.slice(n)]}readTokensForElement(e){let t=this.attributeName,r=e.getAttribute(t)||"";return Ql(r,e,t)}};function Ql(i,e,t){return i.trim().split(/\s+/).filter(r=>r.length).map((r,n)=>({element:e,attributeName:t,content:r,index:n}))}function Jl(i,e){let t=Math.max(i.length,e.length);return Array.from({length:t},(r,n)=>[i[n],e[n]])}function ec(i,e){return i&&e&&i.index==e.index&&i.content==e.content}var tr=class{constructor(e,t,r){this.tokenListObserver=new er(e,t,this),this.delegate=r,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){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).set(e,r),this.delegate.elementMatchedValue(t,r))}tokenUnmatched(e){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,r))}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(t){return{error:t}}}},On=class{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new tr(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){let t=new Ln(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){let 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){let t=xn.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},Rn=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new In(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){let r=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,r.writer(this.receiver[e]),r.writer(r.defaultValue))}stringMapValueChanged(e,t,r){let n=this.valueDescriptorNameMap[t];e!==null&&(r===null&&(r=n.writer(n.defaultValue)),this.invokeChangedCallback(t,e,r))}stringMapKeyRemoved(e,t,r){let n=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,n.writer(this.receiver[e]),r):this.invokeChangedCallback(e,n.writer(n.defaultValue),r)}invokeChangedCallbacksForDefaultValues(){for(let{key:e,name:t,defaultValue:r,writer:n}of this.valueDescriptors)r!=null&&!this.controller.data.has(e)&&this.invokeChangedCallback(t,n(r),void 0)}invokeChangedCallback(e,t,r){let n=`${e}Changed`,s=this.receiver[n];if(typeof s=="function"){let o=this.valueDescriptorNameMap[e];try{let a=o.reader(t),l=r;r&&(l=o.reader(r)),s.call(this.receiver,a,l)}catch(a){throw a instanceof TypeError&&(a.message=`Stimulus Value "${this.context.identifier}.${o.name}" - ${a.message}`),a}}}get valueDescriptors(){let{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){let e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{let r=this.valueDescriptorMap[t];e[r.name]=r}),e}hasValue(e){let t=this.valueDescriptorNameMap[e],r=`has${yi(t.name)}`;return this.receiver[r]}},Mn=class{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new Ue}start(){this.tokenListObserver||(this.tokenListObserver=new er(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 r;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var r;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(let e of this.targetsByName.keys)for(let 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 wi(i,e){let t=Fo(i);return Array.from(t.reduce((r,n)=>(ic(n,e).forEach(s=>r.add(s)),r),new Set))}function tc(i,e){return Fo(i).reduce((r,n)=>(r.push(...rc(n,e)),r),[])}function Fo(i){let e=[];for(;i;)e.push(i),i=Object.getPrototypeOf(i);return e.reverse()}function ic(i,e){let t=i[e];return Array.isArray(t)?t:[]}function rc(i,e){let t=i[e];return t?Object.keys(t).map(r=>[r,t[r]]):[]}var Pn=class{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new Ue,this.outletElementsByName=new Ue,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:r}){let n=this.getOutlet(e,r);n&&this.connectOutlet(n,e,r)}selectorUnmatched(e,t,{outletName:r}){let n=this.getOutletFromMap(e,r);n&&this.disconnectOutlet(n,e,r)}selectorMatchElement(e,{outletName:t}){let r=this.selector(t),n=this.hasOutlet(e,t),s=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return r?n&&s&&e.matches(r):!1}elementMatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementAttributeValueChanged(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementUnmatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}connectOutlet(e,t,r){var n;this.outletElementsByName.has(r,t)||(this.outletsByName.add(r,e),this.outletElementsByName.add(r,t),(n=this.selectorObserverMap.get(r))===null||n===void 0||n.pause(()=>this.delegate.outletConnected(e,t,r)))}disconnectOutlet(e,t,r){var n;this.outletElementsByName.has(r,t)&&(this.outletsByName.delete(r,e),this.outletElementsByName.delete(r,t),(n=this.selectorObserverMap.get(r))===null||n===void 0||n.pause(()=>this.delegate.outletDisconnected(e,t,r)))}disconnectAllOutlets(){for(let e of this.outletElementsByName.keys)for(let t of this.outletElementsByName.getValuesForKey(e))for(let r of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(r,t,e)}updateSelectorObserverForOutlet(e){let t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){let t=this.selector(e),r=new Cn(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,r),r.start()}setupAttributeObserverForOutlet(e){let t=this.attributeNameForOutletName(e),r=new Ji(this.scope.element,t,this);this.attributeObserverMap.set(e,r),r.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(){let e=new Ue;return this.router.modules.forEach(t=>{let r=t.definition.controllerConstructor;wi(r,"outlets").forEach(s=>e.add(s,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){let 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(r=>r.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}},Dn=class{constructor(e,t){this.logDebugActivity=(r,n={})=>{let{identifier:s,controller:o,element:a}=this;n=Object.assign({identifier:s,controller:o,element:a},n),this.application.logDebugActivity(this.identifier,r,n)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new On(this,this.dispatcher),this.valueObserver=new Rn(this,this.controller),this.targetObserver=new Mn(this,this),this.outletObserver=new Pn(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(r){this.handleError(r,"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,r={}){let{identifier:n,controller:s,element:o}=this;r=Object.assign({identifier:n,controller:s,element:o},r),this.application.handleError(e,`Error ${t}`,r)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,r){this.invokeControllerMethod(`${Sn(r)}OutletConnected`,e,t)}outletDisconnected(e,t,r){this.invokeControllerMethod(`${Sn(r)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){let r=this.controller;typeof r[e]=="function"&&r[e](...t)}};function nc(i){return sc(i,oc(i))}function sc(i,e){let t=uc(i),r=ac(i.prototype,e);return Object.defineProperties(t.prototype,r),t}function oc(i){return wi(i,"blessings").reduce((t,r)=>{let n=r(i);for(let s in n){let o=t[s]||{};t[s]=Object.assign(o,n[s])}return t},{})}function ac(i,e){return cc(e).reduce((t,r)=>{let n=lc(i,e,r);return n&&Object.assign(t,{[r]:n}),t},{})}function lc(i,e,t){let r=Object.getOwnPropertyDescriptor(i,t);if(!(r&&"value"in r)){let s=Object.getOwnPropertyDescriptor(e,t).value;return r&&(s.get=r.get||s.get,s.set=r.set||s.set),s}}var cc=typeof Object.getOwnPropertySymbols=="function"?i=>[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)]:Object.getOwnPropertyNames,uc=(()=>{function i(t){function r(){return Reflect.construct(t,arguments,new.target)}return r.prototype=Object.create(t.prototype,{constructor:{value:r}}),Reflect.setPrototypeOf(r,t),r}function e(){let r=i(function(){this.a.call(this)});return r.prototype.a=function(){},new r}try{return e(),i}catch{return r=>class extends r{}}})();function hc(i){return{identifier:i.identifier,controllerConstructor:nc(i.controllerConstructor)}}var Fn=class{constructor(e,t){this.application=e,this.definition=hc(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){let t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){let t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new Dn(this,e),this.contextsByScope.set(e,t)),t}},Bn=class{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){let t=this.data.get(this.getDataKey(e))||"";return Wl(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},Nn=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){let t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){let r=this.getAttributeNameForKey(e);return this.element.setAttribute(r,t),this.get(e)}has(e){let t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){let t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}else return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${Po(e)}`}},Hn=class{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,r){let n=this.warnedKeysByObject.get(e);n||(n=new Set,this.warnedKeysByObject.set(e,n)),n.has(t)||(n.add(t),this.logger.warn(r,e))}};function qn(i,e){return`[${i}~="${e}"]`}var zn=class{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 this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findTarget(r)||this.findLegacyTarget(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllTargets(r),...this.findAllLegacyTargets(r)],[])}findTarget(e){let t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){let t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){let t=this.schema.targetAttributeForScope(this.identifier);return qn(t,e)}findLegacyTarget(e){let t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){let t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(r=>this.deprecate(r,e))}getLegacySelectorForTargetName(e){let t=`${this.identifier}.${e}`;return qn(this.schema.targetAttribute,t)}deprecate(e,t){if(e){let{identifier:r}=this,n=this.schema.targetAttribute,s=this.schema.targetAttributeForScope(r);this.guide.warn(e,`target:${t}`,`Please replace ${n}="${r}.${t}" with ${s}="${t}". The ${n} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}},Vn=class{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 this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findOutlet(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllOutlets(r)],[])}getSelectorForOutletName(e){let t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){let t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){let 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,r){let n=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&n.split(" ").includes(r)}},$n=class i{constructor(e,t,r,n){this.targets=new zn(this),this.classes=new Bn(this),this.data=new Nn(this),this.containsElement=s=>s.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=r,this.guide=new Hn(n),this.outlets=new Vn(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 qn(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new i(this.schema,document.documentElement,this.identifier,this.guide.logger)}},jn=class{constructor(e,t,r){this.element=e,this.schema=t,this.delegate=r,this.valueListObserver=new tr(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){let{element:t,content:r}=e;return this.parseValueForElementAndIdentifier(t,r)}parseValueForElementAndIdentifier(e,t){let r=this.fetchScopesByIdentifierForElement(e),n=r.get(t);return n||(n=this.delegate.createScopeForElementAndIdentifier(e,t),r.set(t,n)),n}elementMatchedValue(e,t){let r=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,r),r==1&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){let r=this.scopeReferenceCounts.get(t);r&&(this.scopeReferenceCounts.set(t,r-1),r==1&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}},Un=class{constructor(e){this.application=e,this.scopeObserver=new jn(this.element,this.schema,this),this.scopesByIdentifier=new Ue,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);let t=new Fn(this.application,e);this.connectModule(t);let r=e.controllerConstructor.afterLoad;r&&r.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){let t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){let r=this.modulesByIdentifier.get(t);if(r)return r.contexts.find(n=>n.element==e)}proposeToConnectScopeForElementAndIdentifier(e,t){let r=this.scopeObserver.parseValueForElementAndIdentifier(e,t);r?this.scopeObserver.elementMatchedValue(r.element,r):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,r){this.application.handleError(e,t,r)}createScopeForElementAndIdentifier(e,t){return new $n(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.connectContextForScope(r))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.disconnectContextForScope(r))}},dc={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:i=>`data-${i}-target`,outletAttributeForScope:(i,e)=>`data-${i}-${e}-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"},Lo("abcdefghijklmnopqrstuvwxyz".split("").map(i=>[i,i]))),Lo("0123456789".split("").map(i=>[i,i])))};function Lo(i){return i.reduce((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r}),{})}var ir=class{constructor(e=document.documentElement,t=dc){this.logger=console,this.debug=!1,this.logDebugActivity=(r,n,s={})=>{this.debug&&this.logFormattedMessage(r,n,s)},this.element=e,this.schema=t,this.dispatcher=new Tn(this),this.router=new Un(this),this.actionDescriptorFilters=Object.assign({},ql)}static start(e,t){let r=new this(e,t);return r.start(),r}async start(){await fc(),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(n=>{n.controllerConstructor.shouldLoad&&this.router.loadDefinition(n)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(n=>this.router.unloadIdentifier(n))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){let r=this.router.getContextForElementAndIdentifier(e,t);return r?r.controller:null}handleError(e,t,r){var n;this.logger.error(`%s
|
2
2
|
|
3
3
|
%o
|
4
4
|
|
5
|
-
%o`,t,e,r),(n=window.onerror)===null||n===void 0||n.call(window,t,"",0,0,e)}logFormattedMessage(e,t,r={}){r=Object.assign({application:this},r),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},r)),this.logger.groupEnd()}};function dc(){return new Promise(i=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>i()):i()})}function fc(i){return wi(i,"classes").reduce((t,r)=>Object.assign(t,pc(r)),{})}function pc(i){return{[`${i}Class`]:{get(){let{classes:e}=this;if(e.has(i))return e.get(i);{let t=e.getAttributeName(i);throw new Error(`Missing attribute "${t}"`)}}},[`${i}Classes`]:{get(){return this.classes.getAll(i)}},[`has${yi(i)}Class`]:{get(){return this.classes.has(i)}}}}function mc(i){return wi(i,"outlets").reduce((t,r)=>Object.assign(t,gc(r)),{})}function Lo(i,e,t){return i.application.getControllerForElementAndIdentifier(e,t)}function Co(i,e,t){let r=Lo(i,e,t);if(r||(i.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),r=Lo(i,e,t),r))return r}function gc(i){let e=Tn(i);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t){let n=Co(this,t,i);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}Outlets`]:{get(){let t=this.outlets.findAll(i);return t.length>0?t.map(r=>{let n=Co(this,r,i);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`,r)}).filter(r=>r):[]}},[`${e}OutletElement`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t)return t;throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(i)}},[`has${yi(e)}Outlet`]:{get(){return this.outlets.has(i)}}}}function vc(i){return wi(i,"targets").reduce((t,r)=>Object.assign(t,bc(r)),{})}function bc(i){return{[`${i}Target`]:{get(){let e=this.targets.find(i);if(e)return e;throw new Error(`Missing target element "${i}" for "${this.identifier}" controller`)}},[`${i}Targets`]:{get(){return this.targets.findAll(i)}},[`has${yi(i)}Target`]:{get(){return this.targets.has(i)}}}}function yc(i){let e=ec(i,"values"),t={valueDescriptorMap:{get(){return e.reduce((r,n)=>{let s=Fo(n,this.identifier),o=this.data.getAttributeNameForKey(s.key);return Object.assign(r,{[o]:s})},{})}}};return e.reduce((r,n)=>Object.assign(r,wc(n)),t)}function wc(i,e){let t=Fo(i,e),{key:r,name:n,reader:s,writer:o}=t;return{[n]:{get(){let a=this.data.get(r);return a!==null?s(a):t.defaultValue},set(a){a===void 0?this.data.delete(r):this.data.set(r,o(a))}},[`has${yi(n)}`]:{get(){return this.data.has(r)||t.hasCustomDefaultValue}}}}function Fo([i,e],t){return Tc({controller:t,token:i,typeDefinition:e})}function rr(i){switch(i){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function bi(i){switch(typeof i){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(i))return"array";if(Object.prototype.toString.call(i)==="[object Object]")return"object"}function Ec(i){let{controller:e,token:t,typeObject:r}=i,n=To(r.type),s=To(r.default),o=n&&s,a=n&&!s,l=!n&&s,f=rr(r.type),u=bi(i.typeObject.default);if(a)return f;if(l)return u;if(f!==u){let g=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${g}" must match the defined type "${f}". The provided default value of "${r.default}" is of type "${u}".`)}if(o)return f}function _c(i){let{controller:e,token:t,typeDefinition:r}=i,s=Ec({controller:e,token:t,typeObject:r}),o=bi(r),a=rr(r),l=s||o||a;if(l)return l;let f=e?`${e}.${r}`:t;throw new Error(`Unknown value type "${f}" for "${t}" value`)}function Ac(i){let e=rr(i);if(e)return Io[e];let t=Sn(i,"default"),r=Sn(i,"type"),n=i;if(t)return n.default;if(r){let{type:s}=n,o=rr(s);if(o)return Io[o]}return i}function Tc(i){let{token:e,typeDefinition:t}=i,r=`${Mo(e)}-value`,n=_c(i);return{type:n,key:r,name:Un(r),get defaultValue(){return Ac(t)},get hasCustomDefaultValue(){return bi(t)!==void 0},reader:Sc[n],writer:Oo[n]||Oo.default}}var Io={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},Sc={array(i){let e=JSON.parse(i);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${i}" of type "${bi(e)}"`);return e},boolean(i){return!(i=="0"||String(i).toLowerCase()=="false")},number(i){return Number(i.replace(/_/g,""))},object(i){let e=JSON.parse(i);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${i}" of type "${bi(e)}"`);return e},string(i){return i}},Oo={default:kc,array:Ro,object:Ro};function Ro(i){return JSON.stringify(i)}function kc(i){return`${i}`}var S=class{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:r={},prefix:n=this.identifier,bubbles:s=!0,cancelable:o=!0}={}){let a=n?`${n}:${e}`:e,l=new CustomEvent(a,{detail:r,bubbles:s,cancelable:o});return t.dispatchEvent(l),l}};S.blessings=[fc,vc,yc,mc];S.targets=[];S.outlets=[];S.values={};var nr=class extends S{connect(){console.log(`resource-layout connected: ${this.element}`)}};var sr=class extends S{connect(){console.log(`nav-grid-menu-item connected: ${this.element}`)}};var or=class extends S{connect(){console.log(`nav-grid-menu connected: ${this.element}`)}};var ar=class extends S{connect(){console.log(`nav-user-section connected: ${this.element}`)}};var lr=class extends S{connect(){console.log(`nav-user-link connected: ${this.element}`)}};var cr=class extends S{connect(){console.log(`nav-user connected: ${this.element}`)}};var ur=class extends S{static targets=["openIcon","closeIcon"];static outlets=["sidebar"];static values={placement:{type:String,default:"left"},bodyScrolling:{type:Boolean,default:!1},backdrop:{type:Boolean,default:!0},edge:{type:Boolean,default:!1},edgeOffset:{type:String,default:"bottom-[60px]"}};static classes={backdrop:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-30"};initialize(){this.visible=!1,this.handleEscapeKey=this.handleEscapeKey.bind(this)}connect(){document.addEventListener("keydown",this.handleEscapeKey)}sidebarOutletConnected(){this.#e(this.sidebarOutlet.element)}disconnect(){this.#i(),document.removeEventListener("keydown",this.handleEscapeKey),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden")}#e(i){i.setAttribute("aria-hidden","true"),i.classList.add("transition-transform"),this.#n(this.placementValue).base.forEach(e=>{i.classList.add(e)})}toggleDrawer(){this.visible?this.hideDrawer():this.showDrawer()}showDrawer(){this.edgeValue?this.#r(`${this.placementValue}-edge`,!0):this.#s(this.placementValue,!0),this.openIconTarget.classList.add("hidden"),this.openIconTarget.setAttribute("aria-hidden","true"),this.closeIconTarget.classList.remove("hidden"),this.closeIconTarget.setAttribute("aria-hidden","false"),this.sidebarOutlet.element.setAttribute("aria-modal","true"),this.sidebarOutlet.element.setAttribute("role","dialog"),this.sidebarOutlet.element.removeAttribute("aria-hidden"),this.bodyScrollingValue||document.body.classList.add("overflow-hidden"),this.backdropValue&&this.#t(),this.visible=!0,this.dispatch("show")}hideDrawer(){this.edgeValue?this.#r(`${this.placementValue}-edge`,!1):this.#s(this.placementValue,!1),this.openIconTarget.classList.remove("hidden"),this.openIconTarget.setAttribute("aria-hidden","false"),this.closeIconTarget.classList.add("hidden"),this.closeIconTarget.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.removeAttribute("aria-modal"),this.sidebarOutlet.element.removeAttribute("role"),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden"),this.backdropValue&&this.#i(),this.visible=!1,this.dispatch("hide")}handleEscapeKey(i){i.key==="Escape"&&this.visible&&this.hideDrawer()}#t(){if(!this.visible){let i=document.createElement("div");i.setAttribute("data-drawer-backdrop",""),i.classList.add(...this.constructor.classes.backdrop.split(" ")),i.addEventListener("click",()=>this.hideDrawer()),document.body.appendChild(i)}}#i(){let i=document.querySelector("[data-drawer-backdrop]");i&&i.remove()}#n(i){let e={top:{base:["top-0","left-0","right-0"],active:["transform-none"],inactive:["-translate-y-full"]},right:{base:["right-0","top-0"],active:["transform-none"],inactive:["translate-x-full"]},bottom:{base:["bottom-0","left-0","right-0"],active:["transform-none"],inactive:["translate-y-full"]},left:{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]},"bottom-edge":{base:["left-0","top-0"],active:["transform-none"],inactive:["translate-y-full",this.edgeOffsetValue]}};return e[i]||e.left}#s(i,e){let t=this.#n(i);e?(t.active.forEach(r=>this.sidebarOutlet.element.classList.add(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.remove(r))):(t.active.forEach(r=>this.sidebarOutlet.element.classList.remove(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.add(r)))}#r(i,e){this.#s(i,e)}};var hr=class extends S{connect(){console.log(`sidebar-menu-item connected: ${this.element}`)}};var dr=class extends S{connect(){console.log(`sidebar-menu connected: ${this.element}`)}};var fr=class extends S{connect(){console.log(`sidebar connected: ${this.element}`)}};var pr=class extends S{connect(){console.log(`has-many-panel connected: ${this.element}`)}};var mr=class extends S{static targets=["target","template","addButton"];static values={wrapperSelector:{type:String,default:".nested-resource-form-fields"},limit:Number};connect(){this.updateState()}add(i){i.preventDefault();let e=this.templateTarget.innerHTML.replace(/NEW_RECORD/g,new Date().getTime().toString());this.targetTarget.insertAdjacentHTML("beforebegin",e);let t=new CustomEvent("nested-resource-form-fields:add",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}remove(i){i.preventDefault();let e=i.target.closest(this.wrapperSelectorValue);if(e.dataset.newRecord!==void 0)e.remove();else{e.style.display="none",e.classList.remove(...e.classList);let r=e.querySelector("input[name*='_destroy']");r.value="1"}let t=new CustomEvent("nested-resource-form-fields:remove",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}updateState(){!this.hasAddButtonTarget||this.limitValue==0||(this.childCount>=this.limitValue?this.addButtonTarget.style.display="none":this.addButtonTarget.style.display="initial")}get childCount(){return this.element.querySelectorAll(this.wrapperSelectorValue).length}};var gr=class extends S{connect(){console.log(`toolbar connected: ${this.element}`)}};var vr=class extends S{connect(){console.log(`table-search-input connected: ${this.element}`)}};var br=class extends S{connect(){console.log(`table-toolbar connected: ${this.element}`)}};var yr=class extends S{connect(){console.log(`table connected: ${this.element}`)}};var sp=Bl(qo(),1),wr=class extends S{connect(){console.log(`form connected: ${this.element}`)}submit(){this.element.requestSubmit()}};var jc=function(){function i(e,t){t===void 0&&(t=[]),this._eventType=e,this._eventFunctions=t}return i.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(t){typeof window<"u"&&window.addEventListener(e._eventType,t)})},i}(),zo=jc;var Uc=function(){function i(){this._instances={Accordion:{},Carousel:{},Collapse:{},Dial:{},Dismiss:{},Drawer:{},Dropdown:{},Modal:{},Popover:{},Tabs:{},Tooltip:{},InputCounter:{},CopyClipboard:{}}}return i.prototype.addInstance=function(e,t,r,n){if(n===void 0&&(n=!1),!this._instances[e])return console.warn("Flowbite: Component ".concat(e," does not exist.")),!1;if(this._instances[e][r]&&!n){console.warn("Flowbite: Instance with ID ".concat(r," already exists."));return}n&&this._instances[e][r]&&this._instances[e][r].destroyAndRemoveInstance(),this._instances[e][r||this._generateRandomId()]=t},i.prototype.getAllInstances=function(){return this._instances},i.prototype.getInstances=function(e){return this._instances[e]?this._instances[e]:(console.warn("Flowbite: Component ".concat(e," does not exist.")),!1)},i.prototype.getInstance=function(e,t){if(this._componentAndInstanceCheck(e,t)){if(!this._instances[e][t]){console.warn("Flowbite: Instance with ID ".concat(t," does not exist."));return}return this._instances[e][t]}},i.prototype.destroyAndRemoveInstance=function(e,t){this._componentAndInstanceCheck(e,t)&&(this.destroyInstanceObject(e,t),this.removeInstance(e,t))},i.prototype.removeInstance=function(e,t){this._componentAndInstanceCheck(e,t)&&delete this._instances[e][t]},i.prototype.destroyInstanceObject=function(e,t){this._componentAndInstanceCheck(e,t)&&this._instances[e][t].destroy()},i.prototype.instanceExists=function(e,t){return!(!this._instances[e]||!this._instances[e][t])},i.prototype._generateRandomId=function(){return Math.random().toString(36).substr(2,9)},i.prototype._componentAndInstanceCheck=function(e,t){return this._instances[e]?this._instances[e][t]?!0:(console.warn("Flowbite: Instance with ID ".concat(t," does not exist.")),!1):(console.warn("Flowbite: Component ".concat(e," does not exist.")),!1)},i}(),Vo=new Uc,I=Vo;typeof window<"u"&&(window.FlowbiteInstances=Vo);var Er=function(){return Er=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Er.apply(this,arguments)},_r={alwaysOpen:!1,activeClasses:"bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white",inactiveClasses:"text-gray-500 dark:text-gray-400",onOpen:function(){},onClose:function(){},onToggle:function(){}},Wc={id:null,override:!0},$o=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=_r),n===void 0&&(n=Wc),this._instanceId=n.id?n.id:e.id,this._accordionEl=e,this._items=t,this._options=Er(Er({},_r),r),this._initialized=!1,this.init(),I.addInstance("Accordion",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._items.length&&!this._initialized&&(this._items.forEach(function(t){t.active&&e.open(t.id);var r=function(){e.toggle(t.id)};t.triggerEl.addEventListener("click",r),t.clickHandler=r}),this._initialized=!0)},i.prototype.destroy=function(){this._items.length&&this._initialized&&(this._items.forEach(function(e){e.triggerEl.removeEventListener("click",e.clickHandler),delete e.clickHandler}),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Accordion",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getItem=function(e){return this._items.filter(function(t){return t.id===e})[0]},i.prototype.open=function(e){var t,r,n=this,s=this.getItem(e);this._options.alwaysOpen||this._items.map(function(o){var a,l;o!==s&&((a=o.triggerEl.classList).remove.apply(a,n._options.activeClasses.split(" ")),(l=o.triggerEl.classList).add.apply(l,n._options.inactiveClasses.split(" ")),o.targetEl.classList.add("hidden"),o.triggerEl.setAttribute("aria-expanded","false"),o.active=!1,o.iconEl&&o.iconEl.classList.add("rotate-180"))}),(t=s.triggerEl.classList).add.apply(t,this._options.activeClasses.split(" ")),(r=s.triggerEl.classList).remove.apply(r,this._options.inactiveClasses.split(" ")),s.triggerEl.setAttribute("aria-expanded","true"),s.targetEl.classList.remove("hidden"),s.active=!0,s.iconEl&&s.iconEl.classList.remove("rotate-180"),this._options.onOpen(this,s)},i.prototype.toggle=function(e){var t=this.getItem(e);t.active?this.close(e):this.open(e),this._options.onToggle(this,t)},i.prototype.close=function(e){var t,r,n=this.getItem(e);(t=n.triggerEl.classList).remove.apply(t,this._options.activeClasses.split(" ")),(r=n.triggerEl.classList).add.apply(r,this._options.inactiveClasses.split(" ")),n.targetEl.classList.add("hidden"),n.triggerEl.setAttribute("aria-expanded","false"),n.active=!1,n.iconEl&&n.iconEl.classList.add("rotate-180"),this._options.onClose(this,n)},i.prototype.updateOnOpen=function(e){this._options.onOpen=e},i.prototype.updateOnClose=function(e){this._options.onClose=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Bt(){document.querySelectorAll("[data-accordion]").forEach(function(i){var e=i.getAttribute("data-accordion"),t=i.getAttribute("data-active-classes"),r=i.getAttribute("data-inactive-classes"),n=[];i.querySelectorAll("[data-accordion-target]").forEach(function(s){if(s.closest("[data-accordion]")===i){var o={id:s.getAttribute("data-accordion-target"),triggerEl:s,targetEl:document.querySelector(s.getAttribute("data-accordion-target")),iconEl:s.querySelector("[data-accordion-icon]"),active:s.getAttribute("aria-expanded")==="true"};n.push(o)}}),new $o(i,n,{alwaysOpen:e==="open",activeClasses:t||_r.activeClasses,inactiveClasses:r||_r.inactiveClasses})})}typeof window<"u"&&(window.Accordion=$o,window.initAccordions=Bt);var Ar=function(){return Ar=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Ar.apply(this,arguments)},jo={onCollapse:function(){},onExpand:function(){},onToggle:function(){}},Kc={id:null,override:!0},Tr=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=jo),n===void 0&&(n=Kc),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=Ar(Ar({},jo),r),this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Collapse",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._triggerEl&&this._targetEl&&!this._initialized&&(this._triggerEl.hasAttribute("aria-expanded")?this._visible=this._triggerEl.getAttribute("aria-expanded")==="true":this._visible=!this._targetEl.classList.contains("hidden"),this._clickHandler=function(){e.toggle()},this._triggerEl.addEventListener("click",this._clickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._initialized&&(this._triggerEl.removeEventListener("click",this._clickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Collapse",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.collapse=function(){this._targetEl.classList.add("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","false"),this._visible=!1,this._options.onCollapse(this)},i.prototype.expand=function(){this._targetEl.classList.remove("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","true"),this._visible=!0,this._options.onExpand(this)},i.prototype.toggle=function(){this._visible?this.collapse():this.expand(),this._options.onToggle(this)},i.prototype.updateOnCollapse=function(e){this._options.onCollapse=e},i.prototype.updateOnExpand=function(e){this._options.onExpand=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Nt(){document.querySelectorAll("[data-collapse-toggle]").forEach(function(i){var e=i.getAttribute("data-collapse-toggle"),t=document.getElementById(e);t?I.instanceExists("Collapse",t.getAttribute("id"))?new Tr(t,i,{},{id:t.getAttribute("id")+"_"+I._generateRandomId()}):new Tr(t,i):console.error('The target element with id "'.concat(e,'" does not exist. Please check the data-collapse-toggle attribute.'))})}typeof window<"u"&&(window.Collapse=Tr,window.initCollapses=Nt);var Gn=Tr;var ct=function(){return ct=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},ct.apply(this,arguments)},Sr={defaultPosition:0,indicators:{items:[],activeClasses:"bg-white dark:bg-gray-800",inactiveClasses:"bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800"},interval:3e3,onNext:function(){},onPrev:function(){},onChange:function(){}},Gc={id:null,override:!0},Uo=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=Sr),n===void 0&&(n=Gc),this._instanceId=n.id?n.id:e.id,this._carouselEl=e,this._items=t,this._options=ct(ct(ct({},Sr),r),{indicators:ct(ct({},Sr.indicators),r.indicators)}),this._activeItem=this.getItem(this._options.defaultPosition),this._indicators=this._options.indicators.items,this._intervalDuration=this._options.interval,this._intervalInstance=null,this._initialized=!1,this.init(),I.addInstance("Carousel",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._items.length&&!this._initialized&&(this._items.map(function(t){t.el.classList.add("absolute","inset-0","transition-transform","transform")}),this.getActiveItem()?this.slideTo(this.getActiveItem().position):this.slideTo(0),this._indicators.map(function(t,r){t.el.addEventListener("click",function(){e.slideTo(r)})}),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Carousel",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getItem=function(e){return this._items[e]},i.prototype.slideTo=function(e){var t=this._items[e],r={left:t.position===0?this._items[this._items.length-1]:this._items[t.position-1],middle:t,right:t.position===this._items.length-1?this._items[0]:this._items[t.position+1]};this._rotate(r),this._setActiveItem(t),this._intervalInstance&&(this.pause(),this.cycle()),this._options.onChange(this)},i.prototype.next=function(){var e=this.getActiveItem(),t=null;e.position===this._items.length-1?t=this._items[0]:t=this._items[e.position+1],this.slideTo(t.position),this._options.onNext(this)},i.prototype.prev=function(){var e=this.getActiveItem(),t=null;e.position===0?t=this._items[this._items.length-1]:t=this._items[e.position-1],this.slideTo(t.position),this._options.onPrev(this)},i.prototype._rotate=function(e){if(this._items.map(function(t){t.el.classList.add("hidden")}),this._items.length===1){e.middle.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-10"),e.middle.el.classList.add("translate-x-0","z-20");return}e.left.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-20"),e.left.el.classList.add("-translate-x-full","z-10"),e.middle.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-10"),e.middle.el.classList.add("translate-x-0","z-30"),e.right.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-30"),e.right.el.classList.add("translate-x-full","z-20")},i.prototype.cycle=function(){var e=this;typeof window<"u"&&(this._intervalInstance=window.setInterval(function(){e.next()},this._intervalDuration))},i.prototype.pause=function(){clearInterval(this._intervalInstance)},i.prototype.getActiveItem=function(){return this._activeItem},i.prototype._setActiveItem=function(e){var t,r,n=this;this._activeItem=e;var s=e.position;this._indicators.length&&(this._indicators.map(function(o){var a,l;o.el.setAttribute("aria-current","false"),(a=o.el.classList).remove.apply(a,n._options.indicators.activeClasses.split(" ")),(l=o.el.classList).add.apply(l,n._options.indicators.inactiveClasses.split(" "))}),(t=this._indicators[s].el.classList).add.apply(t,this._options.indicators.activeClasses.split(" ")),(r=this._indicators[s].el.classList).remove.apply(r,this._options.indicators.inactiveClasses.split(" ")),this._indicators[s].el.setAttribute("aria-current","true"))},i.prototype.updateOnNext=function(e){this._options.onNext=e},i.prototype.updateOnPrev=function(e){this._options.onPrev=e},i.prototype.updateOnChange=function(e){this._options.onChange=e},i}();function Ht(){document.querySelectorAll("[data-carousel]").forEach(function(i){var e=i.getAttribute("data-carousel-interval"),t=i.getAttribute("data-carousel")==="slide",r=[],n=0;i.querySelectorAll("[data-carousel-item]").length&&Array.from(i.querySelectorAll("[data-carousel-item]")).map(function(f,u){r.push({position:u,el:f}),f.getAttribute("data-carousel-item")==="active"&&(n=u)});var s=[];i.querySelectorAll("[data-carousel-slide-to]").length&&Array.from(i.querySelectorAll("[data-carousel-slide-to]")).map(function(f){s.push({position:parseInt(f.getAttribute("data-carousel-slide-to")),el:f})});var o=new Uo(i,r,{defaultPosition:n,indicators:{items:s},interval:e||Sr.interval});t&&o.cycle();var a=i.querySelector("[data-carousel-next]"),l=i.querySelector("[data-carousel-prev]");a&&a.addEventListener("click",function(){o.next()}),l&&l.addEventListener("click",function(){o.prev()})})}typeof window<"u"&&(window.Carousel=Uo,window.initCarousels=Ht);var kr=function(){return kr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},kr.apply(this,arguments)},Wo={transition:"transition-opacity",duration:300,timing:"ease-out",onHide:function(){}},Yc={id:null,override:!0},Ko=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Wo),n===void 0&&(n=Yc),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=kr(kr({},Wo),r),this._initialized=!1,this.init(),I.addInstance("Dismiss",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._triggerEl&&this._targetEl&&!this._initialized&&(this._clickHandler=function(){e.hide()},this._triggerEl.addEventListener("click",this._clickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._initialized&&(this._triggerEl.removeEventListener("click",this._clickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Dismiss",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){var e=this;this._targetEl.classList.add(this._options.transition,"duration-".concat(this._options.duration),this._options.timing,"opacity-0"),setTimeout(function(){e._targetEl.classList.add("hidden")},this._options.duration),this._options.onHide(this,this._targetEl)},i.prototype.updateOnHide=function(e){this._options.onHide=e},i}();function qt(){document.querySelectorAll("[data-dismiss-target]").forEach(function(i){var e=i.getAttribute("data-dismiss-target"),t=document.querySelector(e);t?new Ko(t,i):console.error('The dismiss element with id "'.concat(e,'" does not exist. Please check the data-dismiss-target attribute.'))})}typeof window<"u"&&(window.Dismiss=Ko,window.initDismisses=qt);var J="top",ie="bottom",te="right",ee="left",xr="auto",Je=[J,ie,te,ee],We="start",ut="end",Go="clippingParents",Lr="viewport",zt="popper",Yo="reference",Yn=Je.reduce(function(i,e){return i.concat([e+"-"+We,e+"-"+ut])},[]),Cr=[].concat(Je,[xr]).reduce(function(i,e){return i.concat([e,e+"-"+We,e+"-"+ut])},[]),Xc="beforeRead",Zc="read",Qc="afterRead",Jc="beforeMain",eu="main",tu="afterMain",iu="beforeWrite",ru="write",nu="afterWrite",Xo=[Xc,Zc,Qc,Jc,eu,tu,iu,ru,nu];function oe(i){return i?(i.nodeName||"").toLowerCase():null}function G(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function _e(i){var e=G(i).Element;return i instanceof e||i instanceof Element}function re(i){var e=G(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function Vt(i){if(typeof ShadowRoot>"u")return!1;var e=G(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function su(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];!re(s)||!oe(s)||(Object.assign(s.style,r),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function ou(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var n=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=o.reduce(function(l,f){return l[f]="",l},{});!re(n)||!oe(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}var Zo={name:"applyStyles",enabled:!0,phase:"write",fn:su,effect:ou,requires:["computeStyles"]};function ae(i){return i.split("-")[0]}var Ce=Math.max,ht=Math.min,Ke=Math.round;function $t(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ei(){return!/^((?!chrome|android).)*safari/i.test($t())}function Ae(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=i.getBoundingClientRect(),n=1,s=1;e&&re(i)&&(n=i.offsetWidth>0&&Ke(r.width)/i.offsetWidth||1,s=i.offsetHeight>0&&Ke(r.height)/i.offsetHeight||1);var o=_e(i)?G(i):window,a=o.visualViewport,l=!Ei()&&t,f=(r.left+(l&&a?a.offsetLeft:0))/n,u=(r.top+(l&&a?a.offsetTop:0))/s,g=r.width/n,w=r.height/s;return{width:g,height:w,top:u,right:f+g,bottom:u+w,left:f,x:f,y:u}}function dt(i){var e=Ae(i),t=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:r}}function _i(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&Vt(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function me(i){return G(i).getComputedStyle(i)}function Xn(i){return["table","td","th"].indexOf(oe(i))>=0}function he(i){return((_e(i)?i.ownerDocument:i.document)||window.document).documentElement}function Ge(i){return oe(i)==="html"?i:i.assignedSlot||i.parentNode||(Vt(i)?i.host:null)||he(i)}function Qo(i){return!re(i)||me(i).position==="fixed"?null:i.offsetParent}function au(i){var e=/firefox/i.test($t()),t=/Trident/i.test($t());if(t&&re(i)){var r=me(i);if(r.position==="fixed")return null}var n=Ge(i);for(Vt(n)&&(n=n.host);re(n)&&["html","body"].indexOf(oe(n))<0;){var s=me(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function Ie(i){for(var e=G(i),t=Qo(i);t&&Xn(t)&&me(t).position==="static";)t=Qo(t);return t&&(oe(t)==="html"||oe(t)==="body"&&me(t).position==="static")?e:t||au(i)||e}function ft(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function pt(i,e,t){return Ce(i,ht(e,t))}function Jo(i,e,t){var r=pt(i,e,t);return r>t?t:r}function Ai(){return{top:0,right:0,bottom:0,left:0}}function Ti(i){return Object.assign({},Ai(),i)}function Si(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var lu=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Ti(typeof e!="number"?e:Si(e,Je))};function cu(i){var e,t=i.state,r=i.name,n=i.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=ae(t.placement),l=ft(a),f=[ee,te].indexOf(a)>=0,u=f?"height":"width";if(!(!s||!o)){var g=lu(n.padding,t),w=dt(s),y=l==="y"?J:ee,_=l==="y"?ie:te,L=t.rects.reference[u]+t.rects.reference[l]-o[l]-t.rects.popper[u],k=o[l]-t.rects.reference[l],P=Ie(s),q=P?l==="y"?P.clientHeight||0:P.clientWidth||0:0,B=L/2-k/2,T=g[y],O=q-w[u]-g[_],x=q/2-w[u]/2+B,F=pt(T,x,O),j=l;t.modifiersData[r]=(e={},e[j]=F,e.centerOffset=F-x,e)}}function uu(i){var e=i.state,t=i.options,r=t.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||_i(e.elements.popper,n)&&(e.elements.arrow=n))}var ea={name:"arrow",enabled:!0,phase:"main",fn:cu,effect:uu,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Te(i){return i.split("-")[1]}var hu={top:"auto",right:"auto",bottom:"auto",left:"auto"};function du(i,e){var t=i.x,r=i.y,n=e.devicePixelRatio||1;return{x:Ke(t*n)/n||0,y:Ke(r*n)/n||0}}function ta(i){var e,t=i.popper,r=i.popperRect,n=i.placement,s=i.variation,o=i.offsets,a=i.position,l=i.gpuAcceleration,f=i.adaptive,u=i.roundOffsets,g=i.isFixed,w=o.x,y=w===void 0?0:w,_=o.y,L=_===void 0?0:_,k=typeof u=="function"?u({x:y,y:L}):{x:y,y:L};y=k.x,L=k.y;var P=o.hasOwnProperty("x"),q=o.hasOwnProperty("y"),B=ee,T=J,O=window;if(f){var x=Ie(t),F="clientHeight",j="clientWidth";if(x===G(t)&&(x=he(t),me(x).position!=="static"&&a==="absolute"&&(F="scrollHeight",j="scrollWidth")),x=x,n===J||(n===ee||n===te)&&s===ut){T=ie;var U=g&&x===O&&O.visualViewport?O.visualViewport.height:x[F];L-=U-r.height,L*=l?1:-1}if(n===ee||(n===J||n===ie)&&s===ut){B=te;var Y=g&&x===O&&O.visualViewport?O.visualViewport.width:x[j];y-=Y-r.width,y*=l?1:-1}}var H=Object.assign({position:a},f&&hu),X=u===!0?du({x:y,y:L},G(t)):{x:y,y:L};if(y=X.x,L=X.y,l){var W;return Object.assign({},H,(W={},W[T]=q?"0":"",W[B]=P?"0":"",W.transform=(O.devicePixelRatio||1)<=1?"translate("+y+"px, "+L+"px)":"translate3d("+y+"px, "+L+"px, 0)",W))}return Object.assign({},H,(e={},e[T]=q?L+"px":"",e[B]=P?y+"px":"",e.transform="",e))}function fu(i){var e=i.state,t=i.options,r=t.gpuAcceleration,n=r===void 0?!0:r,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,l=a===void 0?!0:a,f={placement:ae(e.placement),variation:Te(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ta(Object.assign({},f,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ta(Object.assign({},f,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var ia={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:fu,data:{}};var Ir={passive:!0};function pu(i){var e=i.state,t=i.instance,r=i.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,l=G(e.elements.popper),f=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&f.forEach(function(u){u.addEventListener("scroll",t.update,Ir)}),a&&l.addEventListener("resize",t.update,Ir),function(){s&&f.forEach(function(u){u.removeEventListener("scroll",t.update,Ir)}),a&&l.removeEventListener("resize",t.update,Ir)}}var ra={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:pu,data:{}};var mu={left:"right",right:"left",bottom:"top",top:"bottom"};function jt(i){return i.replace(/left|right|bottom|top/g,function(e){return mu[e]})}var gu={start:"end",end:"start"};function Or(i){return i.replace(/start|end/g,function(e){return gu[e]})}function mt(i){var e=G(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function gt(i){return Ae(he(i)).left+mt(i).scrollLeft}function Zn(i,e){var t=G(i),r=he(i),n=t.visualViewport,s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;var f=Ei();(f||!f&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:s,height:o,x:a+gt(i),y:l}}function Qn(i){var e,t=he(i),r=mt(i),n=(e=i.ownerDocument)==null?void 0:e.body,s=Ce(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=Ce(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+gt(i),l=-r.scrollTop;return me(n||t).direction==="rtl"&&(a+=Ce(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function vt(i){var e=me(i),t=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+r)}function Rr(i){return["html","body","#document"].indexOf(oe(i))>=0?i.ownerDocument.body:re(i)&&vt(i)?i:Rr(Ge(i))}function et(i,e){var t;e===void 0&&(e=[]);var r=Rr(i),n=r===((t=i.ownerDocument)==null?void 0:t.body),s=G(r),o=n?[s].concat(s.visualViewport||[],vt(r)?r:[]):r,a=e.concat(o);return n?a:a.concat(et(Ge(o)))}function Ut(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function vu(i,e){var t=Ae(i,!1,e==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function na(i,e,t){return e===Lr?Ut(Zn(i,t)):_e(e)?vu(e,t):Ut(Qn(he(i)))}function bu(i){var e=et(Ge(i)),t=["absolute","fixed"].indexOf(me(i).position)>=0,r=t&&re(i)?Ie(i):i;return _e(r)?e.filter(function(n){return _e(n)&&_i(n,r)&&oe(n)!=="body"}):[]}function Jn(i,e,t,r){var n=e==="clippingParents"?bu(i):[].concat(e),s=[].concat(n,[t]),o=s[0],a=s.reduce(function(l,f){var u=na(i,f,r);return l.top=Ce(u.top,l.top),l.right=ht(u.right,l.right),l.bottom=ht(u.bottom,l.bottom),l.left=Ce(u.left,l.left),l},na(i,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ki(i){var e=i.reference,t=i.element,r=i.placement,n=r?ae(r):null,s=r?Te(r):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(n){case J:l={x:o,y:e.y-t.height};break;case ie:l={x:o,y:e.y+e.height};break;case te:l={x:e.x+e.width,y:a};break;case ee:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var f=n?ft(n):null;if(f!=null){var u=f==="y"?"height":"width";switch(s){case We:l[f]=l[f]-(e[u]/2-t[u]/2);break;case ut:l[f]=l[f]+(e[u]/2-t[u]/2);break;default:}}return l}function Oe(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=r===void 0?i.placement:r,s=t.strategy,o=s===void 0?i.strategy:s,a=t.boundary,l=a===void 0?Go:a,f=t.rootBoundary,u=f===void 0?Lr:f,g=t.elementContext,w=g===void 0?zt:g,y=t.altBoundary,_=y===void 0?!1:y,L=t.padding,k=L===void 0?0:L,P=Ti(typeof k!="number"?k:Si(k,Je)),q=w===zt?Yo:zt,B=i.rects.popper,T=i.elements[_?q:w],O=Jn(_e(T)?T:T.contextElement||he(i.elements.popper),l,u,o),x=Ae(i.elements.reference),F=ki({reference:x,element:B,strategy:"absolute",placement:n}),j=Ut(Object.assign({},B,F)),U=w===zt?j:x,Y={top:O.top-U.top+P.top,bottom:U.bottom-O.bottom+P.bottom,left:O.left-U.left+P.left,right:U.right-O.right+P.right},H=i.modifiersData.offset;if(w===zt&&H){var X=H[n];Object.keys(Y).forEach(function(W){var be=[te,ie].indexOf(W)>=0?1:-1,xe=[J,ie].indexOf(W)>=0?"y":"x";Y[W]+=X[xe]*be})}return Y}function es(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,f=l===void 0?Cr:l,u=Te(r),g=u?a?Yn:Yn.filter(function(_){return Te(_)===u}):Je,w=g.filter(function(_){return f.indexOf(_)>=0});w.length===0&&(w=g);var y=w.reduce(function(_,L){return _[L]=Oe(i,{placement:L,boundary:n,rootBoundary:s,padding:o})[ae(L)],_},{});return Object.keys(y).sort(function(_,L){return y[_]-y[L]})}function yu(i){if(ae(i)===xr)return[];var e=jt(i);return[Or(i),e,Or(e)]}function wu(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,f=t.padding,u=t.boundary,g=t.rootBoundary,w=t.altBoundary,y=t.flipVariations,_=y===void 0?!0:y,L=t.allowedAutoPlacements,k=e.options.placement,P=ae(k),q=P===k,B=l||(q||!_?[jt(k)]:yu(k)),T=[k].concat(B).reduce(function(ce,N){return ce.concat(ae(N)===xr?es(e,{placement:N,boundary:u,rootBoundary:g,padding:f,flipVariations:_,allowedAutoPlacements:L}):N)},[]),O=e.rects.reference,x=e.rects.popper,F=new Map,j=!0,U=T[0],Y=0;Y<T.length;Y++){var H=T[Y],X=ae(H),W=Te(H)===We,be=[J,ie].indexOf(X)>=0,xe=be?"width":"height",h=Oe(e,{placement:H,boundary:u,rootBoundary:g,altBoundary:w,padding:f}),d=be?W?te:ee:W?ie:J;O[xe]>x[xe]&&(d=jt(d));var p=jt(d),b=[];if(s&&b.push(h[X]<=0),a&&b.push(h[d]<=0,h[p]<=0),b.every(function(ce){return ce})){U=H,j=!1;break}F.set(H,b)}if(j)for(var E=_?3:1,v=function(N){var z=T.find(function(ne){var de=F.get(ne);if(de)return de.slice(0,N).every(function(Le){return Le})});if(z)return U=z,"break"},R=E;R>0;R--){var M=v(R);if(M==="break")break}e.placement!==U&&(e.modifiersData[r]._skip=!0,e.placement=U,e.reset=!0)}}var sa={name:"flip",enabled:!0,phase:"main",fn:wu,requiresIfExists:["offset"],data:{_skip:!1}};function oa(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function aa(i){return[J,te,ie,ee].some(function(e){return i[e]>=0})}function Eu(i){var e=i.state,t=i.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=Oe(e,{elementContext:"reference"}),a=Oe(e,{altBoundary:!0}),l=oa(o,r),f=oa(a,n,s),u=aa(l),g=aa(f);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:f,isReferenceHidden:u,hasPopperEscaped:g},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":g})}var la={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Eu};function _u(i,e,t){var r=ae(i),n=[ee,J].indexOf(r)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[ee,te].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Au(i){var e=i.state,t=i.options,r=i.name,n=t.offset,s=n===void 0?[0,0]:n,o=Cr.reduce(function(u,g){return u[g]=_u(g,e.rects,s),u},{}),a=o[e.placement],l=a.x,f=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=f),e.modifiersData[r]=o}var ca={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Au};function Tu(i){var e=i.state,t=i.name;e.modifiersData[t]=ki({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var ua={name:"popperOffsets",enabled:!0,phase:"read",fn:Tu,data:{}};function ts(i){return i==="x"?"y":"x"}function Su(i){var e=i.state,t=i.options,r=i.name,n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,f=t.rootBoundary,u=t.altBoundary,g=t.padding,w=t.tether,y=w===void 0?!0:w,_=t.tetherOffset,L=_===void 0?0:_,k=Oe(e,{boundary:l,rootBoundary:f,padding:g,altBoundary:u}),P=ae(e.placement),q=Te(e.placement),B=!q,T=ft(P),O=ts(T),x=e.modifiersData.popperOffsets,F=e.rects.reference,j=e.rects.popper,U=typeof L=="function"?L(Object.assign({},e.rects,{placement:e.placement})):L,Y=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),H=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,X={x:0,y:0};if(x){if(s){var W,be=T==="y"?J:ee,xe=T==="y"?ie:te,h=T==="y"?"height":"width",d=x[T],p=d+k[be],b=d-k[xe],E=y?-j[h]/2:0,v=q===We?F[h]:j[h],R=q===We?-j[h]:-F[h],M=e.elements.arrow,ce=y&&M?dt(M):{width:0,height:0},N=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Ai(),z=N[be],ne=N[xe],de=pt(0,F[h],ce[h]),Le=B?F[h]/2-E-de-z-Y.mainAxis:v-de-z-Y.mainAxis,Lt=B?-F[h]/2+E+de+ne+Y.mainAxis:R+de+ne+Y.mainAxis,Ct=e.elements.arrow&&Ie(e.elements.arrow),Qe=Ct?T==="y"?Ct.clientTop||0:Ct.clientLeft||0:0,It=(W=H?.[T])!=null?W:0,Ne=d+Le-It-Qe,fi=d+Lt-It,Ot=pt(y?ht(p,Ne):p,d,y?Ce(b,fi):b);x[T]=Ot,X[T]=Ot-d}if(a){var He,Rt=T==="x"?J:ee,Mt=T==="x"?ie:te,Pe=x[O],lt=O==="y"?"height":"width",Ui=Pe+k[Rt],Pt=Pe-k[Mt],qe=[J,ee].indexOf(P)!==-1,ze=(He=H?.[O])!=null?He:0,Ve=qe?Ui:Pe-F[lt]-j[lt]-ze+Y.altAxis,pi=qe?Pe+F[lt]+j[lt]-ze-Y.altAxis:Pt,mi=y&&qe?Jo(Ve,Pe,pi):pt(y?Ve:Ui,Pe,y?pi:Pt);x[O]=mi,X[O]=mi-Pe}e.modifiersData[r]=X}}var ha={name:"preventOverflow",enabled:!0,phase:"main",fn:Su,requiresIfExists:["offset"]};function is(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function rs(i){return i===G(i)||!re(i)?mt(i):is(i)}function ku(i){var e=i.getBoundingClientRect(),t=Ke(e.width)/i.offsetWidth||1,r=Ke(e.height)/i.offsetHeight||1;return t!==1||r!==1}function ns(i,e,t){t===void 0&&(t=!1);var r=re(e),n=re(e)&&ku(e),s=he(e),o=Ae(i,n,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!t)&&((oe(e)!=="body"||vt(s))&&(a=rs(e)),re(e)?(l=Ae(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=gt(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function xu(i){var e=new Map,t=new Set,r=[];i.forEach(function(s){e.set(s.name,s)});function n(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&n(l)}}),r.push(s)}return i.forEach(function(s){t.has(s.name)||n(s)}),r}function ss(i){var e=xu(i);return Xo.reduce(function(t,r){return t.concat(e.filter(function(n){return n.phase===r}))},[])}function os(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function as(i){var e=i.reduce(function(t,r){var n=t[r.name];return t[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var da={placement:"bottom",modifiers:[],strategy:"absolute"};function fa(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function pa(i){i===void 0&&(i={});var e=i,t=e.defaultModifiers,r=t===void 0?[]:t,n=e.defaultOptions,s=n===void 0?da:n;return function(a,l,f){f===void 0&&(f=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},da,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},g=[],w=!1,y={state:u,setOptions:function(P){var q=typeof P=="function"?P(u.options):P;L(),u.options=Object.assign({},s,u.options,q),u.scrollParents={reference:_e(a)?et(a):a.contextElement?et(a.contextElement):[],popper:et(l)};var B=ss(as([].concat(r,u.options.modifiers)));return u.orderedModifiers=B.filter(function(T){return T.enabled}),_(),y.update()},forceUpdate:function(){if(!w){var P=u.elements,q=P.reference,B=P.popper;if(fa(q,B)){u.rects={reference:ns(q,Ie(B),u.options.strategy==="fixed"),popper:dt(B)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(Y){return u.modifiersData[Y.name]=Object.assign({},Y.data)});for(var T=0;T<u.orderedModifiers.length;T++){if(u.reset===!0){u.reset=!1,T=-1;continue}var O=u.orderedModifiers[T],x=O.fn,F=O.options,j=F===void 0?{}:F,U=O.name;typeof x=="function"&&(u=x({state:u,options:j,name:U,instance:y})||u)}}}},update:os(function(){return new Promise(function(k){y.forceUpdate(),k(u)})}),destroy:function(){L(),w=!0}};if(!fa(a,l))return y;y.setOptions(f).then(function(k){!w&&f.onFirstUpdate&&f.onFirstUpdate(k)});function _(){u.orderedModifiers.forEach(function(k){var P=k.name,q=k.options,B=q===void 0?{}:q,T=k.effect;if(typeof T=="function"){var O=T({state:u,name:P,instance:y,options:B}),x=function(){};g.push(O||x)}})}function L(){g.forEach(function(k){return k()}),g=[]}return y}}var Lu=[ra,ua,ia,Zo,ca,sa,ha,ea,la],bt=pa({defaultModifiers:Lu});var tt=function(){return tt=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},tt.apply(this,arguments)},Mr=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,s;r<n;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))},it={placement:"bottom",triggerType:"click",offsetSkidding:0,offsetDistance:10,delay:300,ignoreClickOutsideClass:!1,onShow:function(){},onHide:function(){},onToggle:function(){}},Cu={id:null,override:!0},ls=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=it),n===void 0&&(n=Cu),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=tt(tt({},it),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Dropdown",this,this._instanceId,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._popperInstance=this._createPopperInstance(),this._setupEventListeners(),this._initialized=!0)},i.prototype.destroy=function(){var e=this,t=this._getTriggerEvents();this._options.triggerType==="click"&&t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._clickHandler)}),this._options.triggerType==="hover"&&(t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hoverShowTriggerElHandler),e._targetEl.removeEventListener(r,e._hoverShowTargetElHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hoverHideHandler),e._targetEl.removeEventListener(r,e._hoverHideHandler)})),this._popperInstance.destroy(),this._initialized=!1},i.prototype.removeInstance=function(){I.removeInstance("Dropdown",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var e=this,t=this._getTriggerEvents();this._clickHandler=function(){e.toggle()},this._options.triggerType==="click"&&t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._clickHandler)}),this._hoverShowTriggerElHandler=function(r){r.type==="click"?e.toggle():setTimeout(function(){e.show()},e._options.delay)},this._hoverShowTargetElHandler=function(){e.show()},this._hoverHideHandler=function(){setTimeout(function(){e._targetEl.matches(":hover")||e.hide()},e._options.delay)},this._options.triggerType==="hover"&&(t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hoverShowTriggerElHandler),e._targetEl.addEventListener(r,e._hoverShowTargetElHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hoverHideHandler),e._targetEl.addEventListener(r,e._hoverHideHandler)}))},i.prototype._createPopperInstance=function(){return bt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[this._options.offsetSkidding,this._options.offsetDistance]}}]})},i.prototype._setupClickOutsideListener=function(){var e=this;this._clickOutsideEventListener=function(t){e._handleClickOutside(t,e._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(e,t){var r=e.target,n=this._options.ignoreClickOutsideClass,s=!1;if(n){var o=document.querySelectorAll(".".concat(n));o.forEach(function(a){if(a.contains(r)){s=!0;return}})}r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&!s&&this.isVisible()&&this.hide()},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","click"],hideEvents:["mouseleave"]};case"click":return{showEvents:["click"],hideEvents:[]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["click"],hideEvents:[]}}},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show(),this._options.onToggle(this)},i.prototype.isVisible=function(){return this._visible},i.prototype.show=function(){this._targetEl.classList.remove("hidden"),this._targetEl.classList.add("block"),this._popperInstance.setOptions(function(e){return tt(tt({},e),{modifiers:Mr(Mr([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("block"),this._targetEl.classList.add("hidden"),this._popperInstance.setOptions(function(e){return tt(tt({},e),{modifiers:Mr(Mr([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._visible=!1,this._removeClickOutsideListener(),this._options.onHide(this)},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Wt(){document.querySelectorAll("[data-dropdown-toggle]").forEach(function(i){var e=i.getAttribute("data-dropdown-toggle"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-dropdown-placement"),n=i.getAttribute("data-dropdown-offset-skidding"),s=i.getAttribute("data-dropdown-offset-distance"),o=i.getAttribute("data-dropdown-trigger"),a=i.getAttribute("data-dropdown-delay"),l=i.getAttribute("data-dropdown-ignore-click-outside-class");new ls(t,i,{placement:r||it.placement,triggerType:o||it.triggerType,offsetSkidding:n?parseInt(n):it.offsetSkidding,offsetDistance:s?parseInt(s):it.offsetDistance,delay:a?parseInt(a):it.delay,ignoreClickOutsideClass:l||it.ignoreClickOutsideClass})}else console.error('The dropdown element with id "'.concat(e,'" does not exist. Please check the data-dropdown-toggle attribute.'))})}typeof window<"u"&&(window.Dropdown=ls,window.initDropdowns=Wt);var cs=ls;var Pr=function(){return Pr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Pr.apply(this,arguments)},Dr={placement:"center",backdropClasses:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-40",backdrop:"dynamic",closable:!0,onHide:function(){},onShow:function(){},onToggle:function(){}},Iu={id:null,override:!0},ma=function(){function i(e,t,r){e===void 0&&(e=null),t===void 0&&(t=Dr),r===void 0&&(r=Iu),this._eventListenerInstances=[],this._instanceId=r.id?r.id:e.id,this._targetEl=e,this._options=Pr(Pr({},Dr),t),this._isHidden=!0,this._backdropEl=null,this._initialized=!1,this.init(),I.addInstance("Modal",this,this._instanceId,r.override)}return i.prototype.init=function(){var e=this;this._targetEl&&!this._initialized&&(this._getPlacementClasses().map(function(t){e._targetEl.classList.add(t)}),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this.removeAllEventListenerInstances(),this._destroyBackdropEl(),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Modal",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._createBackdrop=function(){var e;if(this._isHidden){var t=document.createElement("div");t.setAttribute("modal-backdrop",""),(e=t.classList).add.apply(e,this._options.backdropClasses.split(" ")),document.querySelector("body").append(t),this._backdropEl=t}},i.prototype._destroyBackdropEl=function(){this._isHidden||document.querySelector("[modal-backdrop]").remove()},i.prototype._setupModalCloseEventListeners=function(){var e=this;this._options.backdrop==="dynamic"&&(this._clickOutsideEventListener=function(t){e._handleOutsideClick(t.target)},this._targetEl.addEventListener("click",this._clickOutsideEventListener,!0)),this._keydownEventListener=function(t){t.key==="Escape"&&e.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeModalCloseEventListeners=function(){this._options.backdrop==="dynamic"&&this._targetEl.removeEventListener("click",this._clickOutsideEventListener,!0),document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._handleOutsideClick=function(e){(e===this._targetEl||e===this._backdropEl&&this.isVisible())&&this.hide()},i.prototype._getPlacementClasses=function(){switch(this._options.placement){case"top-left":return["justify-start","items-start"];case"top-center":return["justify-center","items-start"];case"top-right":return["justify-end","items-start"];case"center-left":return["justify-start","items-center"];case"center":return["justify-center","items-center"];case"center-right":return["justify-end","items-center"];case"bottom-left":return["justify-start","items-end"];case"bottom-center":return["justify-center","items-end"];case"bottom-right":return["justify-end","items-end"];default:return["justify-center","items-center"]}},i.prototype.toggle=function(){this._isHidden?this.show():this.hide(),this._options.onToggle(this)},i.prototype.show=function(){this.isHidden&&(this._targetEl.classList.add("flex"),this._targetEl.classList.remove("hidden"),this._targetEl.setAttribute("aria-modal","true"),this._targetEl.setAttribute("role","dialog"),this._targetEl.removeAttribute("aria-hidden"),this._createBackdrop(),this._isHidden=!1,this._options.closable&&this._setupModalCloseEventListeners(),document.body.classList.add("overflow-hidden"),this._options.onShow(this))},i.prototype.hide=function(){this.isVisible&&(this._targetEl.classList.add("hidden"),this._targetEl.classList.remove("flex"),this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.removeAttribute("aria-modal"),this._targetEl.removeAttribute("role"),this._destroyBackdropEl(),this._isHidden=!0,document.body.classList.remove("overflow-hidden"),this._options.closable&&this._removeModalCloseEventListeners(),this._options.onHide(this))},i.prototype.isVisible=function(){return!this._isHidden},i.prototype.isHidden=function(){return this._isHidden},i.prototype.addEventListenerInstance=function(e,t,r){this._eventListenerInstances.push({element:e,type:t,handler:r})},i.prototype.removeAllEventListenerInstances=function(){this._eventListenerInstances.map(function(e){e.element.removeEventListener(e.type,e.handler)}),this._eventListenerInstances=[]},i.prototype.getAllEventListenerInstances=function(){return this._eventListenerInstances},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Kt(){document.querySelectorAll("[data-modal-target]").forEach(function(i){var e=i.getAttribute("data-modal-target"),t=document.getElementById(e);if(t){var r=t.getAttribute("data-modal-placement"),n=t.getAttribute("data-modal-backdrop");new ma(t,{placement:r||Dr.placement,backdrop:n||Dr.backdrop})}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?."))}),document.querySelectorAll("[data-modal-toggle]").forEach(function(i){var e=i.getAttribute("data-modal-toggle"),t=document.getElementById(e);if(t){var r=I.getInstance("Modal",e);if(r){var n=function(){r.toggle()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(e," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?"))}),document.querySelectorAll("[data-modal-show]").forEach(function(i){var e=i.getAttribute("data-modal-show"),t=document.getElementById(e);if(t){var r=I.getInstance("Modal",e);if(r){var n=function(){r.show()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(e," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?"))}),document.querySelectorAll("[data-modal-hide]").forEach(function(i){var e=i.getAttribute("data-modal-hide"),t=document.getElementById(e);if(t){var r=I.getInstance("Modal",e);if(r){var n=function(){r.hide()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(e," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?"))})}typeof window<"u"&&(window.Modal=ma,window.initModals=Kt);var Fr=function(){return Fr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Fr.apply(this,arguments)},yt={placement:"left",bodyScrolling:!1,backdrop:!0,edge:!1,edgeOffset:"bottom-[60px]",backdropClasses:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-30",onShow:function(){},onHide:function(){},onToggle:function(){}},Ou={id:null,override:!0},ga=function(){function i(e,t,r){e===void 0&&(e=null),t===void 0&&(t=yt),r===void 0&&(r=Ou),this._eventListenerInstances=[],this._instanceId=r.id?r.id:e.id,this._targetEl=e,this._options=Fr(Fr({},yt),t),this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Drawer",this,this._instanceId,r.override)}return i.prototype.init=function(){var e=this;this._targetEl&&!this._initialized&&(this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.classList.add("transition-transform"),this._getPlacementClasses(this._options.placement).base.map(function(t){e._targetEl.classList.add(t)}),this._handleEscapeKey=function(t){t.key==="Escape"&&e.isVisible()&&e.hide()},document.addEventListener("keydown",this._handleEscapeKey),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this.removeAllEventListenerInstances(),this._destroyBackdropEl(),document.removeEventListener("keydown",this._handleEscapeKey),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Drawer",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){var e=this;this._options.edge?(this._getPlacementClasses(this._options.placement+"-edge").active.map(function(t){e._targetEl.classList.remove(t)}),this._getPlacementClasses(this._options.placement+"-edge").inactive.map(function(t){e._targetEl.classList.add(t)})):(this._getPlacementClasses(this._options.placement).active.map(function(t){e._targetEl.classList.remove(t)}),this._getPlacementClasses(this._options.placement).inactive.map(function(t){e._targetEl.classList.add(t)})),this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.removeAttribute("aria-modal"),this._targetEl.removeAttribute("role"),this._options.bodyScrolling||document.body.classList.remove("overflow-hidden"),this._options.backdrop&&this._destroyBackdropEl(),this._visible=!1,this._options.onHide(this)},i.prototype.show=function(){var e=this;this._options.edge?(this._getPlacementClasses(this._options.placement+"-edge").active.map(function(t){e._targetEl.classList.add(t)}),this._getPlacementClasses(this._options.placement+"-edge").inactive.map(function(t){e._targetEl.classList.remove(t)})):(this._getPlacementClasses(this._options.placement).active.map(function(t){e._targetEl.classList.add(t)}),this._getPlacementClasses(this._options.placement).inactive.map(function(t){e._targetEl.classList.remove(t)})),this._targetEl.setAttribute("aria-modal","true"),this._targetEl.setAttribute("role","dialog"),this._targetEl.removeAttribute("aria-hidden"),this._options.bodyScrolling||document.body.classList.add("overflow-hidden"),this._options.backdrop&&this._createBackdrop(),this._visible=!0,this._options.onShow(this)},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show()},i.prototype._createBackdrop=function(){var e,t=this;if(!this._visible){var r=document.createElement("div");r.setAttribute("drawer-backdrop",""),(e=r.classList).add.apply(e,this._options.backdropClasses.split(" ")),document.querySelector("body").append(r),r.addEventListener("click",function(){t.hide()})}},i.prototype._destroyBackdropEl=function(){this._visible&&document.querySelector("[drawer-backdrop]")!==null&&document.querySelector("[drawer-backdrop]").remove()},i.prototype._getPlacementClasses=function(e){switch(e){case"top":return{base:["top-0","left-0","right-0"],active:["transform-none"],inactive:["-translate-y-full"]};case"right":return{base:["right-0","top-0"],active:["transform-none"],inactive:["translate-x-full"]};case"bottom":return{base:["bottom-0","left-0","right-0"],active:["transform-none"],inactive:["translate-y-full"]};case"left":return{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]};case"bottom-edge":return{base:["left-0","top-0"],active:["transform-none"],inactive:["translate-y-full",this._options.edgeOffset]};default:return{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]}}},i.prototype.isHidden=function(){return!this._visible},i.prototype.isVisible=function(){return this._visible},i.prototype.addEventListenerInstance=function(e,t,r){this._eventListenerInstances.push({element:e,type:t,handler:r})},i.prototype.removeAllEventListenerInstances=function(){this._eventListenerInstances.map(function(e){e.element.removeEventListener(e.type,e.handler)}),this._eventListenerInstances=[]},i.prototype.getAllEventListenerInstances=function(){return this._eventListenerInstances},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Gt(){document.querySelectorAll("[data-drawer-target]").forEach(function(i){var e=i.getAttribute("data-drawer-target"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-drawer-placement"),n=i.getAttribute("data-drawer-body-scrolling"),s=i.getAttribute("data-drawer-backdrop"),o=i.getAttribute("data-drawer-edge"),a=i.getAttribute("data-drawer-edge-offset");new ga(t,{placement:r||yt.placement,bodyScrolling:n?n==="true":yt.bodyScrolling,backdrop:s?s==="true":yt.backdrop,edge:o?o==="true":yt.edge,edgeOffset:a||yt.edgeOffset})}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))}),document.querySelectorAll("[data-drawer-toggle]").forEach(function(i){var e=i.getAttribute("data-drawer-toggle"),t=document.getElementById(e);if(t){var r=I.getInstance("Drawer",e);if(r){var n=function(){r.toggle()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(e," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))}),document.querySelectorAll("[data-drawer-dismiss], [data-drawer-hide]").forEach(function(i){var e=i.getAttribute("data-drawer-dismiss")?i.getAttribute("data-drawer-dismiss"):i.getAttribute("data-drawer-hide"),t=document.getElementById(e);if(t){var r=I.getInstance("Drawer",e);if(r){var n=function(){r.hide()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(e," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id"))}),document.querySelectorAll("[data-drawer-show]").forEach(function(i){var e=i.getAttribute("data-drawer-show"),t=document.getElementById(e);if(t){var r=I.getInstance("Drawer",e);if(r){var n=function(){r.show()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(e," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))})}typeof window<"u"&&(window.Drawer=ga,window.initDrawers=Gt);var Br=function(){return Br=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Br.apply(this,arguments)},Nr={defaultTabId:null,activeClasses:"text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500",inactiveClasses:"dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300",onShow:function(){}},Ru={id:null,override:!0},va=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=Nr),n===void 0&&(n=Ru),this._instanceId=n.id?n.id:e.id,this._tabsEl=e,this._items=t,this._activeTab=r?this.getTab(r.defaultTabId):null,this._options=Br(Br({},Nr),r),this._initialized=!1,this.init(),I.addInstance("Tabs",this,this._tabsEl.id,!0),I.addInstance("Tabs",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._items.length&&!this._initialized&&(this._activeTab||this.setActiveTab(this._items[0]),this.show(this._activeTab.id,!0),this._items.map(function(t){t.triggerEl.addEventListener("click",function(r){r.preventDefault(),e.show(t.id)})}))},i.prototype.destroy=function(){this._initialized&&(this._initialized=!1)},i.prototype.removeInstance=function(){this.destroy(),I.removeInstance("Tabs",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getActiveTab=function(){return this._activeTab},i.prototype.setActiveTab=function(e){this._activeTab=e},i.prototype.getTab=function(e){return this._items.filter(function(t){return t.id===e})[0]},i.prototype.show=function(e,t){var r,n,s=this;t===void 0&&(t=!1);var o=this.getTab(e);o===this._activeTab&&!t||(this._items.map(function(a){var l,f;a!==o&&((l=a.triggerEl.classList).remove.apply(l,s._options.activeClasses.split(" ")),(f=a.triggerEl.classList).add.apply(f,s._options.inactiveClasses.split(" ")),a.targetEl.classList.add("hidden"),a.triggerEl.setAttribute("aria-selected","false"))}),(r=o.triggerEl.classList).add.apply(r,this._options.activeClasses.split(" ")),(n=o.triggerEl.classList).remove.apply(n,this._options.inactiveClasses.split(" ")),o.triggerEl.setAttribute("aria-selected","true"),o.targetEl.classList.remove("hidden"),this.setActiveTab(o),this._options.onShow(this,o))},i.prototype.updateOnShow=function(e){this._options.onShow=e},i}();function Yt(){document.querySelectorAll("[data-tabs-toggle]").forEach(function(i){var e=[],t=i.getAttribute("data-tabs-active-classes"),r=i.getAttribute("data-tabs-inactive-classes"),n=null;i.querySelectorAll('[role="tab"]').forEach(function(s){var o=s.getAttribute("aria-selected")==="true",a={id:s.getAttribute("data-tabs-target"),triggerEl:s,targetEl:document.querySelector(s.getAttribute("data-tabs-target"))};e.push(a),o&&(n=a.id)}),new va(i,e,{defaultTabId:n,activeClasses:t||Nr.activeClasses,inactiveClasses:r||Nr.inactiveClasses})})}typeof window<"u"&&(window.Tabs=va,window.initTabs=Yt);var rt=function(){return rt=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},rt.apply(this,arguments)},Hr=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,s;r<n;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))},qr={placement:"top",triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Mu={id:null,override:!0},ba=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=qr),n===void 0&&(n=Mu),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=rt(rt({},qr),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Tooltip",this,this._instanceId,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._setupEventListeners(),this._popperInstance=this._createPopperInstance(),this._initialized=!0)},i.prototype.destroy=function(){var e=this;if(this._initialized){var t=this._getTriggerEvents();t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hideHandler)}),this._removeKeydownListener(),this._removeClickOutsideListener(),this._popperInstance&&this._popperInstance.destroy(),this._initialized=!1}},i.prototype.removeInstance=function(){I.removeInstance("Tooltip",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var e=this,t=this._getTriggerEvents();this._showHandler=function(){e.show()},this._hideHandler=function(){e.hide()},t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hideHandler)})},i.prototype._createPopperInstance=function(){return bt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[0,8]}}]})},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype._setupKeydownListener=function(){var e=this;this._keydownEventListener=function(t){t.key==="Escape"&&e.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeKeydownListener=function(){document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._setupClickOutsideListener=function(){var e=this;this._clickOutsideEventListener=function(t){e._handleClickOutside(t,e._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(e,t){var r=e.target;r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&this.isVisible()&&this.hide()},i.prototype.isVisible=function(){return this._visible},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show()},i.prototype.show=function(){this._targetEl.classList.remove("opacity-0","invisible"),this._targetEl.classList.add("opacity-100","visible"),this._popperInstance.setOptions(function(e){return rt(rt({},e),{modifiers:Hr(Hr([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._setupKeydownListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("opacity-100","visible"),this._targetEl.classList.add("opacity-0","invisible"),this._popperInstance.setOptions(function(e){return rt(rt({},e),{modifiers:Hr(Hr([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._removeClickOutsideListener(),this._removeKeydownListener(),this._visible=!1,this._options.onHide(this)},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Xt(){document.querySelectorAll("[data-tooltip-target]").forEach(function(i){var e=i.getAttribute("data-tooltip-target"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-tooltip-trigger"),n=i.getAttribute("data-tooltip-placement");new ba(t,i,{placement:n||qr.placement,triggerType:r||qr.triggerType})}else console.error('The tooltip element with id "'.concat(e,'" does not exist. Please check the data-tooltip-target attribute.'))})}typeof window<"u"&&(window.Tooltip=ba,window.initTooltips=Xt);var nt=function(){return nt=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},nt.apply(this,arguments)},zr=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,s;r<n;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))},xi={placement:"top",offset:10,triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Pu={id:null,override:!0},ya=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=xi),n===void 0&&(n=Pu),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=nt(nt({},xi),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Popover",this,n.id?n.id:this._targetEl.id,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._setupEventListeners(),this._popperInstance=this._createPopperInstance(),this._initialized=!0)},i.prototype.destroy=function(){var e=this;if(this._initialized){var t=this._getTriggerEvents();t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._showHandler),e._targetEl.removeEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hideHandler),e._targetEl.removeEventListener(r,e._hideHandler)}),this._removeKeydownListener(),this._removeClickOutsideListener(),this._popperInstance&&this._popperInstance.destroy(),this._initialized=!1}},i.prototype.removeInstance=function(){I.removeInstance("Popover",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var e=this,t=this._getTriggerEvents();this._showHandler=function(){e.show()},this._hideHandler=function(){setTimeout(function(){e._targetEl.matches(":hover")||e.hide()},100)},t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._showHandler),e._targetEl.addEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hideHandler),e._targetEl.addEventListener(r,e._hideHandler)})},i.prototype._createPopperInstance=function(){return bt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[0,this._options.offset]}}]})},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype._setupKeydownListener=function(){var e=this;this._keydownEventListener=function(t){t.key==="Escape"&&e.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeKeydownListener=function(){document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._setupClickOutsideListener=function(){var e=this;this._clickOutsideEventListener=function(t){e._handleClickOutside(t,e._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(e,t){var r=e.target;r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&this.isVisible()&&this.hide()},i.prototype.isVisible=function(){return this._visible},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show(),this._options.onToggle(this)},i.prototype.show=function(){this._targetEl.classList.remove("opacity-0","invisible"),this._targetEl.classList.add("opacity-100","visible"),this._popperInstance.setOptions(function(e){return nt(nt({},e),{modifiers:zr(zr([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._setupKeydownListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("opacity-100","visible"),this._targetEl.classList.add("opacity-0","invisible"),this._popperInstance.setOptions(function(e){return nt(nt({},e),{modifiers:zr(zr([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._removeClickOutsideListener(),this._removeKeydownListener(),this._visible=!1,this._options.onHide(this)},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Zt(){document.querySelectorAll("[data-popover-target]").forEach(function(i){var e=i.getAttribute("data-popover-target"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-popover-trigger"),n=i.getAttribute("data-popover-placement"),s=i.getAttribute("data-popover-offset");new ya(t,i,{placement:n||xi.placement,offset:s?parseInt(s):xi.offset,triggerType:r||xi.triggerType})}else console.error('The popover element with id "'.concat(e,'" does not exist. Please check the data-popover-target attribute.'))})}typeof window<"u"&&(window.Popover=ya,window.initPopovers=Zt);var Vr=function(){return Vr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Vr.apply(this,arguments)},us={triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Du={id:null,override:!0},wa=function(){function i(e,t,r,n,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=null),n===void 0&&(n=us),s===void 0&&(s=Du),this._instanceId=s.id?s.id:r.id,this._parentEl=e,this._triggerEl=t,this._targetEl=r,this._options=Vr(Vr({},us),n),this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Dial",this,this._instanceId,s.override)}return i.prototype.init=function(){var e=this;if(this._triggerEl&&this._targetEl&&!this._initialized){var t=this._getTriggerEventTypes(this._options.triggerType);this._showEventHandler=function(){e.show()},t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._showEventHandler),e._targetEl.addEventListener(r,e._showEventHandler)}),this._hideEventHandler=function(){e._parentEl.matches(":hover")||e.hide()},t.hideEvents.forEach(function(r){e._parentEl.addEventListener(r,e._hideEventHandler)}),this._initialized=!0}},i.prototype.destroy=function(){var e=this;if(this._initialized){var t=this._getTriggerEventTypes(this._options.triggerType);t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._showEventHandler),e._targetEl.removeEventListener(r,e._showEventHandler)}),t.hideEvents.forEach(function(r){e._parentEl.removeEventListener(r,e._hideEventHandler)}),this._initialized=!1}},i.prototype.removeInstance=function(){I.removeInstance("Dial",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){this._targetEl.classList.add("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","false"),this._visible=!1,this._options.onHide(this)},i.prototype.show=function(){this._targetEl.classList.remove("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","true"),this._visible=!0,this._options.onShow(this)},i.prototype.toggle=function(){this._visible?this.hide():this.show()},i.prototype.isHidden=function(){return!this._visible},i.prototype.isVisible=function(){return this._visible},i.prototype._getTriggerEventTypes=function(e){switch(e){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Qt(){document.querySelectorAll("[data-dial-init]").forEach(function(i){var e=i.querySelector("[data-dial-toggle]");if(e){var t=e.getAttribute("data-dial-toggle"),r=document.getElementById(t);if(r){var n=e.getAttribute("data-dial-trigger");new wa(i,e,r,{triggerType:n||us.triggerType})}else console.error("Dial with id ".concat(t," does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?"))}else console.error("Dial with id ".concat(i.id," does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?"))})}typeof window<"u"&&(window.Dial=wa,window.initDials=Qt);var $r=function(){return $r=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},$r.apply(this,arguments)},Ea={minValue:null,maxValue:null,onIncrement:function(){},onDecrement:function(){}},Fu={id:null,override:!0},_a=function(){function i(e,t,r,n,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=null),n===void 0&&(n=Ea),s===void 0&&(s=Fu),this._instanceId=s.id?s.id:e.id,this._targetEl=e,this._incrementEl=t,this._decrementEl=r,this._options=$r($r({},Ea),n),this._initialized=!1,this.init(),I.addInstance("InputCounter",this,this._instanceId,s.override)}return i.prototype.init=function(){var e=this;this._targetEl&&!this._initialized&&(this._inputHandler=function(t){{var r=t.target;/^\d*$/.test(r.value)||(r.value=r.value.replace(/[^\d]/g,"")),e._options.maxValue!==null&&parseInt(r.value)>e._options.maxValue&&(r.value=e._options.maxValue.toString()),e._options.minValue!==null&&parseInt(r.value)<e._options.minValue&&(r.value=e._options.minValue.toString())}},this._incrementClickHandler=function(){e.increment()},this._decrementClickHandler=function(){e.decrement()},this._targetEl.addEventListener("input",this._inputHandler),this._incrementEl&&this._incrementEl.addEventListener("click",this._incrementClickHandler),this._decrementEl&&this._decrementEl.addEventListener("click",this._decrementClickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._targetEl&&this._initialized&&(this._targetEl.removeEventListener("input",this._inputHandler),this._incrementEl&&this._incrementEl.removeEventListener("click",this._incrementClickHandler),this._decrementEl&&this._decrementEl.removeEventListener("click",this._decrementClickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("InputCounter",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getCurrentValue=function(){return parseInt(this._targetEl.value)||0},i.prototype.increment=function(){this._options.maxValue!==null&&this.getCurrentValue()>=this._options.maxValue||(this._targetEl.value=(this.getCurrentValue()+1).toString(),this._options.onIncrement(this))},i.prototype.decrement=function(){this._options.minValue!==null&&this.getCurrentValue()<=this._options.minValue||(this._targetEl.value=(this.getCurrentValue()-1).toString(),this._options.onDecrement(this))},i.prototype.updateOnIncrement=function(e){this._options.onIncrement=e},i.prototype.updateOnDecrement=function(e){this._options.onDecrement=e},i}();function Jt(){document.querySelectorAll("[data-input-counter]").forEach(function(i){var e=i.id,t=document.querySelector('[data-input-counter-increment="'+e+'"]'),r=document.querySelector('[data-input-counter-decrement="'+e+'"]'),n=i.getAttribute("data-input-counter-min"),s=i.getAttribute("data-input-counter-max");i?I.instanceExists("InputCounter",i.getAttribute("id"))||new _a(i,t||null,r||null,{minValue:n?parseInt(n):null,maxValue:s?parseInt(s):null}):console.error('The target element with id "'.concat(e,'" does not exist. Please check the data-input-counter attribute.'))})}typeof window<"u"&&(window.InputCounter=_a,window.initInputCounters=Jt);var jr=function(){return jr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},jr.apply(this,arguments)},Ur={htmlEntities:!1,contentType:"input",onCopy:function(){}},Bu={id:null,override:!0},Aa=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Ur),n===void 0&&(n=Bu),this._instanceId=n.id?n.id:t.id,this._triggerEl=e,this._targetEl=t,this._options=jr(jr({},Ur),r),this._initialized=!1,this.init(),I.addInstance("CopyClipboard",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._targetEl&&this._triggerEl&&!this._initialized&&(this._triggerElClickHandler=function(){e.copy()},this._triggerEl&&this._triggerEl.addEventListener("click",this._triggerElClickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._targetEl&&this._initialized&&(this._triggerEl&&this._triggerEl.removeEventListener("click",this._triggerElClickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("CopyClipboard",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getTargetValue=function(){if(this._options.contentType==="input")return this._targetEl.value;if(this._options.contentType==="innerHTML")return this._targetEl.innerHTML;if(this._options.contentType==="textContent")return this._targetEl.textContent.replace(/\s+/g," ").trim()},i.prototype.copy=function(){var e=this.getTargetValue();this._options.htmlEntities&&(e=this.decodeHTML(e));var t=document.createElement("textarea");return t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),this._options.onCopy(this),e},i.prototype.decodeHTML=function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.textContent},i.prototype.updateOnCopyCallback=function(e){this._options.onCopy=e},i}();function ei(){document.querySelectorAll("[data-copy-to-clipboard-target]").forEach(function(i){var e=i.getAttribute("data-copy-to-clipboard-target"),t=document.getElementById(e),r=i.getAttribute("data-copy-to-clipboard-content-type"),n=i.getAttribute("data-copy-to-clipboard-html-entities");t?I.instanceExists("CopyClipboard",t.getAttribute("id"))||new Aa(i,t,{htmlEntities:n&&n==="true"?!0:Ur.htmlEntities,contentType:r||Ur.contentType}):console.error('The target element with id "'.concat(e,'" does not exist. Please check the data-copy-to-clipboard-target attribute.'))})}typeof window<"u"&&(window.CopyClipboard=Aa,window.initClipboards=ei);function Ta(){Bt(),Nt(),Ht(),qt(),Wt(),Kt(),Gt(),Yt(),Xt(),Zt(),Qt(),Jt(),ei()}typeof window<"u"&&(window.initFlowbite=Ta);var Nu=new zo("load",[Bt,Nt,Ht,qt,Wt,Kt,Gt,Yt,Xt,Zt,Qt,Jt,ei]);Nu.init();var Wr=class extends S{static targets=["trigger","menu"];connect(){console.log(`resource-drop-down connected: ${this.element}`),this.dropdown=new cs(this.menuTarget,this.triggerTarget)}disconnect(){this.dropdown=null}toggle(){this.dropdown.toggle()}show(){this.dropdown.show()}hide(){this.dropdown.hide()}};var Kr=class extends S{static targets=["trigger","menu"];connect(){console.log(`resource-collapse connected: ${this.element}`),this.collapse=new Gn(this.menuTarget,this.triggerTarget)}disconnect(){this.collapse=null}toggle(){this.collapse.toggle()}show(){this.collapse.show()}hide(){this.collapse.hide()}};var Gr=class extends S{static values={after:Number};connect(){console.log(`resource-dismiss connected: ${this.element}`),this.hasAfterValue&&this.afterValue>0&&(this.autoDismissTimeout=setTimeout(()=>{this.dismiss(),this.autoDismissTimeout=null},this.afterValue))}disconnect(){this.autoDismissTimeout&&clearTimeout(this.autoDismissTimeout),this.autoDismissTimeout=null}dismiss(){this.element.remove()}};var Yr=class extends S{static targets=["frame","refreshButton","backButton","homeButton"];connect(){console.log(`frame-navigator connected: ${this.element}`),this.#e(),this.srcHistory=[],this.originalFrameSrc=this.frameTarget.src,this.hasRefreshButtonTarget&&(this.refreshButtonTarget.style.display="",this.refreshButtonClicked=this.refreshButtonClicked.bind(this),this.refreshButtonTarget.addEventListener("click",this.refreshButtonClicked)),this.hasBackButtonTarget&&(this.backButtonClicked=this.backButtonClicked.bind(this),this.backButtonTarget.addEventListener("click",this.backButtonClicked)),this.hasHomeButtonTarget&&(this.homeButtonClicked=this.homeButtonClicked.bind(this),this.homeButtonTarget.addEventListener("click",this.homeButtonClicked)),this.frameLoaded=this.frameLoaded.bind(this),this.frameTarget.addEventListener("turbo:frame-load",this.frameLoaded),this.frameLoading=this.frameLoading.bind(this),this.frameTarget.addEventListener("turbo:click",this.frameLoading),this.frameTarget.addEventListener("turbo:submit-start",this.frameLoading),this.frameFailed=this.frameFailed.bind(this),this.frameTarget.addEventListener("turbo:fetch-request-error",this.frameFailed)}disconnect(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.removeEventListener("click",this.refreshButtonClicked),this.hasBackButtonTarget&&this.backButtonTarget.removeEventListener("click",this.backButtonClicked),this.hasHomeButtonTarget&&this.homeButtonTarget.removeEventListener("click",this.homeButtonClicked),this.frameTarget.removeEventListener("turbo:frame-load",this.frameLoaded),this.frameTarget.removeEventListener("turbo:click",this.frameLoading),this.frameTarget.removeEventListener("turbo:submit-start",this.frameLoading),this.frameTarget.removeEventListener("turbo:fetch-request-error",this.frameFailed)}frameLoading(i){this.#e()}frameFailed(i){this.#t()}frameLoaded(i){this.#t();let e=i.target.src;e==this.currentSrc||(e==this.originalFrameSrc?this.srcHistory=[e]:this.srcHistory.push(e)),this.#i()}refreshButtonClicked(i){this.frameLoading(null),this.frameTarget.reload()}backButtonClicked(i){this.frameLoading(null),this.srcHistory.pop(),this.frameTarget.src=this.currentSrc}homeButtonClicked(i){this.frameLoading(null),this.frameTarget.src=this.originalFrameSrc}get currentSrc(){return this.srcHistory[this.srcHistory.length-1]}#e(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.add("motion-safe:animate-spin"),this.frameTarget.classList.add("motion-safe:animate-pulse")}#t(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.remove("motion-safe:animate-spin"),this.frameTarget.classList.remove("motion-safe:animate-pulse")}#i(){this.hasHomeButtonTarget&&(this.homeButtonTarget.style.display=this.srcHistory.length>2?"":"none"),this.hasBackButtonTarget&&(this.backButtonTarget.style.display=this.srcHistory.length>1?"":"none")}};var Xr=class extends S{connect(){console.log(`color-mode connected: ${this.element}`),this.updateColorMode()}disconnect(){}updateColorMode(){localStorage.theme==="dark"||!("theme"in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}setLightColorMode(){localStorage.theme="light",this.updateColorMode()}setDarkColorMode(){localStorage.theme="dark",this.updateColorMode()}setSystemColorMode(){localStorage.removeItem("theme"),this.updateColorMode()}};var{entries:Pa,setPrototypeOf:Sa,isFrozen:Hu,getPrototypeOf:qu,getOwnPropertyDescriptor:zu}=Object,{freeze:ve,seal:Se,create:Da}=Object,{apply:gs,construct:vs}=typeof Reflect<"u"&&Reflect;ve||(ve=function(e){return e});Se||(Se=function(e){return e});gs||(gs=function(e,t,r){return e.apply(t,r)});vs||(vs=function(e,t){return new e(...t)});var Zr=we(Array.prototype.forEach),ka=we(Array.prototype.pop),Li=we(Array.prototype.push),Jr=we(String.prototype.toLowerCase),hs=we(String.prototype.toString),xa=we(String.prototype.match),Ci=we(String.prototype.replace),Vu=we(String.prototype.indexOf),$u=we(String.prototype.trim),Re=we(Object.prototype.hasOwnProperty),ge=we(RegExp.prototype.test),Ii=ju(TypeError);function we(i){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return gs(i,e,r)}}function ju(i){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return vs(i,t)}}function D(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Jr;Sa&&Sa(i,null);let r=e.length;for(;r--;){let n=e[r];if(typeof n=="string"){let s=t(n);s!==n&&(Hu(e)||(e[r]=s),n=s)}i[n]=!0}return i}function Uu(i){for(let e=0;e<i.length;e++)Re(i,e)||(i[e]=null);return i}function wt(i){let e=Da(null);for(let[t,r]of Pa(i))Re(i,t)&&(Array.isArray(r)?e[t]=Uu(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=wt(r):e[t]=r);return e}function Oi(i,e){for(;i!==null;){let r=zu(i,e);if(r){if(r.get)return we(r.get);if(typeof r.value=="function")return we(r.value)}i=qu(i)}function t(){return null}return t}var La=ve(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ds=ve(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),fs=ve(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Wu=ve(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ps=ve(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ku=ve(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ca=ve(["#text"]),Ia=ve(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ms=ve(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Oa=ve(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Qr=ve(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Gu=Se(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Yu=Se(/<%[\w\W]*|[\w\W]*%>/gm),Xu=Se(/\${[\w\W]*}/gm),Zu=Se(/^data-[\-\w.\u00B7-\uFFFF]/),Qu=Se(/^aria-[\-\w]+$/),Fa=Se(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ju=Se(/^(?:\w+script|data):/i),eh=Se(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ba=Se(/^html$/i),th=Se(/^[a-z][.\w]*(-[.\w]+)+$/i),Ra=Object.freeze({__proto__:null,ARIA_ATTR:Qu,ATTR_WHITESPACE:eh,CUSTOM_ELEMENT:th,DATA_ATTR:Zu,DOCTYPE_NAME:Ba,ERB_EXPR:Yu,IS_ALLOWED_URI:Fa,IS_SCRIPT_OR_DATA:Ju,MUSTACHE_EXPR:Gu,TMPLIT_EXPR:Xu}),Ri={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ih=function(){return typeof window>"u"?null:window},rh=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));let s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Ma=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Na(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ih(),e=C=>Na(C);if(e.version="3.2.2",e.removed=[],!i||!i.document||i.document.nodeType!==Ri.document)return e.isSupported=!1,e;let{document:t}=i,r=t,n=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:f,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:g,DOMParser:w,trustedTypes:y}=i,_=l.prototype,L=Oi(_,"cloneNode"),k=Oi(_,"remove"),P=Oi(_,"nextSibling"),q=Oi(_,"childNodes"),B=Oi(_,"parentNode");if(typeof o=="function"){let C=t.createElement("template");C.content&&C.content.ownerDocument&&(t=C.content.ownerDocument)}let T,O="",{implementation:x,createNodeIterator:F,createDocumentFragment:j,getElementsByTagName:U}=t,{importNode:Y}=r,H=Ma();e.isSupported=typeof Pa=="function"&&typeof B=="function"&&x&&x.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:X,ERB_EXPR:W,TMPLIT_EXPR:be,DATA_ATTR:xe,ARIA_ATTR:h,IS_SCRIPT_OR_DATA:d,ATTR_WHITESPACE:p,CUSTOM_ELEMENT:b}=Ra,{IS_ALLOWED_URI:E}=Ra,v=null,R=D({},[...La,...ds,...fs,...ps,...Ca]),M=null,ce=D({},[...Ia,...ms,...Oa,...Qr]),N=Object.seal(Da(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),z=null,ne=null,de=!0,Le=!0,Lt=!1,Ct=!0,Qe=!1,It=!0,Ne=!1,fi=!1,Ot=!1,He=!1,Rt=!1,Mt=!1,Pe=!0,lt=!1,Ui="user-content-",Pt=!0,qe=!1,ze={},Ve=null,pi=D({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),mi=null,ao=D({},["audio","video","img","source","image","track"]),bn=null,lo=D({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Wi="http://www.w3.org/1998/Math/MathML",Ki="http://www.w3.org/2000/svg",$e="http://www.w3.org/1999/xhtml",Dt=$e,yn=!1,wn=null,Al=D({},[Wi,Ki,$e],hs),Gi=D({},["mi","mo","mn","ms","mtext"]),Yi=D({},["annotation-xml"]),Tl=D({},["title","style","font","a","script"]),gi=null,Sl=["application/xhtml+xml","text/html"],kl="text/html",se=null,Ft=null,xl=t.createElement("form"),co=function(c){return c instanceof RegExp||c instanceof Function},En=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ft&&Ft===c)){if((!c||typeof c!="object")&&(c={}),c=wt(c),gi=Sl.indexOf(c.PARSER_MEDIA_TYPE)===-1?kl:c.PARSER_MEDIA_TYPE,se=gi==="application/xhtml+xml"?hs:Jr,v=Re(c,"ALLOWED_TAGS")?D({},c.ALLOWED_TAGS,se):R,M=Re(c,"ALLOWED_ATTR")?D({},c.ALLOWED_ATTR,se):ce,wn=Re(c,"ALLOWED_NAMESPACES")?D({},c.ALLOWED_NAMESPACES,hs):Al,bn=Re(c,"ADD_URI_SAFE_ATTR")?D(wt(lo),c.ADD_URI_SAFE_ATTR,se):lo,mi=Re(c,"ADD_DATA_URI_TAGS")?D(wt(ao),c.ADD_DATA_URI_TAGS,se):ao,Ve=Re(c,"FORBID_CONTENTS")?D({},c.FORBID_CONTENTS,se):pi,z=Re(c,"FORBID_TAGS")?D({},c.FORBID_TAGS,se):{},ne=Re(c,"FORBID_ATTR")?D({},c.FORBID_ATTR,se):{},ze=Re(c,"USE_PROFILES")?c.USE_PROFILES:!1,de=c.ALLOW_ARIA_ATTR!==!1,Le=c.ALLOW_DATA_ATTR!==!1,Lt=c.ALLOW_UNKNOWN_PROTOCOLS||!1,Ct=c.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Qe=c.SAFE_FOR_TEMPLATES||!1,It=c.SAFE_FOR_XML!==!1,Ne=c.WHOLE_DOCUMENT||!1,He=c.RETURN_DOM||!1,Rt=c.RETURN_DOM_FRAGMENT||!1,Mt=c.RETURN_TRUSTED_TYPE||!1,Ot=c.FORCE_BODY||!1,Pe=c.SANITIZE_DOM!==!1,lt=c.SANITIZE_NAMED_PROPS||!1,Pt=c.KEEP_CONTENT!==!1,qe=c.IN_PLACE||!1,E=c.ALLOWED_URI_REGEXP||Fa,Dt=c.NAMESPACE||$e,Gi=c.MATHML_TEXT_INTEGRATION_POINTS||Gi,Yi=c.HTML_INTEGRATION_POINTS||Yi,N=c.CUSTOM_ELEMENT_HANDLING||{},c.CUSTOM_ELEMENT_HANDLING&&co(c.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(N.tagNameCheck=c.CUSTOM_ELEMENT_HANDLING.tagNameCheck),c.CUSTOM_ELEMENT_HANDLING&&co(c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(N.attributeNameCheck=c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),c.CUSTOM_ELEMENT_HANDLING&&typeof c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(N.allowCustomizedBuiltInElements=c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Qe&&(Le=!1),Rt&&(He=!0),ze&&(v=D({},Ca),M=[],ze.html===!0&&(D(v,La),D(M,Ia)),ze.svg===!0&&(D(v,ds),D(M,ms),D(M,Qr)),ze.svgFilters===!0&&(D(v,fs),D(M,ms),D(M,Qr)),ze.mathMl===!0&&(D(v,ps),D(M,Oa),D(M,Qr))),c.ADD_TAGS&&(v===R&&(v=wt(v)),D(v,c.ADD_TAGS,se)),c.ADD_ATTR&&(M===ce&&(M=wt(M)),D(M,c.ADD_ATTR,se)),c.ADD_URI_SAFE_ATTR&&D(bn,c.ADD_URI_SAFE_ATTR,se),c.FORBID_CONTENTS&&(Ve===pi&&(Ve=wt(Ve)),D(Ve,c.FORBID_CONTENTS,se)),Pt&&(v["#text"]=!0),Ne&&D(v,["html","head","body"]),v.table&&(D(v,["tbody"]),delete z.tbody),c.TRUSTED_TYPES_POLICY){if(typeof c.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ii('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof c.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ii('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=c.TRUSTED_TYPES_POLICY,O=T.createHTML("")}else T===void 0&&(T=rh(y,n)),T!==null&&typeof O=="string"&&(O=T.createHTML(""));ve&&ve(c),Ft=c}},uo=D({},[...ds,...fs,...Wu]),ho=D({},[...ps,...Ku]),Ll=function(c){let m=B(c);(!m||!m.tagName)&&(m={namespaceURI:Dt,tagName:"template"});let A=Jr(c.tagName),K=Jr(m.tagName);return wn[c.namespaceURI]?c.namespaceURI===Ki?m.namespaceURI===$e?A==="svg":m.namespaceURI===Wi?A==="svg"&&(K==="annotation-xml"||Gi[K]):!!uo[A]:c.namespaceURI===Wi?m.namespaceURI===$e?A==="math":m.namespaceURI===Ki?A==="math"&&Yi[K]:!!ho[A]:c.namespaceURI===$e?m.namespaceURI===Ki&&!Yi[K]||m.namespaceURI===Wi&&!Gi[K]?!1:!ho[A]&&(Tl[A]||!uo[A]):!!(gi==="application/xhtml+xml"&&wn[c.namespaceURI]):!1},De=function(c){Li(e.removed,{element:c});try{B(c).removeChild(c)}catch{k(c)}},Xi=function(c,m){try{Li(e.removed,{attribute:m.getAttributeNode(c),from:m})}catch{Li(e.removed,{attribute:null,from:m})}if(m.removeAttribute(c),c==="is")if(He||Rt)try{De(m)}catch{}else try{m.setAttribute(c,"")}catch{}},fo=function(c){let m=null,A=null;if(Ot)c="<remove></remove>"+c;else{let ue=xa(c,/^[\r\n\t ]+/);A=ue&&ue[0]}gi==="application/xhtml+xml"&&Dt===$e&&(c='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+c+"</body></html>");let K=T?T.createHTML(c):c;if(Dt===$e)try{m=new w().parseFromString(K,gi)}catch{}if(!m||!m.documentElement){m=x.createDocument(Dt,"template",null);try{m.documentElement.innerHTML=yn?O:K}catch{}}let fe=m.body||m.documentElement;return c&&A&&fe.insertBefore(t.createTextNode(A),fe.childNodes[0]||null),Dt===$e?U.call(m,Ne?"html":"body")[0]:Ne?m.documentElement:fe},po=function(c){return F.call(c.ownerDocument||c,c,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT|f.SHOW_PROCESSING_INSTRUCTION|f.SHOW_CDATA_SECTION,null)},mo=function(c){return c instanceof g&&(typeof c.nodeName!="string"||typeof c.textContent!="string"||typeof c.removeChild!="function"||!(c.attributes instanceof u)||typeof c.removeAttribute!="function"||typeof c.setAttribute!="function"||typeof c.namespaceURI!="string"||typeof c.insertBefore!="function"||typeof c.hasChildNodes!="function")},go=function(c){return typeof a=="function"&&c instanceof a};function je(C,c,m){Zr(C,A=>{A.call(e,c,m,Ft)})}let vo=function(c){let m=null;if(je(H.beforeSanitizeElements,c,null),mo(c))return De(c),!0;let A=se(c.nodeName);if(je(H.uponSanitizeElement,c,{tagName:A,allowedTags:v}),c.hasChildNodes()&&!go(c.firstElementChild)&&ge(/<[/\w]/g,c.innerHTML)&&ge(/<[/\w]/g,c.textContent)||c.nodeType===Ri.progressingInstruction||It&&c.nodeType===Ri.comment&&ge(/<[/\w]/g,c.data))return De(c),!0;if(!v[A]||z[A]){if(!z[A]&&yo(A)&&(N.tagNameCheck instanceof RegExp&&ge(N.tagNameCheck,A)||N.tagNameCheck instanceof Function&&N.tagNameCheck(A)))return!1;if(Pt&&!Ve[A]){let K=B(c)||c.parentNode,fe=q(c)||c.childNodes;if(fe&&K){let ue=fe.length;for(let ye=ue-1;ye>=0;--ye){let Fe=L(fe[ye],!0);Fe.__removalCount=(c.__removalCount||0)+1,K.insertBefore(Fe,P(c))}}}return De(c),!0}return c instanceof l&&!Ll(c)||(A==="noscript"||A==="noembed"||A==="noframes")&&ge(/<\/no(script|embed|frames)/i,c.innerHTML)?(De(c),!0):(Qe&&c.nodeType===Ri.text&&(m=c.textContent,Zr([X,W,be],K=>{m=Ci(m,K," ")}),c.textContent!==m&&(Li(e.removed,{element:c.cloneNode()}),c.textContent=m)),je(H.afterSanitizeElements,c,null),!1)},bo=function(c,m,A){if(Pe&&(m==="id"||m==="name")&&(A in t||A in xl))return!1;if(!(Le&&!ne[m]&&ge(xe,m))){if(!(de&&ge(h,m))){if(!M[m]||ne[m]){if(!(yo(c)&&(N.tagNameCheck instanceof RegExp&&ge(N.tagNameCheck,c)||N.tagNameCheck instanceof Function&&N.tagNameCheck(c))&&(N.attributeNameCheck instanceof RegExp&&ge(N.attributeNameCheck,m)||N.attributeNameCheck instanceof Function&&N.attributeNameCheck(m))||m==="is"&&N.allowCustomizedBuiltInElements&&(N.tagNameCheck instanceof RegExp&&ge(N.tagNameCheck,A)||N.tagNameCheck instanceof Function&&N.tagNameCheck(A))))return!1}else if(!bn[m]){if(!ge(E,Ci(A,p,""))){if(!((m==="src"||m==="xlink:href"||m==="href")&&c!=="script"&&Vu(A,"data:")===0&&mi[c])){if(!(Lt&&!ge(d,Ci(A,p,"")))){if(A)return!1}}}}}}return!0},yo=function(c){return c!=="annotation-xml"&&xa(c,b)},wo=function(c){je(H.beforeSanitizeAttributes,c,null);let{attributes:m}=c;if(!m)return;let A={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0},K=m.length;for(;K--;){let fe=m[K],{name:ue,namespaceURI:ye,value:Fe}=fe,vi=se(ue),pe=ue==="value"?Fe:$u(Fe);if(A.attrName=vi,A.attrValue=pe,A.keepAttr=!0,A.forceKeepAttr=void 0,je(H.uponSanitizeAttribute,c,A),pe=A.attrValue,lt&&(vi==="id"||vi==="name")&&(Xi(ue,c),pe=Ui+pe),It&&ge(/((--!?|])>)|<\/(style|title)/i,pe)){Xi(ue,c);continue}if(A.forceKeepAttr||(Xi(ue,c),!A.keepAttr))continue;if(!Ct&&ge(/\/>/i,pe)){Xi(ue,c);continue}Qe&&Zr([X,W,be],_o=>{pe=Ci(pe,_o," ")});let Eo=se(c.nodeName);if(bo(Eo,vi,pe)){if(T&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!ye)switch(y.getAttributeType(Eo,vi)){case"TrustedHTML":{pe=T.createHTML(pe);break}case"TrustedScriptURL":{pe=T.createScriptURL(pe);break}}try{ye?c.setAttributeNS(ye,ue,pe):c.setAttribute(ue,pe),mo(c)?De(c):ka(e.removed)}catch{}}}je(H.afterSanitizeAttributes,c,null)},Cl=function C(c){let m=null,A=po(c);for(je(H.beforeSanitizeShadowDOM,c,null);m=A.nextNode();)je(H.uponSanitizeShadowNode,m,null),!vo(m)&&(m.content instanceof s&&C(m.content),wo(m));je(H.afterSanitizeShadowDOM,c,null)};return e.sanitize=function(C){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=null,A=null,K=null,fe=null;if(yn=!C,yn&&(C="<!-->"),typeof C!="string"&&!go(C))if(typeof C.toString=="function"){if(C=C.toString(),typeof C!="string")throw Ii("dirty is not a string, aborting")}else throw Ii("toString is not a function");if(!e.isSupported)return C;if(fi||En(c),e.removed=[],typeof C=="string"&&(qe=!1),qe){if(C.nodeName){let Fe=se(C.nodeName);if(!v[Fe]||z[Fe])throw Ii("root node is forbidden and cannot be sanitized in-place")}}else if(C instanceof a)m=fo("<!---->"),A=m.ownerDocument.importNode(C,!0),A.nodeType===Ri.element&&A.nodeName==="BODY"||A.nodeName==="HTML"?m=A:m.appendChild(A);else{if(!He&&!Qe&&!Ne&&C.indexOf("<")===-1)return T&&Mt?T.createHTML(C):C;if(m=fo(C),!m)return He?null:Mt?O:""}m&&Ot&&De(m.firstChild);let ue=po(qe?C:m);for(;K=ue.nextNode();)vo(K)||(K.content instanceof s&&Cl(K.content),wo(K));if(qe)return C;if(He){if(Rt)for(fe=j.call(m.ownerDocument);m.firstChild;)fe.appendChild(m.firstChild);else fe=m;return(M.shadowroot||M.shadowrootmode)&&(fe=Y.call(r,fe,!0)),fe}let ye=Ne?m.outerHTML:m.innerHTML;return Ne&&v["!doctype"]&&m.ownerDocument&&m.ownerDocument.doctype&&m.ownerDocument.doctype.name&&ge(Ba,m.ownerDocument.doctype.name)&&(ye="<!DOCTYPE "+m.ownerDocument.doctype.name+`>
|
6
|
-
`+ye),Qe&&Zr([X,W,be],Fe=>{ye=Ci(ye,Fe," ")}),T&&Mt?T.createHTML(ye):ye},e.setConfig=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};
|
5
|
+
%o`,t,e,r),(n=window.onerror)===null||n===void 0||n.call(window,t,"",0,0,e)}logFormattedMessage(e,t,r={}){r=Object.assign({application:this},r),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},r)),this.logger.groupEnd()}};function fc(){return new Promise(i=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>i()):i()})}function pc(i){return wi(i,"classes").reduce((t,r)=>Object.assign(t,mc(r)),{})}function mc(i){return{[`${i}Class`]:{get(){let{classes:e}=this;if(e.has(i))return e.get(i);{let t=e.getAttributeName(i);throw new Error(`Missing attribute "${t}"`)}}},[`${i}Classes`]:{get(){return this.classes.getAll(i)}},[`has${yi(i)}Class`]:{get(){return this.classes.has(i)}}}}function gc(i){return wi(i,"outlets").reduce((t,r)=>Object.assign(t,vc(r)),{})}function Co(i,e,t){return i.application.getControllerForElementAndIdentifier(e,t)}function Io(i,e,t){let r=Co(i,e,t);if(r||(i.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),r=Co(i,e,t),r))return r}function vc(i){let e=Sn(i);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t){let n=Io(this,t,i);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}Outlets`]:{get(){let t=this.outlets.findAll(i);return t.length>0?t.map(r=>{let n=Io(this,r,i);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`,r)}).filter(r=>r):[]}},[`${e}OutletElement`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t)return t;throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(i)}},[`has${yi(e)}Outlet`]:{get(){return this.outlets.has(i)}}}}function bc(i){return wi(i,"targets").reduce((t,r)=>Object.assign(t,yc(r)),{})}function yc(i){return{[`${i}Target`]:{get(){let e=this.targets.find(i);if(e)return e;throw new Error(`Missing target element "${i}" for "${this.identifier}" controller`)}},[`${i}Targets`]:{get(){return this.targets.findAll(i)}},[`has${yi(i)}Target`]:{get(){return this.targets.has(i)}}}}function wc(i){let e=tc(i,"values"),t={valueDescriptorMap:{get(){return e.reduce((r,n)=>{let s=Bo(n,this.identifier),o=this.data.getAttributeNameForKey(s.key);return Object.assign(r,{[o]:s})},{})}}};return e.reduce((r,n)=>Object.assign(r,Ec(n)),t)}function Ec(i,e){let t=Bo(i,e),{key:r,name:n,reader:s,writer:o}=t;return{[n]:{get(){let a=this.data.get(r);return a!==null?s(a):t.defaultValue},set(a){a===void 0?this.data.delete(r):this.data.set(r,o(a))}},[`has${yi(n)}`]:{get(){return this.data.has(r)||t.hasCustomDefaultValue}}}}function Bo([i,e],t){return Sc({controller:t,token:i,typeDefinition:e})}function rr(i){switch(i){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function bi(i){switch(typeof i){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(i))return"array";if(Object.prototype.toString.call(i)==="[object Object]")return"object"}function _c(i){let{controller:e,token:t,typeObject:r}=i,n=So(r.type),s=So(r.default),o=n&&s,a=n&&!s,l=!n&&s,f=rr(r.type),u=bi(i.typeObject.default);if(a)return f;if(l)return u;if(f!==u){let g=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${g}" must match the defined type "${f}". The provided default value of "${r.default}" is of type "${u}".`)}if(o)return f}function Ac(i){let{controller:e,token:t,typeDefinition:r}=i,s=_c({controller:e,token:t,typeObject:r}),o=bi(r),a=rr(r),l=s||o||a;if(l)return l;let f=e?`${e}.${r}`:t;throw new Error(`Unknown value type "${f}" for "${t}" value`)}function Tc(i){let e=rr(i);if(e)return Oo[e];let t=kn(i,"default"),r=kn(i,"type"),n=i;if(t)return n.default;if(r){let{type:s}=n,o=rr(s);if(o)return Oo[o]}return i}function Sc(i){let{token:e,typeDefinition:t}=i,r=`${Po(e)}-value`,n=Ac(i);return{type:n,key:r,name:Wn(r),get defaultValue(){return Tc(t)},get hasCustomDefaultValue(){return bi(t)!==void 0},reader:kc[n],writer:Ro[n]||Ro.default}}var Oo={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},kc={array(i){let e=JSON.parse(i);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${i}" of type "${bi(e)}"`);return e},boolean(i){return!(i=="0"||String(i).toLowerCase()=="false")},number(i){return Number(i.replace(/_/g,""))},object(i){let e=JSON.parse(i);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${i}" of type "${bi(e)}"`);return e},string(i){return i}},Ro={default:xc,array:Mo,object:Mo};function Mo(i){return JSON.stringify(i)}function xc(i){return`${i}`}var S=class{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:r={},prefix:n=this.identifier,bubbles:s=!0,cancelable:o=!0}={}){let a=n?`${n}:${e}`:e,l=new CustomEvent(a,{detail:r,bubbles:s,cancelable:o});return t.dispatchEvent(l),l}};S.blessings=[pc,bc,wc,gc];S.targets=[];S.outlets=[];S.values={};var nr=class extends S{connect(){console.log(`resource-layout connected: ${this.element}`)}};var sr=class extends S{connect(){console.log(`nav-grid-menu-item connected: ${this.element}`)}};var or=class extends S{connect(){console.log(`nav-grid-menu connected: ${this.element}`)}};var ar=class extends S{connect(){console.log(`nav-user-section connected: ${this.element}`)}};var lr=class extends S{connect(){console.log(`nav-user-link connected: ${this.element}`)}};var cr=class extends S{connect(){console.log(`nav-user connected: ${this.element}`)}};var ur=class extends S{static targets=["openIcon","closeIcon"];static outlets=["sidebar"];static values={placement:{type:String,default:"left"},bodyScrolling:{type:Boolean,default:!1},backdrop:{type:Boolean,default:!0},edge:{type:Boolean,default:!1},edgeOffset:{type:String,default:"bottom-[60px]"}};static classes={backdrop:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-30"};initialize(){this.visible=!1,this.handleEscapeKey=this.handleEscapeKey.bind(this)}connect(){document.addEventListener("keydown",this.handleEscapeKey)}sidebarOutletConnected(){this.#e(this.sidebarOutlet.element)}disconnect(){this.#i(),document.removeEventListener("keydown",this.handleEscapeKey),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden")}#e(i){i.setAttribute("aria-hidden","true"),i.classList.add("transition-transform"),this.#n(this.placementValue).base.forEach(e=>{i.classList.add(e)})}toggleDrawer(){this.visible?this.hideDrawer():this.showDrawer()}showDrawer(){this.edgeValue?this.#r(`${this.placementValue}-edge`,!0):this.#s(this.placementValue,!0),this.openIconTarget.classList.add("hidden"),this.openIconTarget.setAttribute("aria-hidden","true"),this.closeIconTarget.classList.remove("hidden"),this.closeIconTarget.setAttribute("aria-hidden","false"),this.sidebarOutlet.element.setAttribute("aria-modal","true"),this.sidebarOutlet.element.setAttribute("role","dialog"),this.sidebarOutlet.element.removeAttribute("aria-hidden"),this.bodyScrollingValue||document.body.classList.add("overflow-hidden"),this.backdropValue&&this.#t(),this.visible=!0,this.dispatch("show")}hideDrawer(){this.edgeValue?this.#r(`${this.placementValue}-edge`,!1):this.#s(this.placementValue,!1),this.openIconTarget.classList.remove("hidden"),this.openIconTarget.setAttribute("aria-hidden","false"),this.closeIconTarget.classList.add("hidden"),this.closeIconTarget.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.removeAttribute("aria-modal"),this.sidebarOutlet.element.removeAttribute("role"),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden"),this.backdropValue&&this.#i(),this.visible=!1,this.dispatch("hide")}handleEscapeKey(i){i.key==="Escape"&&this.visible&&this.hideDrawer()}#t(){if(!this.visible){let i=document.createElement("div");i.setAttribute("data-drawer-backdrop",""),i.classList.add(...this.constructor.classes.backdrop.split(" ")),i.addEventListener("click",()=>this.hideDrawer()),document.body.appendChild(i)}}#i(){let i=document.querySelector("[data-drawer-backdrop]");i&&i.remove()}#n(i){let e={top:{base:["top-0","left-0","right-0"],active:["transform-none"],inactive:["-translate-y-full"]},right:{base:["right-0","top-0"],active:["transform-none"],inactive:["translate-x-full"]},bottom:{base:["bottom-0","left-0","right-0"],active:["transform-none"],inactive:["translate-y-full"]},left:{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]},"bottom-edge":{base:["left-0","top-0"],active:["transform-none"],inactive:["translate-y-full",this.edgeOffsetValue]}};return e[i]||e.left}#s(i,e){let t=this.#n(i);e?(t.active.forEach(r=>this.sidebarOutlet.element.classList.add(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.remove(r))):(t.active.forEach(r=>this.sidebarOutlet.element.classList.remove(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.add(r)))}#r(i,e){this.#s(i,e)}};var hr=class extends S{connect(){console.log(`sidebar-menu-item connected: ${this.element}`)}};var dr=class extends S{connect(){console.log(`sidebar-menu connected: ${this.element}`)}};var fr=class extends S{connect(){console.log(`sidebar connected: ${this.element}`)}};var pr=class extends S{connect(){console.log(`has-many-panel connected: ${this.element}`)}};var mr=class extends S{static targets=["target","template","addButton"];static values={wrapperSelector:{type:String,default:".nested-resource-form-fields"},limit:Number};connect(){this.updateState()}add(i){i.preventDefault();let e=this.templateTarget.innerHTML.replace(/NEW_RECORD/g,new Date().getTime().toString());this.targetTarget.insertAdjacentHTML("beforebegin",e);let t=new CustomEvent("nested-resource-form-fields:add",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}remove(i){i.preventDefault();let e=i.target.closest(this.wrapperSelectorValue);if(e.dataset.newRecord!==void 0)e.remove();else{e.style.display="none",e.classList.remove(...e.classList);let r=e.querySelector("input[name*='_destroy']");r.value="1"}let t=new CustomEvent("nested-resource-form-fields:remove",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}updateState(){!this.hasAddButtonTarget||this.limitValue==0||(this.childCount>=this.limitValue?this.addButtonTarget.style.display="none":this.addButtonTarget.style.display="initial")}get childCount(){return this.element.querySelectorAll(this.wrapperSelectorValue).length}};var gr=class extends S{connect(){console.log(`toolbar connected: ${this.element}`)}};var vr=class extends S{connect(){console.log(`table-search-input connected: ${this.element}`)}};var br=class extends S{connect(){console.log(`table-toolbar connected: ${this.element}`)}};var yr=class extends S{connect(){console.log(`table connected: ${this.element}`)}};var op=Nl(zo(),1),wr=class extends S{connect(){console.log(`form connected: ${this.element}`)}submit(){this.element.requestSubmit()}};var Uc=function(){function i(e,t){t===void 0&&(t=[]),this._eventType=e,this._eventFunctions=t}return i.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(t){typeof window<"u"&&window.addEventListener(e._eventType,t)})},i}(),Vo=Uc;var Wc=function(){function i(){this._instances={Accordion:{},Carousel:{},Collapse:{},Dial:{},Dismiss:{},Drawer:{},Dropdown:{},Modal:{},Popover:{},Tabs:{},Tooltip:{},InputCounter:{},CopyClipboard:{}}}return i.prototype.addInstance=function(e,t,r,n){if(n===void 0&&(n=!1),!this._instances[e])return console.warn("Flowbite: Component ".concat(e," does not exist.")),!1;if(this._instances[e][r]&&!n){console.warn("Flowbite: Instance with ID ".concat(r," already exists."));return}n&&this._instances[e][r]&&this._instances[e][r].destroyAndRemoveInstance(),this._instances[e][r||this._generateRandomId()]=t},i.prototype.getAllInstances=function(){return this._instances},i.prototype.getInstances=function(e){return this._instances[e]?this._instances[e]:(console.warn("Flowbite: Component ".concat(e," does not exist.")),!1)},i.prototype.getInstance=function(e,t){if(this._componentAndInstanceCheck(e,t)){if(!this._instances[e][t]){console.warn("Flowbite: Instance with ID ".concat(t," does not exist."));return}return this._instances[e][t]}},i.prototype.destroyAndRemoveInstance=function(e,t){this._componentAndInstanceCheck(e,t)&&(this.destroyInstanceObject(e,t),this.removeInstance(e,t))},i.prototype.removeInstance=function(e,t){this._componentAndInstanceCheck(e,t)&&delete this._instances[e][t]},i.prototype.destroyInstanceObject=function(e,t){this._componentAndInstanceCheck(e,t)&&this._instances[e][t].destroy()},i.prototype.instanceExists=function(e,t){return!(!this._instances[e]||!this._instances[e][t])},i.prototype._generateRandomId=function(){return Math.random().toString(36).substr(2,9)},i.prototype._componentAndInstanceCheck=function(e,t){return this._instances[e]?this._instances[e][t]?!0:(console.warn("Flowbite: Instance with ID ".concat(t," does not exist.")),!1):(console.warn("Flowbite: Component ".concat(e," does not exist.")),!1)},i}(),$o=new Wc,I=$o;typeof window<"u"&&(window.FlowbiteInstances=$o);var Er=function(){return Er=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Er.apply(this,arguments)},_r={alwaysOpen:!1,activeClasses:"bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white",inactiveClasses:"text-gray-500 dark:text-gray-400",onOpen:function(){},onClose:function(){},onToggle:function(){}},Kc={id:null,override:!0},jo=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=_r),n===void 0&&(n=Kc),this._instanceId=n.id?n.id:e.id,this._accordionEl=e,this._items=t,this._options=Er(Er({},_r),r),this._initialized=!1,this.init(),I.addInstance("Accordion",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._items.length&&!this._initialized&&(this._items.forEach(function(t){t.active&&e.open(t.id);var r=function(){e.toggle(t.id)};t.triggerEl.addEventListener("click",r),t.clickHandler=r}),this._initialized=!0)},i.prototype.destroy=function(){this._items.length&&this._initialized&&(this._items.forEach(function(e){e.triggerEl.removeEventListener("click",e.clickHandler),delete e.clickHandler}),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Accordion",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getItem=function(e){return this._items.filter(function(t){return t.id===e})[0]},i.prototype.open=function(e){var t,r,n=this,s=this.getItem(e);this._options.alwaysOpen||this._items.map(function(o){var a,l;o!==s&&((a=o.triggerEl.classList).remove.apply(a,n._options.activeClasses.split(" ")),(l=o.triggerEl.classList).add.apply(l,n._options.inactiveClasses.split(" ")),o.targetEl.classList.add("hidden"),o.triggerEl.setAttribute("aria-expanded","false"),o.active=!1,o.iconEl&&o.iconEl.classList.add("rotate-180"))}),(t=s.triggerEl.classList).add.apply(t,this._options.activeClasses.split(" ")),(r=s.triggerEl.classList).remove.apply(r,this._options.inactiveClasses.split(" ")),s.triggerEl.setAttribute("aria-expanded","true"),s.targetEl.classList.remove("hidden"),s.active=!0,s.iconEl&&s.iconEl.classList.remove("rotate-180"),this._options.onOpen(this,s)},i.prototype.toggle=function(e){var t=this.getItem(e);t.active?this.close(e):this.open(e),this._options.onToggle(this,t)},i.prototype.close=function(e){var t,r,n=this.getItem(e);(t=n.triggerEl.classList).remove.apply(t,this._options.activeClasses.split(" ")),(r=n.triggerEl.classList).add.apply(r,this._options.inactiveClasses.split(" ")),n.targetEl.classList.add("hidden"),n.triggerEl.setAttribute("aria-expanded","false"),n.active=!1,n.iconEl&&n.iconEl.classList.add("rotate-180"),this._options.onClose(this,n)},i.prototype.updateOnOpen=function(e){this._options.onOpen=e},i.prototype.updateOnClose=function(e){this._options.onClose=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Bt(){document.querySelectorAll("[data-accordion]").forEach(function(i){var e=i.getAttribute("data-accordion"),t=i.getAttribute("data-active-classes"),r=i.getAttribute("data-inactive-classes"),n=[];i.querySelectorAll("[data-accordion-target]").forEach(function(s){if(s.closest("[data-accordion]")===i){var o={id:s.getAttribute("data-accordion-target"),triggerEl:s,targetEl:document.querySelector(s.getAttribute("data-accordion-target")),iconEl:s.querySelector("[data-accordion-icon]"),active:s.getAttribute("aria-expanded")==="true"};n.push(o)}}),new jo(i,n,{alwaysOpen:e==="open",activeClasses:t||_r.activeClasses,inactiveClasses:r||_r.inactiveClasses})})}typeof window<"u"&&(window.Accordion=jo,window.initAccordions=Bt);var Ar=function(){return Ar=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Ar.apply(this,arguments)},Uo={onCollapse:function(){},onExpand:function(){},onToggle:function(){}},Gc={id:null,override:!0},Tr=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Uo),n===void 0&&(n=Gc),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=Ar(Ar({},Uo),r),this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Collapse",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._triggerEl&&this._targetEl&&!this._initialized&&(this._triggerEl.hasAttribute("aria-expanded")?this._visible=this._triggerEl.getAttribute("aria-expanded")==="true":this._visible=!this._targetEl.classList.contains("hidden"),this._clickHandler=function(){e.toggle()},this._triggerEl.addEventListener("click",this._clickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._initialized&&(this._triggerEl.removeEventListener("click",this._clickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Collapse",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.collapse=function(){this._targetEl.classList.add("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","false"),this._visible=!1,this._options.onCollapse(this)},i.prototype.expand=function(){this._targetEl.classList.remove("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","true"),this._visible=!0,this._options.onExpand(this)},i.prototype.toggle=function(){this._visible?this.collapse():this.expand(),this._options.onToggle(this)},i.prototype.updateOnCollapse=function(e){this._options.onCollapse=e},i.prototype.updateOnExpand=function(e){this._options.onExpand=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Nt(){document.querySelectorAll("[data-collapse-toggle]").forEach(function(i){var e=i.getAttribute("data-collapse-toggle"),t=document.getElementById(e);t?I.instanceExists("Collapse",t.getAttribute("id"))?new Tr(t,i,{},{id:t.getAttribute("id")+"_"+I._generateRandomId()}):new Tr(t,i):console.error('The target element with id "'.concat(e,'" does not exist. Please check the data-collapse-toggle attribute.'))})}typeof window<"u"&&(window.Collapse=Tr,window.initCollapses=Nt);var Yn=Tr;var ct=function(){return ct=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},ct.apply(this,arguments)},Sr={defaultPosition:0,indicators:{items:[],activeClasses:"bg-white dark:bg-gray-800",inactiveClasses:"bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800"},interval:3e3,onNext:function(){},onPrev:function(){},onChange:function(){}},Yc={id:null,override:!0},Wo=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=Sr),n===void 0&&(n=Yc),this._instanceId=n.id?n.id:e.id,this._carouselEl=e,this._items=t,this._options=ct(ct(ct({},Sr),r),{indicators:ct(ct({},Sr.indicators),r.indicators)}),this._activeItem=this.getItem(this._options.defaultPosition),this._indicators=this._options.indicators.items,this._intervalDuration=this._options.interval,this._intervalInstance=null,this._initialized=!1,this.init(),I.addInstance("Carousel",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._items.length&&!this._initialized&&(this._items.map(function(t){t.el.classList.add("absolute","inset-0","transition-transform","transform")}),this.getActiveItem()?this.slideTo(this.getActiveItem().position):this.slideTo(0),this._indicators.map(function(t,r){t.el.addEventListener("click",function(){e.slideTo(r)})}),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Carousel",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getItem=function(e){return this._items[e]},i.prototype.slideTo=function(e){var t=this._items[e],r={left:t.position===0?this._items[this._items.length-1]:this._items[t.position-1],middle:t,right:t.position===this._items.length-1?this._items[0]:this._items[t.position+1]};this._rotate(r),this._setActiveItem(t),this._intervalInstance&&(this.pause(),this.cycle()),this._options.onChange(this)},i.prototype.next=function(){var e=this.getActiveItem(),t=null;e.position===this._items.length-1?t=this._items[0]:t=this._items[e.position+1],this.slideTo(t.position),this._options.onNext(this)},i.prototype.prev=function(){var e=this.getActiveItem(),t=null;e.position===0?t=this._items[this._items.length-1]:t=this._items[e.position-1],this.slideTo(t.position),this._options.onPrev(this)},i.prototype._rotate=function(e){if(this._items.map(function(t){t.el.classList.add("hidden")}),this._items.length===1){e.middle.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-10"),e.middle.el.classList.add("translate-x-0","z-20");return}e.left.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-20"),e.left.el.classList.add("-translate-x-full","z-10"),e.middle.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-10"),e.middle.el.classList.add("translate-x-0","z-30"),e.right.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-30"),e.right.el.classList.add("translate-x-full","z-20")},i.prototype.cycle=function(){var e=this;typeof window<"u"&&(this._intervalInstance=window.setInterval(function(){e.next()},this._intervalDuration))},i.prototype.pause=function(){clearInterval(this._intervalInstance)},i.prototype.getActiveItem=function(){return this._activeItem},i.prototype._setActiveItem=function(e){var t,r,n=this;this._activeItem=e;var s=e.position;this._indicators.length&&(this._indicators.map(function(o){var a,l;o.el.setAttribute("aria-current","false"),(a=o.el.classList).remove.apply(a,n._options.indicators.activeClasses.split(" ")),(l=o.el.classList).add.apply(l,n._options.indicators.inactiveClasses.split(" "))}),(t=this._indicators[s].el.classList).add.apply(t,this._options.indicators.activeClasses.split(" ")),(r=this._indicators[s].el.classList).remove.apply(r,this._options.indicators.inactiveClasses.split(" ")),this._indicators[s].el.setAttribute("aria-current","true"))},i.prototype.updateOnNext=function(e){this._options.onNext=e},i.prototype.updateOnPrev=function(e){this._options.onPrev=e},i.prototype.updateOnChange=function(e){this._options.onChange=e},i}();function Ht(){document.querySelectorAll("[data-carousel]").forEach(function(i){var e=i.getAttribute("data-carousel-interval"),t=i.getAttribute("data-carousel")==="slide",r=[],n=0;i.querySelectorAll("[data-carousel-item]").length&&Array.from(i.querySelectorAll("[data-carousel-item]")).map(function(f,u){r.push({position:u,el:f}),f.getAttribute("data-carousel-item")==="active"&&(n=u)});var s=[];i.querySelectorAll("[data-carousel-slide-to]").length&&Array.from(i.querySelectorAll("[data-carousel-slide-to]")).map(function(f){s.push({position:parseInt(f.getAttribute("data-carousel-slide-to")),el:f})});var o=new Wo(i,r,{defaultPosition:n,indicators:{items:s},interval:e||Sr.interval});t&&o.cycle();var a=i.querySelector("[data-carousel-next]"),l=i.querySelector("[data-carousel-prev]");a&&a.addEventListener("click",function(){o.next()}),l&&l.addEventListener("click",function(){o.prev()})})}typeof window<"u"&&(window.Carousel=Wo,window.initCarousels=Ht);var kr=function(){return kr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},kr.apply(this,arguments)},Ko={transition:"transition-opacity",duration:300,timing:"ease-out",onHide:function(){}},Xc={id:null,override:!0},Go=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Ko),n===void 0&&(n=Xc),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=kr(kr({},Ko),r),this._initialized=!1,this.init(),I.addInstance("Dismiss",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._triggerEl&&this._targetEl&&!this._initialized&&(this._clickHandler=function(){e.hide()},this._triggerEl.addEventListener("click",this._clickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._initialized&&(this._triggerEl.removeEventListener("click",this._clickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Dismiss",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){var e=this;this._targetEl.classList.add(this._options.transition,"duration-".concat(this._options.duration),this._options.timing,"opacity-0"),setTimeout(function(){e._targetEl.classList.add("hidden")},this._options.duration),this._options.onHide(this,this._targetEl)},i.prototype.updateOnHide=function(e){this._options.onHide=e},i}();function qt(){document.querySelectorAll("[data-dismiss-target]").forEach(function(i){var e=i.getAttribute("data-dismiss-target"),t=document.querySelector(e);t?new Go(t,i):console.error('The dismiss element with id "'.concat(e,'" does not exist. Please check the data-dismiss-target attribute.'))})}typeof window<"u"&&(window.Dismiss=Go,window.initDismisses=qt);var J="top",ie="bottom",te="right",ee="left",xr="auto",Je=[J,ie,te,ee],We="start",ut="end",Yo="clippingParents",Lr="viewport",zt="popper",Xo="reference",Xn=Je.reduce(function(i,e){return i.concat([e+"-"+We,e+"-"+ut])},[]),Cr=[].concat(Je,[xr]).reduce(function(i,e){return i.concat([e,e+"-"+We,e+"-"+ut])},[]),Zc="beforeRead",Qc="read",Jc="afterRead",eu="beforeMain",tu="main",iu="afterMain",ru="beforeWrite",nu="write",su="afterWrite",Zo=[Zc,Qc,Jc,eu,tu,iu,ru,nu,su];function oe(i){return i?(i.nodeName||"").toLowerCase():null}function G(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function _e(i){var e=G(i).Element;return i instanceof e||i instanceof Element}function re(i){var e=G(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function Vt(i){if(typeof ShadowRoot>"u")return!1;var e=G(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function ou(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];!re(s)||!oe(s)||(Object.assign(s.style,r),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function au(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var n=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=o.reduce(function(l,f){return l[f]="",l},{});!re(n)||!oe(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}var Qo={name:"applyStyles",enabled:!0,phase:"write",fn:ou,effect:au,requires:["computeStyles"]};function ae(i){return i.split("-")[0]}var Ce=Math.max,ht=Math.min,Ke=Math.round;function $t(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ei(){return!/^((?!chrome|android).)*safari/i.test($t())}function Ae(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=i.getBoundingClientRect(),n=1,s=1;e&&re(i)&&(n=i.offsetWidth>0&&Ke(r.width)/i.offsetWidth||1,s=i.offsetHeight>0&&Ke(r.height)/i.offsetHeight||1);var o=_e(i)?G(i):window,a=o.visualViewport,l=!Ei()&&t,f=(r.left+(l&&a?a.offsetLeft:0))/n,u=(r.top+(l&&a?a.offsetTop:0))/s,g=r.width/n,w=r.height/s;return{width:g,height:w,top:u,right:f+g,bottom:u+w,left:f,x:f,y:u}}function dt(i){var e=Ae(i),t=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:r}}function _i(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&Vt(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function me(i){return G(i).getComputedStyle(i)}function Zn(i){return["table","td","th"].indexOf(oe(i))>=0}function he(i){return((_e(i)?i.ownerDocument:i.document)||window.document).documentElement}function Ge(i){return oe(i)==="html"?i:i.assignedSlot||i.parentNode||(Vt(i)?i.host:null)||he(i)}function Jo(i){return!re(i)||me(i).position==="fixed"?null:i.offsetParent}function lu(i){var e=/firefox/i.test($t()),t=/Trident/i.test($t());if(t&&re(i)){var r=me(i);if(r.position==="fixed")return null}var n=Ge(i);for(Vt(n)&&(n=n.host);re(n)&&["html","body"].indexOf(oe(n))<0;){var s=me(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function Ie(i){for(var e=G(i),t=Jo(i);t&&Zn(t)&&me(t).position==="static";)t=Jo(t);return t&&(oe(t)==="html"||oe(t)==="body"&&me(t).position==="static")?e:t||lu(i)||e}function ft(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function pt(i,e,t){return Ce(i,ht(e,t))}function ea(i,e,t){var r=pt(i,e,t);return r>t?t:r}function Ai(){return{top:0,right:0,bottom:0,left:0}}function Ti(i){return Object.assign({},Ai(),i)}function Si(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var cu=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Ti(typeof e!="number"?e:Si(e,Je))};function uu(i){var e,t=i.state,r=i.name,n=i.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=ae(t.placement),l=ft(a),f=[ee,te].indexOf(a)>=0,u=f?"height":"width";if(!(!s||!o)){var g=cu(n.padding,t),w=dt(s),y=l==="y"?J:ee,_=l==="y"?ie:te,L=t.rects.reference[u]+t.rects.reference[l]-o[l]-t.rects.popper[u],k=o[l]-t.rects.reference[l],P=Ie(s),q=P?l==="y"?P.clientHeight||0:P.clientWidth||0:0,B=L/2-k/2,T=g[y],O=q-w[u]-g[_],x=q/2-w[u]/2+B,F=pt(T,x,O),j=l;t.modifiersData[r]=(e={},e[j]=F,e.centerOffset=F-x,e)}}function hu(i){var e=i.state,t=i.options,r=t.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||_i(e.elements.popper,n)&&(e.elements.arrow=n))}var ta={name:"arrow",enabled:!0,phase:"main",fn:uu,effect:hu,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Te(i){return i.split("-")[1]}var du={top:"auto",right:"auto",bottom:"auto",left:"auto"};function fu(i,e){var t=i.x,r=i.y,n=e.devicePixelRatio||1;return{x:Ke(t*n)/n||0,y:Ke(r*n)/n||0}}function ia(i){var e,t=i.popper,r=i.popperRect,n=i.placement,s=i.variation,o=i.offsets,a=i.position,l=i.gpuAcceleration,f=i.adaptive,u=i.roundOffsets,g=i.isFixed,w=o.x,y=w===void 0?0:w,_=o.y,L=_===void 0?0:_,k=typeof u=="function"?u({x:y,y:L}):{x:y,y:L};y=k.x,L=k.y;var P=o.hasOwnProperty("x"),q=o.hasOwnProperty("y"),B=ee,T=J,O=window;if(f){var x=Ie(t),F="clientHeight",j="clientWidth";if(x===G(t)&&(x=he(t),me(x).position!=="static"&&a==="absolute"&&(F="scrollHeight",j="scrollWidth")),x=x,n===J||(n===ee||n===te)&&s===ut){T=ie;var U=g&&x===O&&O.visualViewport?O.visualViewport.height:x[F];L-=U-r.height,L*=l?1:-1}if(n===ee||(n===J||n===ie)&&s===ut){B=te;var Y=g&&x===O&&O.visualViewport?O.visualViewport.width:x[j];y-=Y-r.width,y*=l?1:-1}}var H=Object.assign({position:a},f&&du),X=u===!0?fu({x:y,y:L},G(t)):{x:y,y:L};if(y=X.x,L=X.y,l){var W;return Object.assign({},H,(W={},W[T]=q?"0":"",W[B]=P?"0":"",W.transform=(O.devicePixelRatio||1)<=1?"translate("+y+"px, "+L+"px)":"translate3d("+y+"px, "+L+"px, 0)",W))}return Object.assign({},H,(e={},e[T]=q?L+"px":"",e[B]=P?y+"px":"",e.transform="",e))}function pu(i){var e=i.state,t=i.options,r=t.gpuAcceleration,n=r===void 0?!0:r,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,l=a===void 0?!0:a,f={placement:ae(e.placement),variation:Te(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ia(Object.assign({},f,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ia(Object.assign({},f,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var ra={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:pu,data:{}};var Ir={passive:!0};function mu(i){var e=i.state,t=i.instance,r=i.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,l=G(e.elements.popper),f=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&f.forEach(function(u){u.addEventListener("scroll",t.update,Ir)}),a&&l.addEventListener("resize",t.update,Ir),function(){s&&f.forEach(function(u){u.removeEventListener("scroll",t.update,Ir)}),a&&l.removeEventListener("resize",t.update,Ir)}}var na={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:mu,data:{}};var gu={left:"right",right:"left",bottom:"top",top:"bottom"};function jt(i){return i.replace(/left|right|bottom|top/g,function(e){return gu[e]})}var vu={start:"end",end:"start"};function Or(i){return i.replace(/start|end/g,function(e){return vu[e]})}function mt(i){var e=G(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function gt(i){return Ae(he(i)).left+mt(i).scrollLeft}function Qn(i,e){var t=G(i),r=he(i),n=t.visualViewport,s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;var f=Ei();(f||!f&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:s,height:o,x:a+gt(i),y:l}}function Jn(i){var e,t=he(i),r=mt(i),n=(e=i.ownerDocument)==null?void 0:e.body,s=Ce(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=Ce(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+gt(i),l=-r.scrollTop;return me(n||t).direction==="rtl"&&(a+=Ce(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function vt(i){var e=me(i),t=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+r)}function Rr(i){return["html","body","#document"].indexOf(oe(i))>=0?i.ownerDocument.body:re(i)&&vt(i)?i:Rr(Ge(i))}function et(i,e){var t;e===void 0&&(e=[]);var r=Rr(i),n=r===((t=i.ownerDocument)==null?void 0:t.body),s=G(r),o=n?[s].concat(s.visualViewport||[],vt(r)?r:[]):r,a=e.concat(o);return n?a:a.concat(et(Ge(o)))}function Ut(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function bu(i,e){var t=Ae(i,!1,e==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function sa(i,e,t){return e===Lr?Ut(Qn(i,t)):_e(e)?bu(e,t):Ut(Jn(he(i)))}function yu(i){var e=et(Ge(i)),t=["absolute","fixed"].indexOf(me(i).position)>=0,r=t&&re(i)?Ie(i):i;return _e(r)?e.filter(function(n){return _e(n)&&_i(n,r)&&oe(n)!=="body"}):[]}function es(i,e,t,r){var n=e==="clippingParents"?yu(i):[].concat(e),s=[].concat(n,[t]),o=s[0],a=s.reduce(function(l,f){var u=sa(i,f,r);return l.top=Ce(u.top,l.top),l.right=ht(u.right,l.right),l.bottom=ht(u.bottom,l.bottom),l.left=Ce(u.left,l.left),l},sa(i,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ki(i){var e=i.reference,t=i.element,r=i.placement,n=r?ae(r):null,s=r?Te(r):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(n){case J:l={x:o,y:e.y-t.height};break;case ie:l={x:o,y:e.y+e.height};break;case te:l={x:e.x+e.width,y:a};break;case ee:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var f=n?ft(n):null;if(f!=null){var u=f==="y"?"height":"width";switch(s){case We:l[f]=l[f]-(e[u]/2-t[u]/2);break;case ut:l[f]=l[f]+(e[u]/2-t[u]/2);break;default:}}return l}function Oe(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=r===void 0?i.placement:r,s=t.strategy,o=s===void 0?i.strategy:s,a=t.boundary,l=a===void 0?Yo:a,f=t.rootBoundary,u=f===void 0?Lr:f,g=t.elementContext,w=g===void 0?zt:g,y=t.altBoundary,_=y===void 0?!1:y,L=t.padding,k=L===void 0?0:L,P=Ti(typeof k!="number"?k:Si(k,Je)),q=w===zt?Xo:zt,B=i.rects.popper,T=i.elements[_?q:w],O=es(_e(T)?T:T.contextElement||he(i.elements.popper),l,u,o),x=Ae(i.elements.reference),F=ki({reference:x,element:B,strategy:"absolute",placement:n}),j=Ut(Object.assign({},B,F)),U=w===zt?j:x,Y={top:O.top-U.top+P.top,bottom:U.bottom-O.bottom+P.bottom,left:O.left-U.left+P.left,right:U.right-O.right+P.right},H=i.modifiersData.offset;if(w===zt&&H){var X=H[n];Object.keys(Y).forEach(function(W){var be=[te,ie].indexOf(W)>=0?1:-1,xe=[J,ie].indexOf(W)>=0?"y":"x";Y[W]+=X[xe]*be})}return Y}function ts(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,f=l===void 0?Cr:l,u=Te(r),g=u?a?Xn:Xn.filter(function(_){return Te(_)===u}):Je,w=g.filter(function(_){return f.indexOf(_)>=0});w.length===0&&(w=g);var y=w.reduce(function(_,L){return _[L]=Oe(i,{placement:L,boundary:n,rootBoundary:s,padding:o})[ae(L)],_},{});return Object.keys(y).sort(function(_,L){return y[_]-y[L]})}function wu(i){if(ae(i)===xr)return[];var e=jt(i);return[Or(i),e,Or(e)]}function Eu(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,f=t.padding,u=t.boundary,g=t.rootBoundary,w=t.altBoundary,y=t.flipVariations,_=y===void 0?!0:y,L=t.allowedAutoPlacements,k=e.options.placement,P=ae(k),q=P===k,B=l||(q||!_?[jt(k)]:wu(k)),T=[k].concat(B).reduce(function(ce,N){return ce.concat(ae(N)===xr?ts(e,{placement:N,boundary:u,rootBoundary:g,padding:f,flipVariations:_,allowedAutoPlacements:L}):N)},[]),O=e.rects.reference,x=e.rects.popper,F=new Map,j=!0,U=T[0],Y=0;Y<T.length;Y++){var H=T[Y],X=ae(H),W=Te(H)===We,be=[J,ie].indexOf(X)>=0,xe=be?"width":"height",h=Oe(e,{placement:H,boundary:u,rootBoundary:g,altBoundary:w,padding:f}),d=be?W?te:ee:W?ie:J;O[xe]>x[xe]&&(d=jt(d));var p=jt(d),b=[];if(s&&b.push(h[X]<=0),a&&b.push(h[d]<=0,h[p]<=0),b.every(function(ce){return ce})){U=H,j=!1;break}F.set(H,b)}if(j)for(var E=_?3:1,v=function(N){var z=T.find(function(ne){var de=F.get(ne);if(de)return de.slice(0,N).every(function(Le){return Le})});if(z)return U=z,"break"},R=E;R>0;R--){var M=v(R);if(M==="break")break}e.placement!==U&&(e.modifiersData[r]._skip=!0,e.placement=U,e.reset=!0)}}var oa={name:"flip",enabled:!0,phase:"main",fn:Eu,requiresIfExists:["offset"],data:{_skip:!1}};function aa(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function la(i){return[J,te,ie,ee].some(function(e){return i[e]>=0})}function _u(i){var e=i.state,t=i.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=Oe(e,{elementContext:"reference"}),a=Oe(e,{altBoundary:!0}),l=aa(o,r),f=aa(a,n,s),u=la(l),g=la(f);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:f,isReferenceHidden:u,hasPopperEscaped:g},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":g})}var ca={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:_u};function Au(i,e,t){var r=ae(i),n=[ee,J].indexOf(r)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[ee,te].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Tu(i){var e=i.state,t=i.options,r=i.name,n=t.offset,s=n===void 0?[0,0]:n,o=Cr.reduce(function(u,g){return u[g]=Au(g,e.rects,s),u},{}),a=o[e.placement],l=a.x,f=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=f),e.modifiersData[r]=o}var ua={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Tu};function Su(i){var e=i.state,t=i.name;e.modifiersData[t]=ki({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var ha={name:"popperOffsets",enabled:!0,phase:"read",fn:Su,data:{}};function is(i){return i==="x"?"y":"x"}function ku(i){var e=i.state,t=i.options,r=i.name,n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,f=t.rootBoundary,u=t.altBoundary,g=t.padding,w=t.tether,y=w===void 0?!0:w,_=t.tetherOffset,L=_===void 0?0:_,k=Oe(e,{boundary:l,rootBoundary:f,padding:g,altBoundary:u}),P=ae(e.placement),q=Te(e.placement),B=!q,T=ft(P),O=is(T),x=e.modifiersData.popperOffsets,F=e.rects.reference,j=e.rects.popper,U=typeof L=="function"?L(Object.assign({},e.rects,{placement:e.placement})):L,Y=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),H=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,X={x:0,y:0};if(x){if(s){var W,be=T==="y"?J:ee,xe=T==="y"?ie:te,h=T==="y"?"height":"width",d=x[T],p=d+k[be],b=d-k[xe],E=y?-j[h]/2:0,v=q===We?F[h]:j[h],R=q===We?-j[h]:-F[h],M=e.elements.arrow,ce=y&&M?dt(M):{width:0,height:0},N=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Ai(),z=N[be],ne=N[xe],de=pt(0,F[h],ce[h]),Le=B?F[h]/2-E-de-z-Y.mainAxis:v-de-z-Y.mainAxis,Lt=B?-F[h]/2+E+de+ne+Y.mainAxis:R+de+ne+Y.mainAxis,Ct=e.elements.arrow&&Ie(e.elements.arrow),Qe=Ct?T==="y"?Ct.clientTop||0:Ct.clientLeft||0:0,It=(W=H?.[T])!=null?W:0,Ne=d+Le-It-Qe,fi=d+Lt-It,Ot=pt(y?ht(p,Ne):p,d,y?Ce(b,fi):b);x[T]=Ot,X[T]=Ot-d}if(a){var He,Rt=T==="x"?J:ee,Mt=T==="x"?ie:te,Pe=x[O],lt=O==="y"?"height":"width",Ui=Pe+k[Rt],Pt=Pe-k[Mt],qe=[J,ee].indexOf(P)!==-1,ze=(He=H?.[O])!=null?He:0,Ve=qe?Ui:Pe-F[lt]-j[lt]-ze+Y.altAxis,pi=qe?Pe+F[lt]+j[lt]-ze-Y.altAxis:Pt,mi=y&&qe?ea(Ve,Pe,pi):pt(y?Ve:Ui,Pe,y?pi:Pt);x[O]=mi,X[O]=mi-Pe}e.modifiersData[r]=X}}var da={name:"preventOverflow",enabled:!0,phase:"main",fn:ku,requiresIfExists:["offset"]};function rs(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function ns(i){return i===G(i)||!re(i)?mt(i):rs(i)}function xu(i){var e=i.getBoundingClientRect(),t=Ke(e.width)/i.offsetWidth||1,r=Ke(e.height)/i.offsetHeight||1;return t!==1||r!==1}function ss(i,e,t){t===void 0&&(t=!1);var r=re(e),n=re(e)&&xu(e),s=he(e),o=Ae(i,n,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!t)&&((oe(e)!=="body"||vt(s))&&(a=ns(e)),re(e)?(l=Ae(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=gt(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Lu(i){var e=new Map,t=new Set,r=[];i.forEach(function(s){e.set(s.name,s)});function n(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&n(l)}}),r.push(s)}return i.forEach(function(s){t.has(s.name)||n(s)}),r}function os(i){var e=Lu(i);return Zo.reduce(function(t,r){return t.concat(e.filter(function(n){return n.phase===r}))},[])}function as(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function ls(i){var e=i.reduce(function(t,r){var n=t[r.name];return t[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var fa={placement:"bottom",modifiers:[],strategy:"absolute"};function pa(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function ma(i){i===void 0&&(i={});var e=i,t=e.defaultModifiers,r=t===void 0?[]:t,n=e.defaultOptions,s=n===void 0?fa:n;return function(a,l,f){f===void 0&&(f=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},fa,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},g=[],w=!1,y={state:u,setOptions:function(P){var q=typeof P=="function"?P(u.options):P;L(),u.options=Object.assign({},s,u.options,q),u.scrollParents={reference:_e(a)?et(a):a.contextElement?et(a.contextElement):[],popper:et(l)};var B=os(ls([].concat(r,u.options.modifiers)));return u.orderedModifiers=B.filter(function(T){return T.enabled}),_(),y.update()},forceUpdate:function(){if(!w){var P=u.elements,q=P.reference,B=P.popper;if(pa(q,B)){u.rects={reference:ss(q,Ie(B),u.options.strategy==="fixed"),popper:dt(B)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(Y){return u.modifiersData[Y.name]=Object.assign({},Y.data)});for(var T=0;T<u.orderedModifiers.length;T++){if(u.reset===!0){u.reset=!1,T=-1;continue}var O=u.orderedModifiers[T],x=O.fn,F=O.options,j=F===void 0?{}:F,U=O.name;typeof x=="function"&&(u=x({state:u,options:j,name:U,instance:y})||u)}}}},update:as(function(){return new Promise(function(k){y.forceUpdate(),k(u)})}),destroy:function(){L(),w=!0}};if(!pa(a,l))return y;y.setOptions(f).then(function(k){!w&&f.onFirstUpdate&&f.onFirstUpdate(k)});function _(){u.orderedModifiers.forEach(function(k){var P=k.name,q=k.options,B=q===void 0?{}:q,T=k.effect;if(typeof T=="function"){var O=T({state:u,name:P,instance:y,options:B}),x=function(){};g.push(O||x)}})}function L(){g.forEach(function(k){return k()}),g=[]}return y}}var Cu=[na,ha,ra,Qo,ua,oa,da,ta,ca],bt=ma({defaultModifiers:Cu});var tt=function(){return tt=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},tt.apply(this,arguments)},Mr=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,s;r<n;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))},it={placement:"bottom",triggerType:"click",offsetSkidding:0,offsetDistance:10,delay:300,ignoreClickOutsideClass:!1,onShow:function(){},onHide:function(){},onToggle:function(){}},Iu={id:null,override:!0},cs=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=it),n===void 0&&(n=Iu),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=tt(tt({},it),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Dropdown",this,this._instanceId,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._popperInstance=this._createPopperInstance(),this._setupEventListeners(),this._initialized=!0)},i.prototype.destroy=function(){var e=this,t=this._getTriggerEvents();this._options.triggerType==="click"&&t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._clickHandler)}),this._options.triggerType==="hover"&&(t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hoverShowTriggerElHandler),e._targetEl.removeEventListener(r,e._hoverShowTargetElHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hoverHideHandler),e._targetEl.removeEventListener(r,e._hoverHideHandler)})),this._popperInstance.destroy(),this._initialized=!1},i.prototype.removeInstance=function(){I.removeInstance("Dropdown",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var e=this,t=this._getTriggerEvents();this._clickHandler=function(){e.toggle()},this._options.triggerType==="click"&&t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._clickHandler)}),this._hoverShowTriggerElHandler=function(r){r.type==="click"?e.toggle():setTimeout(function(){e.show()},e._options.delay)},this._hoverShowTargetElHandler=function(){e.show()},this._hoverHideHandler=function(){setTimeout(function(){e._targetEl.matches(":hover")||e.hide()},e._options.delay)},this._options.triggerType==="hover"&&(t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hoverShowTriggerElHandler),e._targetEl.addEventListener(r,e._hoverShowTargetElHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hoverHideHandler),e._targetEl.addEventListener(r,e._hoverHideHandler)}))},i.prototype._createPopperInstance=function(){return bt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[this._options.offsetSkidding,this._options.offsetDistance]}}]})},i.prototype._setupClickOutsideListener=function(){var e=this;this._clickOutsideEventListener=function(t){e._handleClickOutside(t,e._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(e,t){var r=e.target,n=this._options.ignoreClickOutsideClass,s=!1;if(n){var o=document.querySelectorAll(".".concat(n));o.forEach(function(a){if(a.contains(r)){s=!0;return}})}r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&!s&&this.isVisible()&&this.hide()},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","click"],hideEvents:["mouseleave"]};case"click":return{showEvents:["click"],hideEvents:[]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["click"],hideEvents:[]}}},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show(),this._options.onToggle(this)},i.prototype.isVisible=function(){return this._visible},i.prototype.show=function(){this._targetEl.classList.remove("hidden"),this._targetEl.classList.add("block"),this._popperInstance.setOptions(function(e){return tt(tt({},e),{modifiers:Mr(Mr([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("block"),this._targetEl.classList.add("hidden"),this._popperInstance.setOptions(function(e){return tt(tt({},e),{modifiers:Mr(Mr([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._visible=!1,this._removeClickOutsideListener(),this._options.onHide(this)},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Wt(){document.querySelectorAll("[data-dropdown-toggle]").forEach(function(i){var e=i.getAttribute("data-dropdown-toggle"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-dropdown-placement"),n=i.getAttribute("data-dropdown-offset-skidding"),s=i.getAttribute("data-dropdown-offset-distance"),o=i.getAttribute("data-dropdown-trigger"),a=i.getAttribute("data-dropdown-delay"),l=i.getAttribute("data-dropdown-ignore-click-outside-class");new cs(t,i,{placement:r||it.placement,triggerType:o||it.triggerType,offsetSkidding:n?parseInt(n):it.offsetSkidding,offsetDistance:s?parseInt(s):it.offsetDistance,delay:a?parseInt(a):it.delay,ignoreClickOutsideClass:l||it.ignoreClickOutsideClass})}else console.error('The dropdown element with id "'.concat(e,'" does not exist. Please check the data-dropdown-toggle attribute.'))})}typeof window<"u"&&(window.Dropdown=cs,window.initDropdowns=Wt);var us=cs;var Pr=function(){return Pr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Pr.apply(this,arguments)},Dr={placement:"center",backdropClasses:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-40",backdrop:"dynamic",closable:!0,onHide:function(){},onShow:function(){},onToggle:function(){}},Ou={id:null,override:!0},ga=function(){function i(e,t,r){e===void 0&&(e=null),t===void 0&&(t=Dr),r===void 0&&(r=Ou),this._eventListenerInstances=[],this._instanceId=r.id?r.id:e.id,this._targetEl=e,this._options=Pr(Pr({},Dr),t),this._isHidden=!0,this._backdropEl=null,this._initialized=!1,this.init(),I.addInstance("Modal",this,this._instanceId,r.override)}return i.prototype.init=function(){var e=this;this._targetEl&&!this._initialized&&(this._getPlacementClasses().map(function(t){e._targetEl.classList.add(t)}),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this.removeAllEventListenerInstances(),this._destroyBackdropEl(),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Modal",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._createBackdrop=function(){var e;if(this._isHidden){var t=document.createElement("div");t.setAttribute("modal-backdrop",""),(e=t.classList).add.apply(e,this._options.backdropClasses.split(" ")),document.querySelector("body").append(t),this._backdropEl=t}},i.prototype._destroyBackdropEl=function(){this._isHidden||document.querySelector("[modal-backdrop]").remove()},i.prototype._setupModalCloseEventListeners=function(){var e=this;this._options.backdrop==="dynamic"&&(this._clickOutsideEventListener=function(t){e._handleOutsideClick(t.target)},this._targetEl.addEventListener("click",this._clickOutsideEventListener,!0)),this._keydownEventListener=function(t){t.key==="Escape"&&e.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeModalCloseEventListeners=function(){this._options.backdrop==="dynamic"&&this._targetEl.removeEventListener("click",this._clickOutsideEventListener,!0),document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._handleOutsideClick=function(e){(e===this._targetEl||e===this._backdropEl&&this.isVisible())&&this.hide()},i.prototype._getPlacementClasses=function(){switch(this._options.placement){case"top-left":return["justify-start","items-start"];case"top-center":return["justify-center","items-start"];case"top-right":return["justify-end","items-start"];case"center-left":return["justify-start","items-center"];case"center":return["justify-center","items-center"];case"center-right":return["justify-end","items-center"];case"bottom-left":return["justify-start","items-end"];case"bottom-center":return["justify-center","items-end"];case"bottom-right":return["justify-end","items-end"];default:return["justify-center","items-center"]}},i.prototype.toggle=function(){this._isHidden?this.show():this.hide(),this._options.onToggle(this)},i.prototype.show=function(){this.isHidden&&(this._targetEl.classList.add("flex"),this._targetEl.classList.remove("hidden"),this._targetEl.setAttribute("aria-modal","true"),this._targetEl.setAttribute("role","dialog"),this._targetEl.removeAttribute("aria-hidden"),this._createBackdrop(),this._isHidden=!1,this._options.closable&&this._setupModalCloseEventListeners(),document.body.classList.add("overflow-hidden"),this._options.onShow(this))},i.prototype.hide=function(){this.isVisible&&(this._targetEl.classList.add("hidden"),this._targetEl.classList.remove("flex"),this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.removeAttribute("aria-modal"),this._targetEl.removeAttribute("role"),this._destroyBackdropEl(),this._isHidden=!0,document.body.classList.remove("overflow-hidden"),this._options.closable&&this._removeModalCloseEventListeners(),this._options.onHide(this))},i.prototype.isVisible=function(){return!this._isHidden},i.prototype.isHidden=function(){return this._isHidden},i.prototype.addEventListenerInstance=function(e,t,r){this._eventListenerInstances.push({element:e,type:t,handler:r})},i.prototype.removeAllEventListenerInstances=function(){this._eventListenerInstances.map(function(e){e.element.removeEventListener(e.type,e.handler)}),this._eventListenerInstances=[]},i.prototype.getAllEventListenerInstances=function(){return this._eventListenerInstances},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Kt(){document.querySelectorAll("[data-modal-target]").forEach(function(i){var e=i.getAttribute("data-modal-target"),t=document.getElementById(e);if(t){var r=t.getAttribute("data-modal-placement"),n=t.getAttribute("data-modal-backdrop");new ga(t,{placement:r||Dr.placement,backdrop:n||Dr.backdrop})}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?."))}),document.querySelectorAll("[data-modal-toggle]").forEach(function(i){var e=i.getAttribute("data-modal-toggle"),t=document.getElementById(e);if(t){var r=I.getInstance("Modal",e);if(r){var n=function(){r.toggle()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(e," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?"))}),document.querySelectorAll("[data-modal-show]").forEach(function(i){var e=i.getAttribute("data-modal-show"),t=document.getElementById(e);if(t){var r=I.getInstance("Modal",e);if(r){var n=function(){r.show()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(e," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?"))}),document.querySelectorAll("[data-modal-hide]").forEach(function(i){var e=i.getAttribute("data-modal-hide"),t=document.getElementById(e);if(t){var r=I.getInstance("Modal",e);if(r){var n=function(){r.hide()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(e," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?"))})}typeof window<"u"&&(window.Modal=ga,window.initModals=Kt);var Fr=function(){return Fr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Fr.apply(this,arguments)},yt={placement:"left",bodyScrolling:!1,backdrop:!0,edge:!1,edgeOffset:"bottom-[60px]",backdropClasses:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-30",onShow:function(){},onHide:function(){},onToggle:function(){}},Ru={id:null,override:!0},va=function(){function i(e,t,r){e===void 0&&(e=null),t===void 0&&(t=yt),r===void 0&&(r=Ru),this._eventListenerInstances=[],this._instanceId=r.id?r.id:e.id,this._targetEl=e,this._options=Fr(Fr({},yt),t),this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Drawer",this,this._instanceId,r.override)}return i.prototype.init=function(){var e=this;this._targetEl&&!this._initialized&&(this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.classList.add("transition-transform"),this._getPlacementClasses(this._options.placement).base.map(function(t){e._targetEl.classList.add(t)}),this._handleEscapeKey=function(t){t.key==="Escape"&&e.isVisible()&&e.hide()},document.addEventListener("keydown",this._handleEscapeKey),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this.removeAllEventListenerInstances(),this._destroyBackdropEl(),document.removeEventListener("keydown",this._handleEscapeKey),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Drawer",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){var e=this;this._options.edge?(this._getPlacementClasses(this._options.placement+"-edge").active.map(function(t){e._targetEl.classList.remove(t)}),this._getPlacementClasses(this._options.placement+"-edge").inactive.map(function(t){e._targetEl.classList.add(t)})):(this._getPlacementClasses(this._options.placement).active.map(function(t){e._targetEl.classList.remove(t)}),this._getPlacementClasses(this._options.placement).inactive.map(function(t){e._targetEl.classList.add(t)})),this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.removeAttribute("aria-modal"),this._targetEl.removeAttribute("role"),this._options.bodyScrolling||document.body.classList.remove("overflow-hidden"),this._options.backdrop&&this._destroyBackdropEl(),this._visible=!1,this._options.onHide(this)},i.prototype.show=function(){var e=this;this._options.edge?(this._getPlacementClasses(this._options.placement+"-edge").active.map(function(t){e._targetEl.classList.add(t)}),this._getPlacementClasses(this._options.placement+"-edge").inactive.map(function(t){e._targetEl.classList.remove(t)})):(this._getPlacementClasses(this._options.placement).active.map(function(t){e._targetEl.classList.add(t)}),this._getPlacementClasses(this._options.placement).inactive.map(function(t){e._targetEl.classList.remove(t)})),this._targetEl.setAttribute("aria-modal","true"),this._targetEl.setAttribute("role","dialog"),this._targetEl.removeAttribute("aria-hidden"),this._options.bodyScrolling||document.body.classList.add("overflow-hidden"),this._options.backdrop&&this._createBackdrop(),this._visible=!0,this._options.onShow(this)},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show()},i.prototype._createBackdrop=function(){var e,t=this;if(!this._visible){var r=document.createElement("div");r.setAttribute("drawer-backdrop",""),(e=r.classList).add.apply(e,this._options.backdropClasses.split(" ")),document.querySelector("body").append(r),r.addEventListener("click",function(){t.hide()})}},i.prototype._destroyBackdropEl=function(){this._visible&&document.querySelector("[drawer-backdrop]")!==null&&document.querySelector("[drawer-backdrop]").remove()},i.prototype._getPlacementClasses=function(e){switch(e){case"top":return{base:["top-0","left-0","right-0"],active:["transform-none"],inactive:["-translate-y-full"]};case"right":return{base:["right-0","top-0"],active:["transform-none"],inactive:["translate-x-full"]};case"bottom":return{base:["bottom-0","left-0","right-0"],active:["transform-none"],inactive:["translate-y-full"]};case"left":return{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]};case"bottom-edge":return{base:["left-0","top-0"],active:["transform-none"],inactive:["translate-y-full",this._options.edgeOffset]};default:return{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]}}},i.prototype.isHidden=function(){return!this._visible},i.prototype.isVisible=function(){return this._visible},i.prototype.addEventListenerInstance=function(e,t,r){this._eventListenerInstances.push({element:e,type:t,handler:r})},i.prototype.removeAllEventListenerInstances=function(){this._eventListenerInstances.map(function(e){e.element.removeEventListener(e.type,e.handler)}),this._eventListenerInstances=[]},i.prototype.getAllEventListenerInstances=function(){return this._eventListenerInstances},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Gt(){document.querySelectorAll("[data-drawer-target]").forEach(function(i){var e=i.getAttribute("data-drawer-target"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-drawer-placement"),n=i.getAttribute("data-drawer-body-scrolling"),s=i.getAttribute("data-drawer-backdrop"),o=i.getAttribute("data-drawer-edge"),a=i.getAttribute("data-drawer-edge-offset");new va(t,{placement:r||yt.placement,bodyScrolling:n?n==="true":yt.bodyScrolling,backdrop:s?s==="true":yt.backdrop,edge:o?o==="true":yt.edge,edgeOffset:a||yt.edgeOffset})}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))}),document.querySelectorAll("[data-drawer-toggle]").forEach(function(i){var e=i.getAttribute("data-drawer-toggle"),t=document.getElementById(e);if(t){var r=I.getInstance("Drawer",e);if(r){var n=function(){r.toggle()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(e," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))}),document.querySelectorAll("[data-drawer-dismiss], [data-drawer-hide]").forEach(function(i){var e=i.getAttribute("data-drawer-dismiss")?i.getAttribute("data-drawer-dismiss"):i.getAttribute("data-drawer-hide"),t=document.getElementById(e);if(t){var r=I.getInstance("Drawer",e);if(r){var n=function(){r.hide()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(e," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id"))}),document.querySelectorAll("[data-drawer-show]").forEach(function(i){var e=i.getAttribute("data-drawer-show"),t=document.getElementById(e);if(t){var r=I.getInstance("Drawer",e);if(r){var n=function(){r.show()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(e," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))})}typeof window<"u"&&(window.Drawer=va,window.initDrawers=Gt);var Br=function(){return Br=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Br.apply(this,arguments)},Nr={defaultTabId:null,activeClasses:"text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500",inactiveClasses:"dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300",onShow:function(){}},Mu={id:null,override:!0},ba=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=Nr),n===void 0&&(n=Mu),this._instanceId=n.id?n.id:e.id,this._tabsEl=e,this._items=t,this._activeTab=r?this.getTab(r.defaultTabId):null,this._options=Br(Br({},Nr),r),this._initialized=!1,this.init(),I.addInstance("Tabs",this,this._tabsEl.id,!0),I.addInstance("Tabs",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._items.length&&!this._initialized&&(this._activeTab||this.setActiveTab(this._items[0]),this.show(this._activeTab.id,!0),this._items.map(function(t){t.triggerEl.addEventListener("click",function(r){r.preventDefault(),e.show(t.id)})}))},i.prototype.destroy=function(){this._initialized&&(this._initialized=!1)},i.prototype.removeInstance=function(){this.destroy(),I.removeInstance("Tabs",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getActiveTab=function(){return this._activeTab},i.prototype.setActiveTab=function(e){this._activeTab=e},i.prototype.getTab=function(e){return this._items.filter(function(t){return t.id===e})[0]},i.prototype.show=function(e,t){var r,n,s=this;t===void 0&&(t=!1);var o=this.getTab(e);o===this._activeTab&&!t||(this._items.map(function(a){var l,f;a!==o&&((l=a.triggerEl.classList).remove.apply(l,s._options.activeClasses.split(" ")),(f=a.triggerEl.classList).add.apply(f,s._options.inactiveClasses.split(" ")),a.targetEl.classList.add("hidden"),a.triggerEl.setAttribute("aria-selected","false"))}),(r=o.triggerEl.classList).add.apply(r,this._options.activeClasses.split(" ")),(n=o.triggerEl.classList).remove.apply(n,this._options.inactiveClasses.split(" ")),o.triggerEl.setAttribute("aria-selected","true"),o.targetEl.classList.remove("hidden"),this.setActiveTab(o),this._options.onShow(this,o))},i.prototype.updateOnShow=function(e){this._options.onShow=e},i}();function Yt(){document.querySelectorAll("[data-tabs-toggle]").forEach(function(i){var e=[],t=i.getAttribute("data-tabs-active-classes"),r=i.getAttribute("data-tabs-inactive-classes"),n=null;i.querySelectorAll('[role="tab"]').forEach(function(s){var o=s.getAttribute("aria-selected")==="true",a={id:s.getAttribute("data-tabs-target"),triggerEl:s,targetEl:document.querySelector(s.getAttribute("data-tabs-target"))};e.push(a),o&&(n=a.id)}),new ba(i,e,{defaultTabId:n,activeClasses:t||Nr.activeClasses,inactiveClasses:r||Nr.inactiveClasses})})}typeof window<"u"&&(window.Tabs=ba,window.initTabs=Yt);var rt=function(){return rt=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},rt.apply(this,arguments)},Hr=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,s;r<n;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))},qr={placement:"top",triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Pu={id:null,override:!0},ya=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=qr),n===void 0&&(n=Pu),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=rt(rt({},qr),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Tooltip",this,this._instanceId,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._setupEventListeners(),this._popperInstance=this._createPopperInstance(),this._initialized=!0)},i.prototype.destroy=function(){var e=this;if(this._initialized){var t=this._getTriggerEvents();t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hideHandler)}),this._removeKeydownListener(),this._removeClickOutsideListener(),this._popperInstance&&this._popperInstance.destroy(),this._initialized=!1}},i.prototype.removeInstance=function(){I.removeInstance("Tooltip",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var e=this,t=this._getTriggerEvents();this._showHandler=function(){e.show()},this._hideHandler=function(){e.hide()},t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hideHandler)})},i.prototype._createPopperInstance=function(){return bt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[0,8]}}]})},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype._setupKeydownListener=function(){var e=this;this._keydownEventListener=function(t){t.key==="Escape"&&e.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeKeydownListener=function(){document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._setupClickOutsideListener=function(){var e=this;this._clickOutsideEventListener=function(t){e._handleClickOutside(t,e._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(e,t){var r=e.target;r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&this.isVisible()&&this.hide()},i.prototype.isVisible=function(){return this._visible},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show()},i.prototype.show=function(){this._targetEl.classList.remove("opacity-0","invisible"),this._targetEl.classList.add("opacity-100","visible"),this._popperInstance.setOptions(function(e){return rt(rt({},e),{modifiers:Hr(Hr([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._setupKeydownListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("opacity-100","visible"),this._targetEl.classList.add("opacity-0","invisible"),this._popperInstance.setOptions(function(e){return rt(rt({},e),{modifiers:Hr(Hr([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._removeClickOutsideListener(),this._removeKeydownListener(),this._visible=!1,this._options.onHide(this)},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Xt(){document.querySelectorAll("[data-tooltip-target]").forEach(function(i){var e=i.getAttribute("data-tooltip-target"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-tooltip-trigger"),n=i.getAttribute("data-tooltip-placement");new ya(t,i,{placement:n||qr.placement,triggerType:r||qr.triggerType})}else console.error('The tooltip element with id "'.concat(e,'" does not exist. Please check the data-tooltip-target attribute.'))})}typeof window<"u"&&(window.Tooltip=ya,window.initTooltips=Xt);var nt=function(){return nt=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},nt.apply(this,arguments)},zr=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,s;r<n;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))},xi={placement:"top",offset:10,triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Du={id:null,override:!0},wa=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=xi),n===void 0&&(n=Du),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=nt(nt({},xi),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Popover",this,n.id?n.id:this._targetEl.id,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._setupEventListeners(),this._popperInstance=this._createPopperInstance(),this._initialized=!0)},i.prototype.destroy=function(){var e=this;if(this._initialized){var t=this._getTriggerEvents();t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._showHandler),e._targetEl.removeEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hideHandler),e._targetEl.removeEventListener(r,e._hideHandler)}),this._removeKeydownListener(),this._removeClickOutsideListener(),this._popperInstance&&this._popperInstance.destroy(),this._initialized=!1}},i.prototype.removeInstance=function(){I.removeInstance("Popover",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var e=this,t=this._getTriggerEvents();this._showHandler=function(){e.show()},this._hideHandler=function(){setTimeout(function(){e._targetEl.matches(":hover")||e.hide()},100)},t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._showHandler),e._targetEl.addEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hideHandler),e._targetEl.addEventListener(r,e._hideHandler)})},i.prototype._createPopperInstance=function(){return bt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[0,this._options.offset]}}]})},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype._setupKeydownListener=function(){var e=this;this._keydownEventListener=function(t){t.key==="Escape"&&e.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeKeydownListener=function(){document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._setupClickOutsideListener=function(){var e=this;this._clickOutsideEventListener=function(t){e._handleClickOutside(t,e._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(e,t){var r=e.target;r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&this.isVisible()&&this.hide()},i.prototype.isVisible=function(){return this._visible},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show(),this._options.onToggle(this)},i.prototype.show=function(){this._targetEl.classList.remove("opacity-0","invisible"),this._targetEl.classList.add("opacity-100","visible"),this._popperInstance.setOptions(function(e){return nt(nt({},e),{modifiers:zr(zr([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._setupKeydownListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("opacity-100","visible"),this._targetEl.classList.add("opacity-0","invisible"),this._popperInstance.setOptions(function(e){return nt(nt({},e),{modifiers:zr(zr([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._removeClickOutsideListener(),this._removeKeydownListener(),this._visible=!1,this._options.onHide(this)},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Zt(){document.querySelectorAll("[data-popover-target]").forEach(function(i){var e=i.getAttribute("data-popover-target"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-popover-trigger"),n=i.getAttribute("data-popover-placement"),s=i.getAttribute("data-popover-offset");new wa(t,i,{placement:n||xi.placement,offset:s?parseInt(s):xi.offset,triggerType:r||xi.triggerType})}else console.error('The popover element with id "'.concat(e,'" does not exist. Please check the data-popover-target attribute.'))})}typeof window<"u"&&(window.Popover=wa,window.initPopovers=Zt);var Vr=function(){return Vr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Vr.apply(this,arguments)},hs={triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Fu={id:null,override:!0},Ea=function(){function i(e,t,r,n,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=null),n===void 0&&(n=hs),s===void 0&&(s=Fu),this._instanceId=s.id?s.id:r.id,this._parentEl=e,this._triggerEl=t,this._targetEl=r,this._options=Vr(Vr({},hs),n),this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Dial",this,this._instanceId,s.override)}return i.prototype.init=function(){var e=this;if(this._triggerEl&&this._targetEl&&!this._initialized){var t=this._getTriggerEventTypes(this._options.triggerType);this._showEventHandler=function(){e.show()},t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._showEventHandler),e._targetEl.addEventListener(r,e._showEventHandler)}),this._hideEventHandler=function(){e._parentEl.matches(":hover")||e.hide()},t.hideEvents.forEach(function(r){e._parentEl.addEventListener(r,e._hideEventHandler)}),this._initialized=!0}},i.prototype.destroy=function(){var e=this;if(this._initialized){var t=this._getTriggerEventTypes(this._options.triggerType);t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._showEventHandler),e._targetEl.removeEventListener(r,e._showEventHandler)}),t.hideEvents.forEach(function(r){e._parentEl.removeEventListener(r,e._hideEventHandler)}),this._initialized=!1}},i.prototype.removeInstance=function(){I.removeInstance("Dial",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){this._targetEl.classList.add("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","false"),this._visible=!1,this._options.onHide(this)},i.prototype.show=function(){this._targetEl.classList.remove("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","true"),this._visible=!0,this._options.onShow(this)},i.prototype.toggle=function(){this._visible?this.hide():this.show()},i.prototype.isHidden=function(){return!this._visible},i.prototype.isVisible=function(){return this._visible},i.prototype._getTriggerEventTypes=function(e){switch(e){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Qt(){document.querySelectorAll("[data-dial-init]").forEach(function(i){var e=i.querySelector("[data-dial-toggle]");if(e){var t=e.getAttribute("data-dial-toggle"),r=document.getElementById(t);if(r){var n=e.getAttribute("data-dial-trigger");new Ea(i,e,r,{triggerType:n||hs.triggerType})}else console.error("Dial with id ".concat(t," does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?"))}else console.error("Dial with id ".concat(i.id," does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?"))})}typeof window<"u"&&(window.Dial=Ea,window.initDials=Qt);var $r=function(){return $r=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},$r.apply(this,arguments)},_a={minValue:null,maxValue:null,onIncrement:function(){},onDecrement:function(){}},Bu={id:null,override:!0},Aa=function(){function i(e,t,r,n,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=null),n===void 0&&(n=_a),s===void 0&&(s=Bu),this._instanceId=s.id?s.id:e.id,this._targetEl=e,this._incrementEl=t,this._decrementEl=r,this._options=$r($r({},_a),n),this._initialized=!1,this.init(),I.addInstance("InputCounter",this,this._instanceId,s.override)}return i.prototype.init=function(){var e=this;this._targetEl&&!this._initialized&&(this._inputHandler=function(t){{var r=t.target;/^\d*$/.test(r.value)||(r.value=r.value.replace(/[^\d]/g,"")),e._options.maxValue!==null&&parseInt(r.value)>e._options.maxValue&&(r.value=e._options.maxValue.toString()),e._options.minValue!==null&&parseInt(r.value)<e._options.minValue&&(r.value=e._options.minValue.toString())}},this._incrementClickHandler=function(){e.increment()},this._decrementClickHandler=function(){e.decrement()},this._targetEl.addEventListener("input",this._inputHandler),this._incrementEl&&this._incrementEl.addEventListener("click",this._incrementClickHandler),this._decrementEl&&this._decrementEl.addEventListener("click",this._decrementClickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._targetEl&&this._initialized&&(this._targetEl.removeEventListener("input",this._inputHandler),this._incrementEl&&this._incrementEl.removeEventListener("click",this._incrementClickHandler),this._decrementEl&&this._decrementEl.removeEventListener("click",this._decrementClickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("InputCounter",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getCurrentValue=function(){return parseInt(this._targetEl.value)||0},i.prototype.increment=function(){this._options.maxValue!==null&&this.getCurrentValue()>=this._options.maxValue||(this._targetEl.value=(this.getCurrentValue()+1).toString(),this._options.onIncrement(this))},i.prototype.decrement=function(){this._options.minValue!==null&&this.getCurrentValue()<=this._options.minValue||(this._targetEl.value=(this.getCurrentValue()-1).toString(),this._options.onDecrement(this))},i.prototype.updateOnIncrement=function(e){this._options.onIncrement=e},i.prototype.updateOnDecrement=function(e){this._options.onDecrement=e},i}();function Jt(){document.querySelectorAll("[data-input-counter]").forEach(function(i){var e=i.id,t=document.querySelector('[data-input-counter-increment="'+e+'"]'),r=document.querySelector('[data-input-counter-decrement="'+e+'"]'),n=i.getAttribute("data-input-counter-min"),s=i.getAttribute("data-input-counter-max");i?I.instanceExists("InputCounter",i.getAttribute("id"))||new Aa(i,t||null,r||null,{minValue:n?parseInt(n):null,maxValue:s?parseInt(s):null}):console.error('The target element with id "'.concat(e,'" does not exist. Please check the data-input-counter attribute.'))})}typeof window<"u"&&(window.InputCounter=Aa,window.initInputCounters=Jt);var jr=function(){return jr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},jr.apply(this,arguments)},Ur={htmlEntities:!1,contentType:"input",onCopy:function(){}},Nu={id:null,override:!0},Ta=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Ur),n===void 0&&(n=Nu),this._instanceId=n.id?n.id:t.id,this._triggerEl=e,this._targetEl=t,this._options=jr(jr({},Ur),r),this._initialized=!1,this.init(),I.addInstance("CopyClipboard",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._targetEl&&this._triggerEl&&!this._initialized&&(this._triggerElClickHandler=function(){e.copy()},this._triggerEl&&this._triggerEl.addEventListener("click",this._triggerElClickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._targetEl&&this._initialized&&(this._triggerEl&&this._triggerEl.removeEventListener("click",this._triggerElClickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("CopyClipboard",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getTargetValue=function(){if(this._options.contentType==="input")return this._targetEl.value;if(this._options.contentType==="innerHTML")return this._targetEl.innerHTML;if(this._options.contentType==="textContent")return this._targetEl.textContent.replace(/\s+/g," ").trim()},i.prototype.copy=function(){var e=this.getTargetValue();this._options.htmlEntities&&(e=this.decodeHTML(e));var t=document.createElement("textarea");return t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),this._options.onCopy(this),e},i.prototype.decodeHTML=function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.textContent},i.prototype.updateOnCopyCallback=function(e){this._options.onCopy=e},i}();function ei(){document.querySelectorAll("[data-copy-to-clipboard-target]").forEach(function(i){var e=i.getAttribute("data-copy-to-clipboard-target"),t=document.getElementById(e),r=i.getAttribute("data-copy-to-clipboard-content-type"),n=i.getAttribute("data-copy-to-clipboard-html-entities");t?I.instanceExists("CopyClipboard",t.getAttribute("id"))||new Ta(i,t,{htmlEntities:n&&n==="true"?!0:Ur.htmlEntities,contentType:r||Ur.contentType}):console.error('The target element with id "'.concat(e,'" does not exist. Please check the data-copy-to-clipboard-target attribute.'))})}typeof window<"u"&&(window.CopyClipboard=Ta,window.initClipboards=ei);function Sa(){Bt(),Nt(),Ht(),qt(),Wt(),Kt(),Gt(),Yt(),Xt(),Zt(),Qt(),Jt(),ei()}typeof window<"u"&&(window.initFlowbite=Sa);var Hu=new Vo("load",[Bt,Nt,Ht,qt,Wt,Kt,Gt,Yt,Xt,Zt,Qt,Jt,ei]);Hu.init();var Wr=class extends S{static targets=["trigger","menu"];connect(){console.log(`resource-drop-down connected: ${this.element}`),this.dropdown=new us(this.menuTarget,this.triggerTarget)}disconnect(){this.dropdown=null}toggle(){this.dropdown.toggle()}show(){this.dropdown.show()}hide(){this.dropdown.hide()}};var Kr=class extends S{static targets=["trigger","menu"];connect(){console.log(`resource-collapse connected: ${this.element}`),this.collapse=new Yn(this.menuTarget,this.triggerTarget)}disconnect(){this.collapse=null}toggle(){this.collapse.toggle()}show(){this.collapse.show()}hide(){this.collapse.hide()}};var Gr=class extends S{static values={after:Number};connect(){console.log(`resource-dismiss connected: ${this.element}`),this.hasAfterValue&&this.afterValue>0&&(this.autoDismissTimeout=setTimeout(()=>{this.dismiss(),this.autoDismissTimeout=null},this.afterValue))}disconnect(){this.autoDismissTimeout&&clearTimeout(this.autoDismissTimeout),this.autoDismissTimeout=null}dismiss(){this.element.remove()}};var Yr=class extends S{static targets=["frame","refreshButton","backButton","homeButton"];connect(){console.log(`frame-navigator connected: ${this.element}`),this.#e(),this.srcHistory=[],this.originalFrameSrc=this.frameTarget.src,this.hasRefreshButtonTarget&&(this.refreshButtonTarget.style.display="",this.refreshButtonClicked=this.refreshButtonClicked.bind(this),this.refreshButtonTarget.addEventListener("click",this.refreshButtonClicked)),this.hasBackButtonTarget&&(this.backButtonClicked=this.backButtonClicked.bind(this),this.backButtonTarget.addEventListener("click",this.backButtonClicked)),this.hasHomeButtonTarget&&(this.homeButtonClicked=this.homeButtonClicked.bind(this),this.homeButtonTarget.addEventListener("click",this.homeButtonClicked)),this.frameLoaded=this.frameLoaded.bind(this),this.frameTarget.addEventListener("turbo:frame-load",this.frameLoaded),this.frameLoading=this.frameLoading.bind(this),this.frameTarget.addEventListener("turbo:click",this.frameLoading),this.frameTarget.addEventListener("turbo:submit-start",this.frameLoading),this.frameFailed=this.frameFailed.bind(this),this.frameTarget.addEventListener("turbo:fetch-request-error",this.frameFailed)}disconnect(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.removeEventListener("click",this.refreshButtonClicked),this.hasBackButtonTarget&&this.backButtonTarget.removeEventListener("click",this.backButtonClicked),this.hasHomeButtonTarget&&this.homeButtonTarget.removeEventListener("click",this.homeButtonClicked),this.frameTarget.removeEventListener("turbo:frame-load",this.frameLoaded),this.frameTarget.removeEventListener("turbo:click",this.frameLoading),this.frameTarget.removeEventListener("turbo:submit-start",this.frameLoading),this.frameTarget.removeEventListener("turbo:fetch-request-error",this.frameFailed)}frameLoading(i){this.#e()}frameFailed(i){this.#t()}frameLoaded(i){this.#t();let e=i.target.src;e==this.currentSrc||(e==this.originalFrameSrc?this.srcHistory=[e]:this.srcHistory.push(e)),this.#i()}refreshButtonClicked(i){this.frameLoading(null),this.frameTarget.reload()}backButtonClicked(i){this.frameLoading(null),this.srcHistory.pop(),this.frameTarget.src=this.currentSrc}homeButtonClicked(i){this.frameLoading(null),this.frameTarget.src=this.originalFrameSrc}get currentSrc(){return this.srcHistory[this.srcHistory.length-1]}#e(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.add("motion-safe:animate-spin"),this.frameTarget.classList.add("motion-safe:animate-pulse")}#t(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.remove("motion-safe:animate-spin"),this.frameTarget.classList.remove("motion-safe:animate-pulse")}#i(){this.hasHomeButtonTarget&&(this.homeButtonTarget.style.display=this.srcHistory.length>2?"":"none"),this.hasBackButtonTarget&&(this.backButtonTarget.style.display=this.srcHistory.length>1?"":"none")}};var Xr=class extends S{connect(){console.log(`color-mode connected: ${this.element}`),this.updateColorMode()}disconnect(){}updateColorMode(){localStorage.theme==="dark"||!("theme"in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}setLightColorMode(){localStorage.theme="light",this.updateColorMode()}setDarkColorMode(){localStorage.theme="dark",this.updateColorMode()}setSystemColorMode(){localStorage.removeItem("theme"),this.updateColorMode()}};var{entries:Da,setPrototypeOf:ka,isFrozen:qu,getPrototypeOf:zu,getOwnPropertyDescriptor:Vu}=Object,{freeze:ve,seal:Se,create:Fa}=Object,{apply:vs,construct:bs}=typeof Reflect<"u"&&Reflect;ve||(ve=function(e){return e});Se||(Se=function(e){return e});vs||(vs=function(e,t,r){return e.apply(t,r)});bs||(bs=function(e,t){return new e(...t)});var Zr=we(Array.prototype.forEach),xa=we(Array.prototype.pop),Li=we(Array.prototype.push),Jr=we(String.prototype.toLowerCase),ds=we(String.prototype.toString),La=we(String.prototype.match),Ci=we(String.prototype.replace),$u=we(String.prototype.indexOf),ju=we(String.prototype.trim),Re=we(Object.prototype.hasOwnProperty),ge=we(RegExp.prototype.test),Ii=Uu(TypeError);function we(i){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return vs(i,e,r)}}function Uu(i){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return bs(i,t)}}function D(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Jr;ka&&ka(i,null);let r=e.length;for(;r--;){let n=e[r];if(typeof n=="string"){let s=t(n);s!==n&&(qu(e)||(e[r]=s),n=s)}i[n]=!0}return i}function Wu(i){for(let e=0;e<i.length;e++)Re(i,e)||(i[e]=null);return i}function wt(i){let e=Fa(null);for(let[t,r]of Da(i))Re(i,t)&&(Array.isArray(r)?e[t]=Wu(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=wt(r):e[t]=r);return e}function Oi(i,e){for(;i!==null;){let r=Vu(i,e);if(r){if(r.get)return we(r.get);if(typeof r.value=="function")return we(r.value)}i=zu(i)}function t(){return null}return t}var Ca=ve(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),fs=ve(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ps=ve(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ku=ve(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ms=ve(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Gu=ve(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ia=ve(["#text"]),Oa=ve(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),gs=ve(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ra=ve(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Qr=ve(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Yu=Se(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Xu=Se(/<%[\w\W]*|[\w\W]*%>/gm),Zu=Se(/\${[\w\W]*}/gm),Qu=Se(/^data-[\-\w.\u00B7-\uFFFF]/),Ju=Se(/^aria-[\-\w]+$/),Ba=Se(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),eh=Se(/^(?:\w+script|data):/i),th=Se(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Na=Se(/^html$/i),ih=Se(/^[a-z][.\w]*(-[.\w]+)+$/i),Ma=Object.freeze({__proto__:null,ARIA_ATTR:Ju,ATTR_WHITESPACE:th,CUSTOM_ELEMENT:ih,DATA_ATTR:Qu,DOCTYPE_NAME:Na,ERB_EXPR:Xu,IS_ALLOWED_URI:Ba,IS_SCRIPT_OR_DATA:eh,MUSTACHE_EXPR:Yu,TMPLIT_EXPR:Zu}),Ri={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},rh=function(){return typeof window>"u"?null:window},nh=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));let s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Pa=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ha(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rh(),e=C=>Ha(C);if(e.version="3.2.2",e.removed=[],!i||!i.document||i.document.nodeType!==Ri.document)return e.isSupported=!1,e;let{document:t}=i,r=t,n=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:f,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:g,DOMParser:w,trustedTypes:y}=i,_=l.prototype,L=Oi(_,"cloneNode"),k=Oi(_,"remove"),P=Oi(_,"nextSibling"),q=Oi(_,"childNodes"),B=Oi(_,"parentNode");if(typeof o=="function"){let C=t.createElement("template");C.content&&C.content.ownerDocument&&(t=C.content.ownerDocument)}let T,O="",{implementation:x,createNodeIterator:F,createDocumentFragment:j,getElementsByTagName:U}=t,{importNode:Y}=r,H=Pa();e.isSupported=typeof Da=="function"&&typeof B=="function"&&x&&x.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:X,ERB_EXPR:W,TMPLIT_EXPR:be,DATA_ATTR:xe,ARIA_ATTR:h,IS_SCRIPT_OR_DATA:d,ATTR_WHITESPACE:p,CUSTOM_ELEMENT:b}=Ma,{IS_ALLOWED_URI:E}=Ma,v=null,R=D({},[...Ca,...fs,...ps,...ms,...Ia]),M=null,ce=D({},[...Oa,...gs,...Ra,...Qr]),N=Object.seal(Fa(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),z=null,ne=null,de=!0,Le=!0,Lt=!1,Ct=!0,Qe=!1,It=!0,Ne=!1,fi=!1,Ot=!1,He=!1,Rt=!1,Mt=!1,Pe=!0,lt=!1,Ui="user-content-",Pt=!0,qe=!1,ze={},Ve=null,pi=D({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),mi=null,lo=D({},["audio","video","img","source","image","track"]),yn=null,co=D({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Wi="http://www.w3.org/1998/Math/MathML",Ki="http://www.w3.org/2000/svg",$e="http://www.w3.org/1999/xhtml",Dt=$e,wn=!1,En=null,Tl=D({},[Wi,Ki,$e],ds),Gi=D({},["mi","mo","mn","ms","mtext"]),Yi=D({},["annotation-xml"]),Sl=D({},["title","style","font","a","script"]),gi=null,kl=["application/xhtml+xml","text/html"],xl="text/html",se=null,Ft=null,Ll=t.createElement("form"),uo=function(c){return c instanceof RegExp||c instanceof Function},_n=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ft&&Ft===c)){if((!c||typeof c!="object")&&(c={}),c=wt(c),gi=kl.indexOf(c.PARSER_MEDIA_TYPE)===-1?xl:c.PARSER_MEDIA_TYPE,se=gi==="application/xhtml+xml"?ds:Jr,v=Re(c,"ALLOWED_TAGS")?D({},c.ALLOWED_TAGS,se):R,M=Re(c,"ALLOWED_ATTR")?D({},c.ALLOWED_ATTR,se):ce,En=Re(c,"ALLOWED_NAMESPACES")?D({},c.ALLOWED_NAMESPACES,ds):Tl,yn=Re(c,"ADD_URI_SAFE_ATTR")?D(wt(co),c.ADD_URI_SAFE_ATTR,se):co,mi=Re(c,"ADD_DATA_URI_TAGS")?D(wt(lo),c.ADD_DATA_URI_TAGS,se):lo,Ve=Re(c,"FORBID_CONTENTS")?D({},c.FORBID_CONTENTS,se):pi,z=Re(c,"FORBID_TAGS")?D({},c.FORBID_TAGS,se):{},ne=Re(c,"FORBID_ATTR")?D({},c.FORBID_ATTR,se):{},ze=Re(c,"USE_PROFILES")?c.USE_PROFILES:!1,de=c.ALLOW_ARIA_ATTR!==!1,Le=c.ALLOW_DATA_ATTR!==!1,Lt=c.ALLOW_UNKNOWN_PROTOCOLS||!1,Ct=c.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Qe=c.SAFE_FOR_TEMPLATES||!1,It=c.SAFE_FOR_XML!==!1,Ne=c.WHOLE_DOCUMENT||!1,He=c.RETURN_DOM||!1,Rt=c.RETURN_DOM_FRAGMENT||!1,Mt=c.RETURN_TRUSTED_TYPE||!1,Ot=c.FORCE_BODY||!1,Pe=c.SANITIZE_DOM!==!1,lt=c.SANITIZE_NAMED_PROPS||!1,Pt=c.KEEP_CONTENT!==!1,qe=c.IN_PLACE||!1,E=c.ALLOWED_URI_REGEXP||Ba,Dt=c.NAMESPACE||$e,Gi=c.MATHML_TEXT_INTEGRATION_POINTS||Gi,Yi=c.HTML_INTEGRATION_POINTS||Yi,N=c.CUSTOM_ELEMENT_HANDLING||{},c.CUSTOM_ELEMENT_HANDLING&&uo(c.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(N.tagNameCheck=c.CUSTOM_ELEMENT_HANDLING.tagNameCheck),c.CUSTOM_ELEMENT_HANDLING&&uo(c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(N.attributeNameCheck=c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),c.CUSTOM_ELEMENT_HANDLING&&typeof c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(N.allowCustomizedBuiltInElements=c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Qe&&(Le=!1),Rt&&(He=!0),ze&&(v=D({},Ia),M=[],ze.html===!0&&(D(v,Ca),D(M,Oa)),ze.svg===!0&&(D(v,fs),D(M,gs),D(M,Qr)),ze.svgFilters===!0&&(D(v,ps),D(M,gs),D(M,Qr)),ze.mathMl===!0&&(D(v,ms),D(M,Ra),D(M,Qr))),c.ADD_TAGS&&(v===R&&(v=wt(v)),D(v,c.ADD_TAGS,se)),c.ADD_ATTR&&(M===ce&&(M=wt(M)),D(M,c.ADD_ATTR,se)),c.ADD_URI_SAFE_ATTR&&D(yn,c.ADD_URI_SAFE_ATTR,se),c.FORBID_CONTENTS&&(Ve===pi&&(Ve=wt(Ve)),D(Ve,c.FORBID_CONTENTS,se)),Pt&&(v["#text"]=!0),Ne&&D(v,["html","head","body"]),v.table&&(D(v,["tbody"]),delete z.tbody),c.TRUSTED_TYPES_POLICY){if(typeof c.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ii('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof c.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ii('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=c.TRUSTED_TYPES_POLICY,O=T.createHTML("")}else T===void 0&&(T=nh(y,n)),T!==null&&typeof O=="string"&&(O=T.createHTML(""));ve&&ve(c),Ft=c}},ho=D({},[...fs,...ps,...Ku]),fo=D({},[...ms,...Gu]),Cl=function(c){let m=B(c);(!m||!m.tagName)&&(m={namespaceURI:Dt,tagName:"template"});let A=Jr(c.tagName),K=Jr(m.tagName);return En[c.namespaceURI]?c.namespaceURI===Ki?m.namespaceURI===$e?A==="svg":m.namespaceURI===Wi?A==="svg"&&(K==="annotation-xml"||Gi[K]):!!ho[A]:c.namespaceURI===Wi?m.namespaceURI===$e?A==="math":m.namespaceURI===Ki?A==="math"&&Yi[K]:!!fo[A]:c.namespaceURI===$e?m.namespaceURI===Ki&&!Yi[K]||m.namespaceURI===Wi&&!Gi[K]?!1:!fo[A]&&(Sl[A]||!ho[A]):!!(gi==="application/xhtml+xml"&&En[c.namespaceURI]):!1},De=function(c){Li(e.removed,{element:c});try{B(c).removeChild(c)}catch{k(c)}},Xi=function(c,m){try{Li(e.removed,{attribute:m.getAttributeNode(c),from:m})}catch{Li(e.removed,{attribute:null,from:m})}if(m.removeAttribute(c),c==="is")if(He||Rt)try{De(m)}catch{}else try{m.setAttribute(c,"")}catch{}},po=function(c){let m=null,A=null;if(Ot)c="<remove></remove>"+c;else{let ue=La(c,/^[\r\n\t ]+/);A=ue&&ue[0]}gi==="application/xhtml+xml"&&Dt===$e&&(c='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+c+"</body></html>");let K=T?T.createHTML(c):c;if(Dt===$e)try{m=new w().parseFromString(K,gi)}catch{}if(!m||!m.documentElement){m=x.createDocument(Dt,"template",null);try{m.documentElement.innerHTML=wn?O:K}catch{}}let fe=m.body||m.documentElement;return c&&A&&fe.insertBefore(t.createTextNode(A),fe.childNodes[0]||null),Dt===$e?U.call(m,Ne?"html":"body")[0]:Ne?m.documentElement:fe},mo=function(c){return F.call(c.ownerDocument||c,c,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT|f.SHOW_PROCESSING_INSTRUCTION|f.SHOW_CDATA_SECTION,null)},go=function(c){return c instanceof g&&(typeof c.nodeName!="string"||typeof c.textContent!="string"||typeof c.removeChild!="function"||!(c.attributes instanceof u)||typeof c.removeAttribute!="function"||typeof c.setAttribute!="function"||typeof c.namespaceURI!="string"||typeof c.insertBefore!="function"||typeof c.hasChildNodes!="function")},vo=function(c){return typeof a=="function"&&c instanceof a};function je(C,c,m){Zr(C,A=>{A.call(e,c,m,Ft)})}let bo=function(c){let m=null;if(je(H.beforeSanitizeElements,c,null),go(c))return De(c),!0;let A=se(c.nodeName);if(je(H.uponSanitizeElement,c,{tagName:A,allowedTags:v}),c.hasChildNodes()&&!vo(c.firstElementChild)&&ge(/<[/\w]/g,c.innerHTML)&&ge(/<[/\w]/g,c.textContent)||c.nodeType===Ri.progressingInstruction||It&&c.nodeType===Ri.comment&&ge(/<[/\w]/g,c.data))return De(c),!0;if(!v[A]||z[A]){if(!z[A]&&wo(A)&&(N.tagNameCheck instanceof RegExp&&ge(N.tagNameCheck,A)||N.tagNameCheck instanceof Function&&N.tagNameCheck(A)))return!1;if(Pt&&!Ve[A]){let K=B(c)||c.parentNode,fe=q(c)||c.childNodes;if(fe&&K){let ue=fe.length;for(let ye=ue-1;ye>=0;--ye){let Fe=L(fe[ye],!0);Fe.__removalCount=(c.__removalCount||0)+1,K.insertBefore(Fe,P(c))}}}return De(c),!0}return c instanceof l&&!Cl(c)||(A==="noscript"||A==="noembed"||A==="noframes")&&ge(/<\/no(script|embed|frames)/i,c.innerHTML)?(De(c),!0):(Qe&&c.nodeType===Ri.text&&(m=c.textContent,Zr([X,W,be],K=>{m=Ci(m,K," ")}),c.textContent!==m&&(Li(e.removed,{element:c.cloneNode()}),c.textContent=m)),je(H.afterSanitizeElements,c,null),!1)},yo=function(c,m,A){if(Pe&&(m==="id"||m==="name")&&(A in t||A in Ll))return!1;if(!(Le&&!ne[m]&&ge(xe,m))){if(!(de&&ge(h,m))){if(!M[m]||ne[m]){if(!(wo(c)&&(N.tagNameCheck instanceof RegExp&&ge(N.tagNameCheck,c)||N.tagNameCheck instanceof Function&&N.tagNameCheck(c))&&(N.attributeNameCheck instanceof RegExp&&ge(N.attributeNameCheck,m)||N.attributeNameCheck instanceof Function&&N.attributeNameCheck(m))||m==="is"&&N.allowCustomizedBuiltInElements&&(N.tagNameCheck instanceof RegExp&&ge(N.tagNameCheck,A)||N.tagNameCheck instanceof Function&&N.tagNameCheck(A))))return!1}else if(!yn[m]){if(!ge(E,Ci(A,p,""))){if(!((m==="src"||m==="xlink:href"||m==="href")&&c!=="script"&&$u(A,"data:")===0&&mi[c])){if(!(Lt&&!ge(d,Ci(A,p,"")))){if(A)return!1}}}}}}return!0},wo=function(c){return c!=="annotation-xml"&&La(c,b)},Eo=function(c){je(H.beforeSanitizeAttributes,c,null);let{attributes:m}=c;if(!m)return;let A={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0},K=m.length;for(;K--;){let fe=m[K],{name:ue,namespaceURI:ye,value:Fe}=fe,vi=se(ue),pe=ue==="value"?Fe:ju(Fe);if(A.attrName=vi,A.attrValue=pe,A.keepAttr=!0,A.forceKeepAttr=void 0,je(H.uponSanitizeAttribute,c,A),pe=A.attrValue,lt&&(vi==="id"||vi==="name")&&(Xi(ue,c),pe=Ui+pe),It&&ge(/((--!?|])>)|<\/(style|title)/i,pe)){Xi(ue,c);continue}if(A.forceKeepAttr||(Xi(ue,c),!A.keepAttr))continue;if(!Ct&&ge(/\/>/i,pe)){Xi(ue,c);continue}Qe&&Zr([X,W,be],Ao=>{pe=Ci(pe,Ao," ")});let _o=se(c.nodeName);if(yo(_o,vi,pe)){if(T&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!ye)switch(y.getAttributeType(_o,vi)){case"TrustedHTML":{pe=T.createHTML(pe);break}case"TrustedScriptURL":{pe=T.createScriptURL(pe);break}}try{ye?c.setAttributeNS(ye,ue,pe):c.setAttribute(ue,pe),go(c)?De(c):xa(e.removed)}catch{}}}je(H.afterSanitizeAttributes,c,null)},Il=function C(c){let m=null,A=mo(c);for(je(H.beforeSanitizeShadowDOM,c,null);m=A.nextNode();)je(H.uponSanitizeShadowNode,m,null),!bo(m)&&(m.content instanceof s&&C(m.content),Eo(m));je(H.afterSanitizeShadowDOM,c,null)};return e.sanitize=function(C){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=null,A=null,K=null,fe=null;if(wn=!C,wn&&(C="<!-->"),typeof C!="string"&&!vo(C))if(typeof C.toString=="function"){if(C=C.toString(),typeof C!="string")throw Ii("dirty is not a string, aborting")}else throw Ii("toString is not a function");if(!e.isSupported)return C;if(fi||_n(c),e.removed=[],typeof C=="string"&&(qe=!1),qe){if(C.nodeName){let Fe=se(C.nodeName);if(!v[Fe]||z[Fe])throw Ii("root node is forbidden and cannot be sanitized in-place")}}else if(C instanceof a)m=po("<!---->"),A=m.ownerDocument.importNode(C,!0),A.nodeType===Ri.element&&A.nodeName==="BODY"||A.nodeName==="HTML"?m=A:m.appendChild(A);else{if(!He&&!Qe&&!Ne&&C.indexOf("<")===-1)return T&&Mt?T.createHTML(C):C;if(m=po(C),!m)return He?null:Mt?O:""}m&&Ot&&De(m.firstChild);let ue=mo(qe?C:m);for(;K=ue.nextNode();)bo(K)||(K.content instanceof s&&Il(K.content),Eo(K));if(qe)return C;if(He){if(Rt)for(fe=j.call(m.ownerDocument);m.firstChild;)fe.appendChild(m.firstChild);else fe=m;return(M.shadowroot||M.shadowrootmode)&&(fe=Y.call(r,fe,!0)),fe}let ye=Ne?m.outerHTML:m.innerHTML;return Ne&&v["!doctype"]&&m.ownerDocument&&m.ownerDocument.doctype&&m.ownerDocument.doctype.name&&ge(Na,m.ownerDocument.doctype.name)&&(ye="<!DOCTYPE "+m.ownerDocument.doctype.name+`>
|
6
|
+
`+ye),Qe&&Zr([X,W,be],Fe=>{ye=Ci(ye,Fe," ")}),T&&Mt?T.createHTML(ye):ye},e.setConfig=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_n(C),fi=!0},e.clearConfig=function(){Ft=null,fi=!1},e.isValidAttribute=function(C,c,m){Ft||_n({});let A=se(C),K=se(c);return yo(A,K,m)},e.addHook=function(C,c){typeof c=="function"&&Li(H[C],c)},e.removeHook=function(C){return xa(H[C])},e.removeHooks=function(C){H[C]=[]},e.removeAllHooks=function(){H=Pa()},e}var ys=Ha();function _s(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var _t=_s();function Ua(i){_t=i}var Wa=/[&<>"']/,sh=new RegExp(Wa.source,"g"),Ka=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,oh=new RegExp(Ka.source,"g"),ah={"&":"&","<":"<",">":">",'"':""","'":"'"},qa=i=>ah[i];function Ee(i,e){if(e){if(Wa.test(i))return i.replace(sh,qa)}else if(Ka.test(i))return i.replace(oh,qa);return i}var lh=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ch(i){return i.replace(lh,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}var uh=/(^|[^\[])\^/g;function $(i,e){let t=typeof i=="string"?i:i.source;e=e||"";let r={replace:(n,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(uh,"$1"),t=t.replace(n,o),r},getRegex:()=>new RegExp(t,e)};return r}function za(i){try{i=encodeURI(i).replace(/%25/g,"%")}catch{return null}return i}var Di={exec:()=>null};function Va(i,e){let t=i.replace(/\|/g,(s,o,a)=>{let l=!1,f=o;for(;--f>=0&&a[f]==="\\";)l=!l;return l?"|":" |"}),r=t.split(/ \|/),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(/\\\|/g,"|");return r}function Mi(i,e,t){let r=i.length;if(r===0)return"";let n=0;for(;n<r;){let s=i.charAt(r-n-1);if(s===e&&!t)n++;else if(s!==e&&t)n++;else break}return i.slice(0,r-n)}function hh(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<i.length;r++)if(i[r]==="\\")r++;else if(i[r]===e[0])t++;else if(i[r]===e[1]&&(t--,t<0))return r;return-1}function $a(i,e,t,r){let n=e.href,s=e.title?Ee(e.title):null,o=i[1].replace(/\\([\[\]])/g,"$1");if(i[0].charAt(0)!=="!"){r.state.inLink=!0;let a={type:"link",raw:t,href:n,title:s,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,a}return{type:"image",raw:t,href:n,title:s,text:Ee(o)}}function dh(i,e){let t=i.match(/^(\s+)(?:```)/);if(t===null)return e;let r=t[1];return e.split(`
|
7
7
|
`).map(n=>{let s=n.match(/^\s+/);if(s===null)return n;let[o]=s;return o.length>=r.length?n.slice(r.length):n}).join(`
|
8
8
|
`)}var ii=class{options;rules;lexer;constructor(e){this.options=e||_t}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let r=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Mi(r,`
|
9
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],n=
|
9
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],n=dh(r,t[3]||"");return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(/#$/.test(r)){let n=Mi(r,"#");(this.options.pedantic||!n||/ $/.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Mi(t[0],`
|
10
10
|
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=Mi(t[0],`
|
11
11
|
`).split(`
|
12
12
|
`),n="",s="",o=[];for(;r.length>0;){let a=!1,l=[],f;for(f=0;f<r.length;f++)if(/^ {0,3}>/.test(r[f]))l.push(r[f]),a=!0;else if(!a)l.push(r[f]);else break;r=r.slice(f);let u=l.join(`
|
@@ -25,10 +25,10 @@ ${g}`:g;let w=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
25
25
|
`,1)[0];if(w=O,this.options.pedantic&&(w=w.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),B.test(w)||T.test(w)||P.test(w)||q.test(e))break;if(w.search(/[^ ]/)>=_||!w.trim())u+=`
|
26
26
|
`+w.slice(_);else{if(y||g.search(/[^ ]/)>=4||B.test(g)||T.test(g)||q.test(g))break;u+=`
|
27
27
|
`+w}!y&&!w.trim()&&(y=!0),f+=O+`
|
28
|
-
`,e=e.substring(O.length+1),g=w.slice(_)}}s.loose||(a?s.loose=!0:/\n *\n *$/.test(f)&&(a=!0));let L=null,k;this.options.gfm&&(L=/^\[[ xX]\] /.exec(u),L&&(k=L[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:f,task:!!L,checked:k,loose:!1,text:u,tokens:[]}),s.raw+=f}s.items[s.items.length-1].raw=s.items[s.items.length-1].raw.trimEnd(),s.items[s.items.length-1].text=s.items[s.items.length-1].text.trimEnd(),s.raw=s.raw.trimEnd();for(let l=0;l<s.items.length;l++)if(this.lexer.state.top=!1,s.items[l].tokens=this.lexer.blockTokens(s.items[l].text,[]),!s.loose){let f=s.items[l].tokens.filter(g=>g.type==="space"),u=f.length>0&&f.some(g=>/\n.*\n/.test(g.raw));s.loose=u}if(s.loose)for(let l=0;l<s.items.length;l++)s.items[l].loose=!0;return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let r=
|
29
|
-
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let a of n)/^ *-+: *$/.test(a)?o.align.push("right"):/^ *:-+: *$/.test(a)?o.align.push("center"):/^ *:-+ *$/.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<r.length;a++)o.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:o.align[a]});for(let a of s)o.rows.push(
|
30
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Ee(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;let o=Mi(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=
|
31
|
-
]`).replace("lheading",
|
28
|
+
`,e=e.substring(O.length+1),g=w.slice(_)}}s.loose||(a?s.loose=!0:/\n *\n *$/.test(f)&&(a=!0));let L=null,k;this.options.gfm&&(L=/^\[[ xX]\] /.exec(u),L&&(k=L[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:f,task:!!L,checked:k,loose:!1,text:u,tokens:[]}),s.raw+=f}s.items[s.items.length-1].raw=s.items[s.items.length-1].raw.trimEnd(),s.items[s.items.length-1].text=s.items[s.items.length-1].text.trimEnd(),s.raw=s.raw.trimEnd();for(let l=0;l<s.items.length;l++)if(this.lexer.state.top=!1,s.items[l].tokens=this.lexer.blockTokens(s.items[l].text,[]),!s.loose){let f=s.items[l].tokens.filter(g=>g.type==="space"),u=f.length>0&&f.some(g=>/\n.*\n/.test(g.raw));s.loose=u}if(s.loose)for(let l=0;l<s.items.length;l++)s.items[l].loose=!0;return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let r=Va(t[1]),n=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
|
29
|
+
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let a of n)/^ *-+: *$/.test(a)?o.align.push("right"):/^ *:-+: *$/.test(a)?o.align.push("center"):/^ *:-+ *$/.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<r.length;a++)o.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:o.align[a]});for(let a of s)o.rows.push(Va(a,o.header.length).map((l,f)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[f]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===`
|
30
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Ee(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;let o=Mi(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=hh(t[2],"()");if(o>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){let o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);o&&(n=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(this.options.pedantic&&!/>$/.test(r)?n=n.slice(1):n=n.slice(1,-1)),$a(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let n=(r[2]||r[1]).replace(/\s+/g," "),s=t[n.toLowerCase()];if(!s){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return $a(r,s,r[0],this.lexer)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n||n[3]&&r.match(/[\p{L}\p{N}]/u))return;if(!(n[1]||n[2]||"")||!r||this.rules.inline.punctuation.exec(r)){let o=[...n[0]].length-1,a,l,f=o,u=0,g=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,t=t.slice(-1*e.length+o);(n=g.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(l=[...a].length,n[3]||n[4]){f+=l;continue}else if((n[5]||n[6])&&o%3&&!((o+l)%3)){u+=l;continue}if(f-=l,f>0)continue;l=Math.min(l,l+f+u);let w=[...n[0]][0].length,y=e.slice(0,o+n.index+w+l);if(Math.min(o,l)%2){let L=y.slice(1,-1);return{type:"em",raw:y,text:L,tokens:this.lexer.inlineTokens(L)}}let _=y.slice(2,-2);return{type:"strong",raw:y,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(/\n/g," "),n=/[^ ]/.test(r),s=/^ /.test(r)&&/ $/.test(r);return n&&s&&(r=r.substring(1,r.length-1)),r=Ee(r,!0),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=Ee(t[1]),n="mailto:"+r):(r=Ee(t[1]),n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,n;if(t[2]==="@")r=Ee(t[0]),n="mailto:"+r;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);r=Ee(t[0]),t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let r;return this.lexer.state.inRawBlock?r=t[0]:r=Ee(t[0]),{type:"text",raw:t[0],text:r}}}},fh=/^(?: *(?:\n|$))+/,ph=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,mh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Bi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,gh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ga=/(?:[*+-]|\d{1,9}[.)])/,Ya=$(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Ga).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),As=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,vh=/^[^\n]+/,Ts=/(?!\s*\])(?:\\.|[^\[\]\\])+/,bh=$(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Ts).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),yh=$(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ga).getRegex(),rn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ss=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,wh=$("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Ss).replace("tag",rn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Xa=$(As).replace("hr",Bi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex(),Eh=$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Xa).getRegex(),ks={blockquote:Eh,code:ph,def:bh,fences:mh,heading:gh,hr:Bi,html:wh,lheading:Ya,list:yh,newline:fh,paragraph:Xa,table:Di,text:vh},ja=$("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Bi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex(),_h={...ks,table:ja,paragraph:$(As).replace("hr",Bi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ja).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex()},Ah={...ks,html:$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ss).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Di,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$(As).replace("hr",Bi).replace("heading",` *#{1,6} *[^
|
31
|
+
]`).replace("lheading",Ya).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Za=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Th=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Qa=/^( {2,}|\\)\n(?!\s*$)/,Sh=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ni="\\p{P}\\p{S}",kh=$(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Ni).getRegex(),xh=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Lh=$(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Ni).getRegex(),Ch=$("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Ni).getRegex(),Ih=$("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Ni).getRegex(),Oh=$(/\\([punct])/,"gu").replace(/punct/g,Ni).getRegex(),Rh=$(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Mh=$(Ss).replace("(?:-->|$)","-->").getRegex(),Ph=$("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Mh).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),tn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Dh=$(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",tn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ja=$(/^!?\[(label)\]\[(ref)\]/).replace("label",tn).replace("ref",Ts).getRegex(),el=$(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ts).getRegex(),Fh=$("reflink|nolink(?!\\()","g").replace("reflink",Ja).replace("nolink",el).getRegex(),xs={_backpedal:Di,anyPunctuation:Oh,autolink:Rh,blockSkip:xh,br:Qa,code:Th,del:Di,emStrongLDelim:Lh,emStrongRDelimAst:Ch,emStrongRDelimUnd:Ih,escape:Za,link:Dh,nolink:el,punctuation:kh,reflink:Ja,reflinkSearch:Fh,tag:Ph,text:Sh,url:Di},Bh={...xs,link:$(/^!?\[(label)\]\((.*?)\)/).replace("label",tn).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",tn).getRegex()},ws={...xs,escape:$(Za).replace("])","~|])").getRegex(),url:$(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Nh={...ws,br:$(Qa).replace("{2,}","*").getRegex(),text:$(ws.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},en={normal:ks,gfm:_h,pedantic:Ah},Pi={normal:xs,gfm:ws,breaks:Nh,pedantic:Bh},Ye=class i{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||_t,this.options.tokenizer=this.options.tokenizer||new ii,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={block:en.normal,inline:Pi.normal};this.options.pedantic?(t.block=en.pedantic,t.inline=Pi.pedantic):this.options.gfm&&(t.block=en.gfm,this.options.breaks?t.inline=Pi.breaks:t.inline=Pi.gfm),this.tokenizer.rules=t}static get rules(){return{block:en,inline:Pi}}static lex(e,t){return new i(t).lex(e)}static lexInline(e,t){return new i(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
|
32
32
|
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(a,l,f)=>l+" ".repeat(f.length));let n,s,o;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(n=a.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=`
|
33
33
|
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=`
|
34
34
|
`+n.raw,s.text+=`
|
@@ -56,11 +56,11 @@ ${this.parser.parse(e)}</blockquote>
|
|
56
56
|
`}tablerow({text:e}){return`<tr>
|
57
57
|
${e}</tr>
|
58
58
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
|
59
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),s=
|
60
|
-
`+this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l}]}):r+=l;continue}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t){t=t||this.renderer;let r="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){let a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=a||"";continue}}let o=s;switch(o.type){case"escape":{r+=t.text(o);break}case"html":{r+=t.html(o);break}case"link":{r+=t.link(o);break}case"image":{r+=t.image(o);break}case"strong":{r+=t.strong(o);break}case"em":{r+=t.em(o);break}case"codespan":{r+=t.codespan(o);break}case"br":{r+=t.br(o);break}case"del":{r+=t.del(o);break}case"text":{r+=t.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},ti=class{options;constructor(e){this.options=e||_t}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}},
|
61
|
-
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+Ee(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},Et=new
|
59
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),s=za(e);if(s===null)return n;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>",o}image({href:e,title:t,text:r}){let n=za(e);if(n===null)return r;e=n;let s=`<img src="${e}" alt="${r}"`;return t&&(s+=` title="${t}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}},Fi=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Xe=class i{options;renderer;textRenderer;constructor(e){this.options=e||_t,this.options.renderer=this.options.renderer||new ri,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Fi}static parse(e,t){return new i(t).parse(e)}static parseInline(e,t){return new i(t).parseInline(e)}parse(e,t=!0){let r="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){let a=s,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=l||"";continue}}let o=s;switch(o.type){case"space":{r+=this.renderer.space(o);continue}case"hr":{r+=this.renderer.hr(o);continue}case"heading":{r+=this.renderer.heading(o);continue}case"code":{r+=this.renderer.code(o);continue}case"table":{r+=this.renderer.table(o);continue}case"blockquote":{r+=this.renderer.blockquote(o);continue}case"list":{r+=this.renderer.list(o);continue}case"html":{r+=this.renderer.html(o);continue}case"paragraph":{r+=this.renderer.paragraph(o);continue}case"text":{let a=o,l=this.renderer.text(a);for(;n+1<e.length&&e[n+1].type==="text";)a=e[++n],l+=`
|
60
|
+
`+this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l}]}):r+=l;continue}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t){t=t||this.renderer;let r="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){let a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=a||"";continue}}let o=s;switch(o.type){case"escape":{r+=t.text(o);break}case"html":{r+=t.html(o);break}case"link":{r+=t.link(o);break}case"image":{r+=t.image(o);break}case"strong":{r+=t.strong(o);break}case"em":{r+=t.em(o);break}case"codespan":{r+=t.codespan(o);break}case"br":{r+=t.br(o);break}case"del":{r+=t.del(o);break}case"text":{r+=t.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},ti=class{options;constructor(e){this.options=e||_t}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}},Es=class{defaults=_s();options=this.setOptions;parse=this.#t(Ye.lex,Xe.parse);parseInline=this.#t(Ye.lexInline,Xe.parseInline);Parser=Xe;Renderer=ri;TextRenderer=Fi;Lexer=Ye;Tokenizer=ii;Hooks=ti;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":{let s=n;for(let o of s.header)r=r.concat(this.walkTokens(o.tokens,t));for(let o of s.rows)for(let a of o)r=r.concat(this.walkTokens(a.tokens,t));break}case"list":{let s=n;r=r.concat(this.walkTokens(s.items,t));break}default:{let s=n;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(o=>{let a=s[o].flat(1/0);r=r.concat(this.walkTokens(a,t))}):s.tokens&&(r=r.concat(this.walkTokens(s.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=t.renderers[s.name];o?t.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),n.extensions=t),r.renderer){let s=this.defaults.renderer||new ri(this.defaults);for(let o in r.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,l=r.renderer[a];r.useNewRenderer||(l=this.#e(l,a,s));let f=s[a];s[a]=(...u)=>{let g=l.apply(s,u);return g===!1&&(g=f.apply(s,u)),g||""}}n.renderer=s}if(r.tokenizer){let s=this.defaults.tokenizer||new ii(this.defaults);for(let o in r.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,l=r.tokenizer[a],f=s[a];s[a]=(...u)=>{let g=l.apply(s,u);return g===!1&&(g=f.apply(s,u)),g}}n.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new ti;for(let o in r.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(o==="options")continue;let a=o,l=r.hooks[a],f=s[a];ti.passThroughHooks.has(o)?s[a]=u=>{if(this.defaults.async)return Promise.resolve(l.call(s,u)).then(w=>f.call(s,w));let g=l.call(s,u);return f.call(s,g)}:s[a]=(...u)=>{let g=l.apply(s,u);return g===!1&&(g=f.apply(s,u)),g}}n.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,o=r.walkTokens;n.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),s&&(l=l.concat(s.call(this,a))),l}}this.defaults={...this.defaults,...n}}),this}#e(e,t,r){switch(t){case"heading":return function(n){return!n.type||n.type!==t?e.apply(this,arguments):e.call(this,r.parser.parseInline(n.tokens),n.depth,ch(r.parser.parseInline(n.tokens,r.parser.textRenderer)))};case"code":return function(n){return!n.type||n.type!==t?e.apply(this,arguments):e.call(this,n.text,n.lang,!!n.escaped)};case"table":return function(n){if(!n.type||n.type!==t)return e.apply(this,arguments);let s="",o="";for(let l=0;l<n.header.length;l++)o+=this.tablecell({text:n.header[l].text,tokens:n.header[l].tokens,header:!0,align:n.align[l]});s+=this.tablerow({text:o});let a="";for(let l=0;l<n.rows.length;l++){let f=n.rows[l];o="";for(let u=0;u<f.length;u++)o+=this.tablecell({text:f[u].text,tokens:f[u].tokens,header:!1,align:n.align[u]});a+=this.tablerow({text:o})}return e.call(this,s,a)};case"blockquote":return function(n){if(!n.type||n.type!==t)return e.apply(this,arguments);let s=this.parser.parse(n.tokens);return e.call(this,s)};case"list":return function(n){if(!n.type||n.type!==t)return e.apply(this,arguments);let s=n.ordered,o=n.start,a=n.loose,l="";for(let f=0;f<n.items.length;f++){let u=n.items[f],g=u.checked,w=u.task,y="";if(u.task){let _=this.checkbox({checked:!!g});a?u.tokens.length>0&&u.tokens[0].type==="paragraph"?(u.tokens[0].text=_+" "+u.tokens[0].text,u.tokens[0].tokens&&u.tokens[0].tokens.length>0&&u.tokens[0].tokens[0].type==="text"&&(u.tokens[0].tokens[0].text=_+" "+u.tokens[0].tokens[0].text)):u.tokens.unshift({type:"text",text:_+" "}):y+=_+" "}y+=this.parser.parse(u.tokens,a),l+=this.listitem({type:"list_item",raw:y,text:y,task:w,checked:!!g,loose:a,tokens:u.tokens})}return e.call(this,l,s,o)};case"html":return function(n){return!n.type||n.type!==t?e.apply(this,arguments):e.call(this,n.text,n.block)};case"paragraph":return function(n){return!n.type||n.type!==t?e.apply(this,arguments):e.call(this,this.parser.parseInline(n.tokens))};case"escape":return function(n){return!n.type||n.type!==t?e.apply(this,arguments):e.call(this,n.text)};case"link":return function(n){return!n.type||n.type!==t?e.apply(this,arguments):e.call(this,n.href,n.title,this.parser.parseInline(n.tokens))};case"image":return function(n){return!n.type||n.type!==t?e.apply(this,arguments):e.call(this,n.href,n.title,n.text)};case"strong":return function(n){return!n.type||n.type!==t?e.apply(this,arguments):e.call(this,this.parser.parseInline(n.tokens))};case"em":return function(n){return!n.type||n.type!==t?e.apply(this,arguments):e.call(this,this.parser.parseInline(n.tokens))};case"codespan":return function(n){return!n.type||n.type!==t?e.apply(this,arguments):e.call(this,n.text)};case"del":return function(n){return!n.type||n.type!==t?e.apply(this,arguments):e.call(this,this.parser.parseInline(n.tokens))};case"text":return function(n){return!n.type||n.type!==t?e.apply(this,arguments):e.call(this,n.text)}}return e}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ye.lex(e,t??this.defaults)}parser(e,t){return Xe.parse(e,t??this.defaults)}#t(e,t){return(r,n)=>{let s={...n},o={...this.defaults,...s};this.defaults.async===!0&&s.async===!1&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);let a=this.#i(!!o.silent,!!o.async);if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(l=>e(l,o)).then(l=>o.hooks?o.hooks.processAllTokens(l):l).then(l=>o.walkTokens?Promise.all(this.walkTokens(l,o.walkTokens)).then(()=>l):l).then(l=>t(l,o)).then(l=>o.hooks?o.hooks.postprocess(l):l).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let l=e(r,o);o.hooks&&(l=o.hooks.processAllTokens(l)),o.walkTokens&&this.walkTokens(l,o.walkTokens);let f=t(l,o);return o.hooks&&(f=o.hooks.postprocess(f)),f}catch(l){return a(l)}}}#i(e,t){return r=>{if(r.message+=`
|
61
|
+
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+Ee(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},Et=new Es;function V(i,e){return Et.parse(i,e)}V.options=V.setOptions=function(i){return Et.setOptions(i),V.defaults=Et.defaults,Ua(V.defaults),V};V.getDefaults=_s;V.defaults=_t;V.use=function(...i){return Et.use(...i),V.defaults=Et.defaults,Ua(V.defaults),V};V.walkTokens=function(i,e){return Et.walkTokens(i,e)};V.parseInline=Et.parseInline;V.Parser=Xe;V.parser=Xe.parse;V.Renderer=ri;V.TextRenderer=Fi;V.Lexer=Ye;V.lexer=Ye.lex;V.Tokenizer=ii;V.Hooks=ti;V.parse=V;var Hw=V.options,qw=V.setOptions,zw=V.use,Vw=V.walkTokens,$w=V.parseInline;var jw=Xe.parse,Uw=Ye.lex;var nn=class extends S{connect(){console.log(`easymde connected: ${this.element}`),this.easyMDE=new EasyMDE(this.#e()),this.element.setAttribute("data-action","turbo:morph-element->easymde#reconnect")}disconnect(){this.easyMDE.toTextArea(),this.easyMDE=null}reconnect(){this.disconnect(),this.connect()}#e(){let i={element:this.element,promptURLs:!0,spellChecker:!1,previewRender:e=>{let t=ys.sanitize(e,{ALLOWED_TAGS:["strong","em","sub","sup","details","summary"],ALLOWED_ATTR:[]}),r=V(t);return ys.sanitize(r,{USE_PROFILES:{html:!0}})}};return this.element.attributes.id.value&&(i.autosave={enabled:!0,uniqueId:this.element.attributes.id.value,delay:1e3}),i}};var sn=class extends S{connect(){console.log(`slim-select connected: ${this.element}`),this.slimSelect=new SlimSelect({select:this.element}),this.element.setAttribute("data-action","turbo:morph-element->slim-select#reconnect")}disconnect(){this.slimSelect.destroy(),this.slimSelect=null}reconnect(){this.disconnect(),this.connect()}};var on=class extends S{connect(){console.log(`flatpickr connected: ${this.element}`),this.picker=new flatpickr(this.element,this.#e()),this.element.setAttribute("data-action","turbo:morph-element->flatpickr#reconnect")}disconnect(){this.picker.destroy(),this.picker=null}reconnect(){this.disconnect(),this.connect()}#e(){let i={altInput:!0};return this.element.attributes.type.value=="datetime-local"?i.enableTime=!0:this.element.attributes.type.value=="time"&&(i.enableTime=!0,i.noCalendar=!0),i}};var an=class extends S{static targets=["input"];connect(){console.log(`intl-tel-input connected: ${this.element}`)}disconnect(){this.inputTargetDisconnected()}inputTargetConnected(){this.hasInputTarget&&(this.iti=window.intlTelInput(this.inputTarget,this.#e()),this.inputTarget.setAttribute("data-action","turbo:morph-element->intl-tel-input#reconnect"))}inputTargetDisconnected(){this.iti&&this.iti.destroy(),this.iti=null}reconnect(){this.inputTargetDisconnected(),this.inputTargetConnected()}#e(){return{strictMode:!0,hiddenInput:()=>({phone:this.inputTarget.attributes.name.value}),loadUtilsOnInit:"https://cdn.jsdelivr.net/npm/intl-tel-input@24.8.1/build/js/utils.js"}}};function Ls(i){i.register("resource-layout",nr),i.register("nav-grid-menu-item",sr),i.register("nav-grid-menu",or),i.register("nav-user-section",ar),i.register("nav-user-link",lr),i.register("nav-user",cr),i.register("header",ur),i.register("sidebar-menu-item",hr),i.register("sidebar-menu",dr),i.register("sidebar",fr),i.register("has-many-panel",pr),i.register("nested-resource-form-fields",mr),i.register("toolbar",gr),i.register("table-search-input",vr),i.register("table-toolbar",br),i.register("table",yr),i.register("form",wr),i.register("resource-drop-down",Wr),i.register("resource-collapse",Kr),i.register("resource-dismiss",Gr),i.register("frame-navigator",Yr),i.register("color-mode",Xr),i.register("easymde",nn),i.register("slim-select",sn),i.register("flatpickr",on),i.register("intl-tel-input",an)}(function(i){if(typeof i.requestSubmit=="function")return;i.requestSubmit=function(r){r?(e(r,this),r.click()):(r=document.createElement("input"),r.type="submit",r.hidden=!0,this.appendChild(r),r.click(),this.removeChild(r))};function e(r,n){r instanceof HTMLElement||t(TypeError,"parameter 1 is not of type 'HTMLElement'"),r.type=="submit"||t(TypeError,"The specified element is not a submit button"),r.form==n||t(DOMException,"The specified element is not owned by this form element","NotFoundError")}function t(r,n,s){throw new r("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+n+".",s)}})(HTMLFormElement.prototype);var ol=new WeakMap;function Hh(i){let e=i instanceof Element?i:i instanceof Node?i.parentElement:null,t=e?e.closest("input, button"):null;return t?.type=="submit"?t:null}function qh(i){let e=Hh(i.target);e&&e.form&&ol.set(e.form,e)}(function(){if("submitter"in Event.prototype)return;let i=window.Event.prototype;if("SubmitEvent"in window){let e=window.SubmitEvent.prototype;if(/Apple Computer/.test(navigator.vendor)&&!("submitter"in e))i=e;else return}addEventListener("click",qh,!0),Object.defineProperty(i,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return ol.get(this.target)}})})();var si={eager:"eager",lazy:"lazy"},Be=class i extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new i.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(e){e=="loading"?this.delegate.loadingStyleChanged():e=="src"?this.delegate.sourceURLChanged():e=="disabled"&&this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(e){e?this.setAttribute("refresh",e):this.removeAttribute("refresh")}get loading(){return zh(this.getAttribute("loading")||"")}set loading(e){e?this.setAttribute("loading",e):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(e){e?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){return this.ownerDocument?.documentElement?.hasAttribute("data-turbo-preview")}};function zh(i){switch(i.toLowerCase()){case"lazy":return si.lazy;default:return si.eager}}function le(i){return new URL(i.toString(),document.baseURI)}function St(i){let e;if(i.hash)return i.hash.slice(1);if(e=i.href.match(/#(.*)$/))return e[1]}function no(i,e){let t=e?.getAttribute("formaction")||i.getAttribute("action")||i.action;return le(t)}function Vh(i){return(Kh(i).match(/\.[^.]*$/)||[])[0]||""}function $h(i){return!!Vh(i).match(/^(?:|\.(?:htm|html|xhtml|php))$/)}function jh(i,e){let t=Gh(e);return i.href===le(t).href||i.href.startsWith(t)}function st(i,e){return jh(i,e)&&$h(i)}function Cs(i){let e=St(i);return e!=null?i.href.slice(0,-(e.length+1)):i.href}function ln(i){return Cs(i)}function Uh(i,e){return le(i).href==le(e).href}function Wh(i){return i.pathname.split("/").slice(1)}function Kh(i){return Wh(i).slice(-1)[0]}function Gh(i){return Yh(i.origin+i.pathname)}function Yh(i){return i.endsWith("/")?i:i+"/"}var Hi=class{constructor(e){this.response=e}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return le(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}};function qi(i){if(i.getAttribute("data-turbo-eval")=="false")return i;{let e=document.createElement("script"),t=ui("csp-nonce");return t&&(e.nonce=t),e.textContent=i.textContent,e.async=!1,Xh(e,i),e}}function Xh(i,e){for(let{name:t,value:r}of e.attributes)i.setAttribute(t,r)}function Zh(i){let e=document.createElement("template");return e.innerHTML=i,e.content}function Q(i,{target:e,cancelable:t,detail:r}={}){let n=new CustomEvent(i,{cancelable:t,bubbles:!0,composed:!0,detail:r});return e&&e.isConnected?e.dispatchEvent(n):document.documentElement.dispatchEvent(n),n}function ai(){return document.visibilityState==="hidden"?ll():al()}function al(){return new Promise(i=>requestAnimationFrame(()=>i()))}function ll(){return new Promise(i=>setTimeout(()=>i(),0))}function Qh(){return Promise.resolve()}function cl(i=""){return new DOMParser().parseFromString(i,"text/html")}function ul(i,...e){let t=Jh(i,e).replace(/^\n/,"").split(`
|
62
62
|
`),r=t[0].match(/^\s+/),n=r?r[0].length:0;return t.map(s=>s.slice(n)).join(`
|
63
|
-
`)}function Qh(i,e){return i.reduce((t,r,n)=>{let s=e[n]==null?"":e[n];return t+r+s},"")}function ot(){return Array.from({length:36}).map((i,e)=>e==8||e==13||e==18||e==23?"-":e==14?"4":e==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}function cn(i,...e){for(let t of e.map(r=>r?.getAttribute(i)))if(typeof t=="string")return t;return null}function Jh(i,...e){return e.some(t=>t&&t.hasAttribute(i))}function un(...i){for(let e of i)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function hn(...i){for(let e of i)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function ed(i,e=2e3){return new Promise(t=>{let r=()=>{i.removeEventListener("error",r),i.removeEventListener("load",r),t()};i.addEventListener("load",r,{once:!0}),i.addEventListener("error",r,{once:!0}),setTimeout(t,e)})}function ul(i){switch(i){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function td(i){return i=="advance"||i=="replace"||i=="restore"}function kt(...i){let e=cn("data-turbo-action",...i);return td(e)?e:null}function hl(i){return document.querySelector(`meta[name="${i}"]`)}function ui(i){let e=hl(i);return e&&e.content}function id(i,e){let t=hl(i);return t||(t=document.createElement("meta"),t.setAttribute("name",i),document.head.appendChild(t)),t.setAttribute("content",e),t}function li(i,e){if(i instanceof Element)return i.closest(e)||li(i.assignedSlot||i.getRootNode()?.host,e)}function no(i){return!!i&&i.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof i.focus=="function"}function dl(i){return Array.from(i.querySelectorAll("[autofocus]")).find(no)}async function rd(i,e){let t=e();i(),await ol();let r=e();return[t,r]}function nd(i){if(i.hasAttribute("target")){for(let e of document.getElementsByName(i.target))if(e instanceof HTMLIFrameElement)return!1}return!0}function sd(i){return li(i,"a[href]:not([target^=_]):not([download])")}function fl(i){return le(i.getAttribute("href")||"")}function od(i,e){let t=null;return(...r)=>{let n=()=>i.apply(this,r);clearTimeout(t),t=setTimeout(n,e)}}var Cs=class extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){let r=this.values().next().value;this.delete(r)}super.add(e)}},pl=new Cs(20),ad=window.fetch;function ml(i,e={}){let t=new Headers(e.headers||{}),r=ot();return pl.add(r),t.append("X-Turbo-Request-Id",r),ad(i,{...e,headers:t})}function so(i){switch(i.toLowerCase()){case"get":return ke.get;case"post":return ke.post;case"put":return ke.put;case"patch":return ke.patch;case"delete":return ke.delete}}var ke={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function ld(i){switch(i.toLowerCase()){case Tt.multipart:return Tt.multipart;case Tt.plain:return Tt.plain;default:return Tt.urlEncoded}}var Tt={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"},xt=class{abortController=new AbortController;#e=e=>{};constructor(e,t,r,n=new URLSearchParams,s=null,o=Tt.urlEncoded){let[a,l]=el(le(r),t,n,o);this.delegate=e,this.url=a,this.target=s,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t,headers:{...this.defaultHeaders},body:l,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=o}get method(){return this.fetchOptions.method}set method(e){let t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,r=so(e)||ke.get;this.url.search="";let[n,s]=el(this.url,r,t,this.enctype);this.url=n,this.fetchOptions.body=s,this.fetchOptions.method=r}get headers(){return this.fetchOptions.headers}set headers(e){this.fetchOptions.headers=e}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(e){this.fetchOptions.body=e}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){let{fetchOptions:e}=this;this.delegate.prepareRequest(this);let t=await this.#t(e);try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=ml(this.url.href,e);let r=await this.response;return await this.receive(r)}catch(r){if(r.name!=="AbortError")throw this.#i(r)&&this.delegate.requestErrored(this,r),r}finally{this.delegate.requestFinished(this)}}async receive(e){let t=new Hi(e);return Q("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return oo(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#t(e){let t=new Promise(n=>this.#e=n),r=Q("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#e},target:this.target});return this.url=r.detail.url,r.defaultPrevented&&await t,r}#i(e){return!Q("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}};function oo(i){return so(i)==ke.get}function el(i,e,t,r){let n=Array.from(t).length>0?new URLSearchParams(gl(t)):i.searchParams;return oo(e)?[cd(i,n),null]:r==Tt.urlEncoded?[i,n]:[i,t]}function gl(i){let e=[];for(let[t,r]of i)r instanceof File||e.push([t,r]);return e}function cd(i,e){let t=new URLSearchParams(gl(e));return i.search=t.toString(),i}var Is=class{started=!1;constructor(e,t){this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}intersect=e=>{e.slice(-1)[0]?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)}},at=class{static contentType="text/vnd.turbo-stream.html";static wrap(e){return typeof e=="string"?new this(Xh(e)):e}constructor(e){this.fragment=ud(e)}};function ud(i){for(let e of i.querySelectorAll("turbo-stream")){let t=document.importNode(e,!0);for(let r of t.templateElement.content.querySelectorAll("script"))r.replaceWith(qi(r));e.replaceWith(t)}return i}var hd=100,Os=class{#e=null;#t=null;get(e){if(this.#t&&this.#t.url===e&&this.#t.expire>Date.now())return this.#t.request}setLater(e,t,r){this.clear(),this.#e=setTimeout(()=>{t.perform(),this.set(e,t,r),this.#e=null},hd)}set(e,t,r){this.#t={url:e,request:t,expire:new Date(new Date().getTime()+r)}}clear(){this.#e&&clearTimeout(this.#e),this.#t=null}},dd=10*1e3,oi=new Os,ni={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"},zi=class i{state=ni.initialized;static confirmMethod(e,t,r){return Promise.resolve(confirm(e))}constructor(e,t,r,n=!1){let s=bd(t,r),o=vd(gd(t,r),s),a=fd(t,r),l=yd(t,r);this.delegate=e,this.formElement=t,this.submitter=r,this.fetchRequest=new xt(this,s,o,a,t,l),this.mustRedirect=n}get method(){return this.fetchRequest.method}set method(e){this.fetchRequest.method=e}get action(){return this.fetchRequest.url.toString()}set action(e){this.fetchRequest.url=le(e)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){let{initialized:e,requesting:t}=ni,r=cn("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof r=="string"&&!await i.confirmMethod(r,this.formElement,this.submitter))&&this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:t}=ni;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){let t=pd(ui("csrf-param"))||ui("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(at.contentType)}requestStarted(e){this.state=ni.waiting,this.submitter?.setAttribute("disabled",""),this.setSubmitsWith(),un(this.formElement),Q("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){oi.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(oi.clear(),this.requestMustRedirect(e)&&md(t)){let r=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,r)}else this.state=ni.receiving,this.result={success:!0,fetchResponse:t},this.delegate.formSubmissionSucceededWithResponse(this,t)}requestFailedWithResponse(e,t){this.result={success:!1,fetchResponse:t},this.delegate.formSubmissionFailedWithResponse(this,t)}requestErrored(e,t){this.result={success:!1,error:t},this.delegate.formSubmissionErrored(this,t)}requestFinished(e){this.state=ni.stopped,this.submitter?.removeAttribute("disabled"),this.resetSubmitterText(),hn(this.formElement),Q("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(!(!this.submitter||!this.submitsWith)){if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){let e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}}resetSubmitterText(){if(!(!this.submitter||!this.originalSubmitText)){if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){let e=this.submitter;e.value=this.originalSubmitText}}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||Jh("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}};function fd(i,e){let t=new FormData(i),r=e?.getAttribute("name"),n=e?.getAttribute("value");return r&&t.append(r,n||""),t}function pd(i){if(i!=null){let t=(document.cookie?document.cookie.split("; "):[]).find(r=>r.startsWith(i));if(t){let r=t.split("=").slice(1).join("=");return r?decodeURIComponent(r):void 0}}}function md(i){return i.statusCode==200&&!i.redirected}function gd(i,e){let t=typeof i.action=="string"?i.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":i.getAttribute("action")||t||""}function vd(i,e){let t=le(i);return oo(e)&&(t.search=""),t}function bd(i,e){let t=e?.getAttribute("formmethod")||i.getAttribute("method")||"";return so(t.toLowerCase())||ke.get}function yd(i,e){return ld(e?.getAttribute("formenctype")||i.enctype)}var hi=class{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return this.getElementForAnchor(e)!=null}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return dl(this.element)}get permanentElements(){return bl(this.element)}getPermanentElementById(e){return vl(this.element,e)}getPermanentElementMapForSnapshot(e){let t={};for(let r of this.permanentElements){let{id:n}=r,s=e.getPermanentElementById(n);s&&(t[n]=[r,s])}return t}};function vl(i,e){return i.querySelector(`#${e}[data-turbo-permanent]`)}function bl(i){return i.querySelectorAll("[id][data-turbo-permanent]")}var Vi=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)};submitBubbled=e=>{if(!e.defaultPrevented){let t=e.target instanceof HTMLFormElement?e.target:void 0,r=e.submitter||void 0;t&&wd(t,r)&&Ed(t,r)&&this.delegate.willSubmitForm(t,r)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,r))}}};function wd(i,e){return(e?.getAttribute("formmethod")||i.getAttribute("method"))!="dialog"}function Ed(i,e){if(e?.hasAttribute("formtarget")||i.hasAttribute("target")){let t=e?.getAttribute("formtarget")||i.target;for(let r of document.getElementsByName(t))if(r instanceof HTMLIFrameElement)return!1;return!0}else return!0}var dn=class{#e=e=>{};#t=e=>{};constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){let t=this.snapshot.getElementForAnchor(e);t?(this.scrollToElement(t),this.focusElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(St(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){let{isPreview:t,shouldRender:r,willRender:n,newSnapshot:s}=e,o=n;if(r)try{this.renderPromise=new Promise(u=>this.#e=u),this.renderer=e,await this.prepareToRenderSnapshot(e);let a=new Promise(u=>this.#t=u),l={resume:this.#t,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(s,l)||await a,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(s,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#e(void 0),delete this.renderPromise}else o&&this.invalidate(e.reloadReason)}invalidate(e){this.delegate.viewInvalidated(e)}async prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),await e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}markVisitDirection(e){this.element.setAttribute("data-turbo-visit-direction",e)}unmarkVisitDirection(){this.element.removeAttribute("data-turbo-visit-direction")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}},Rs=class extends dn{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new hi(this.element)}},fn=class{constructor(e,t){this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}clickBubbled=e=>{this.respondsToEventTarget(e.target)?this.clickEvent=e:delete this.clickEvent};linkClicked=e=>{this.clickEvent&&this.respondsToEventTarget(e.target)&&e.target instanceof Element&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url,e.detail.originalEvent)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.detail.url,e.detail.originalEvent)),delete this.clickEvent};willVisit=e=>{delete this.clickEvent};respondsToEventTarget(e){let t=e instanceof Element?e:e instanceof Node?e.parentElement:null;return t&&t.closest("turbo-frame, html")==this.element}},pn=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)};clickBubbled=e=>{if(e instanceof MouseEvent&&this.clickEventIsSignificant(e)){let t=e.composedPath&&e.composedPath()[0]||e.target,r=sd(t);if(r&&nd(r)){let n=fl(r);this.delegate.willFollowLinkToLocation(r,n,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(r,n))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}},mn=class{constructor(e,t){this.delegate=e,this.linkInterceptor=new pn(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,r){return this.delegate.willSubmitFormLinkToLocation(e,t,r)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,t){let r=document.createElement("form"),n="hidden";for(let[g,w]of t.searchParams)r.append(Object.assign(document.createElement("input"),{type:n,name:g,value:w}));let s=Object.assign(t,{search:""});r.setAttribute("data-turbo","true"),r.setAttribute("action",s.href),r.setAttribute("hidden","");let o=e.getAttribute("data-turbo-method");o&&r.setAttribute("method",o);let a=e.getAttribute("data-turbo-frame");a&&r.setAttribute("data-turbo-frame",a);let l=kt(e);l&&r.setAttribute("data-turbo-action",l);let f=e.getAttribute("data-turbo-confirm");f&&r.setAttribute("data-turbo-confirm",f),e.hasAttribute("data-turbo-stream")&&r.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,r),document.body.appendChild(r),r.addEventListener("turbo:submit-end",()=>r.remove(),{once:!0}),requestAnimationFrame(()=>r.requestSubmit())}},gn=class{static async preservingPermanentElements(e,t,r){let n=new this(e,t);n.enter(),await r(),n.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(let e in this.permanentElementMap){let[t,r]=this.permanentElementMap[e];this.delegate.enteringBardo(t,r),this.replaceNewPermanentElementWithPlaceholder(r)}}leave(){for(let e in this.permanentElementMap){let[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){let t=_d(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){let t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){this.getPlaceholderById(e.id)?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}};function _d(i){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",i.id),e}var $i=class{#e=null;constructor(e,t,r,n,s=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=n,this.willRender=s,this.renderElement=r,this.promise=new Promise((o,a)=>this.resolvingFunctions={resolve:o,reject:a})}get shouldRender(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await gn.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){let e=this.connectedSnapshot.firstAutofocusableElement;e&&e.focus()}enteringBardo(e){this.#e||e.contains(this.currentSnapshot.activeElement)&&(this.#e=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.#e)&&this.#e instanceof HTMLElement&&(this.#e.focus(),this.#e=null)}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get renderMethod(){return"replace"}},ji=class extends $i{static renderElement(e,t){let r=document.createRange();r.selectNodeContents(e),r.deleteContents();let n=t,s=n.ownerDocument?.createRange();s&&(s.selectNodeContents(n),e.appendChild(s.extractContents()))}constructor(e,t,r,n,s,o=!0){super(t,r,n,s,o),this.delegate=e}get shouldRender(){return!0}async render(){await ai(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await ai(),this.focusFirstAutofocusableElement(),await ai(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){let e=this.currentElement.firstElementChild,t=Ad(this.currentElement.getAttribute("data-autoscroll-block"),"end"),r=Td(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:t,behavior:r}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let t=qi(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function Ad(i,e){return i=="end"||i=="start"||i=="center"||i=="nearest"?i:e}function Td(i,e){return i=="auto"||i=="smooth"?i:e}var Ms=class i{static animationDuration=300;static get defaultCSS(){return cl`
|
63
|
+
`)}function Jh(i,e){return i.reduce((t,r,n)=>{let s=e[n]==null?"":e[n];return t+r+s},"")}function ot(){return Array.from({length:36}).map((i,e)=>e==8||e==13||e==18||e==23?"-":e==14?"4":e==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}function un(i,...e){for(let t of e.map(r=>r?.getAttribute(i)))if(typeof t=="string")return t;return null}function ed(i,...e){return e.some(t=>t&&t.hasAttribute(i))}function hn(...i){for(let e of i)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function dn(...i){for(let e of i)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function td(i,e=2e3){return new Promise(t=>{let r=()=>{i.removeEventListener("error",r),i.removeEventListener("load",r),t()};i.addEventListener("load",r,{once:!0}),i.addEventListener("error",r,{once:!0}),setTimeout(t,e)})}function hl(i){switch(i){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function id(i){return i=="advance"||i=="replace"||i=="restore"}function kt(...i){let e=un("data-turbo-action",...i);return id(e)?e:null}function dl(i){return document.querySelector(`meta[name="${i}"]`)}function ui(i){let e=dl(i);return e&&e.content}function rd(i,e){let t=dl(i);return t||(t=document.createElement("meta"),t.setAttribute("name",i),document.head.appendChild(t)),t.setAttribute("content",e),t}function li(i,e){if(i instanceof Element)return i.closest(e)||li(i.assignedSlot||i.getRootNode()?.host,e)}function so(i){return!!i&&i.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof i.focus=="function"}function fl(i){return Array.from(i.querySelectorAll("[autofocus]")).find(so)}async function nd(i,e){let t=e();i(),await al();let r=e();return[t,r]}function sd(i){if(i.hasAttribute("target")){for(let e of document.getElementsByName(i.target))if(e instanceof HTMLIFrameElement)return!1}return!0}function od(i){return li(i,"a[href]:not([target^=_]):not([download])")}function pl(i){return le(i.getAttribute("href")||"")}function ad(i,e){let t=null;return(...r)=>{let n=()=>i.apply(this,r);clearTimeout(t),t=setTimeout(n,e)}}var Is=class extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){let r=this.values().next().value;this.delete(r)}super.add(e)}},ml=new Is(20),ld=window.fetch;function gl(i,e={}){let t=new Headers(e.headers||{}),r=ot();return ml.add(r),t.append("X-Turbo-Request-Id",r),ld(i,{...e,headers:t})}function oo(i){switch(i.toLowerCase()){case"get":return ke.get;case"post":return ke.post;case"put":return ke.put;case"patch":return ke.patch;case"delete":return ke.delete}}var ke={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function cd(i){switch(i.toLowerCase()){case Tt.multipart:return Tt.multipart;case Tt.plain:return Tt.plain;default:return Tt.urlEncoded}}var Tt={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"},xt=class{abortController=new AbortController;#e=e=>{};constructor(e,t,r,n=new URLSearchParams,s=null,o=Tt.urlEncoded){let[a,l]=tl(le(r),t,n,o);this.delegate=e,this.url=a,this.target=s,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t,headers:{...this.defaultHeaders},body:l,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=o}get method(){return this.fetchOptions.method}set method(e){let t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,r=oo(e)||ke.get;this.url.search="";let[n,s]=tl(this.url,r,t,this.enctype);this.url=n,this.fetchOptions.body=s,this.fetchOptions.method=r}get headers(){return this.fetchOptions.headers}set headers(e){this.fetchOptions.headers=e}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(e){this.fetchOptions.body=e}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){let{fetchOptions:e}=this;this.delegate.prepareRequest(this);let t=await this.#t(e);try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=gl(this.url.href,e);let r=await this.response;return await this.receive(r)}catch(r){if(r.name!=="AbortError")throw this.#i(r)&&this.delegate.requestErrored(this,r),r}finally{this.delegate.requestFinished(this)}}async receive(e){let t=new Hi(e);return Q("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return ao(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#t(e){let t=new Promise(n=>this.#e=n),r=Q("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#e},target:this.target});return this.url=r.detail.url,r.defaultPrevented&&await t,r}#i(e){return!Q("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}};function ao(i){return oo(i)==ke.get}function tl(i,e,t,r){let n=Array.from(t).length>0?new URLSearchParams(vl(t)):i.searchParams;return ao(e)?[ud(i,n),null]:r==Tt.urlEncoded?[i,n]:[i,t]}function vl(i){let e=[];for(let[t,r]of i)r instanceof File||e.push([t,r]);return e}function ud(i,e){let t=new URLSearchParams(vl(e));return i.search=t.toString(),i}var Os=class{started=!1;constructor(e,t){this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}intersect=e=>{e.slice(-1)[0]?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)}},at=class{static contentType="text/vnd.turbo-stream.html";static wrap(e){return typeof e=="string"?new this(Zh(e)):e}constructor(e){this.fragment=hd(e)}};function hd(i){for(let e of i.querySelectorAll("turbo-stream")){let t=document.importNode(e,!0);for(let r of t.templateElement.content.querySelectorAll("script"))r.replaceWith(qi(r));e.replaceWith(t)}return i}var dd=100,Rs=class{#e=null;#t=null;get(e){if(this.#t&&this.#t.url===e&&this.#t.expire>Date.now())return this.#t.request}setLater(e,t,r){this.clear(),this.#e=setTimeout(()=>{t.perform(),this.set(e,t,r),this.#e=null},dd)}set(e,t,r){this.#t={url:e,request:t,expire:new Date(new Date().getTime()+r)}}clear(){this.#e&&clearTimeout(this.#e),this.#t=null}},fd=10*1e3,oi=new Rs,ni={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"},zi=class i{state=ni.initialized;static confirmMethod(e,t,r){return Promise.resolve(confirm(e))}constructor(e,t,r,n=!1){let s=yd(t,r),o=bd(vd(t,r),s),a=pd(t,r),l=wd(t,r);this.delegate=e,this.formElement=t,this.submitter=r,this.fetchRequest=new xt(this,s,o,a,t,l),this.mustRedirect=n}get method(){return this.fetchRequest.method}set method(e){this.fetchRequest.method=e}get action(){return this.fetchRequest.url.toString()}set action(e){this.fetchRequest.url=le(e)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){let{initialized:e,requesting:t}=ni,r=un("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof r=="string"&&!await i.confirmMethod(r,this.formElement,this.submitter))&&this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:t}=ni;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){let t=md(ui("csrf-param"))||ui("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(at.contentType)}requestStarted(e){this.state=ni.waiting,this.submitter?.setAttribute("disabled",""),this.setSubmitsWith(),hn(this.formElement),Q("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){oi.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(oi.clear(),this.requestMustRedirect(e)&&gd(t)){let r=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,r)}else this.state=ni.receiving,this.result={success:!0,fetchResponse:t},this.delegate.formSubmissionSucceededWithResponse(this,t)}requestFailedWithResponse(e,t){this.result={success:!1,fetchResponse:t},this.delegate.formSubmissionFailedWithResponse(this,t)}requestErrored(e,t){this.result={success:!1,error:t},this.delegate.formSubmissionErrored(this,t)}requestFinished(e){this.state=ni.stopped,this.submitter?.removeAttribute("disabled"),this.resetSubmitterText(),dn(this.formElement),Q("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(!(!this.submitter||!this.submitsWith)){if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){let e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}}resetSubmitterText(){if(!(!this.submitter||!this.originalSubmitText)){if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){let e=this.submitter;e.value=this.originalSubmitText}}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||ed("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}};function pd(i,e){let t=new FormData(i),r=e?.getAttribute("name"),n=e?.getAttribute("value");return r&&t.append(r,n||""),t}function md(i){if(i!=null){let t=(document.cookie?document.cookie.split("; "):[]).find(r=>r.startsWith(i));if(t){let r=t.split("=").slice(1).join("=");return r?decodeURIComponent(r):void 0}}}function gd(i){return i.statusCode==200&&!i.redirected}function vd(i,e){let t=typeof i.action=="string"?i.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":i.getAttribute("action")||t||""}function bd(i,e){let t=le(i);return ao(e)&&(t.search=""),t}function yd(i,e){let t=e?.getAttribute("formmethod")||i.getAttribute("method")||"";return oo(t.toLowerCase())||ke.get}function wd(i,e){return cd(e?.getAttribute("formenctype")||i.enctype)}var hi=class{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return this.getElementForAnchor(e)!=null}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return fl(this.element)}get permanentElements(){return yl(this.element)}getPermanentElementById(e){return bl(this.element,e)}getPermanentElementMapForSnapshot(e){let t={};for(let r of this.permanentElements){let{id:n}=r,s=e.getPermanentElementById(n);s&&(t[n]=[r,s])}return t}};function bl(i,e){return i.querySelector(`#${e}[data-turbo-permanent]`)}function yl(i){return i.querySelectorAll("[id][data-turbo-permanent]")}var Vi=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)};submitBubbled=e=>{if(!e.defaultPrevented){let t=e.target instanceof HTMLFormElement?e.target:void 0,r=e.submitter||void 0;t&&Ed(t,r)&&_d(t,r)&&this.delegate.willSubmitForm(t,r)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,r))}}};function Ed(i,e){return(e?.getAttribute("formmethod")||i.getAttribute("method"))!="dialog"}function _d(i,e){if(e?.hasAttribute("formtarget")||i.hasAttribute("target")){let t=e?.getAttribute("formtarget")||i.target;for(let r of document.getElementsByName(t))if(r instanceof HTMLIFrameElement)return!1;return!0}else return!0}var fn=class{#e=e=>{};#t=e=>{};constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){let t=this.snapshot.getElementForAnchor(e);t?(this.scrollToElement(t),this.focusElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(St(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){let{isPreview:t,shouldRender:r,willRender:n,newSnapshot:s}=e,o=n;if(r)try{this.renderPromise=new Promise(u=>this.#e=u),this.renderer=e,await this.prepareToRenderSnapshot(e);let a=new Promise(u=>this.#t=u),l={resume:this.#t,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(s,l)||await a,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(s,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#e(void 0),delete this.renderPromise}else o&&this.invalidate(e.reloadReason)}invalidate(e){this.delegate.viewInvalidated(e)}async prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),await e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}markVisitDirection(e){this.element.setAttribute("data-turbo-visit-direction",e)}unmarkVisitDirection(){this.element.removeAttribute("data-turbo-visit-direction")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}},Ms=class extends fn{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new hi(this.element)}},pn=class{constructor(e,t){this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}clickBubbled=e=>{this.respondsToEventTarget(e.target)?this.clickEvent=e:delete this.clickEvent};linkClicked=e=>{this.clickEvent&&this.respondsToEventTarget(e.target)&&e.target instanceof Element&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url,e.detail.originalEvent)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.detail.url,e.detail.originalEvent)),delete this.clickEvent};willVisit=e=>{delete this.clickEvent};respondsToEventTarget(e){let t=e instanceof Element?e:e instanceof Node?e.parentElement:null;return t&&t.closest("turbo-frame, html")==this.element}},mn=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)};clickBubbled=e=>{if(e instanceof MouseEvent&&this.clickEventIsSignificant(e)){let t=e.composedPath&&e.composedPath()[0]||e.target,r=od(t);if(r&&sd(r)){let n=pl(r);this.delegate.willFollowLinkToLocation(r,n,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(r,n))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}},gn=class{constructor(e,t){this.delegate=e,this.linkInterceptor=new mn(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,r){return this.delegate.willSubmitFormLinkToLocation(e,t,r)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,t){let r=document.createElement("form"),n="hidden";for(let[g,w]of t.searchParams)r.append(Object.assign(document.createElement("input"),{type:n,name:g,value:w}));let s=Object.assign(t,{search:""});r.setAttribute("data-turbo","true"),r.setAttribute("action",s.href),r.setAttribute("hidden","");let o=e.getAttribute("data-turbo-method");o&&r.setAttribute("method",o);let a=e.getAttribute("data-turbo-frame");a&&r.setAttribute("data-turbo-frame",a);let l=kt(e);l&&r.setAttribute("data-turbo-action",l);let f=e.getAttribute("data-turbo-confirm");f&&r.setAttribute("data-turbo-confirm",f),e.hasAttribute("data-turbo-stream")&&r.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,r),document.body.appendChild(r),r.addEventListener("turbo:submit-end",()=>r.remove(),{once:!0}),requestAnimationFrame(()=>r.requestSubmit())}},vn=class{static async preservingPermanentElements(e,t,r){let n=new this(e,t);n.enter(),await r(),n.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(let e in this.permanentElementMap){let[t,r]=this.permanentElementMap[e];this.delegate.enteringBardo(t,r),this.replaceNewPermanentElementWithPlaceholder(r)}}leave(){for(let e in this.permanentElementMap){let[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){let t=Ad(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){let t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){this.getPlaceholderById(e.id)?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}};function Ad(i){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",i.id),e}var $i=class{#e=null;constructor(e,t,r,n,s=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=n,this.willRender=s,this.renderElement=r,this.promise=new Promise((o,a)=>this.resolvingFunctions={resolve:o,reject:a})}get shouldRender(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await vn.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){let e=this.connectedSnapshot.firstAutofocusableElement;e&&e.focus()}enteringBardo(e){this.#e||e.contains(this.currentSnapshot.activeElement)&&(this.#e=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.#e)&&this.#e instanceof HTMLElement&&(this.#e.focus(),this.#e=null)}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get renderMethod(){return"replace"}},ji=class extends $i{static renderElement(e,t){let r=document.createRange();r.selectNodeContents(e),r.deleteContents();let n=t,s=n.ownerDocument?.createRange();s&&(s.selectNodeContents(n),e.appendChild(s.extractContents()))}constructor(e,t,r,n,s,o=!0){super(t,r,n,s,o),this.delegate=e}get shouldRender(){return!0}async render(){await ai(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await ai(),this.focusFirstAutofocusableElement(),await ai(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){let e=this.currentElement.firstElementChild,t=Td(this.currentElement.getAttribute("data-autoscroll-block"),"end"),r=Sd(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:t,behavior:r}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let t=qi(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function Td(i,e){return i=="end"||i=="start"||i=="center"||i=="nearest"?i:e}function Sd(i,e){return i=="auto"||i=="smooth"?i:e}var Ps=class i{static animationDuration=300;static get defaultCSS(){return ul`
|
64
64
|
.turbo-progress-bar {
|
65
65
|
position: fixed;
|
66
66
|
display: block;
|
@@ -74,7 +74,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error
|
|
74
74
|
opacity ${i.animationDuration/2}ms ${i.animationDuration/2}ms ease-in;
|
75
75
|
transform: translate3d(0, 0, 0);
|
76
76
|
}
|
77
|
-
`}hiding=!1;value=0;visible=!1;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,i.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,i.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}trickle=()=>{this.setValue(this.value+Math.random()/100)};refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){let e=document.createElement("style");return e.type="text/css",e.textContent=i.defaultCSS,this.cspNonce&&(e.nonce=this.cspNonce),e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}get cspNonce(){return ui("csp-nonce")}},Ps=class extends hi{detailsByOuterHTML=this.children.filter(e=>!Ld(e)).map(e=>Od(e)).reduce((e,t)=>{let{outerHTML:r}=t,n=r in e?e[r]:{type:Sd(t),tracked:kd(t),elements:[]};return{...e,[r]:{...n,elements:[...n.elements,t]}}},{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter(r=>!(r in t.detailsByOuterHTML)).map(r=>this.detailsByOuterHTML[r]).filter(({type:r})=>r==e).map(({elements:[r]})=>r)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:r,tracked:n,elements:s}=this.detailsByOuterHTML[t];return r==null&&!n?[...e,...s]:s.length>1?[...e,...s.slice(1)]:e},[])}getMetaValue(e){let t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,r)=>{let{elements:[n]}=this.detailsByOuterHTML[r];return Id(n,e)?n:t},void 0|void 0)}};function Sd(i){if(xd(i))return"script";if(Cd(i))return"stylesheet"}function kd(i){return i.getAttribute("data-turbo-track")=="reload"}function xd(i){return i.localName=="script"}function Ld(i){return i.localName=="noscript"}function Cd(i){let e=i.localName;return e=="style"||e=="link"&&i.getAttribute("rel")=="stylesheet"}function Id(i,e){return i.localName=="meta"&&i.getAttribute("name")==e}function Od(i){return i.hasAttribute("nonce")&&i.setAttribute("nonce",""),i}var Me=class i extends hi{static fromHTMLString(e=""){return this.fromDocument(ll(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:r}){return new this(e,t,new Ps(r))}constructor(e,t,r){super(t),this.documentElement=e,this.headSnapshot=r}clone(){let e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),r=e.querySelectorAll("select");for(let[n,s]of t.entries()){let o=r[n];for(let a of o.selectedOptions)a.selected=!1;for(let a of s.selectedOptions)o.options[a.index].selected=!0}for(let n of e.querySelectorAll('input[type="password"]'))n.value="";return new i(this.documentElement,e,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get headElement(){return this.headSnapshot.element}get rootLocation(){let e=this.getSetting("root")??"/";return le(e)}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}get prefersViewTransitions(){return this.headSnapshot.getMetaValue("view-transition")==="same-origin"}get shouldMorphPage(){return this.getSetting("refresh-method")==="morph"}get shouldPreserveScrollPosition(){return this.getSetting("refresh-scroll")==="preserve"}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},Ds=class{#e=!1;#t=Promise.resolve();renderChange(e,t){return e&&this.viewTransitionsAvailable&&!this.#e?(this.#e=!0,this.#t=this.#t.then(async()=>{await document.startViewTransition(t).finished})):this.#t=this.#t.then(t),this.#t}get viewTransitionsAvailable(){return document.startViewTransition}},Rd={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},ln={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},Ze={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},ci={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},Md={advance:"forward",restore:"back",replace:"none"},Fs=class{identifier=ot();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=Ze.initialized;viewTransitioner=new Ds;constructor(e,t,r,n={}){this.delegate=e,this.location=t,this.restorationIdentifier=r||ot();let{action:s,historyChanged:o,referrer:a,snapshot:l,snapshotHTML:f,response:u,visitCachedSnapshot:g,willRender:w,updateHistory:y,shouldCacheSnapshot:_,acceptsStreamResponse:L,direction:k}={...Rd,...n};this.action=s,this.historyChanged=o,this.referrer=a,this.snapshot=l,this.snapshotHTML=f,this.response=u,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=g,this.willRender=w,this.updateHistory=y,this.scrolled=!w,this.shouldCacheSnapshot=_,this.acceptsStreamResponse=L,this.direction=k||Md[s]}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==Ze.initialized&&(this.recordTimingMetric(ln.visitStart),this.state=Ze.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==Ze.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=Ze.canceled)}complete(){this.state==Ze.started&&(this.recordTimingMetric(ln.visitEnd),this.adapter.visitCompleted(this),this.state=Ze.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==Ze.started&&(this.state=Ze.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){let e=this.location.href===this.referrer?.href?"replace":this.action,t=ul(e);this.history.update(t,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new xt(this,ke.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(ln.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;tl(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(ln.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,tl(e)&&t!=null){let r=Me.fromHTMLString(t);await this.renderPageSnapshot(r,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(Me.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!St(this.location)||e.hasAnchor(St(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return Me.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){let e=this.getCachedSnapshot();if(e){let t=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage||this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(e,t),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&this.response?.redirected&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)})}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(at.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let r=await t.responseHTML,{redirected:n,statusCode:s}=t;r==null?this.recordResponse({statusCode:ci.contentTypeMismatch,redirected:n}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:s,responseHTML:r,redirected:n}))}async requestFailedWithResponse(e,t){let r=await t.responseHTML,{redirected:n,statusCode:s}=t;r==null?this.recordResponse({statusCode:ci.contentTypeMismatch,redirected:n}):this.recordResponse({statusCode:s,responseHTML:r,redirected:n})}requestErrored(e,t){this.recordResponse({statusCode:ci.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){!this.scrolled&&!this.view.forceReloaded&&!this.view.shouldPreserveScrollPosition(this)&&(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=St(this.location);if(e!=null)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=new Date().getTime()}getTimingMetrics(){return{...this.timingMetrics}}getHistoryMethodForAction(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return typeof this.response=="object"}shouldIssueRequest(){return this.isSamePage?!1:this.action=="restore"?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),this.frame=await ai(),await e(),delete this.frame}async renderPageSnapshot(e,t){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(e),async()=>{await this.view.renderPage(e,t,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};function tl(i){return i>=200&&i<300}var Bs=class{progressBar=new Ms;constructor(e){this.session=e}visitProposedToLocation(e,t){st(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||ot(),t):window.location.href=e.toString()}visitStarted(e){this.location=e.location,e.loadCachedSnapshot(),e.issueRequest(),e.goToSamePageAnchor()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||e.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case ci.networkFailure:case ci.timeoutFailure:case ci.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:t}});default:return e.loadResponse()}}visitRequestFinished(e){}visitCompleted(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(e){this.reload(e)}visitFailed(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(e){}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){this.formProgressBarTimeout==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}showProgressBar=()=>{this.progressBar.show()};reload(e){Q("turbo:reload",{detail:e}),window.location.href=this.location?.toString()||window.location.href}get navigator(){return this.session.navigator}},Ns=class{selector="[data-turbo-temporary]";deprecatedSelector="[data-turbo-cache=false]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=e=>{for(let t of this.temporaryElements)t.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){let e=document.querySelectorAll(this.deprecatedSelector);return e.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...e]}},Hs=class{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new fn(this,t),this.formSubmitObserver=new Vi(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,r){return this.#t(e)}linkClickIntercepted(e,t,r){let n=this.#i(e);n&&n.delegate.linkClickIntercepted(e,t,r)}willSubmitForm(e,t){return e.closest("turbo-frame")==null&&this.#e(e,t)&&this.#t(e,t)}formSubmitted(e,t){let r=this.#i(e,t);r&&r.delegate.formSubmitted(e,t)}#e(e,t){let r=ro(e,t),n=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),s=le(n?.content??"/");return this.#t(e,t)&&st(r,s)}#t(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){let n=this.#i(e,t);return n?n!=e.closest("turbo-frame"):!1}else return!1}#i(e,t){let r=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(r&&r!="_top"){let n=this.element.querySelector(`#${r}:not([disabled])`);if(n instanceof Be)return n}}},qs=class{location;restorationIdentifier=ot();restorationData={};started=!1;pageLoaded=!1;currentIndex=0;constructor(e){this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,r=ot()){e===history.pushState&&++this.currentIndex;let n={turbo:{restorationIdentifier:r,restorationIndex:this.currentIndex}};e.call(history,n,"",t.href),this.location=t,this.restorationIdentifier=r}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){let{restorationIdentifier:t}=this,r=this.restorationData[t];this.restorationData[t]={...r,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=e=>{if(this.shouldHandlePopState()){let{turbo:t}=e.state||{};if(t){this.location=new URL(window.location.href);let{restorationIdentifier:r,restorationIndex:n}=t;this.restorationIdentifier=r;let s=n>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,r,s),this.currentIndex=n}}};onPageLoad=async e=>{await Zh(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},zs=class{started=!1;#e=null;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.readyState==="loading"?this.eventTarget.addEventListener("DOMContentLoaded",this.#t,{once:!0}):this.#t())}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#r,!0),this.started=!1)}#t=()=>{this.eventTarget.addEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#r,!0),this.started=!0};#i=e=>{if(ui("turbo-prefetch")==="false")return;let t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&this.#a(t)){let n=t,s=fl(n);if(this.delegate.canPrefetchRequestToLocation(n,s)){this.#e=n;let o=new xt(this,ke.get,s,new URLSearchParams,t);oi.setLater(s.toString(),o,this.#o)}}};#n=e=>{e.target===this.#e&&this.#s()};#s=()=>{oi.clear(),this.#e=null};#r=e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="get"){let t=oi.get(e.detail.url.toString());t&&(e.detail.fetchRequest=t),oi.clear()}};prepareRequest(e){let t=e.target;e.headers["X-Sec-Purpose"]="prefetch";let r=t.closest("turbo-frame"),n=t.getAttribute("data-turbo-frame")||r?.getAttribute("target")||r?.id;n&&n!=="_top"&&(e.headers["Turbo-Frame"]=n)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#o(){return Number(ui("turbo-prefetch-cache-time"))||dd}#a(e){return!(!e.getAttribute("href")||Pd(e)||Dd(e)||Fd(e)||Bd(e)||Hd(e))}},Pd=i=>i.origin!==document.location.origin||!["http:","https:"].includes(i.protocol)||i.hasAttribute("target"),Dd=i=>i.pathname+i.search===document.location.pathname+document.location.search||i.href.startsWith("#"),Fd=i=>{if(i.getAttribute("data-turbo-prefetch")==="false"||i.getAttribute("data-turbo")==="false")return!0;let e=li(i,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},Bd=i=>{let e=i.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||Nd(i)||i.hasAttribute("data-turbo-confirm")||i.hasAttribute("data-turbo-stream"))},Nd=i=>i.hasAttribute("data-remote")||i.hasAttribute("data-behavior")||i.hasAttribute("data-confirm")||i.hasAttribute("data-method"),Hd=i=>Q("turbo:before-prefetch",{target:i,cancelable:!0}).defaultPrevented,Vs=class{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,r={}){this.stop(),this.currentVisit=new Fs(this,le(e),t,{referrer:this.location,...r}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new zi(this,e,t,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(e){typeof this.adapter.formSubmissionStarted=="function"&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){let r=await t.responseHTML;if(r){let n=e.isSafe;n||this.view.clearSnapshotCache();let{statusCode:s,redirected:o}=t,l={action:this.#e(e,t),shouldCacheSnapshot:n,response:{statusCode:s,responseHTML:r,redirected:o}};this.proposeVisit(t.location,l)}}}async formSubmissionFailedWithResponse(e,t){let r=await t.responseHTML;if(r){let n=Me.fromHTMLString(r);t.serverError?await this.view.renderError(n,this.currentVisit):await this.view.renderPage(n,!1,!0,this.currentVisit),n.shouldPreserveScrollPosition||this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e)}locationWithActionIsSamePage(e,t){let r=St(e),n=St(this.view.lastRenderedLocation),s=t==="restore"&&typeof r>"u";return t!=="replace"&&Ls(e)===Ls(this.view.lastRenderedLocation)&&(s||r!=null&&r!==n)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#e(e,t){let{submitter:r,formElement:n}=e;return kt(r,n)||this.#t(t)}#t(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}},At={initial:0,loading:1,interactive:2,complete:3},$s=class{stage=At.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==At.initial&&(this.stage=At.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=>{let{readyState:e}=this;e=="interactive"?this.pageIsInteractive():e=="complete"&&this.pageIsComplete()};pageIsInteractive(){this.stage==At.loading&&(this.stage=At.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==At.interactive&&(this.stage=At.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}},js=class{started=!1;constructor(e){this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}},Us=class{render({fragment:e}){gn.preservingPermanentElements(this,qd(e),()=>{zd(e,()=>{Vd(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}};function qd(i){let e=bl(document.documentElement),t={};for(let r of e){let{id:n}=r;for(let s of i.querySelectorAll("turbo-stream")){let o=vl(s.templateElement.content,n);o&&(t[n]=[r,o])}}return t}async function zd(i,e){let t=`turbo-stream-autofocus-${ot()}`,r=i.querySelectorAll("turbo-stream"),n=$d(r),s=null;if(n&&(n.id?s=n.id:s=t,n.id=s),e(),await ai(),(document.activeElement==null||document.activeElement==document.body)&&s){let a=document.getElementById(s);no(a)&&a.focus(),a&&a.id==t&&a.removeAttribute("id")}}async function Vd(i){let[e,t]=await rd(i,()=>document.activeElement),r=e&&e.id;if(r){let n=document.getElementById(r);no(n)&&n!=t&&n.focus()}}function $d(i){for(let e of i){let t=dl(e.templateElement.content);if(t)return t}return null}var Ws=class{sources=new Set;#e=!1;constructor(e){this.delegate=e}start(){this.#e||(this.#e=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.#e&&(this.#e=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}inspectFetchResponse=e=>{let t=jd(e);t&&Ud(t)&&(e.preventDefault(),this.receiveMessageResponse(t))};receiveMessageEvent=e=>{this.#e&&typeof e.data=="string"&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){let t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(at.wrap(e))}};function jd(i){let e=i.detail?.fetchResponse;if(e instanceof Hi)return e}function Ud(i){return(i.contentType??"").startsWith(at.contentType)}var vn=class extends $i{static renderElement(e,t){let{documentElement:r,body:n}=document;r.replaceChild(t,n)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){let{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(let e of this.scriptElements){let t=e.parentNode;if(t){let r=qi(e);t.replaceChild(r,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}},Wd=function(){let i=new Set,e={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:w,afterNodeAdded:w,beforeNodeMorphed:w,afterNodeMorphed:w,beforeNodeRemoved:w,afterNodeRemoved:w,beforeAttributeUpdated:w},head:{style:"merge",shouldPreserve:function(h){return h.getAttribute("im-preserve")==="true"},shouldReAppend:function(h){return h.getAttribute("im-re-append")==="true"},shouldRemove:w,afterHeadMorphed:w}};function t(h,d,p={}){h instanceof Document&&(h=h.documentElement),typeof d=="string"&&(d=T(d));let b=O(d),E=_(h,b,p);return r(h,b,E)}function r(h,d,p){if(p.head.block){let b=h.querySelector("head"),E=d.querySelector("head");if(b&&E){let v=g(E,b,p);Promise.all(v).then(function(){r(h,d,Object.assign(p,{head:{block:!1,ignore:!0}}))});return}}if(p.morphStyle==="innerHTML")return o(d,h,p),h.children;if(p.morphStyle==="outerHTML"||p.morphStyle==null){let b=F(d,h,p),E=b?.previousSibling,v=b?.nextSibling,R=s(h,b,p);return b?x(E,R,v):[]}else throw"Do not understand how to morph style "+p.morphStyle}function n(h,d){return d.ignoreActiveValue&&h===document.activeElement&&h!==document.body}function s(h,d,p){if(!(p.ignoreActive&&h===document.activeElement))return d==null?p.callbacks.beforeNodeRemoved(h)===!1?h:(h.remove(),p.callbacks.afterNodeRemoved(h),null):k(h,d)?(p.callbacks.beforeNodeMorphed(h,d)===!1||(h instanceof HTMLHeadElement&&p.head.ignore||(h instanceof HTMLHeadElement&&p.head.style!=="morph"?g(d,h,p):(l(d,h,p),n(h,p)||o(d,h,p))),p.callbacks.afterNodeMorphed(h,d)),h):p.callbacks.beforeNodeRemoved(h)===!1||p.callbacks.beforeNodeAdded(d)===!1?h:(h.parentElement.replaceChild(d,h),p.callbacks.afterNodeAdded(d),p.callbacks.afterNodeRemoved(h),d)}function o(h,d,p){let b=h.firstChild,E=d.firstChild,v;for(;b;){if(v=b,b=v.nextSibling,E==null){if(p.callbacks.beforeNodeAdded(v)===!1)return;d.appendChild(v),p.callbacks.afterNodeAdded(v),X(p,v);continue}if(L(v,E,p)){s(E,v,p),E=E.nextSibling,X(p,v);continue}let R=q(h,d,v,E,p);if(R){E=P(E,R,p),s(R,v,p),X(p,v);continue}let M=B(h,d,v,E,p);if(M){E=P(E,M,p),s(M,v,p),X(p,v);continue}if(p.callbacks.beforeNodeAdded(v)===!1)return;d.insertBefore(v,E),p.callbacks.afterNodeAdded(v),X(p,v)}for(;E!==null;){let R=E;E=E.nextSibling,U(R,p)}}function a(h,d,p,b){return h==="value"&&b.ignoreActiveValue&&d===document.activeElement?!0:b.callbacks.beforeAttributeUpdated(h,d,p)===!1}function l(h,d,p){let b=h.nodeType;if(b===1){let E=h.attributes,v=d.attributes;for(let R of E)a(R.name,d,"update",p)||d.getAttribute(R.name)!==R.value&&d.setAttribute(R.name,R.value);for(let R=v.length-1;0<=R;R--){let M=v[R];a(M.name,d,"remove",p)||h.hasAttribute(M.name)||d.removeAttribute(M.name)}}(b===8||b===3)&&d.nodeValue!==h.nodeValue&&(d.nodeValue=h.nodeValue),n(d,p)||u(h,d,p)}function f(h,d,p,b){if(h[p]!==d[p]){let E=a(p,d,"update",b);E||(d[p]=h[p]),h[p]?E||d.setAttribute(p,h[p]):a(p,d,"remove",b)||d.removeAttribute(p)}}function u(h,d,p){if(h instanceof HTMLInputElement&&d instanceof HTMLInputElement&&h.type!=="file"){let b=h.value,E=d.value;f(h,d,"checked",p),f(h,d,"disabled",p),h.hasAttribute("value")?b!==E&&(a("value",d,"update",p)||(d.setAttribute("value",b),d.value=b)):a("value",d,"remove",p)||(d.value="",d.removeAttribute("value"))}else if(h instanceof HTMLOptionElement)f(h,d,"selected",p);else if(h instanceof HTMLTextAreaElement&&d instanceof HTMLTextAreaElement){let b=h.value,E=d.value;if(a("value",d,"update",p))return;b!==E&&(d.value=b),d.firstChild&&d.firstChild.nodeValue!==b&&(d.firstChild.nodeValue=b)}}function g(h,d,p){let b=[],E=[],v=[],R=[],M=p.head.style,ce=new Map;for(let z of h.children)ce.set(z.outerHTML,z);for(let z of d.children){let ne=ce.has(z.outerHTML),de=p.head.shouldReAppend(z),Le=p.head.shouldPreserve(z);ne||Le?de?E.push(z):(ce.delete(z.outerHTML),v.push(z)):M==="append"?de&&(E.push(z),R.push(z)):p.head.shouldRemove(z)!==!1&&E.push(z)}R.push(...ce.values());let N=[];for(let z of R){let ne=document.createRange().createContextualFragment(z.outerHTML).firstChild;if(p.callbacks.beforeNodeAdded(ne)!==!1){if(ne.href||ne.src){let de=null,Le=new Promise(function(Lt){de=Lt});ne.addEventListener("load",function(){de()}),N.push(Le)}d.appendChild(ne),p.callbacks.afterNodeAdded(ne),b.push(ne)}}for(let z of E)p.callbacks.beforeNodeRemoved(z)!==!1&&(d.removeChild(z),p.callbacks.afterNodeRemoved(z));return p.head.afterHeadMorphed(d,{added:b,kept:v,removed:E}),N}function w(){}function y(h){let d={};return Object.assign(d,e),Object.assign(d,h),d.callbacks={},Object.assign(d.callbacks,e.callbacks),Object.assign(d.callbacks,h.callbacks),d.head={},Object.assign(d.head,e.head),Object.assign(d.head,h.head),d}function _(h,d,p){return p=y(p),{target:h,newContent:d,config:p,morphStyle:p.morphStyle,ignoreActive:p.ignoreActive,ignoreActiveValue:p.ignoreActiveValue,idMap:xe(h,d),deadIds:new Set,callbacks:p.callbacks,head:p.head}}function L(h,d,p){return h==null||d==null?!1:h.nodeType===d.nodeType&&h.tagName===d.tagName?h.id!==""&&h.id===d.id?!0:W(p,h,d)>0:!1}function k(h,d){return h==null||d==null?!1:h.nodeType===d.nodeType&&h.tagName===d.tagName}function P(h,d,p){for(;h!==d;){let b=h;h=h.nextSibling,U(b,p)}return X(p,d),d.nextSibling}function q(h,d,p,b,E){let v=W(E,p,d),R=null;if(v>0){let M=b,ce=0;for(;M!=null;){if(L(p,M,E))return M;if(ce+=W(E,M,h),ce>v)return null;M=M.nextSibling}}return R}function B(h,d,p,b,E){let v=b,R=p.nextSibling,M=0;for(;v!=null;){if(W(E,v,h)>0)return null;if(k(p,v))return v;if(k(R,v)&&(M++,R=R.nextSibling,M>=2))return null;v=v.nextSibling}return v}function T(h){let d=new DOMParser,p=h.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(p.match(/<\/html>/)||p.match(/<\/head>/)||p.match(/<\/body>/)){let b=d.parseFromString(h,"text/html");if(p.match(/<\/html>/))return b.generatedByIdiomorph=!0,b;{let E=b.firstChild;return E?(E.generatedByIdiomorph=!0,E):null}}else{let E=d.parseFromString("<body><template>"+h+"</template></body>","text/html").body.querySelector("template").content;return E.generatedByIdiomorph=!0,E}}function O(h){if(h==null)return document.createElement("div");if(h.generatedByIdiomorph)return h;if(h instanceof Node){let d=document.createElement("div");return d.append(h),d}else{let d=document.createElement("div");for(let p of[...h])d.append(p);return d}}function x(h,d,p){let b=[],E=[];for(;h!=null;)b.push(h),h=h.previousSibling;for(;b.length>0;){let v=b.pop();E.push(v),d.parentElement.insertBefore(v,d)}for(E.push(d);p!=null;)b.push(p),E.push(p),p=p.nextSibling;for(;b.length>0;)d.parentElement.insertBefore(b.pop(),d.nextSibling);return E}function F(h,d,p){let b;b=h.firstChild;let E=b,v=0;for(;b;){let R=j(b,d,p);R>v&&(E=b,v=R),b=b.nextSibling}return E}function j(h,d,p){return k(h,d)?.5+W(p,h,d):0}function U(h,d){X(d,h),d.callbacks.beforeNodeRemoved(h)!==!1&&(h.remove(),d.callbacks.afterNodeRemoved(h))}function Y(h,d){return!h.deadIds.has(d)}function H(h,d,p){return(h.idMap.get(p)||i).has(d)}function X(h,d){let p=h.idMap.get(d)||i;for(let b of p)h.deadIds.add(b)}function W(h,d,p){let b=h.idMap.get(d)||i,E=0;for(let v of b)Y(h,v)&&H(h,v,p)&&++E;return E}function be(h,d){let p=h.parentElement,b=h.querySelectorAll("[id]");for(let E of b){let v=E;for(;v!==p&&v!=null;){let R=d.get(v);R==null&&(R=new Set,d.set(v,R)),R.add(E.id),v=v.parentElement}}}function xe(h,d){let p=new Map;return be(h,p),be(d,p),p}return{morph:t,defaults:e}}(),di=class extends $i{static renderElement(e,t){document.body&&t instanceof HTMLBodyElement?document.body.replaceWith(t):document.documentElement.appendChild(t)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){if(!this.newSnapshot.isVisitable)return{reason:"turbo_visit_control_is_reload"};if(!this.trackedElementsAreIdentical)return{reason:"tracked_element_mismatch"}}async prepareToRender(){this.#e(),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#e(){let{documentElement:e}=this.currentSnapshot,{lang:t}=this.newSnapshot;t?e.setAttribute("lang",t):e.removeAttribute("lang")}async mergeHead(){let e=this.mergeProvisionalElements(),t=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await e,await t,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){let e=[];for(let t of this.newHeadStylesheetElements)e.push(ed(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(qi(e))}removeUnusedDynamicStylesheetElements(){for(let e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){let e=[...this.newHeadProvisionalElements];for(let t of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(t,e)||document.head.removeChild(t);for(let t of e)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(let[r,n]of t.entries()){if(e.tagName=="TITLE"){if(n.tagName!="TITLE")continue;if(e.innerHTML==n.innerHTML)return t.splice(r,1),!0}if(n.isEqualNode(e))return t.splice(r,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(let e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let t=qi(e);e.replaceWith(t)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(e=>e.getAttribute("data-turbo-track")==="dynamic")}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}},Ks=class extends di{async render(){this.willRender&&await this.#e()}get renderMethod(){return"morph"}async#e(){this.#t(this.currentElement,this.newElement),this.#a(),Q("turbo:morph",{detail:{currentElement:this.currentElement,newElement:this.newElement}})}#t(e,t,r="outerHTML"){this.isMorphingTurboFrame=this.#l(e),Wd.morph(e,t,{morphStyle:r,callbacks:{beforeNodeAdded:this.#i,beforeNodeMorphed:this.#n,beforeAttributeUpdated:this.#s,beforeNodeRemoved:this.#o,afterNodeMorphed:this.#r}})}#i=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));#n=(e,t)=>{if(e instanceof HTMLElement)return!e.hasAttribute("data-turbo-permanent")&&(this.isMorphingTurboFrame||!this.#l(e))?!Q("turbo:before-morph-element",{cancelable:!0,target:e,detail:{newElement:t}}).defaultPrevented:!1};#s=(e,t,r)=>!Q("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:r}}).defaultPrevented;#r=(e,t)=>{t instanceof HTMLElement&&Q("turbo:morph-element",{target:e,detail:{newElement:t}})};#o=e=>this.#n(e);#a(){this.#d().forEach(e=>{this.#l(e)&&(this.#u(e),e.reload())})}#u(e){e.addEventListener("turbo:before-frame-render",t=>{t.detail.render=this.#h},{once:!0})}#h=(e,t)=>{Q("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),this.#t(e,t.children,"innerHTML")};#l(e){return e.src&&e.refresh==="morph"}#d(){return Array.from(document.querySelectorAll("turbo-frame[src]")).filter(e=>!e.closest("[data-turbo-permanent]"))}},Gs=class{keys=[];snapshots={};constructor(e){this.size=e}has(e){return an(e)in this.snapshots}get(e){if(this.has(e)){let t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){this.snapshots={}}read(e){return this.snapshots[an(e)]}write(e,t){this.snapshots[an(e)]=t}touch(e){let t=an(e),r=this.keys.indexOf(t);r>-1&&this.keys.splice(r,1),this.keys.unshift(t),this.trim()}trim(){for(let e of this.keys.splice(this.size))delete this.snapshots[e]}},Ys=class extends dn{snapshotCache=new Gs(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,r=!0,n){let o=this.isPageRefresh(n)&&this.snapshot.shouldMorphPage?Ks:di,a=new o(this.snapshot,e,di.renderElement,t,r);return a.shouldRender?n?.changeHistory():this.forceReloaded=!0,this.render(a)}renderError(e,t){t?.changeHistory();let r=new vn(this.snapshot,e,vn.renderElement,!1);return this.render(r)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();let{lastRenderedLocation:t}=this;await al();let r=e.clone();return this.snapshotCache.put(t,r),r}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}isPageRefresh(e){return!e||this.lastRenderedLocation.pathname===e.location.pathname&&e.action==="replace"}shouldPreserveScrollPosition(e){return this.isPageRefresh(e)&&this.snapshot.shouldPreserveScrollPosition}get snapshot(){return Me.fromElement(this.element)}},Xs=class{selector="a[data-turbo-preload]";constructor(e,t){this.delegate=e,this.snapshotCache=t}start(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.#e):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",this.#e)}preloadOnLoadLinksForView(e){for(let t of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(t)&&this.preloadURL(t)}async preloadURL(e){let t=new URL(e.href);if(this.snapshotCache.has(t))return;await new xt(this,ke.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{let r=await t.responseHTML,n=Me.fromHTMLString(r);this.snapshotCache.put(e.url,n)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#e=()=>{this.preloadOnLoadLinksForView(document.body)}},Zs=class{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.#e("")}exemptPageFromCache(){this.#e("no-cache")}exemptPageFromPreview(){this.#e("no-preview")}#e(e){id("turbo-cache-control",e)}},Qs=class{navigator=new Vs(this);history=new qs(this);view=new Ys(this,document.documentElement);adapter=new Bs(this);pageObserver=new $s(this);cacheObserver=new Ns;linkPrefetchObserver=new zs(this,document);linkClickObserver=new pn(this,window);formSubmitObserver=new Vi(this,document);scrollObserver=new js(this);streamObserver=new Ws(this);formLinkClickObserver=new mn(this,document.documentElement);frameRedirector=new Hs(this,document.documentElement);streamMessageRenderer=new Us;cache=new Zs(this);drive=!0;enabled=!0;progressBarDelay=500;started=!1;formMode="on";#e=150;constructor(e){this.recentRequests=e,this.preloader=new Xs(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){let r=t.frame?document.getElementById(t.frame):null;if(r instanceof Be){let n=t.action||kt(r);r.delegate.proposeVisitIfNavigatedWithAction(r,n),r.src=e.toString()}else this.navigator.proposeVisit(le(e),t)}refresh(e,t){t&&this.recentRequests.has(t)||this.visit(e,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(at.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){this.progressBarDelay=e}setFormMode(e){this.formMode=e}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#e}set pageRefreshDebouncePeriod(e){this.refresh=od(this.debouncedRefresh.bind(this),e),this.#e=e}shouldPreloadLink(e){let t=e.hasAttribute("data-turbo-method"),r=e.hasAttribute("data-turbo-stream"),n=e.getAttribute("data-turbo-frame"),s=n=="_top"?null:document.getElementById(n)||li(e,"turbo-frame:not([disabled])");if(t||r||s instanceof Be)return!1;{let o=new URL(e.href);return this.elementIsNavigatable(e)&&st(o,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,t,r){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0,direction:r}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&st(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&st(t,this.snapshot.rootLocation)}willFollowLinkToLocation(e,t,r){return this.elementIsNavigatable(e)&&st(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,r)}followedLinkToLocation(e,t){let r=this.getActionForLink(e),n=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:r,acceptsStreamResponse:n})}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){il(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(un(document.documentElement),this.view.markVisitDirection(e.direction)),il(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),hn(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){let r=ro(e,t);return this.submissionIsNavigatable(e,t)&&st(le(r),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){this.navigator.currentVisit?.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){let r=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:n,detail:{render:s}}=r;return this.view.renderer&&s&&(this.view.renderer.renderElement=s),!n}viewRenderedSnapshot(e,t,r){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(r)}preloadOnLoadLinksForView(e){this.preloader.preloadOnLoadLinksForView(e)}viewInvalidated(e){this.adapter.pageInvalidated(e)}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t,r){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,r).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,r){return Q("turbo:click",{target:e,detail:{url:t.href,originalEvent:r},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return Q("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return Q("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return Q("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return Q("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return Q("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return Q("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return Q("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return Q("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if(this.formMode=="off")return!1;{let r=t?this.elementIsNavigatable(t):!0;return this.formMode=="optin"?r&&e.closest('[data-turbo="true"]')!=null:r&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){let t=li(e,"[data-turbo]"),r=li(e,"turbo-frame");return this.drive||r?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return kt(e)||"advance"}get snapshot(){return this.view.snapshot}};function il(i){Object.defineProperties(i,Kd)}var Kd={absoluteURL:{get(){return this.toString()}}},Z=new Qs(pl),{cache:Gd,navigator:Yd}=Z;function yl(){Z.start()}function Xd(i){Z.registerAdapter(i)}function Zd(i,e){Z.visit(i,e)}function wl(i){Z.connectStreamSource(i)}function El(i){Z.disconnectStreamSource(i)}function Qd(i){Z.renderStreamMessage(i)}function Jd(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),Z.clearCache()}function ef(i){Z.setProgressBarDelay(i)}function tf(i){zi.confirmMethod=i}function rf(i){Z.setFormMode(i)}var nf=Object.freeze({__proto__:null,navigator:Yd,session:Z,cache:Gd,PageRenderer:di,PageSnapshot:Me,FrameRenderer:ji,fetch:ml,start:yl,registerAdapter:Xd,visit:Zd,connectStreamSource:wl,disconnectStreamSource:El,renderStreamMessage:Qd,clearCache:Jd,setProgressBarDelay:ef,setConfirmMethod:tf,setFormMode:rf}),Js=class extends Error{},eo=class{fetchResponseLoaded=e=>Promise.resolve();#e=null;#t=()=>{};#i=!1;#n=!1;#s=new Set;action=null;constructor(e){this.element=e,this.view=new Rs(this,this.element),this.appearanceObserver=new Is(this,this.element),this.formLinkClickObserver=new mn(this,this.element),this.linkInterceptor=new fn(this,this.element),this.restorationIdentifier=ot(),this.formSubmitObserver=new Vi(this,this.element)}connect(){this.#i||(this.#i=!0,this.loadingStyle==si.lazy?this.appearanceObserver.start():this.#r(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#i&&(this.#i=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==si.eager&&this.#r()}sourceURLChanged(){this.#v("src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==si.eager||this.#n)&&this.#r())}sourceURLReloaded(){let{src:e}=this.element;return this.element.removeAttribute("complete"),this.element.src=null,this.element.src=e,this.element.loaded}loadingStyleChanged(){this.loadingStyle==si.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#r())}async#r(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#a(le(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#n=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{let t=await e.responseHTML;if(t){let r=ll(t);Me.fromDocument(r).isVisitable?await this.#o(e,r):await this.#h(e)}}finally{this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,kt(e)),this.#r()}willSubmitFormLinkToLocation(e){return this.#f(e)}submittedFormLinkToLocation(e,t,r){let n=this.#c(e);n&&r.setAttribute("data-turbo-frame",n.id)}shouldInterceptLinkClick(e,t,r){return this.#f(e)}linkClickIntercepted(e,t){this.#u(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.#f(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new zi(this,e,t);let{fetchRequest:r}=this.formSubmission;this.prepareRequest(r),this.formSubmission.start()}prepareRequest(e){e.headers["Turbo-Frame"]=this.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&&e.acceptResponseType(at.contentType)}requestStarted(e){un(this.element)}requestPreventedHandlingResponse(e,t){this.#t()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.#t()}async requestFailedWithResponse(e,t){await this.loadResponse(t),this.#t()}requestErrored(e,t){console.error(t),this.#t()}requestFinished(e){hn(this.element)}formSubmissionStarted({formElement:e}){un(e,this.#c(e))}formSubmissionSucceededWithResponse(e,t){let r=this.#c(e.formElement,e.submitter);r.delegate.proposeVisitIfNavigatedWithAction(r,kt(e.submitter,e.formElement,r)),r.delegate.loadResponse(t),e.isSafe||Z.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),Z.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){hn(e,this.#c(e))}allowsImmediateRender({element:e},t){let r=Q("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0}),{defaultPrevented:n,detail:{render:s}}=r;return this.view.renderer&&s&&(this.view.renderer.renderElement=s),!n}viewRenderedSnapshot(e,t,r){}preloadOnLoadLinksForView(e){Z.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>{let t=e.querySelector("#"+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#o(e,t){let r=await this.extractForeignFrameElement(t.body);if(r){let n=new hi(r),s=new ji(this,this.view.snapshot,n,ji.renderElement,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(s),this.complete=!0,Z.frameRendered(e,this.element),Z.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#l(e)&&this.#d(e)}async#a(e){let t=new xt(this,ke.get,e,new URLSearchParams,this.element);return this.#e?.cancel(),this.#e=t,new Promise(r=>{this.#t=()=>{this.#t=()=>{},this.#e=null,r()},t.perform()})}#u(e,t,r){let n=this.#c(e,r);n.delegate.proposeVisitIfNavigatedWithAction(n,kt(r,e,n)),this.#y(e,()=>{n.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){let r=Me.fromElement(e).clone(),{visitCachedSnapshot:n}=e.delegate;e.delegate.fetchResponseLoaded=async s=>{if(e.src){let{statusCode:o,redirected:a}=s,l=await s.responseHTML,u={response:{statusCode:o,redirected:a,responseHTML:l},visitCachedSnapshot:n,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:r};this.action&&(u.action=this.action),Z.visit(e.src,u)}}}}changeHistory(){if(this.action){let e=ul(this.action);Z.history.update(e,le(this.element.src||""),this.restorationIdentifier)}}async#h(e){console.warn(`The response (${e.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await this.#p(e.response)}#l(e){this.element.setAttribute("complete","");let t=e.response,r=async(s,o)=>{s instanceof Response?this.#p(s):Z.visit(s,o)};return!Q("turbo:frame-missing",{target:this.element,detail:{response:t,visit:r},cancelable:!0}).defaultPrevented}#d(e){this.view.missing(),this.#m(e)}#m(e){let t=`The response (${e.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new Js(t)}async#p(e){let t=new Hi(e),r=await t.responseHTML,{location:n,redirected:s,statusCode:o}=t;return Z.visit(n,{response:{redirected:s,statusCode:o,responseHTML:r}})}#c(e,t){let r=cn("data-turbo-frame",t,e)||this.element.getAttribute("target");return rl(r)??this.element}async extractForeignFrameElement(e){let t,r=CSS.escape(this.id);try{if(t=nl(e.querySelector(`turbo-frame#${r}`),this.sourceURL),t)return t;if(t=nl(e.querySelector(`turbo-frame[src][recurse~=${r}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(n){return console.error(n),new Be}return null}#g(e,t){let r=ro(e,t);return st(le(r),this.rootLocation)}#f(e,t){let r=cn("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#g(e,t)||!this.enabled||r=="_top")return!1;if(r){let n=rl(r);if(n)return!n.disabled}return!(!Z.elementIsNavigatable(e)||t&&!Z.elementIsNavigatable(t))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(e){this.#b("src",()=>{this.element.src=e??null})}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||this.#t()!==void 0}get complete(){return this.element.hasAttribute("complete")}set complete(e){e?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&this.#i}get rootLocation(){let t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]')?.content??"/";return le(t)}#v(e){return this.#s.has(e)}#b(e,t){this.#s.add(e),t(),this.#s.delete(e)}#y(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}};function rl(i){if(i!=null){let e=document.getElementById(i);if(e instanceof Be)return e}}function nl(i,e){if(i){let t=i.getAttribute("src");if(t!=null&&e!=null&&jh(t,e))throw new Error(`Matching <turbo-frame id="${i.id}"> element has a source URL which references itself`);if(i.ownerDocument!==document&&(i=document.importNode(i,!0)),i instanceof Be)return i.connectedCallback(),i.disconnectedCallback(),i}}var _l={after(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.append(this.templateContent))},before(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.prepend(this.templateContent))},remove(){this.targetElements.forEach(i=>i.remove())},replace(){this.targetElements.forEach(i=>i.replaceWith(this.templateContent))},update(){this.targetElements.forEach(i=>{i.innerHTML="",i.append(this.templateContent)})},refresh(){Z.refresh(this.baseURI,this.requestId)}},to=class i extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=>{let e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await ai(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){let e=this.targetElements.flatMap(r=>[...r.children]).filter(r=>!!r.id),t=[...this.templateContent?.children||[]].filter(r=>!!r.id).map(r=>r.id);return e.filter(r=>t.includes(r.id))}get performAction(){if(this.action){let e=_l[this.action];if(e)return e;this.#e("unknown action")}this.#e("action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;this.#e("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild===null){let e=this.ownerDocument.createElement("template");return this.appendChild(e),e}else if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.#e("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}#e(e){throw new Error(`${this.description}: ${e}`)}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:i.renderElement}})}get targetElementsById(){let e=this.ownerDocument?.getElementById(this.target);return e!==null?[e]:[]}get targetElementsByQuery(){let e=this.ownerDocument?.querySelectorAll(this.targets);return e.length!==0?Array.prototype.slice.call(e):[]}},io=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),wl(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),El(this.streamSource))}get src(){return this.getAttribute("src")||""}};Be.delegateConstructor=eo;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",Be);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",to);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",io);(()=>{let i=document.currentScript;if(i&&!i.hasAttribute("data-turbo-suppress-warning"))for(i=i.parentElement;i;){if(i==document.body)return console.warn(cl`
|
77
|
+
`}hiding=!1;value=0;visible=!1;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,i.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,i.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}trickle=()=>{this.setValue(this.value+Math.random()/100)};refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){let e=document.createElement("style");return e.type="text/css",e.textContent=i.defaultCSS,this.cspNonce&&(e.nonce=this.cspNonce),e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}get cspNonce(){return ui("csp-nonce")}},Ds=class extends hi{detailsByOuterHTML=this.children.filter(e=>!Cd(e)).map(e=>Rd(e)).reduce((e,t)=>{let{outerHTML:r}=t,n=r in e?e[r]:{type:kd(t),tracked:xd(t),elements:[]};return{...e,[r]:{...n,elements:[...n.elements,t]}}},{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter(r=>!(r in t.detailsByOuterHTML)).map(r=>this.detailsByOuterHTML[r]).filter(({type:r})=>r==e).map(({elements:[r]})=>r)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:r,tracked:n,elements:s}=this.detailsByOuterHTML[t];return r==null&&!n?[...e,...s]:s.length>1?[...e,...s.slice(1)]:e},[])}getMetaValue(e){let t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,r)=>{let{elements:[n]}=this.detailsByOuterHTML[r];return Od(n,e)?n:t},void 0|void 0)}};function kd(i){if(Ld(i))return"script";if(Id(i))return"stylesheet"}function xd(i){return i.getAttribute("data-turbo-track")=="reload"}function Ld(i){return i.localName=="script"}function Cd(i){return i.localName=="noscript"}function Id(i){let e=i.localName;return e=="style"||e=="link"&&i.getAttribute("rel")=="stylesheet"}function Od(i,e){return i.localName=="meta"&&i.getAttribute("name")==e}function Rd(i){return i.hasAttribute("nonce")&&i.setAttribute("nonce",""),i}var Me=class i extends hi{static fromHTMLString(e=""){return this.fromDocument(cl(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:r}){return new this(e,t,new Ds(r))}constructor(e,t,r){super(t),this.documentElement=e,this.headSnapshot=r}clone(){let e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),r=e.querySelectorAll("select");for(let[n,s]of t.entries()){let o=r[n];for(let a of o.selectedOptions)a.selected=!1;for(let a of s.selectedOptions)o.options[a.index].selected=!0}for(let n of e.querySelectorAll('input[type="password"]'))n.value="";return new i(this.documentElement,e,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get headElement(){return this.headSnapshot.element}get rootLocation(){let e=this.getSetting("root")??"/";return le(e)}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}get prefersViewTransitions(){return this.headSnapshot.getMetaValue("view-transition")==="same-origin"}get shouldMorphPage(){return this.getSetting("refresh-method")==="morph"}get shouldPreserveScrollPosition(){return this.getSetting("refresh-scroll")==="preserve"}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},Fs=class{#e=!1;#t=Promise.resolve();renderChange(e,t){return e&&this.viewTransitionsAvailable&&!this.#e?(this.#e=!0,this.#t=this.#t.then(async()=>{await document.startViewTransition(t).finished})):this.#t=this.#t.then(t),this.#t}get viewTransitionsAvailable(){return document.startViewTransition}},Md={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},cn={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},Ze={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},ci={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},Pd={advance:"forward",restore:"back",replace:"none"},Bs=class{identifier=ot();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=Ze.initialized;viewTransitioner=new Fs;constructor(e,t,r,n={}){this.delegate=e,this.location=t,this.restorationIdentifier=r||ot();let{action:s,historyChanged:o,referrer:a,snapshot:l,snapshotHTML:f,response:u,visitCachedSnapshot:g,willRender:w,updateHistory:y,shouldCacheSnapshot:_,acceptsStreamResponse:L,direction:k}={...Md,...n};this.action=s,this.historyChanged=o,this.referrer=a,this.snapshot=l,this.snapshotHTML=f,this.response=u,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=g,this.willRender=w,this.updateHistory=y,this.scrolled=!w,this.shouldCacheSnapshot=_,this.acceptsStreamResponse=L,this.direction=k||Pd[s]}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==Ze.initialized&&(this.recordTimingMetric(cn.visitStart),this.state=Ze.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==Ze.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=Ze.canceled)}complete(){this.state==Ze.started&&(this.recordTimingMetric(cn.visitEnd),this.adapter.visitCompleted(this),this.state=Ze.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==Ze.started&&(this.state=Ze.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){let e=this.location.href===this.referrer?.href?"replace":this.action,t=hl(e);this.history.update(t,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new xt(this,ke.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(cn.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;il(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(cn.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,il(e)&&t!=null){let r=Me.fromHTMLString(t);await this.renderPageSnapshot(r,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(Me.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!St(this.location)||e.hasAnchor(St(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return Me.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){let e=this.getCachedSnapshot();if(e){let t=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage||this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(e,t),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&this.response?.redirected&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)})}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(at.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let r=await t.responseHTML,{redirected:n,statusCode:s}=t;r==null?this.recordResponse({statusCode:ci.contentTypeMismatch,redirected:n}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:s,responseHTML:r,redirected:n}))}async requestFailedWithResponse(e,t){let r=await t.responseHTML,{redirected:n,statusCode:s}=t;r==null?this.recordResponse({statusCode:ci.contentTypeMismatch,redirected:n}):this.recordResponse({statusCode:s,responseHTML:r,redirected:n})}requestErrored(e,t){this.recordResponse({statusCode:ci.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){!this.scrolled&&!this.view.forceReloaded&&!this.view.shouldPreserveScrollPosition(this)&&(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=St(this.location);if(e!=null)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=new Date().getTime()}getTimingMetrics(){return{...this.timingMetrics}}getHistoryMethodForAction(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return typeof this.response=="object"}shouldIssueRequest(){return this.isSamePage?!1:this.action=="restore"?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),this.frame=await ai(),await e(),delete this.frame}async renderPageSnapshot(e,t){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(e),async()=>{await this.view.renderPage(e,t,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};function il(i){return i>=200&&i<300}var Ns=class{progressBar=new Ps;constructor(e){this.session=e}visitProposedToLocation(e,t){st(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||ot(),t):window.location.href=e.toString()}visitStarted(e){this.location=e.location,e.loadCachedSnapshot(),e.issueRequest(),e.goToSamePageAnchor()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||e.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case ci.networkFailure:case ci.timeoutFailure:case ci.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:t}});default:return e.loadResponse()}}visitRequestFinished(e){}visitCompleted(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(e){this.reload(e)}visitFailed(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(e){}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){this.formProgressBarTimeout==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}showProgressBar=()=>{this.progressBar.show()};reload(e){Q("turbo:reload",{detail:e}),window.location.href=this.location?.toString()||window.location.href}get navigator(){return this.session.navigator}},Hs=class{selector="[data-turbo-temporary]";deprecatedSelector="[data-turbo-cache=false]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=e=>{for(let t of this.temporaryElements)t.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){let e=document.querySelectorAll(this.deprecatedSelector);return e.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...e]}},qs=class{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new pn(this,t),this.formSubmitObserver=new Vi(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,r){return this.#t(e)}linkClickIntercepted(e,t,r){let n=this.#i(e);n&&n.delegate.linkClickIntercepted(e,t,r)}willSubmitForm(e,t){return e.closest("turbo-frame")==null&&this.#e(e,t)&&this.#t(e,t)}formSubmitted(e,t){let r=this.#i(e,t);r&&r.delegate.formSubmitted(e,t)}#e(e,t){let r=no(e,t),n=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),s=le(n?.content??"/");return this.#t(e,t)&&st(r,s)}#t(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){let n=this.#i(e,t);return n?n!=e.closest("turbo-frame"):!1}else return!1}#i(e,t){let r=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(r&&r!="_top"){let n=this.element.querySelector(`#${r}:not([disabled])`);if(n instanceof Be)return n}}},zs=class{location;restorationIdentifier=ot();restorationData={};started=!1;pageLoaded=!1;currentIndex=0;constructor(e){this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,r=ot()){e===history.pushState&&++this.currentIndex;let n={turbo:{restorationIdentifier:r,restorationIndex:this.currentIndex}};e.call(history,n,"",t.href),this.location=t,this.restorationIdentifier=r}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){let{restorationIdentifier:t}=this,r=this.restorationData[t];this.restorationData[t]={...r,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=e=>{if(this.shouldHandlePopState()){let{turbo:t}=e.state||{};if(t){this.location=new URL(window.location.href);let{restorationIdentifier:r,restorationIndex:n}=t;this.restorationIdentifier=r;let s=n>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,r,s),this.currentIndex=n}}};onPageLoad=async e=>{await Qh(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},Vs=class{started=!1;#e=null;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.readyState==="loading"?this.eventTarget.addEventListener("DOMContentLoaded",this.#t,{once:!0}):this.#t())}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#r,!0),this.started=!1)}#t=()=>{this.eventTarget.addEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#r,!0),this.started=!0};#i=e=>{if(ui("turbo-prefetch")==="false")return;let t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&this.#a(t)){let n=t,s=pl(n);if(this.delegate.canPrefetchRequestToLocation(n,s)){this.#e=n;let o=new xt(this,ke.get,s,new URLSearchParams,t);oi.setLater(s.toString(),o,this.#o)}}};#n=e=>{e.target===this.#e&&this.#s()};#s=()=>{oi.clear(),this.#e=null};#r=e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="get"){let t=oi.get(e.detail.url.toString());t&&(e.detail.fetchRequest=t),oi.clear()}};prepareRequest(e){let t=e.target;e.headers["X-Sec-Purpose"]="prefetch";let r=t.closest("turbo-frame"),n=t.getAttribute("data-turbo-frame")||r?.getAttribute("target")||r?.id;n&&n!=="_top"&&(e.headers["Turbo-Frame"]=n)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#o(){return Number(ui("turbo-prefetch-cache-time"))||fd}#a(e){return!(!e.getAttribute("href")||Dd(e)||Fd(e)||Bd(e)||Nd(e)||qd(e))}},Dd=i=>i.origin!==document.location.origin||!["http:","https:"].includes(i.protocol)||i.hasAttribute("target"),Fd=i=>i.pathname+i.search===document.location.pathname+document.location.search||i.href.startsWith("#"),Bd=i=>{if(i.getAttribute("data-turbo-prefetch")==="false"||i.getAttribute("data-turbo")==="false")return!0;let e=li(i,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},Nd=i=>{let e=i.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||Hd(i)||i.hasAttribute("data-turbo-confirm")||i.hasAttribute("data-turbo-stream"))},Hd=i=>i.hasAttribute("data-remote")||i.hasAttribute("data-behavior")||i.hasAttribute("data-confirm")||i.hasAttribute("data-method"),qd=i=>Q("turbo:before-prefetch",{target:i,cancelable:!0}).defaultPrevented,$s=class{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,r={}){this.stop(),this.currentVisit=new Bs(this,le(e),t,{referrer:this.location,...r}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new zi(this,e,t,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(e){typeof this.adapter.formSubmissionStarted=="function"&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){let r=await t.responseHTML;if(r){let n=e.isSafe;n||this.view.clearSnapshotCache();let{statusCode:s,redirected:o}=t,l={action:this.#e(e,t),shouldCacheSnapshot:n,response:{statusCode:s,responseHTML:r,redirected:o}};this.proposeVisit(t.location,l)}}}async formSubmissionFailedWithResponse(e,t){let r=await t.responseHTML;if(r){let n=Me.fromHTMLString(r);t.serverError?await this.view.renderError(n,this.currentVisit):await this.view.renderPage(n,!1,!0,this.currentVisit),n.shouldPreserveScrollPosition||this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e)}locationWithActionIsSamePage(e,t){let r=St(e),n=St(this.view.lastRenderedLocation),s=t==="restore"&&typeof r>"u";return t!=="replace"&&Cs(e)===Cs(this.view.lastRenderedLocation)&&(s||r!=null&&r!==n)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#e(e,t){let{submitter:r,formElement:n}=e;return kt(r,n)||this.#t(t)}#t(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}},At={initial:0,loading:1,interactive:2,complete:3},js=class{stage=At.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==At.initial&&(this.stage=At.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=>{let{readyState:e}=this;e=="interactive"?this.pageIsInteractive():e=="complete"&&this.pageIsComplete()};pageIsInteractive(){this.stage==At.loading&&(this.stage=At.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==At.interactive&&(this.stage=At.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}},Us=class{started=!1;constructor(e){this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}},Ws=class{render({fragment:e}){vn.preservingPermanentElements(this,zd(e),()=>{Vd(e,()=>{$d(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}};function zd(i){let e=yl(document.documentElement),t={};for(let r of e){let{id:n}=r;for(let s of i.querySelectorAll("turbo-stream")){let o=bl(s.templateElement.content,n);o&&(t[n]=[r,o])}}return t}async function Vd(i,e){let t=`turbo-stream-autofocus-${ot()}`,r=i.querySelectorAll("turbo-stream"),n=jd(r),s=null;if(n&&(n.id?s=n.id:s=t,n.id=s),e(),await ai(),(document.activeElement==null||document.activeElement==document.body)&&s){let a=document.getElementById(s);so(a)&&a.focus(),a&&a.id==t&&a.removeAttribute("id")}}async function $d(i){let[e,t]=await nd(i,()=>document.activeElement),r=e&&e.id;if(r){let n=document.getElementById(r);so(n)&&n!=t&&n.focus()}}function jd(i){for(let e of i){let t=fl(e.templateElement.content);if(t)return t}return null}var Ks=class{sources=new Set;#e=!1;constructor(e){this.delegate=e}start(){this.#e||(this.#e=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.#e&&(this.#e=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}inspectFetchResponse=e=>{let t=Ud(e);t&&Wd(t)&&(e.preventDefault(),this.receiveMessageResponse(t))};receiveMessageEvent=e=>{this.#e&&typeof e.data=="string"&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){let t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(at.wrap(e))}};function Ud(i){let e=i.detail?.fetchResponse;if(e instanceof Hi)return e}function Wd(i){return(i.contentType??"").startsWith(at.contentType)}var bn=class extends $i{static renderElement(e,t){let{documentElement:r,body:n}=document;r.replaceChild(t,n)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){let{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(let e of this.scriptElements){let t=e.parentNode;if(t){let r=qi(e);t.replaceChild(r,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}},Kd=function(){let i=new Set,e={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:w,afterNodeAdded:w,beforeNodeMorphed:w,afterNodeMorphed:w,beforeNodeRemoved:w,afterNodeRemoved:w,beforeAttributeUpdated:w},head:{style:"merge",shouldPreserve:function(h){return h.getAttribute("im-preserve")==="true"},shouldReAppend:function(h){return h.getAttribute("im-re-append")==="true"},shouldRemove:w,afterHeadMorphed:w}};function t(h,d,p={}){h instanceof Document&&(h=h.documentElement),typeof d=="string"&&(d=T(d));let b=O(d),E=_(h,b,p);return r(h,b,E)}function r(h,d,p){if(p.head.block){let b=h.querySelector("head"),E=d.querySelector("head");if(b&&E){let v=g(E,b,p);Promise.all(v).then(function(){r(h,d,Object.assign(p,{head:{block:!1,ignore:!0}}))});return}}if(p.morphStyle==="innerHTML")return o(d,h,p),h.children;if(p.morphStyle==="outerHTML"||p.morphStyle==null){let b=F(d,h,p),E=b?.previousSibling,v=b?.nextSibling,R=s(h,b,p);return b?x(E,R,v):[]}else throw"Do not understand how to morph style "+p.morphStyle}function n(h,d){return d.ignoreActiveValue&&h===document.activeElement&&h!==document.body}function s(h,d,p){if(!(p.ignoreActive&&h===document.activeElement))return d==null?p.callbacks.beforeNodeRemoved(h)===!1?h:(h.remove(),p.callbacks.afterNodeRemoved(h),null):k(h,d)?(p.callbacks.beforeNodeMorphed(h,d)===!1||(h instanceof HTMLHeadElement&&p.head.ignore||(h instanceof HTMLHeadElement&&p.head.style!=="morph"?g(d,h,p):(l(d,h,p),n(h,p)||o(d,h,p))),p.callbacks.afterNodeMorphed(h,d)),h):p.callbacks.beforeNodeRemoved(h)===!1||p.callbacks.beforeNodeAdded(d)===!1?h:(h.parentElement.replaceChild(d,h),p.callbacks.afterNodeAdded(d),p.callbacks.afterNodeRemoved(h),d)}function o(h,d,p){let b=h.firstChild,E=d.firstChild,v;for(;b;){if(v=b,b=v.nextSibling,E==null){if(p.callbacks.beforeNodeAdded(v)===!1)return;d.appendChild(v),p.callbacks.afterNodeAdded(v),X(p,v);continue}if(L(v,E,p)){s(E,v,p),E=E.nextSibling,X(p,v);continue}let R=q(h,d,v,E,p);if(R){E=P(E,R,p),s(R,v,p),X(p,v);continue}let M=B(h,d,v,E,p);if(M){E=P(E,M,p),s(M,v,p),X(p,v);continue}if(p.callbacks.beforeNodeAdded(v)===!1)return;d.insertBefore(v,E),p.callbacks.afterNodeAdded(v),X(p,v)}for(;E!==null;){let R=E;E=E.nextSibling,U(R,p)}}function a(h,d,p,b){return h==="value"&&b.ignoreActiveValue&&d===document.activeElement?!0:b.callbacks.beforeAttributeUpdated(h,d,p)===!1}function l(h,d,p){let b=h.nodeType;if(b===1){let E=h.attributes,v=d.attributes;for(let R of E)a(R.name,d,"update",p)||d.getAttribute(R.name)!==R.value&&d.setAttribute(R.name,R.value);for(let R=v.length-1;0<=R;R--){let M=v[R];a(M.name,d,"remove",p)||h.hasAttribute(M.name)||d.removeAttribute(M.name)}}(b===8||b===3)&&d.nodeValue!==h.nodeValue&&(d.nodeValue=h.nodeValue),n(d,p)||u(h,d,p)}function f(h,d,p,b){if(h[p]!==d[p]){let E=a(p,d,"update",b);E||(d[p]=h[p]),h[p]?E||d.setAttribute(p,h[p]):a(p,d,"remove",b)||d.removeAttribute(p)}}function u(h,d,p){if(h instanceof HTMLInputElement&&d instanceof HTMLInputElement&&h.type!=="file"){let b=h.value,E=d.value;f(h,d,"checked",p),f(h,d,"disabled",p),h.hasAttribute("value")?b!==E&&(a("value",d,"update",p)||(d.setAttribute("value",b),d.value=b)):a("value",d,"remove",p)||(d.value="",d.removeAttribute("value"))}else if(h instanceof HTMLOptionElement)f(h,d,"selected",p);else if(h instanceof HTMLTextAreaElement&&d instanceof HTMLTextAreaElement){let b=h.value,E=d.value;if(a("value",d,"update",p))return;b!==E&&(d.value=b),d.firstChild&&d.firstChild.nodeValue!==b&&(d.firstChild.nodeValue=b)}}function g(h,d,p){let b=[],E=[],v=[],R=[],M=p.head.style,ce=new Map;for(let z of h.children)ce.set(z.outerHTML,z);for(let z of d.children){let ne=ce.has(z.outerHTML),de=p.head.shouldReAppend(z),Le=p.head.shouldPreserve(z);ne||Le?de?E.push(z):(ce.delete(z.outerHTML),v.push(z)):M==="append"?de&&(E.push(z),R.push(z)):p.head.shouldRemove(z)!==!1&&E.push(z)}R.push(...ce.values());let N=[];for(let z of R){let ne=document.createRange().createContextualFragment(z.outerHTML).firstChild;if(p.callbacks.beforeNodeAdded(ne)!==!1){if(ne.href||ne.src){let de=null,Le=new Promise(function(Lt){de=Lt});ne.addEventListener("load",function(){de()}),N.push(Le)}d.appendChild(ne),p.callbacks.afterNodeAdded(ne),b.push(ne)}}for(let z of E)p.callbacks.beforeNodeRemoved(z)!==!1&&(d.removeChild(z),p.callbacks.afterNodeRemoved(z));return p.head.afterHeadMorphed(d,{added:b,kept:v,removed:E}),N}function w(){}function y(h){let d={};return Object.assign(d,e),Object.assign(d,h),d.callbacks={},Object.assign(d.callbacks,e.callbacks),Object.assign(d.callbacks,h.callbacks),d.head={},Object.assign(d.head,e.head),Object.assign(d.head,h.head),d}function _(h,d,p){return p=y(p),{target:h,newContent:d,config:p,morphStyle:p.morphStyle,ignoreActive:p.ignoreActive,ignoreActiveValue:p.ignoreActiveValue,idMap:xe(h,d),deadIds:new Set,callbacks:p.callbacks,head:p.head}}function L(h,d,p){return h==null||d==null?!1:h.nodeType===d.nodeType&&h.tagName===d.tagName?h.id!==""&&h.id===d.id?!0:W(p,h,d)>0:!1}function k(h,d){return h==null||d==null?!1:h.nodeType===d.nodeType&&h.tagName===d.tagName}function P(h,d,p){for(;h!==d;){let b=h;h=h.nextSibling,U(b,p)}return X(p,d),d.nextSibling}function q(h,d,p,b,E){let v=W(E,p,d),R=null;if(v>0){let M=b,ce=0;for(;M!=null;){if(L(p,M,E))return M;if(ce+=W(E,M,h),ce>v)return null;M=M.nextSibling}}return R}function B(h,d,p,b,E){let v=b,R=p.nextSibling,M=0;for(;v!=null;){if(W(E,v,h)>0)return null;if(k(p,v))return v;if(k(R,v)&&(M++,R=R.nextSibling,M>=2))return null;v=v.nextSibling}return v}function T(h){let d=new DOMParser,p=h.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(p.match(/<\/html>/)||p.match(/<\/head>/)||p.match(/<\/body>/)){let b=d.parseFromString(h,"text/html");if(p.match(/<\/html>/))return b.generatedByIdiomorph=!0,b;{let E=b.firstChild;return E?(E.generatedByIdiomorph=!0,E):null}}else{let E=d.parseFromString("<body><template>"+h+"</template></body>","text/html").body.querySelector("template").content;return E.generatedByIdiomorph=!0,E}}function O(h){if(h==null)return document.createElement("div");if(h.generatedByIdiomorph)return h;if(h instanceof Node){let d=document.createElement("div");return d.append(h),d}else{let d=document.createElement("div");for(let p of[...h])d.append(p);return d}}function x(h,d,p){let b=[],E=[];for(;h!=null;)b.push(h),h=h.previousSibling;for(;b.length>0;){let v=b.pop();E.push(v),d.parentElement.insertBefore(v,d)}for(E.push(d);p!=null;)b.push(p),E.push(p),p=p.nextSibling;for(;b.length>0;)d.parentElement.insertBefore(b.pop(),d.nextSibling);return E}function F(h,d,p){let b;b=h.firstChild;let E=b,v=0;for(;b;){let R=j(b,d,p);R>v&&(E=b,v=R),b=b.nextSibling}return E}function j(h,d,p){return k(h,d)?.5+W(p,h,d):0}function U(h,d){X(d,h),d.callbacks.beforeNodeRemoved(h)!==!1&&(h.remove(),d.callbacks.afterNodeRemoved(h))}function Y(h,d){return!h.deadIds.has(d)}function H(h,d,p){return(h.idMap.get(p)||i).has(d)}function X(h,d){let p=h.idMap.get(d)||i;for(let b of p)h.deadIds.add(b)}function W(h,d,p){let b=h.idMap.get(d)||i,E=0;for(let v of b)Y(h,v)&&H(h,v,p)&&++E;return E}function be(h,d){let p=h.parentElement,b=h.querySelectorAll("[id]");for(let E of b){let v=E;for(;v!==p&&v!=null;){let R=d.get(v);R==null&&(R=new Set,d.set(v,R)),R.add(E.id),v=v.parentElement}}}function xe(h,d){let p=new Map;return be(h,p),be(d,p),p}return{morph:t,defaults:e}}(),di=class extends $i{static renderElement(e,t){document.body&&t instanceof HTMLBodyElement?document.body.replaceWith(t):document.documentElement.appendChild(t)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){if(!this.newSnapshot.isVisitable)return{reason:"turbo_visit_control_is_reload"};if(!this.trackedElementsAreIdentical)return{reason:"tracked_element_mismatch"}}async prepareToRender(){this.#e(),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#e(){let{documentElement:e}=this.currentSnapshot,{lang:t}=this.newSnapshot;t?e.setAttribute("lang",t):e.removeAttribute("lang")}async mergeHead(){let e=this.mergeProvisionalElements(),t=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await e,await t,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){let e=[];for(let t of this.newHeadStylesheetElements)e.push(td(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(qi(e))}removeUnusedDynamicStylesheetElements(){for(let e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){let e=[...this.newHeadProvisionalElements];for(let t of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(t,e)||document.head.removeChild(t);for(let t of e)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(let[r,n]of t.entries()){if(e.tagName=="TITLE"){if(n.tagName!="TITLE")continue;if(e.innerHTML==n.innerHTML)return t.splice(r,1),!0}if(n.isEqualNode(e))return t.splice(r,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(let e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let t=qi(e);e.replaceWith(t)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(e=>e.getAttribute("data-turbo-track")==="dynamic")}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}},Gs=class extends di{async render(){this.willRender&&await this.#e()}get renderMethod(){return"morph"}async#e(){this.#t(this.currentElement,this.newElement),this.#a(),Q("turbo:morph",{detail:{currentElement:this.currentElement,newElement:this.newElement}})}#t(e,t,r="outerHTML"){this.isMorphingTurboFrame=this.#l(e),Kd.morph(e,t,{morphStyle:r,callbacks:{beforeNodeAdded:this.#i,beforeNodeMorphed:this.#n,beforeAttributeUpdated:this.#s,beforeNodeRemoved:this.#o,afterNodeMorphed:this.#r}})}#i=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));#n=(e,t)=>{if(e instanceof HTMLElement)return!e.hasAttribute("data-turbo-permanent")&&(this.isMorphingTurboFrame||!this.#l(e))?!Q("turbo:before-morph-element",{cancelable:!0,target:e,detail:{newElement:t}}).defaultPrevented:!1};#s=(e,t,r)=>!Q("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:r}}).defaultPrevented;#r=(e,t)=>{t instanceof HTMLElement&&Q("turbo:morph-element",{target:e,detail:{newElement:t}})};#o=e=>this.#n(e);#a(){this.#d().forEach(e=>{this.#l(e)&&(this.#u(e),e.reload())})}#u(e){e.addEventListener("turbo:before-frame-render",t=>{t.detail.render=this.#h},{once:!0})}#h=(e,t)=>{Q("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),this.#t(e,t.children,"innerHTML")};#l(e){return e.src&&e.refresh==="morph"}#d(){return Array.from(document.querySelectorAll("turbo-frame[src]")).filter(e=>!e.closest("[data-turbo-permanent]"))}},Ys=class{keys=[];snapshots={};constructor(e){this.size=e}has(e){return ln(e)in this.snapshots}get(e){if(this.has(e)){let t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){this.snapshots={}}read(e){return this.snapshots[ln(e)]}write(e,t){this.snapshots[ln(e)]=t}touch(e){let t=ln(e),r=this.keys.indexOf(t);r>-1&&this.keys.splice(r,1),this.keys.unshift(t),this.trim()}trim(){for(let e of this.keys.splice(this.size))delete this.snapshots[e]}},Xs=class extends fn{snapshotCache=new Ys(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,r=!0,n){let o=this.isPageRefresh(n)&&this.snapshot.shouldMorphPage?Gs:di,a=new o(this.snapshot,e,di.renderElement,t,r);return a.shouldRender?n?.changeHistory():this.forceReloaded=!0,this.render(a)}renderError(e,t){t?.changeHistory();let r=new bn(this.snapshot,e,bn.renderElement,!1);return this.render(r)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();let{lastRenderedLocation:t}=this;await ll();let r=e.clone();return this.snapshotCache.put(t,r),r}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}isPageRefresh(e){return!e||this.lastRenderedLocation.pathname===e.location.pathname&&e.action==="replace"}shouldPreserveScrollPosition(e){return this.isPageRefresh(e)&&this.snapshot.shouldPreserveScrollPosition}get snapshot(){return Me.fromElement(this.element)}},Zs=class{selector="a[data-turbo-preload]";constructor(e,t){this.delegate=e,this.snapshotCache=t}start(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.#e):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",this.#e)}preloadOnLoadLinksForView(e){for(let t of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(t)&&this.preloadURL(t)}async preloadURL(e){let t=new URL(e.href);if(this.snapshotCache.has(t))return;await new xt(this,ke.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{let r=await t.responseHTML,n=Me.fromHTMLString(r);this.snapshotCache.put(e.url,n)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#e=()=>{this.preloadOnLoadLinksForView(document.body)}},Qs=class{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.#e("")}exemptPageFromCache(){this.#e("no-cache")}exemptPageFromPreview(){this.#e("no-preview")}#e(e){rd("turbo-cache-control",e)}},Js=class{navigator=new $s(this);history=new zs(this);view=new Xs(this,document.documentElement);adapter=new Ns(this);pageObserver=new js(this);cacheObserver=new Hs;linkPrefetchObserver=new Vs(this,document);linkClickObserver=new mn(this,window);formSubmitObserver=new Vi(this,document);scrollObserver=new Us(this);streamObserver=new Ks(this);formLinkClickObserver=new gn(this,document.documentElement);frameRedirector=new qs(this,document.documentElement);streamMessageRenderer=new Ws;cache=new Qs(this);drive=!0;enabled=!0;progressBarDelay=500;started=!1;formMode="on";#e=150;constructor(e){this.recentRequests=e,this.preloader=new Zs(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){let r=t.frame?document.getElementById(t.frame):null;if(r instanceof Be){let n=t.action||kt(r);r.delegate.proposeVisitIfNavigatedWithAction(r,n),r.src=e.toString()}else this.navigator.proposeVisit(le(e),t)}refresh(e,t){t&&this.recentRequests.has(t)||this.visit(e,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(at.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){this.progressBarDelay=e}setFormMode(e){this.formMode=e}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#e}set pageRefreshDebouncePeriod(e){this.refresh=ad(this.debouncedRefresh.bind(this),e),this.#e=e}shouldPreloadLink(e){let t=e.hasAttribute("data-turbo-method"),r=e.hasAttribute("data-turbo-stream"),n=e.getAttribute("data-turbo-frame"),s=n=="_top"?null:document.getElementById(n)||li(e,"turbo-frame:not([disabled])");if(t||r||s instanceof Be)return!1;{let o=new URL(e.href);return this.elementIsNavigatable(e)&&st(o,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,t,r){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0,direction:r}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&st(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&st(t,this.snapshot.rootLocation)}willFollowLinkToLocation(e,t,r){return this.elementIsNavigatable(e)&&st(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,r)}followedLinkToLocation(e,t){let r=this.getActionForLink(e),n=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:r,acceptsStreamResponse:n})}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){rl(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(hn(document.documentElement),this.view.markVisitDirection(e.direction)),rl(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),dn(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){let r=no(e,t);return this.submissionIsNavigatable(e,t)&&st(le(r),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){this.navigator.currentVisit?.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){let r=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:n,detail:{render:s}}=r;return this.view.renderer&&s&&(this.view.renderer.renderElement=s),!n}viewRenderedSnapshot(e,t,r){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(r)}preloadOnLoadLinksForView(e){this.preloader.preloadOnLoadLinksForView(e)}viewInvalidated(e){this.adapter.pageInvalidated(e)}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t,r){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,r).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,r){return Q("turbo:click",{target:e,detail:{url:t.href,originalEvent:r},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return Q("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return Q("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return Q("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return Q("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return Q("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return Q("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return Q("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return Q("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if(this.formMode=="off")return!1;{let r=t?this.elementIsNavigatable(t):!0;return this.formMode=="optin"?r&&e.closest('[data-turbo="true"]')!=null:r&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){let t=li(e,"[data-turbo]"),r=li(e,"turbo-frame");return this.drive||r?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return kt(e)||"advance"}get snapshot(){return this.view.snapshot}};function rl(i){Object.defineProperties(i,Gd)}var Gd={absoluteURL:{get(){return this.toString()}}},Z=new Js(ml),{cache:Yd,navigator:Xd}=Z;function wl(){Z.start()}function Zd(i){Z.registerAdapter(i)}function Qd(i,e){Z.visit(i,e)}function El(i){Z.connectStreamSource(i)}function _l(i){Z.disconnectStreamSource(i)}function Jd(i){Z.renderStreamMessage(i)}function ef(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),Z.clearCache()}function tf(i){Z.setProgressBarDelay(i)}function rf(i){zi.confirmMethod=i}function nf(i){Z.setFormMode(i)}var sf=Object.freeze({__proto__:null,navigator:Xd,session:Z,cache:Yd,PageRenderer:di,PageSnapshot:Me,FrameRenderer:ji,fetch:gl,start:wl,registerAdapter:Zd,visit:Qd,connectStreamSource:El,disconnectStreamSource:_l,renderStreamMessage:Jd,clearCache:ef,setProgressBarDelay:tf,setConfirmMethod:rf,setFormMode:nf}),eo=class extends Error{},to=class{fetchResponseLoaded=e=>Promise.resolve();#e=null;#t=()=>{};#i=!1;#n=!1;#s=new Set;action=null;constructor(e){this.element=e,this.view=new Ms(this,this.element),this.appearanceObserver=new Os(this,this.element),this.formLinkClickObserver=new gn(this,this.element),this.linkInterceptor=new pn(this,this.element),this.restorationIdentifier=ot(),this.formSubmitObserver=new Vi(this,this.element)}connect(){this.#i||(this.#i=!0,this.loadingStyle==si.lazy?this.appearanceObserver.start():this.#r(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#i&&(this.#i=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==si.eager&&this.#r()}sourceURLChanged(){this.#v("src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==si.eager||this.#n)&&this.#r())}sourceURLReloaded(){let{src:e}=this.element;return this.element.removeAttribute("complete"),this.element.src=null,this.element.src=e,this.element.loaded}loadingStyleChanged(){this.loadingStyle==si.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#r())}async#r(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#a(le(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#n=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{let t=await e.responseHTML;if(t){let r=cl(t);Me.fromDocument(r).isVisitable?await this.#o(e,r):await this.#h(e)}}finally{this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,kt(e)),this.#r()}willSubmitFormLinkToLocation(e){return this.#f(e)}submittedFormLinkToLocation(e,t,r){let n=this.#c(e);n&&r.setAttribute("data-turbo-frame",n.id)}shouldInterceptLinkClick(e,t,r){return this.#f(e)}linkClickIntercepted(e,t){this.#u(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.#f(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new zi(this,e,t);let{fetchRequest:r}=this.formSubmission;this.prepareRequest(r),this.formSubmission.start()}prepareRequest(e){e.headers["Turbo-Frame"]=this.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&&e.acceptResponseType(at.contentType)}requestStarted(e){hn(this.element)}requestPreventedHandlingResponse(e,t){this.#t()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.#t()}async requestFailedWithResponse(e,t){await this.loadResponse(t),this.#t()}requestErrored(e,t){console.error(t),this.#t()}requestFinished(e){dn(this.element)}formSubmissionStarted({formElement:e}){hn(e,this.#c(e))}formSubmissionSucceededWithResponse(e,t){let r=this.#c(e.formElement,e.submitter);r.delegate.proposeVisitIfNavigatedWithAction(r,kt(e.submitter,e.formElement,r)),r.delegate.loadResponse(t),e.isSafe||Z.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),Z.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){dn(e,this.#c(e))}allowsImmediateRender({element:e},t){let r=Q("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0}),{defaultPrevented:n,detail:{render:s}}=r;return this.view.renderer&&s&&(this.view.renderer.renderElement=s),!n}viewRenderedSnapshot(e,t,r){}preloadOnLoadLinksForView(e){Z.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>{let t=e.querySelector("#"+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#o(e,t){let r=await this.extractForeignFrameElement(t.body);if(r){let n=new hi(r),s=new ji(this,this.view.snapshot,n,ji.renderElement,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(s),this.complete=!0,Z.frameRendered(e,this.element),Z.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#l(e)&&this.#d(e)}async#a(e){let t=new xt(this,ke.get,e,new URLSearchParams,this.element);return this.#e?.cancel(),this.#e=t,new Promise(r=>{this.#t=()=>{this.#t=()=>{},this.#e=null,r()},t.perform()})}#u(e,t,r){let n=this.#c(e,r);n.delegate.proposeVisitIfNavigatedWithAction(n,kt(r,e,n)),this.#y(e,()=>{n.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){let r=Me.fromElement(e).clone(),{visitCachedSnapshot:n}=e.delegate;e.delegate.fetchResponseLoaded=async s=>{if(e.src){let{statusCode:o,redirected:a}=s,l=await s.responseHTML,u={response:{statusCode:o,redirected:a,responseHTML:l},visitCachedSnapshot:n,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:r};this.action&&(u.action=this.action),Z.visit(e.src,u)}}}}changeHistory(){if(this.action){let e=hl(this.action);Z.history.update(e,le(this.element.src||""),this.restorationIdentifier)}}async#h(e){console.warn(`The response (${e.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await this.#p(e.response)}#l(e){this.element.setAttribute("complete","");let t=e.response,r=async(s,o)=>{s instanceof Response?this.#p(s):Z.visit(s,o)};return!Q("turbo:frame-missing",{target:this.element,detail:{response:t,visit:r},cancelable:!0}).defaultPrevented}#d(e){this.view.missing(),this.#m(e)}#m(e){let t=`The response (${e.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new eo(t)}async#p(e){let t=new Hi(e),r=await t.responseHTML,{location:n,redirected:s,statusCode:o}=t;return Z.visit(n,{response:{redirected:s,statusCode:o,responseHTML:r}})}#c(e,t){let r=un("data-turbo-frame",t,e)||this.element.getAttribute("target");return nl(r)??this.element}async extractForeignFrameElement(e){let t,r=CSS.escape(this.id);try{if(t=sl(e.querySelector(`turbo-frame#${r}`),this.sourceURL),t)return t;if(t=sl(e.querySelector(`turbo-frame[src][recurse~=${r}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(n){return console.error(n),new Be}return null}#g(e,t){let r=no(e,t);return st(le(r),this.rootLocation)}#f(e,t){let r=un("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#g(e,t)||!this.enabled||r=="_top")return!1;if(r){let n=nl(r);if(n)return!n.disabled}return!(!Z.elementIsNavigatable(e)||t&&!Z.elementIsNavigatable(t))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(e){this.#b("src",()=>{this.element.src=e??null})}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||this.#t()!==void 0}get complete(){return this.element.hasAttribute("complete")}set complete(e){e?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&this.#i}get rootLocation(){let t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]')?.content??"/";return le(t)}#v(e){return this.#s.has(e)}#b(e,t){this.#s.add(e),t(),this.#s.delete(e)}#y(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}};function nl(i){if(i!=null){let e=document.getElementById(i);if(e instanceof Be)return e}}function sl(i,e){if(i){let t=i.getAttribute("src");if(t!=null&&e!=null&&Uh(t,e))throw new Error(`Matching <turbo-frame id="${i.id}"> element has a source URL which references itself`);if(i.ownerDocument!==document&&(i=document.importNode(i,!0)),i instanceof Be)return i.connectedCallback(),i.disconnectedCallback(),i}}var Al={after(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.append(this.templateContent))},before(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.prepend(this.templateContent))},remove(){this.targetElements.forEach(i=>i.remove())},replace(){this.targetElements.forEach(i=>i.replaceWith(this.templateContent))},update(){this.targetElements.forEach(i=>{i.innerHTML="",i.append(this.templateContent)})},refresh(){Z.refresh(this.baseURI,this.requestId)}},io=class i extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=>{let e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await ai(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){let e=this.targetElements.flatMap(r=>[...r.children]).filter(r=>!!r.id),t=[...this.templateContent?.children||[]].filter(r=>!!r.id).map(r=>r.id);return e.filter(r=>t.includes(r.id))}get performAction(){if(this.action){let e=Al[this.action];if(e)return e;this.#e("unknown action")}this.#e("action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;this.#e("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild===null){let e=this.ownerDocument.createElement("template");return this.appendChild(e),e}else if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.#e("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}#e(e){throw new Error(`${this.description}: ${e}`)}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:i.renderElement}})}get targetElementsById(){let e=this.ownerDocument?.getElementById(this.target);return e!==null?[e]:[]}get targetElementsByQuery(){let e=this.ownerDocument?.querySelectorAll(this.targets);return e.length!==0?Array.prototype.slice.call(e):[]}},ro=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),El(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),_l(this.streamSource))}get src(){return this.getAttribute("src")||""}};Be.delegateConstructor=to;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",Be);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",io);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",ro);(()=>{let i=document.currentScript;if(i&&!i.hasAttribute("data-turbo-suppress-warning"))for(i=i.parentElement;i;){if(i==document.body)return console.warn(ul`
|
78
78
|
You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
|
79
79
|
|
80
80
|
Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
|
@@ -83,7 +83,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error
|
|
83
83
|
|
84
84
|
——
|
85
85
|
Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
|
86
|
-
`,i.outerHTML);i=i.parentElement}})();window.Turbo={...
|
86
|
+
`,i.outerHTML);i=i.parentElement}})();window.Turbo={...sf,StreamActions:Al};wl();["turbo:click","turbo:before-visit","turbo:visit","turbo:submit-start","turbo:before-fetch-request","turbo:before-fetch-response","turbo:submit-end","turbo:before-cache","turbo:before-render","turbo:before-stream-render","turbo:render","turbo:load","turbo:before-frame-render","turbo:frame-render","turbo:frame-load","turbo:frame-missing","turbo:fetch-request-error","turbo:reload","turbo:morph","turbo:before-morph-element","turbo:morph-attribute","turbo:morph"].forEach(i=>{document.addEventListener(i,e=>{console.log(e.type,e)})});var of=ir.start();Ls(of);})();
|
87
87
|
/*! Bundled license information:
|
88
88
|
|
89
89
|
dompurify/dist/purify.es.mjs:
|