plutonium 0.10.1 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/app/assets/javascripts/turbo/index.js +1 -1
  4. data/app/views/application/_resource_header.html.erb +12 -12
  5. data/app/views/layouts/resource.html.erb +1 -0
  6. data/app/views/layouts/rodauth.html.erb +4 -4
  7. data/app/views/resource/_nav_user.html.erb +1 -1
  8. data/app/views/resource/index.rabl +1 -1
  9. data/brakeman.ignore +1 -1
  10. data/config/initializers/rabl.rb +2 -0
  11. data/css.manifest +1 -1
  12. data/js.manifest +2 -2
  13. data/lib/generators/pu/core/install/templates/config/initializers/plutonium.rb +0 -3
  14. data/lib/generators/pu/gen/pug/pug_generator.rb +6 -0
  15. data/lib/generators/pu/gen/pug/templates/pug.rb.tt +1 -1
  16. data/lib/generators/pu/pkg/app/templates/config/routes.rb.tt +3 -3
  17. data/lib/plutonium/config.rb +0 -11
  18. data/lib/plutonium/core/autodiscovery/input_discoverer.rb +1 -1
  19. data/lib/plutonium/core/autodiscovery/renderer_discoverer.rb +1 -1
  20. data/lib/plutonium/core/controllers/base.rb +13 -3
  21. data/lib/plutonium/core/controllers/queryable.rb +3 -1
  22. data/lib/plutonium/pkg/app.rb +6 -0
  23. data/lib/plutonium/railtie.rb +15 -0
  24. data/lib/plutonium/reloader.rb +99 -0
  25. data/lib/plutonium/resource/controller.rb +61 -22
  26. data/lib/plutonium/resource/policy.rb +56 -9
  27. data/lib/plutonium/resource/presenter.rb +44 -12
  28. data/lib/plutonium/resource/query_object.rb +186 -73
  29. data/lib/plutonium/resource/record.rb +213 -119
  30. data/lib/plutonium/rodauth/controller_methods.rb +7 -0
  31. data/lib/plutonium/version.rb +1 -1
  32. data/lib/plutonium.rb +50 -12
  33. data/package-lock.json +174 -0
  34. data/package.json +2 -0
  35. data/public/plutonium-assets/plutonium-app-6WILQCTT.js +39 -0
  36. data/public/plutonium-assets/plutonium-app-6WILQCTT.js.map +7 -0
  37. data/public/plutonium-assets/plutonium-logo-original.png +0 -0
  38. data/public/plutonium-assets/plutonium-logo-white.png +0 -0
  39. data/public/plutonium-assets/plutonium-logo.png +0 -0
  40. data/public/plutonium-assets/plutonium.2d4f0c333cd000051d3b.css +3424 -0
  41. data/public/plutonium-assets/plutonium.ico +0 -0
  42. metadata +10 -4
  43. data/lib/plutonium/reactor/core.rb +0 -78
  44. data/public/plutonium-assets/logo.png +0 -0
@@ -0,0 +1,39 @@
1
+ (()=>{var Kn=Object.create;var gs=Object.defineProperty;var Xn=Object.getOwnPropertyDescriptor;var Yn=Object.getOwnPropertyNames;var Jn=Object.getPrototypeOf,Gn=Object.prototype.hasOwnProperty;var Qn=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Zn=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Yn(e))!Gn.call(i,s)&&s!==t&&gs(i,s,{get:()=>e[s],enumerable:!(r=Xn(e,s))||r.enumerable});return i};var eo=(i,e,t)=>(t=i!=null?Kn(Jn(i)):{},Zn(e||!i||!i.__esModule?gs(t,"default",{value:i,enumerable:!0}):t,i));var Ms=Qn(($c,Ps)=>{var $o="Expected a function",ks=NaN,Uo="[object Symbol]",Ko=/^\s+|\s+$/g,Xo=/^[-+]0x[0-9a-f]+$/i,Yo=/^0b[01]+$/i,Jo=/^0o[0-7]+$/i,Go=parseInt,Qo=typeof global=="object"&&global&&global.Object===Object&&global,Zo=typeof self=="object"&&self&&self.Object===Object&&self,ea=Qo||Zo||Function("return this")(),ta=Object.prototype,ia=ta.toString,ra=Math.max,sa=Math.min,ar=function(){return ea.Date.now()};function na(i,e,t){var r,s,n,o,a,u,f=0,d=!1,E=!1,w=!0;if(typeof i!="function")throw new TypeError($o);e=Is(e)||0,lr(t)&&(d=!!t.leading,E="maxWait"in t,n=E?ra(Is(t.maxWait)||0,e):n,w="trailing"in t?!!t.trailing:w);function y(v){var x=r,P=s;return r=s=void 0,f=v,o=i.apply(P,x),o}function O(v){return f=v,a=setTimeout(C,e),d?y(v):o}function L(v){var x=v-u,P=v-f,R=e-x;return E?sa(R,n-P):R}function _(v){var x=v-u,P=v-f;return u===void 0||x>=e||x<0||E&&P>=n}function C(){var v=ar();if(_(v))return k(v);a=setTimeout(C,L(v))}function k(v){return a=void 0,w&&r?y(v):(r=s=void 0,o)}function I(){a!==void 0&&clearTimeout(a),f=0,r=u=s=a=void 0}function S(){return a===void 0?o:k(ar())}function T(){var v=ar(),x=_(v);if(r=arguments,s=this,u=v,x){if(a===void 0)return O(u);if(E)return a=setTimeout(C,e),y(u)}return a===void 0&&(a=setTimeout(C,e)),o}return T.cancel=I,T.flush=S,T}function lr(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function oa(i){return!!i&&typeof i=="object"}function aa(i){return typeof i=="symbol"||oa(i)&&ia.call(i)==Uo}function Is(i){if(typeof i=="number")return i;if(aa(i))return ks;if(lr(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=lr(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(Ko,"");var t=Yo.test(i);return t||Jo.test(i)?Go(i.slice(2),t?2:8):Xo.test(i)?ks:+i}Ps.exports=na});var Bi=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=to(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,s=t.index;return r<s?-1:r>s?1:0})}};function to(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 Hi=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:s}=e,n=this.fetchEventListenerMapForEventTarget(t),o=this.cacheKey(r,s);n.delete(o),n.size==0&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){let{eventTarget:t,eventName:r,eventOptions:s}=e;return this.fetchEventListener(t,r,s)}fetchEventListener(e,t,r){let s=this.fetchEventListenerMapForEventTarget(e),n=this.cacheKey(t,r),o=s.get(n);return o||(o=this.createEventListener(e,t,r),s.set(n,o)),o}createEventListener(e,t,r){let s=new Bi(e,t,r);return this.started&&s.connect(),s}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(s=>{r.push(`${t[s]?"":"!"}${s}`)}),r.join(":")}},io={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}},ro=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function so(i){let t=i.trim().match(ro)||[],r=t[2],s=t[3];return s&&!["keydown","keyup","keypress"].includes(r)&&(r+=`.${s}`,s=""),{eventTarget:no(t[4]),eventName:r,eventOptions:t[7]?oo(t[7]):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||s}}function no(i){if(i=="window")return window;if(i=="document")return document}function oo(i){return i.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})}function ao(i){if(i==window)return"window";if(i==document)return"document"}function or(i){return i.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function qi(i){return or(i.replace(/--/g,"-").replace(/__/g,"_"))}function Et(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Ts(i){return i.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function lo(i){return i.match(/[^\s]+/g)||[]}function vs(i){return i!=null}function Ni(i,e){return Object.prototype.hasOwnProperty.call(i,e)}var bs=["meta","ctrl","alt","shift"],Vi=class{constructor(e,t,r,s){this.element=e,this.index=t,this.eventTarget=r.eventTarget||e,this.eventName=r.eventName||co(e)||Bt("missing event name"),this.eventOptions=r.eventOptions||{},this.identifier=r.identifier||Bt("missing identifier"),this.methodName=r.methodName||Bt("missing method name"),this.keyFilter=r.keyFilter||"",this.schema=s}static forToken(e,t){return new this(e.element,e.index,so(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(s=>!bs.includes(s))[0];return r?(Ni(this.keyMappings,r)||Bt(`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:s}of Array.from(this.element.attributes)){let n=r.match(t),o=n&&n[1];o&&(e[or(o)]=ho(s))}return e}get eventTargetName(){return ao(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){let[r,s,n,o]=bs.map(a=>t.includes(a));return e.metaKey!==r||e.ctrlKey!==s||e.altKey!==n||e.shiftKey!==o}},ys={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:i=>i.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function co(i){let e=i.tagName.toLowerCase();if(e in ys)return ys[e](i)}function Bt(i){throw new Error(i)}function ho(i){try{return JSON.parse(i)}catch{return i}}var ji=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:s}=this.context,n=!0;for(let[o,a]of Object.entries(this.eventOptions))if(o in r){let u=r[o];n=n&&u({name:o,value:a,event:e,element:t,controller:s})}else continue;return n}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(s){let{identifier:n,controller:o,element:a,index:u}=this,f={identifier:n,controller:o,element:a,index:u,event:e};this.context.handleError(s,`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}},Ht=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))}},qt=class{constructor(e,t,r){this.attributeName=t,this.delegate=r,this.elementObserver=new Ht(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 uo(i,e,t){Cs(i,e).add(t)}function fo(i,e,t){Cs(i,e).delete(t),po(i,e)}function Cs(i,e){let t=i.get(e);return t||(t=new Set,i.set(e,t)),t}function po(i,e){let t=i.get(e);t!=null&&t.size==0&&i.delete(e)}var me=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){uo(this.valuesByKey,e,t)}delete(e,t){fo(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 Wi=class{constructor(e,t,r,s){this._selector=t,this.details=s,this.elementObserver=new Ht(e,this),this.delegate=r,this.matchesByElement=new me}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]:[],s=Array.from(e.querySelectorAll(t)).filter(n=>this.matchElement(n));return r.concat(s)}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 s=this.matchElement(e),n=this.matchesByElement.has(r,e);s&&!n?this.selectorMatched(e,r):!s&&n&&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)}},zi=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 s=this.element.getAttribute(e);if(this.stringMap.get(e)!=s&&this.stringMapValueChanged(s,r,t),s==null){let n=this.stringMap.get(e);this.stringMap.delete(e),n&&this.stringMapKeyRemoved(r,e,n)}else this.stringMap.set(e,s)}}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())}},Nt=class{constructor(e,t,r){this.attributeObserver=new qt(e,t,this),this.delegate=r,this.tokensByElement=new me}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),s=go(t,r).findIndex(([n,o])=>!vo(n,o));return s==-1?[[],[]]:[t.slice(s),r.slice(s)]}readTokensForElement(e){let t=this.attributeName,r=e.getAttribute(t)||"";return mo(r,e,t)}};function mo(i,e,t){return i.trim().split(/\s+/).filter(r=>r.length).map((r,s)=>({element:e,attributeName:t,content:r,index:s}))}function go(i,e){let t=Math.max(i.length,e.length);return Array.from({length:t},(r,s)=>[i[s],e[s]])}function vo(i,e){return i&&e&&i.index==e.index&&i.content==e.content}var Vt=class{constructor(e,t,r){this.tokenListObserver=new Nt(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}}}},$i=class{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new Vt(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 ji(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=Vi.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},Ui=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new zi(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 s=this.valueDescriptorNameMap[t];e!==null&&(r===null&&(r=s.writer(s.defaultValue)),this.invokeChangedCallback(t,e,r))}stringMapKeyRemoved(e,t,r){let s=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,s.writer(this.receiver[e]),r):this.invokeChangedCallback(e,s.writer(s.defaultValue),r)}invokeChangedCallbacksForDefaultValues(){for(let{key:e,name:t,defaultValue:r,writer:s}of this.valueDescriptors)r!=null&&!this.controller.data.has(e)&&this.invokeChangedCallback(t,s(r),void 0)}invokeChangedCallback(e,t,r){let s=`${e}Changed`,n=this.receiver[s];if(typeof n=="function"){let o=this.valueDescriptorNameMap[e];try{let a=o.reader(t),u=r;r&&(u=o.reader(r)),n.call(this.receiver,a,u)}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${Et(t.name)}`;return this.receiver[r]}},Ki=class{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new me}start(){this.tokenListObserver||(this.tokenListObserver=new Nt(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 _t(i,e){let t=xs(i);return Array.from(t.reduce((r,s)=>(yo(s,e).forEach(n=>r.add(n)),r),new Set))}function bo(i,e){return xs(i).reduce((r,s)=>(r.push(...wo(s,e)),r),[])}function xs(i){let e=[];for(;i;)e.push(i),i=Object.getPrototypeOf(i);return e.reverse()}function yo(i,e){let t=i[e];return Array.isArray(t)?t:[]}function wo(i,e){let t=i[e];return t?Object.keys(t).map(r=>[r,t[r]]):[]}var Xi=class{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new me,this.outletElementsByName=new me,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 s=this.getOutlet(e,r);s&&this.connectOutlet(s,e,r)}selectorUnmatched(e,t,{outletName:r}){let s=this.getOutletFromMap(e,r);s&&this.disconnectOutlet(s,e,r)}selectorMatchElement(e,{outletName:t}){let r=this.selector(t),s=this.hasOutlet(e,t),n=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return r?s&&n&&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 s;this.outletElementsByName.has(r,t)||(this.outletsByName.add(r,e),this.outletElementsByName.add(r,t),(s=this.selectorObserverMap.get(r))===null||s===void 0||s.pause(()=>this.delegate.outletConnected(e,t,r)))}disconnectOutlet(e,t,r){var s;this.outletElementsByName.has(r,t)&&(this.outletsByName.delete(r,e),this.outletElementsByName.delete(r,t),(s=this.selectorObserverMap.get(r))===null||s===void 0||s.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 Wi(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,r),r.start()}setupAttributeObserverForOutlet(e){let t=this.attributeNameForOutletName(e),r=new qt(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 me;return this.router.modules.forEach(t=>{let r=t.definition.controllerConstructor;_t(r,"outlets").forEach(n=>e.add(n,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){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}},Yi=class{constructor(e,t){this.logDebugActivity=(r,s={})=>{let{identifier:n,controller:o,element:a}=this;s=Object.assign({identifier:n,controller:o,element:a},s),this.application.logDebugActivity(this.identifier,r,s)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new $i(this,this.dispatcher),this.valueObserver=new Ui(this,this.controller),this.targetObserver=new Ki(this,this),this.outletObserver=new Xi(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:s,controller:n,element:o}=this;r=Object.assign({identifier:s,controller:n,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(`${qi(r)}OutletConnected`,e,t)}outletDisconnected(e,t,r){this.invokeControllerMethod(`${qi(r)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){let r=this.controller;typeof r[e]=="function"&&r[e](...t)}};function Eo(i){return _o(i,Ao(i))}function _o(i,e){let t=Co(i),r=So(i.prototype,e);return Object.defineProperties(t.prototype,r),t}function Ao(i){return _t(i,"blessings").reduce((t,r)=>{let s=r(i);for(let n in s){let o=t[n]||{};t[n]=Object.assign(o,s[n])}return t},{})}function So(i,e){return To(e).reduce((t,r)=>{let s=Lo(i,e,r);return s&&Object.assign(t,{[r]:s}),t},{})}function Lo(i,e,t){let r=Object.getOwnPropertyDescriptor(i,t);if(!(r&&"value"in r)){let n=Object.getOwnPropertyDescriptor(e,t).value;return r&&(n.get=r.get||n.get,n.set=r.set||n.set),n}}var To=typeof Object.getOwnPropertySymbols=="function"?i=>[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)]:Object.getOwnPropertyNames,Co=(()=>{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 xo(i){return{identifier:i.identifier,controllerConstructor:Eo(i.controllerConstructor)}}var Ji=class{constructor(e,t){this.application=e,this.definition=xo(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 Yi(this,e),this.contextsByScope.set(e,t)),t}},Gi=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 lo(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},Qi=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}-${Ts(e)}`}},Zi=class{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,r){let s=this.warnedKeysByObject.get(e);s||(s=new Set,this.warnedKeysByObject.set(e,s)),s.has(t)||(s.add(t),this.logger.warn(r,e))}};function er(i,e){return`[${i}~="${e}"]`}var tr=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 er(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 er(this.schema.targetAttribute,t)}deprecate(e,t){if(e){let{identifier:r}=this,s=this.schema.targetAttribute,n=this.schema.targetAttributeForScope(r);this.guide.warn(e,`target:${t}`,`Please replace ${s}="${r}.${t}" with ${n}="${t}". The ${s} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}},ir=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(s=>this.matchesElement(s,e,t))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter(s=>this.matchesElement(s,e,t))}matchesElement(e,t,r){let s=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&s.split(" ").includes(r)}},rr=class i{constructor(e,t,r,s){this.targets=new tr(this),this.classes=new Gi(this),this.data=new Qi(this),this.containsElement=n=>n.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=r,this.guide=new Zi(s),this.outlets=new ir(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 er(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)}},sr=class{constructor(e,t,r){this.element=e,this.schema=t,this.delegate=r,this.valueListObserver=new Vt(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),s=r.get(t);return s||(s=this.delegate.createScopeForElementAndIdentifier(e,t),r.set(t,s)),s}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}},nr=class{constructor(e){this.application=e,this.scopeObserver=new sr(this.element,this.schema,this),this.scopesByIdentifier=new me,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 Ji(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(s=>s.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 rr(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))}},Oo={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"},ws("abcdefghijklmnopqrstuvwxyz".split("").map(i=>[i,i]))),ws("0123456789".split("").map(i=>[i,i])))};function ws(i){return i.reduce((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r}),{})}var jt=class{constructor(e=document.documentElement,t=Oo){this.logger=console,this.debug=!1,this.logDebugActivity=(r,s,n={})=>{this.debug&&this.logFormattedMessage(r,s,n)},this.element=e,this.schema=t,this.dispatcher=new Hi(this),this.router=new nr(this),this.actionDescriptorFilters=Object.assign({},io)}static start(e,t){let r=new this(e,t);return r.start(),r}async start(){await ko(),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(s=>{s.controllerConstructor.shouldLoad&&this.router.loadDefinition(s)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(s=>this.router.unloadIdentifier(s))}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 s;this.logger.error(`%s
2
+
3
+ %o
4
+
5
+ %o`,t,e,r),(s=window.onerror)===null||s===void 0||s.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 ko(){return new Promise(i=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>i()):i()})}function Io(i){return _t(i,"classes").reduce((t,r)=>Object.assign(t,Po(r)),{})}function Po(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${Et(i)}Class`]:{get(){return this.classes.has(i)}}}}function Mo(i){return _t(i,"outlets").reduce((t,r)=>Object.assign(t,Ro(r)),{})}function Es(i,e,t){return i.application.getControllerForElementAndIdentifier(e,t)}function _s(i,e,t){let r=Es(i,e,t);if(r||(i.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),r=Es(i,e,t),r))return r}function Ro(i){let e=qi(i);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t){let s=_s(this,t,i);if(s)return s;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 s=_s(this,r,i);if(s)return s;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${Et(e)}Outlet`]:{get(){return this.outlets.has(i)}}}}function Fo(i){return _t(i,"targets").reduce((t,r)=>Object.assign(t,Do(r)),{})}function Do(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${Et(i)}Target`]:{get(){return this.targets.has(i)}}}}function Bo(i){let e=bo(i,"values"),t={valueDescriptorMap:{get(){return e.reduce((r,s)=>{let n=Os(s,this.identifier),o=this.data.getAttributeNameForKey(n.key);return Object.assign(r,{[o]:n})},{})}}};return e.reduce((r,s)=>Object.assign(r,Ho(s)),t)}function Ho(i,e){let t=Os(i,e),{key:r,name:s,reader:n,writer:o}=t;return{[s]:{get(){let a=this.data.get(r);return a!==null?n(a):t.defaultValue},set(a){a===void 0?this.data.delete(r):this.data.set(r,o(a))}},[`has${Et(s)}`]:{get(){return this.data.has(r)||t.hasCustomDefaultValue}}}}function Os([i,e],t){return jo({controller:t,token:i,typeDefinition:e})}function Wt(i){switch(i){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function wt(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 qo(i){let{controller:e,token:t,typeObject:r}=i,s=vs(r.type),n=vs(r.default),o=s&&n,a=s&&!n,u=!s&&n,f=Wt(r.type),d=wt(i.typeObject.default);if(a)return f;if(u)return d;if(f!==d){let E=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${E}" must match the defined type "${f}". The provided default value of "${r.default}" is of type "${d}".`)}if(o)return f}function No(i){let{controller:e,token:t,typeDefinition:r}=i,n=qo({controller:e,token:t,typeObject:r}),o=wt(r),a=Wt(r),u=n||o||a;if(u)return u;let f=e?`${e}.${r}`:t;throw new Error(`Unknown value type "${f}" for "${t}" value`)}function Vo(i){let e=Wt(i);if(e)return As[e];let t=Ni(i,"default"),r=Ni(i,"type"),s=i;if(t)return s.default;if(r){let{type:n}=s,o=Wt(n);if(o)return As[o]}return i}function jo(i){let{token:e,typeDefinition:t}=i,r=`${Ts(e)}-value`,s=No(i);return{type:s,key:r,name:or(r),get defaultValue(){return Vo(t)},get hasCustomDefaultValue(){return wt(t)!==void 0},reader:Wo[s],writer:Ss[s]||Ss.default}}var As={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},Wo={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 "${wt(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 "${wt(e)}"`);return e},string(i){return i}},Ss={default:zo,array:Ls,object:Ls};function Ls(i){return JSON.stringify(i)}function zo(i){return`${i}`}var D=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:s=this.identifier,bubbles:n=!0,cancelable:o=!0}={}){let a=s?`${s}:${e}`:e,u=new CustomEvent(a,{detail:r,bubbles:n,cancelable:o});return t.dispatchEvent(u),u}};D.blessings=[Io,Fo,Bo,Mo];D.targets=[];D.outlets=[];D.values={};var zt=class extends D{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==="true")e.remove();else{e.style.display="none";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 $t=class extends D{connect(){console.log(`tab-bar connected: ${this.element}`)}};var Ut=class extends D{connect(){console.log(`toolbar connected: ${this.element}`)}};var Kt=class extends D{connect(){console.log(`table-search-input connected: ${this.element}`)}};var Xt=class extends D{connect(){console.log(`table-toolbar connected: ${this.element}`)}};var Yt=class extends D{connect(){console.log(`table connected: ${this.element}`)}};var Kc=eo(Ms()),Jt=class extends D{connect(){console.log(`form connected: ${this.element}`)}submit(){this.element.requestSubmit()}};var la=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}(),Rs=la;var ca=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,s){if(s===void 0&&(s=!1),!this._instances[e])return console.warn("Flowbite: Component ".concat(e," does not exist.")),!1;if(this._instances[e][r]&&!s){console.warn("Flowbite: Instance with ID ".concat(r," already exists."));return}s&&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}(),Fs=new ca,b=Fs;typeof window<"u"&&(window.FlowbiteInstances=Fs);var Gt=function(){return Gt=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}return i},Gt.apply(this,arguments)},Qt={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(){}},ha={id:null,override:!0},Ds=function(){function i(e,t,r,s){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=Qt),s===void 0&&(s=ha),this._instanceId=s.id?s.id:e.id,this._accordionEl=e,this._items=t,this._options=Gt(Gt({},Qt),r),this._initialized=!1,this.init(),b.addInstance("Accordion",this,this._instanceId,s.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(){b.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,s=this,n=this.getItem(e);this._options.alwaysOpen||this._items.map(function(o){var a,u;o!==n&&((a=o.triggerEl.classList).remove.apply(a,s._options.activeClasses.split(" ")),(u=o.triggerEl.classList).add.apply(u,s._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=n.triggerEl.classList).add.apply(t,this._options.activeClasses.split(" ")),(r=n.triggerEl.classList).remove.apply(r,this._options.inactiveClasses.split(" ")),n.triggerEl.setAttribute("aria-expanded","true"),n.targetEl.classList.remove("hidden"),n.active=!0,n.iconEl&&n.iconEl.classList.remove("rotate-180"),this._options.onOpen(this,n)},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,s=this.getItem(e);(t=s.triggerEl.classList).remove.apply(t,this._options.activeClasses.split(" ")),(r=s.triggerEl.classList).add.apply(r,this._options.inactiveClasses.split(" ")),s.targetEl.classList.add("hidden"),s.triggerEl.setAttribute("aria-expanded","false"),s.active=!1,s.iconEl&&s.iconEl.classList.add("rotate-180"),this._options.onClose(this,s)},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 Ke(){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"),s=[];i.querySelectorAll("[data-accordion-target]").forEach(function(n){if(n.closest("[data-accordion]")===i){var o={id:n.getAttribute("data-accordion-target"),triggerEl:n,targetEl:document.querySelector(n.getAttribute("data-accordion-target")),iconEl:n.querySelector("[data-accordion-icon]"),active:n.getAttribute("aria-expanded")==="true"};s.push(o)}}),new Ds(i,s,{alwaysOpen:e==="open",activeClasses:t||Qt.activeClasses,inactiveClasses:r||Qt.inactiveClasses})})}typeof window<"u"&&(window.Accordion=Ds,window.initAccordions=Ke);var Zt=function(){return Zt=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}return i},Zt.apply(this,arguments)},Bs={onCollapse:function(){},onExpand:function(){},onToggle:function(){}},ua={id:null,override:!0},cr=function(){function i(e,t,r,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Bs),s===void 0&&(s=ua),this._instanceId=s.id?s.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=Zt(Zt({},Bs),r),this._visible=!1,this._initialized=!1,this.init(),b.addInstance("Collapse",this,this._instanceId,s.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(){b.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 Xe(){document.querySelectorAll("[data-collapse-toggle]").forEach(function(i){var e=i.getAttribute("data-collapse-toggle"),t=document.getElementById(e);t?b.instanceExists("Collapse",t.getAttribute("id"))?new cr(t,i,{},{id:t.getAttribute("id")+"_"+b._generateRandomId()}):new cr(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=cr,window.initCollapses=Xe);var Ie=function(){return Ie=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}return i},Ie.apply(this,arguments)},ei={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(){}},da={id:null,override:!0},Hs=function(){function i(e,t,r,s){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=ei),s===void 0&&(s=da),this._instanceId=s.id?s.id:e.id,this._carouselEl=e,this._items=t,this._options=Ie(Ie(Ie({},ei),r),{indicators:Ie(Ie({},ei.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(),b.addInstance("Carousel",this,this._instanceId,s.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(){b.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,s=this;this._activeItem=e;var n=e.position;this._indicators.length&&(this._indicators.map(function(o){var a,u;o.el.setAttribute("aria-current","false"),(a=o.el.classList).remove.apply(a,s._options.indicators.activeClasses.split(" ")),(u=o.el.classList).add.apply(u,s._options.indicators.inactiveClasses.split(" "))}),(t=this._indicators[n].el.classList).add.apply(t,this._options.indicators.activeClasses.split(" ")),(r=this._indicators[n].el.classList).remove.apply(r,this._options.indicators.inactiveClasses.split(" ")),this._indicators[n].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 Ye(){document.querySelectorAll("[data-carousel]").forEach(function(i){var e=i.getAttribute("data-carousel-interval"),t=i.getAttribute("data-carousel")==="slide",r=[],s=0;i.querySelectorAll("[data-carousel-item]").length&&Array.from(i.querySelectorAll("[data-carousel-item]")).map(function(f,d){r.push({position:d,el:f}),f.getAttribute("data-carousel-item")==="active"&&(s=d)});var n=[];i.querySelectorAll("[data-carousel-slide-to]").length&&Array.from(i.querySelectorAll("[data-carousel-slide-to]")).map(function(f){n.push({position:parseInt(f.getAttribute("data-carousel-slide-to")),el:f})});var o=new Hs(i,r,{defaultPosition:s,indicators:{items:n},interval:e||ei.interval});t&&o.cycle();var a=i.querySelector("[data-carousel-next]"),u=i.querySelector("[data-carousel-prev]");a&&a.addEventListener("click",function(){o.next()}),u&&u.addEventListener("click",function(){o.prev()})})}typeof window<"u"&&(window.Carousel=Hs,window.initCarousels=Ye);var ti=function(){return ti=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}return i},ti.apply(this,arguments)},qs={transition:"transition-opacity",duration:300,timing:"ease-out",onHide:function(){}},fa={id:null,override:!0},hr=function(){function i(e,t,r,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=qs),s===void 0&&(s=fa),this._instanceId=s.id?s.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=ti(ti({},qs),r),this._initialized=!1,this.init(),b.addInstance("Dismiss",this,this._instanceId,s.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(){b.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 Je(){document.querySelectorAll("[data-dismiss-target]").forEach(function(i){var e=i.getAttribute("data-dismiss-target"),t=document.querySelector(e);t?new hr(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=hr,window.initDismisses=Je);var ur=hr;var N="top",U="bottom",z="right",W="left",ii="auto",we=[N,U,z,W],ge="start",Pe="end",Ns="clippingParents",ri="viewport",Ge="popper",Vs="reference",dr=we.reduce(function(i,e){return i.concat([e+"-"+ge,e+"-"+Pe])},[]),si=[].concat(we,[ii]).reduce(function(i,e){return i.concat([e,e+"-"+ge,e+"-"+Pe])},[]),pa="beforeRead",ma="read",ga="afterRead",va="beforeMain",ba="main",ya="afterMain",wa="beforeWrite",Ea="write",_a="afterWrite",js=[pa,ma,ga,va,ba,ya,wa,Ea,_a];function Y(i){return i?(i.nodeName||"").toLowerCase():null}function B(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function re(i){var e=B(i).Element;return i instanceof e||i instanceof Element}function K(i){var e=B(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function Qe(i){if(typeof ShadowRoot>"u")return!1;var e=B(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function Aa(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},s=e.attributes[t]||{},n=e.elements[t];!K(n)||!Y(n)||(Object.assign(n.style,r),Object.keys(s).forEach(function(o){var a=s[o];a===!1?n.removeAttribute(o):n.setAttribute(o,a===!0?"":a)}))})}function Sa(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 s=e.elements[r],n=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=o.reduce(function(u,f){return u[f]="",u},{});!K(s)||!Y(s)||(Object.assign(s.style,a),Object.keys(n).forEach(function(u){s.removeAttribute(u)}))})}}var Ws={name:"applyStyles",enabled:!0,phase:"write",fn:Aa,effect:Sa,requires:["computeStyles"]};function J(i){return i.split("-")[0]}var le=Math.max,Me=Math.min,ve=Math.round;function Ze(){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 At(){return!/^((?!chrome|android).)*safari/i.test(Ze())}function se(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=i.getBoundingClientRect(),s=1,n=1;e&&K(i)&&(s=i.offsetWidth>0&&ve(r.width)/i.offsetWidth||1,n=i.offsetHeight>0&&ve(r.height)/i.offsetHeight||1);var o=re(i)?B(i):window,a=o.visualViewport,u=!At()&&t,f=(r.left+(u&&a?a.offsetLeft:0))/s,d=(r.top+(u&&a?a.offsetTop:0))/n,E=r.width/s,w=r.height/n;return{width:E,height:w,top:d,right:f+E,bottom:d+w,left:f,x:f,y:d}}function Re(i){var e=se(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 St(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&Qe(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Z(i){return B(i).getComputedStyle(i)}function fr(i){return["table","td","th"].indexOf(Y(i))>=0}function Q(i){return((re(i)?i.ownerDocument:i.document)||window.document).documentElement}function be(i){return Y(i)==="html"?i:i.assignedSlot||i.parentNode||(Qe(i)?i.host:null)||Q(i)}function zs(i){return!K(i)||Z(i).position==="fixed"?null:i.offsetParent}function La(i){var e=/firefox/i.test(Ze()),t=/Trident/i.test(Ze());if(t&&K(i)){var r=Z(i);if(r.position==="fixed")return null}var s=be(i);for(Qe(s)&&(s=s.host);K(s)&&["html","body"].indexOf(Y(s))<0;){var n=Z(s);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||e&&n.willChange==="filter"||e&&n.filter&&n.filter!=="none")return s;s=s.parentNode}return null}function ce(i){for(var e=B(i),t=zs(i);t&&fr(t)&&Z(t).position==="static";)t=zs(t);return t&&(Y(t)==="html"||Y(t)==="body"&&Z(t).position==="static")?e:t||La(i)||e}function Fe(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function De(i,e,t){return le(i,Me(e,t))}function $s(i,e,t){var r=De(i,e,t);return r>t?t:r}function Lt(){return{top:0,right:0,bottom:0,left:0}}function Tt(i){return Object.assign({},Lt(),i)}function Ct(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var Ta=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Tt(typeof e!="number"?e:Ct(e,we))};function Ca(i){var e,t=i.state,r=i.name,s=i.options,n=t.elements.arrow,o=t.modifiersData.popperOffsets,a=J(t.placement),u=Fe(a),f=[W,z].indexOf(a)>=0,d=f?"height":"width";if(!(!n||!o)){var E=Ta(s.padding,t),w=Re(n),y=u==="y"?N:W,O=u==="y"?U:z,L=t.rects.reference[d]+t.rects.reference[u]-o[u]-t.rects.popper[d],_=o[u]-t.rects.reference[u],C=ce(n),k=C?u==="y"?C.clientHeight||0:C.clientWidth||0:0,I=L/2-_/2,S=E[y],T=k-w[d]-E[O],v=k/2-w[d]/2+I,x=De(S,v,T),P=u;t.modifiersData[r]=(e={},e[P]=x,e.centerOffset=x-v,e)}}function xa(i){var e=i.state,t=i.options,r=t.element,s=r===void 0?"[data-popper-arrow]":r;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||St(e.elements.popper,s)&&(e.elements.arrow=s))}var Us={name:"arrow",enabled:!0,phase:"main",fn:Ca,effect:xa,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ne(i){return i.split("-")[1]}var Oa={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ka(i,e){var t=i.x,r=i.y,s=e.devicePixelRatio||1;return{x:ve(t*s)/s||0,y:ve(r*s)/s||0}}function Ks(i){var e,t=i.popper,r=i.popperRect,s=i.placement,n=i.variation,o=i.offsets,a=i.position,u=i.gpuAcceleration,f=i.adaptive,d=i.roundOffsets,E=i.isFixed,w=o.x,y=w===void 0?0:w,O=o.y,L=O===void 0?0:O,_=typeof d=="function"?d({x:y,y:L}):{x:y,y:L};y=_.x,L=_.y;var C=o.hasOwnProperty("x"),k=o.hasOwnProperty("y"),I=W,S=N,T=window;if(f){var v=ce(t),x="clientHeight",P="clientWidth";if(v===B(t)&&(v=Q(t),Z(v).position!=="static"&&a==="absolute"&&(x="scrollHeight",P="scrollWidth")),v=v,s===N||(s===W||s===z)&&n===Pe){S=U;var R=E&&v===T&&T.visualViewport?T.visualViewport.height:v[x];L-=R-r.height,L*=u?1:-1}if(s===W||(s===N||s===U)&&n===Pe){I=z;var V=E&&v===T&&T.visualViewport?T.visualViewport.width:v[P];y-=V-r.width,y*=u?1:-1}}var X=Object.assign({position:a},f&&Oa),$=d===!0?ka({x:y,y:L},B(t)):{x:y,y:L};if(y=$.x,L=$.y,u){var j;return Object.assign({},X,(j={},j[S]=k?"0":"",j[I]=C?"0":"",j.transform=(T.devicePixelRatio||1)<=1?"translate("+y+"px, "+L+"px)":"translate3d("+y+"px, "+L+"px, 0)",j))}return Object.assign({},X,(e={},e[S]=k?L+"px":"",e[I]=C?y+"px":"",e.transform="",e))}function Ia(i){var e=i.state,t=i.options,r=t.gpuAcceleration,s=r===void 0?!0:r,n=t.adaptive,o=n===void 0?!0:n,a=t.roundOffsets,u=a===void 0?!0:a,f={placement:J(e.placement),variation:ne(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Ks(Object.assign({},f,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ks(Object.assign({},f,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Xs={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ia,data:{}};var ni={passive:!0};function Pa(i){var e=i.state,t=i.instance,r=i.options,s=r.scroll,n=s===void 0?!0:s,o=r.resize,a=o===void 0?!0:o,u=B(e.elements.popper),f=[].concat(e.scrollParents.reference,e.scrollParents.popper);return n&&f.forEach(function(d){d.addEventListener("scroll",t.update,ni)}),a&&u.addEventListener("resize",t.update,ni),function(){n&&f.forEach(function(d){d.removeEventListener("scroll",t.update,ni)}),a&&u.removeEventListener("resize",t.update,ni)}}var Ys={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Pa,data:{}};var Ma={left:"right",right:"left",bottom:"top",top:"bottom"};function et(i){return i.replace(/left|right|bottom|top/g,function(e){return Ma[e]})}var Ra={start:"end",end:"start"};function oi(i){return i.replace(/start|end/g,function(e){return Ra[e]})}function Be(i){var e=B(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function He(i){return se(Q(i)).left+Be(i).scrollLeft}function pr(i,e){var t=B(i),r=Q(i),s=t.visualViewport,n=r.clientWidth,o=r.clientHeight,a=0,u=0;if(s){n=s.width,o=s.height;var f=At();(f||!f&&e==="fixed")&&(a=s.offsetLeft,u=s.offsetTop)}return{width:n,height:o,x:a+He(i),y:u}}function mr(i){var e,t=Q(i),r=Be(i),s=(e=i.ownerDocument)==null?void 0:e.body,n=le(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=le(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-r.scrollLeft+He(i),u=-r.scrollTop;return Z(s||t).direction==="rtl"&&(a+=le(t.clientWidth,s?s.clientWidth:0)-n),{width:n,height:o,x:a,y:u}}function qe(i){var e=Z(i),t=e.overflow,r=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+r)}function ai(i){return["html","body","#document"].indexOf(Y(i))>=0?i.ownerDocument.body:K(i)&&qe(i)?i:ai(be(i))}function Ee(i,e){var t;e===void 0&&(e=[]);var r=ai(i),s=r===((t=i.ownerDocument)==null?void 0:t.body),n=B(r),o=s?[n].concat(n.visualViewport||[],qe(r)?r:[]):r,a=e.concat(o);return s?a:a.concat(Ee(be(o)))}function tt(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function Fa(i,e){var t=se(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 Js(i,e,t){return e===ri?tt(pr(i,t)):re(e)?Fa(e,t):tt(mr(Q(i)))}function Da(i){var e=Ee(be(i)),t=["absolute","fixed"].indexOf(Z(i).position)>=0,r=t&&K(i)?ce(i):i;return re(r)?e.filter(function(s){return re(s)&&St(s,r)&&Y(s)!=="body"}):[]}function gr(i,e,t,r){var s=e==="clippingParents"?Da(i):[].concat(e),n=[].concat(s,[t]),o=n[0],a=n.reduce(function(u,f){var d=Js(i,f,r);return u.top=le(d.top,u.top),u.right=Me(d.right,u.right),u.bottom=Me(d.bottom,u.bottom),u.left=le(d.left,u.left),u},Js(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 xt(i){var e=i.reference,t=i.element,r=i.placement,s=r?J(r):null,n=r?ne(r):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,u;switch(s){case N:u={x:o,y:e.y-t.height};break;case U:u={x:o,y:e.y+e.height};break;case z:u={x:e.x+e.width,y:a};break;case W:u={x:e.x-t.width,y:a};break;default:u={x:e.x,y:e.y}}var f=s?Fe(s):null;if(f!=null){var d=f==="y"?"height":"width";switch(n){case ge:u[f]=u[f]-(e[d]/2-t[d]/2);break;case Pe:u[f]=u[f]+(e[d]/2-t[d]/2);break;default:}}return u}function he(i,e){e===void 0&&(e={});var t=e,r=t.placement,s=r===void 0?i.placement:r,n=t.strategy,o=n===void 0?i.strategy:n,a=t.boundary,u=a===void 0?Ns:a,f=t.rootBoundary,d=f===void 0?ri:f,E=t.elementContext,w=E===void 0?Ge:E,y=t.altBoundary,O=y===void 0?!1:y,L=t.padding,_=L===void 0?0:L,C=Tt(typeof _!="number"?_:Ct(_,we)),k=w===Ge?Vs:Ge,I=i.rects.popper,S=i.elements[O?k:w],T=gr(re(S)?S:S.contextElement||Q(i.elements.popper),u,d,o),v=se(i.elements.reference),x=xt({reference:v,element:I,strategy:"absolute",placement:s}),P=tt(Object.assign({},I,x)),R=w===Ge?P:v,V={top:T.top-R.top+C.top,bottom:R.bottom-T.bottom+C.bottom,left:T.left-R.left+C.left,right:R.right-T.right+C.right},X=i.modifiersData.offset;if(w===Ge&&X){var $=X[s];Object.keys(V).forEach(function(j){var de=[z,U].indexOf(j)>=0?1:-1,pe=[N,U].indexOf(j)>=0?"y":"x";V[j]+=$[pe]*de})}return V}function vr(i,e){e===void 0&&(e={});var t=e,r=t.placement,s=t.boundary,n=t.rootBoundary,o=t.padding,a=t.flipVariations,u=t.allowedAutoPlacements,f=u===void 0?si:u,d=ne(r),E=d?a?dr:dr.filter(function(O){return ne(O)===d}):we,w=E.filter(function(O){return f.indexOf(O)>=0});w.length===0&&(w=E);var y=w.reduce(function(O,L){return O[L]=he(i,{placement:L,boundary:s,rootBoundary:n,padding:o})[J(L)],O},{});return Object.keys(y).sort(function(O,L){return y[O]-y[L]})}function Ba(i){if(J(i)===ii)return[];var e=et(i);return[oi(i),e,oi(e)]}function Ha(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var s=t.mainAxis,n=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!0:o,u=t.fallbackPlacements,f=t.padding,d=t.boundary,E=t.rootBoundary,w=t.altBoundary,y=t.flipVariations,O=y===void 0?!0:y,L=t.allowedAutoPlacements,_=e.options.placement,C=J(_),k=C===_,I=u||(k||!O?[et(_)]:Ba(_)),S=[_].concat(I).reduce(function(ee,ae){return ee.concat(J(ae)===ii?vr(e,{placement:ae,boundary:d,rootBoundary:E,padding:f,flipVariations:O,allowedAutoPlacements:L}):ae)},[]),T=e.rects.reference,v=e.rects.popper,x=new Map,P=!0,R=S[0],V=0;V<S.length;V++){var X=S[V],$=J(X),j=ne(X)===ge,de=[N,U].indexOf($)>=0,pe=de?"width":"height",l=he(e,{placement:X,boundary:d,rootBoundary:E,altBoundary:w,padding:f}),c=de?j?z:W:j?U:N;T[pe]>v[pe]&&(c=et(c));var h=et(c),p=[];if(n&&p.push(l[$]<=0),a&&p.push(l[c]<=0,l[h]<=0),p.every(function(ee){return ee})){R=X,P=!1;break}x.set(X,p)}if(P)for(var m=O?3:1,g=function(ae){var M=S.find(function(te){var ie=x.get(te);if(ie)return ie.slice(0,ae).every(function(Oe){return Oe})});if(M)return R=M,"break"},A=m;A>0;A--){var F=g(A);if(F==="break")break}e.placement!==R&&(e.modifiersData[r]._skip=!0,e.placement=R,e.reset=!0)}}var Gs={name:"flip",enabled:!0,phase:"main",fn:Ha,requiresIfExists:["offset"],data:{_skip:!1}};function Qs(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 Zs(i){return[N,z,U,W].some(function(e){return i[e]>=0})}function qa(i){var e=i.state,t=i.name,r=e.rects.reference,s=e.rects.popper,n=e.modifiersData.preventOverflow,o=he(e,{elementContext:"reference"}),a=he(e,{altBoundary:!0}),u=Qs(o,r),f=Qs(a,s,n),d=Zs(u),E=Zs(f);e.modifiersData[t]={referenceClippingOffsets:u,popperEscapeOffsets:f,isReferenceHidden:d,hasPopperEscaped:E},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":E})}var en={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:qa};function Na(i,e,t){var r=J(i),s=[W,N].indexOf(r)>=0?-1:1,n=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=n[0],a=n[1];return o=o||0,a=(a||0)*s,[W,z].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Va(i){var e=i.state,t=i.options,r=i.name,s=t.offset,n=s===void 0?[0,0]:s,o=si.reduce(function(d,E){return d[E]=Na(E,e.rects,n),d},{}),a=o[e.placement],u=a.x,f=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=f),e.modifiersData[r]=o}var tn={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Va};function ja(i){var e=i.state,t=i.name;e.modifiersData[t]=xt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var rn={name:"popperOffsets",enabled:!0,phase:"read",fn:ja,data:{}};function br(i){return i==="x"?"y":"x"}function Wa(i){var e=i.state,t=i.options,r=i.name,s=t.mainAxis,n=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!1:o,u=t.boundary,f=t.rootBoundary,d=t.altBoundary,E=t.padding,w=t.tether,y=w===void 0?!0:w,O=t.tetherOffset,L=O===void 0?0:O,_=he(e,{boundary:u,rootBoundary:f,padding:E,altBoundary:d}),C=J(e.placement),k=ne(e.placement),I=!k,S=Fe(C),T=br(S),v=e.modifiersData.popperOffsets,x=e.rects.reference,P=e.rects.popper,R=typeof L=="function"?L(Object.assign({},e.rects,{placement:e.placement})):L,V=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),X=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,$={x:0,y:0};if(v){if(n){var j,de=S==="y"?N:W,pe=S==="y"?U:z,l=S==="y"?"height":"width",c=v[S],h=c+_[de],p=c-_[pe],m=y?-P[l]/2:0,g=k===ge?x[l]:P[l],A=k===ge?-P[l]:-x[l],F=e.elements.arrow,ee=y&&F?Re(F):{width:0,height:0},ae=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Lt(),M=ae[de],te=ae[pe],ie=De(0,x[l],ee[l]),Oe=I?x[l]/2-m-ie-M-V.mainAxis:g-ie-M-V.mainAxis,Ri=I?-x[l]/2+m+ie+te+V.mainAxis:A+ie+te+V.mainAxis,Fi=e.elements.arrow&&ce(e.elements.arrow),jn=Fi?S==="y"?Fi.clientTop||0:Fi.clientLeft||0:0,as=(j=X?.[S])!=null?j:0,Wn=c+Oe-as-jn,zn=c+Ri-as,ls=De(y?Me(h,Wn):h,c,y?le(p,zn):p);v[S]=ls,$[S]=ls-c}if(a){var cs,$n=S==="x"?N:W,Un=S==="x"?U:z,ke=v[T],Dt=T==="y"?"height":"width",hs=ke+_[$n],us=ke-_[Un],Di=[N,W].indexOf(C)!==-1,ds=(cs=X?.[T])!=null?cs:0,fs=Di?hs:ke-x[Dt]-P[Dt]-ds+V.altAxis,ps=Di?ke+x[Dt]+P[Dt]-ds-V.altAxis:us,ms=y&&Di?$s(fs,ke,ps):De(y?fs:hs,ke,y?ps:us);v[T]=ms,$[T]=ms-ke}e.modifiersData[r]=$}}var sn={name:"preventOverflow",enabled:!0,phase:"main",fn:Wa,requiresIfExists:["offset"]};function yr(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function wr(i){return i===B(i)||!K(i)?Be(i):yr(i)}function za(i){var e=i.getBoundingClientRect(),t=ve(e.width)/i.offsetWidth||1,r=ve(e.height)/i.offsetHeight||1;return t!==1||r!==1}function Er(i,e,t){t===void 0&&(t=!1);var r=K(e),s=K(e)&&za(e),n=Q(e),o=se(i,s,t),a={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!t)&&((Y(e)!=="body"||qe(n))&&(a=wr(e)),K(e)?(u=se(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):n&&(u.x=He(n))),{x:o.left+a.scrollLeft-u.x,y:o.top+a.scrollTop-u.y,width:o.width,height:o.height}}function $a(i){var e=new Map,t=new Set,r=[];i.forEach(function(n){e.set(n.name,n)});function s(n){t.add(n.name);var o=[].concat(n.requires||[],n.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var u=e.get(a);u&&s(u)}}),r.push(n)}return i.forEach(function(n){t.has(n.name)||s(n)}),r}function _r(i){var e=$a(i);return js.reduce(function(t,r){return t.concat(e.filter(function(s){return s.phase===r}))},[])}function Ar(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function Sr(i){var e=i.reduce(function(t,r){var s=t[r.name];return t[r.name]=s?Object.assign({},s,r,{options:Object.assign({},s.options,r.options),data:Object.assign({},s.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var nn={placement:"bottom",modifiers:[],strategy:"absolute"};function on(){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 an(i){i===void 0&&(i={});var e=i,t=e.defaultModifiers,r=t===void 0?[]:t,s=e.defaultOptions,n=s===void 0?nn:s;return function(a,u,f){f===void 0&&(f=n);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},nn,n),modifiersData:{},elements:{reference:a,popper:u},attributes:{},styles:{}},E=[],w=!1,y={state:d,setOptions:function(C){var k=typeof C=="function"?C(d.options):C;L(),d.options=Object.assign({},n,d.options,k),d.scrollParents={reference:re(a)?Ee(a):a.contextElement?Ee(a.contextElement):[],popper:Ee(u)};var I=_r(Sr([].concat(r,d.options.modifiers)));return d.orderedModifiers=I.filter(function(S){return S.enabled}),O(),y.update()},forceUpdate:function(){if(!w){var C=d.elements,k=C.reference,I=C.popper;if(on(k,I)){d.rects={reference:Er(k,ce(I),d.options.strategy==="fixed"),popper:Re(I)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(V){return d.modifiersData[V.name]=Object.assign({},V.data)});for(var S=0;S<d.orderedModifiers.length;S++){if(d.reset===!0){d.reset=!1,S=-1;continue}var T=d.orderedModifiers[S],v=T.fn,x=T.options,P=x===void 0?{}:x,R=T.name;typeof v=="function"&&(d=v({state:d,options:P,name:R,instance:y})||d)}}}},update:Ar(function(){return new Promise(function(_){y.forceUpdate(),_(d)})}),destroy:function(){L(),w=!0}};if(!on(a,u))return y;y.setOptions(f).then(function(_){!w&&f.onFirstUpdate&&f.onFirstUpdate(_)});function O(){d.orderedModifiers.forEach(function(_){var C=_.name,k=_.options,I=k===void 0?{}:k,S=_.effect;if(typeof S=="function"){var T=S({state:d,name:C,instance:y,options:I}),v=function(){};E.push(T||v)}})}function L(){E.forEach(function(_){return _()}),E=[]}return y}}var Ua=[Ys,rn,Xs,Ws,tn,Gs,sn,Us,en],Ne=an({defaultModifiers:Ua});var _e=function(){return _e=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}return i},_e.apply(this,arguments)},li=function(i,e,t){if(t||arguments.length===2)for(var r=0,s=e.length,n;r<s;r++)(n||!(r in e))&&(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return i.concat(n||Array.prototype.slice.call(e))},Ae={placement:"bottom",triggerType:"click",offsetSkidding:0,offsetDistance:10,delay:300,ignoreClickOutsideClass:!1,onShow:function(){},onHide:function(){},onToggle:function(){}},Ka={id:null,override:!0},Lr=function(){function i(e,t,r,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Ae),s===void 0&&(s=Ka),this._instanceId=s.id?s.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=_e(_e({},Ae),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),b.addInstance("Dropdown",this,this._instanceId,s.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(){b.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 Ne(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,s=this._options.ignoreClickOutsideClass,n=!1;if(s){var o=document.querySelectorAll(".".concat(s));o.forEach(function(a){if(a.contains(r)){n=!0;return}})}r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&!n&&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 _e(_e({},e),{modifiers:li(li([],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 _e(_e({},e),{modifiers:li(li([],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 it(){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"),s=i.getAttribute("data-dropdown-offset-skidding"),n=i.getAttribute("data-dropdown-offset-distance"),o=i.getAttribute("data-dropdown-trigger"),a=i.getAttribute("data-dropdown-delay"),u=i.getAttribute("data-dropdown-ignore-click-outside-class");new Lr(t,i,{placement:r||Ae.placement,triggerType:o||Ae.triggerType,offsetSkidding:s?parseInt(s):Ae.offsetSkidding,offsetDistance:n?parseInt(n):Ae.offsetDistance,delay:a?parseInt(a):Ae.delay,ignoreClickOutsideClass:u||Ae.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=Lr,window.initDropdowns=it);var Tr=Lr;var ci=function(){return ci=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}return i},ci.apply(this,arguments)},hi={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(){}},Xa={id:null,override:!0},ln=function(){function i(e,t,r){e===void 0&&(e=null),t===void 0&&(t=hi),r===void 0&&(r=Xa),this._eventListenerInstances=[],this._instanceId=r.id?r.id:e.id,this._targetEl=e,this._options=ci(ci({},hi),t),this._isHidden=!0,this._backdropEl=null,this._initialized=!1,this.init(),b.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(){b.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 rt(){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"),s=t.getAttribute("data-modal-backdrop");new ln(t,{placement:r||hi.placement,backdrop:s||hi.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=b.getInstance("Modal",e);if(r){var s=function(){r.toggle()};i.addEventListener("click",s),r.addEventListenerInstance(i,"click",s)}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=b.getInstance("Modal",e);if(r){var s=function(){r.show()};i.addEventListener("click",s),r.addEventListenerInstance(i,"click",s)}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=b.getInstance("Modal",e);if(r){var s=function(){r.hide()};i.addEventListener("click",s),r.addEventListenerInstance(i,"click",s)}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=ln,window.initModals=rt);var ui=function(){return ui=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}return i},ui.apply(this,arguments)},Ve={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(){}},Ya={id:null,override:!0},cn=function(){function i(e,t,r){e===void 0&&(e=null),t===void 0&&(t=Ve),r===void 0&&(r=Ya),this._eventListenerInstances=[],this._instanceId=r.id?r.id:e.id,this._targetEl=e,this._options=ui(ui({},Ve),t),this._visible=!1,this._initialized=!1,this.init(),b.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(){b.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 st(){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"),s=i.getAttribute("data-drawer-body-scrolling"),n=i.getAttribute("data-drawer-backdrop"),o=i.getAttribute("data-drawer-edge"),a=i.getAttribute("data-drawer-edge-offset");new cn(t,{placement:r||Ve.placement,bodyScrolling:s?s==="true":Ve.bodyScrolling,backdrop:n?n==="true":Ve.backdrop,edge:o?o==="true":Ve.edge,edgeOffset:a||Ve.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=b.getInstance("Drawer",e);if(r){var s=function(){r.toggle()};i.addEventListener("click",s),r.addEventListenerInstance(i,"click",s)}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=b.getInstance("Drawer",e);if(r){var s=function(){r.hide()};i.addEventListener("click",s),r.addEventListenerInstance(i,"click",s)}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=b.getInstance("Drawer",e);if(r){var s=function(){r.show()};i.addEventListener("click",s),r.addEventListenerInstance(i,"click",s)}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=cn,window.initDrawers=st);var di=function(){return di=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}return i},di.apply(this,arguments)},fi={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(){}},Ja={id:null,override:!0},hn=function(){function i(e,t,r,s){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=fi),s===void 0&&(s=Ja),this._instanceId=s.id?s.id:e.id,this._tabsEl=e,this._items=t,this._activeTab=r?this.getTab(r.defaultTabId):null,this._options=di(di({},fi),r),this._initialized=!1,this.init(),b.addInstance("Tabs",this,this._tabsEl.id,!0),b.addInstance("Tabs",this,this._instanceId,s.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(),b.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,s,n=this;t===void 0&&(t=!1);var o=this.getTab(e);o===this._activeTab&&!t||(this._items.map(function(a){var u,f;a!==o&&((u=a.triggerEl.classList).remove.apply(u,n._options.activeClasses.split(" ")),(f=a.triggerEl.classList).add.apply(f,n._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(" ")),(s=o.triggerEl.classList).remove.apply(s,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 nt(){document.querySelectorAll("[data-tabs-toggle]").forEach(function(i){var e=[],t=i.getAttribute("data-tabs-active-classes"),r=i.getAttribute("data-tabs-inactive-classes"),s=null;i.querySelectorAll('[role="tab"]').forEach(function(n){var o=n.getAttribute("aria-selected")==="true",a={id:n.getAttribute("data-tabs-target"),triggerEl:n,targetEl:document.querySelector(n.getAttribute("data-tabs-target"))};e.push(a),o&&(s=a.id)}),new hn(i,e,{defaultTabId:s,activeClasses:t||fi.activeClasses,inactiveClasses:r||fi.inactiveClasses})})}typeof window<"u"&&(window.Tabs=hn,window.initTabs=nt);var Se=function(){return Se=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}return i},Se.apply(this,arguments)},pi=function(i,e,t){if(t||arguments.length===2)for(var r=0,s=e.length,n;r<s;r++)(n||!(r in e))&&(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return i.concat(n||Array.prototype.slice.call(e))},mi={placement:"top",triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Ga={id:null,override:!0},un=function(){function i(e,t,r,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=mi),s===void 0&&(s=Ga),this._instanceId=s.id?s.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=Se(Se({},mi),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),b.addInstance("Tooltip",this,this._instanceId,s.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(){b.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 Ne(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 Se(Se({},e),{modifiers:pi(pi([],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 Se(Se({},e),{modifiers:pi(pi([],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 ot(){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"),s=i.getAttribute("data-tooltip-placement");new un(t,i,{placement:s||mi.placement,triggerType:r||mi.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=un,window.initTooltips=ot);var Le=function(){return Le=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}return i},Le.apply(this,arguments)},gi=function(i,e,t){if(t||arguments.length===2)for(var r=0,s=e.length,n;r<s;r++)(n||!(r in e))&&(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return i.concat(n||Array.prototype.slice.call(e))},Ot={placement:"top",offset:10,triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Qa={id:null,override:!0},dn=function(){function i(e,t,r,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Ot),s===void 0&&(s=Qa),this._instanceId=s.id?s.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=Le(Le({},Ot),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),b.addInstance("Popover",this,s.id?s.id:this._targetEl.id,s.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(){b.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 Ne(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 Le(Le({},e),{modifiers:gi(gi([],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 Le(Le({},e),{modifiers:gi(gi([],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 at(){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"),s=i.getAttribute("data-popover-placement"),n=i.getAttribute("data-popover-offset");new dn(t,i,{placement:s||Ot.placement,offset:n?parseInt(n):Ot.offset,triggerType:r||Ot.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=dn,window.initPopovers=at);var vi=function(){return vi=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}return i},vi.apply(this,arguments)},Cr={triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Za={id:null,override:!0},fn=function(){function i(e,t,r,s,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=null),s===void 0&&(s=Cr),n===void 0&&(n=Za),this._instanceId=n.id?n.id:r.id,this._parentEl=e,this._triggerEl=t,this._targetEl=r,this._options=vi(vi({},Cr),s),this._visible=!1,this._initialized=!1,this.init(),b.addInstance("Dial",this,this._instanceId,n.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(){b.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 lt(){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 s=e.getAttribute("data-dial-trigger");new fn(i,e,r,{triggerType:s||Cr.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=fn,window.initDials=lt);var bi=function(){return bi=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}return i},bi.apply(this,arguments)},pn={minValue:null,maxValue:null,onIncrement:function(){},onDecrement:function(){}},el={id:null,override:!0},mn=function(){function i(e,t,r,s,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=null),s===void 0&&(s=pn),n===void 0&&(n=el),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._incrementEl=t,this._decrementEl=r,this._options=bi(bi({},pn),s),this._initialized=!1,this.init(),b.addInstance("InputCounter",this,this._instanceId,n.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(){b.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 ct(){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+'"]'),s=i.getAttribute("data-input-counter-min"),n=i.getAttribute("data-input-counter-max");i?b.instanceExists("InputCounter",i.getAttribute("id"))||new mn(i,t||null,r||null,{minValue:s?parseInt(s):null,maxValue:n?parseInt(n):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=mn,window.initInputCounters=ct);var yi=function(){return yi=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s])}return i},yi.apply(this,arguments)},wi={htmlEntities:!1,contentType:"input",onCopy:function(){}},tl={id:null,override:!0},gn=function(){function i(e,t,r,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=wi),s===void 0&&(s=tl),this._instanceId=s.id?s.id:t.id,this._triggerEl=e,this._targetEl=t,this._options=yi(yi({},wi),r),this._initialized=!1,this.init(),b.addInstance("CopyClipboard",this,this._instanceId,s.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(){b.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 ht(){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"),s=i.getAttribute("data-copy-to-clipboard-html-entities");t?b.instanceExists("CopyClipboard",t.getAttribute("id"))||new gn(i,t,{htmlEntities:s&&s==="true"?!0:wi.htmlEntities,contentType:r||wi.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=gn,window.initClipboards=ht);function vn(){Ke(),Xe(),Ye(),Je(),it(),rt(),st(),nt(),ot(),at(),lt(),ct(),ht()}typeof window<"u"&&(window.initFlowbite=vn);var il=new Rs("load",[Ke,Xe,Ye,Je,it,rt,st,nt,ot,at,lt,ct,ht]);il.init();var Ei=class extends D{static targets=["trigger","menu"];connect(){this.dropdown=new Tr(this.menuTarget,this.triggerTarget)}disconnect(){this.dropdown=null}toggle(){this.dropdown.toggle()}show(){this.dropdown.show()}hide(){this.dropdown.show()}};var _i=class extends D{static targets=["trigger","target"];static values={after:Number};connect(){this.dismiss=new ur(this.targetTarget,this.triggerTarget),console.log(this.hasAfterValue),console.log(this.afterValue),this.hasAfterValue&&this.afterValue>0&&(this.autoDismissTimeout=setTimeout(()=>{this.hide(),this.autoDismissTimeout=null},this.afterValue))}disconnect(){this.autoDismissTimeout&&clearTimeout(this.autoDismissTimeout),this.dismiss=null,this.autoDismissTimeout=null}hide(){this.dismiss.hide()}};function bn(i){i.register("nested-resource-form-fields",zt),i.register("tab-bar",$t),i.register("toolbar",Ut),i.register("table-search-input",Kt),i.register("table-toolbar",Xt),i.register("table",Yt),i.register("form",Jt),i.register("resource-drop-down",Ei),i.register("resource-dismiss",_i)}(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,s){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==s||t(DOMException,"The specified element is not owned by this form element","NotFoundError")}function t(r,s,n){throw new r("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+s+".",n)}})(HTMLFormElement.prototype);var Sn=new WeakMap;function rl(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 sl(i){let e=rl(i.target);e&&e.form&&Sn.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",sl,!0),Object.defineProperty(i,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return Sn.get(this.target)}})})();var dt={eager:"eager",lazy:"lazy"},fe=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 nl(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 nl(i){switch(i.toLowerCase()){case"lazy":return dt.lazy;default:return dt.eager}}function G(i){return new URL(i.toString(),document.baseURI)}function ze(i){let e;if(i.hash)return i.hash.slice(1);if(e=i.href.match(/#(.*)$/))return e[1]}function rs(i,e){let t=e?.getAttribute("formaction")||i.getAttribute("action")||i.action;return G(t)}function ol(i){return(ul(i).match(/\.[^.]*$/)||[])[0]||""}function al(i){return!!ol(i).match(/^(?:|\.(?:htm|html|xhtml|php))$/)}function ll(i,e){let t=dl(e);return i.href===G(t).href||i.href.startsWith(t)}function Te(i,e){return ll(i,e)&&al(i)}function xr(i){let e=ze(i);return e!=null?i.href.slice(0,-(e.length+1)):i.href}function Ai(i){return xr(i)}function cl(i,e){return G(i).href==G(e).href}function hl(i){return i.pathname.split("/").slice(1)}function ul(i){return hl(i).slice(-1)[0]}function dl(i){return fl(i.origin+i.pathname)}function fl(i){return i.endsWith("/")?i:i+"/"}var kt=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 G(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 It(i){if(i.getAttribute("data-turbo-eval")=="false")return i;{let e=document.createElement("script"),t=vt("csp-nonce");return t&&(e.nonce=t),e.textContent=i.textContent,e.async=!1,pl(e,i),e}}function pl(i,e){for(let{name:t,value:r}of e.attributes)i.setAttribute(t,r)}function ml(i){let e=document.createElement("template");return e.innerHTML=i,e.content}function q(i,{target:e,cancelable:t,detail:r}={}){let s=new CustomEvent(i,{cancelable:t,bubbles:!0,composed:!0,detail:r});return e&&e.isConnected?e.dispatchEvent(s):document.documentElement.dispatchEvent(s),s}function pt(){return document.visibilityState==="hidden"?Tn():Ln()}function Ln(){return new Promise(i=>requestAnimationFrame(()=>i()))}function Tn(){return new Promise(i=>setTimeout(()=>i(),0))}function gl(){return Promise.resolve()}function Cn(i=""){return new DOMParser().parseFromString(i,"text/html")}function xn(i,...e){let t=vl(i,e).replace(/^\n/,"").split(`
6
+ `),r=t[0].match(/^\s+/),s=r?r[0].length:0;return t.map(n=>n.slice(s)).join(`
7
+ `)}function vl(i,e){return i.reduce((t,r,s)=>{let n=e[s]==null?"":e[s];return t+r+n},"")}function Ce(){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 Li(i,...e){for(let t of e.map(r=>r?.getAttribute(i)))if(typeof t=="string")return t;return null}function bl(i,...e){return e.some(t=>t&&t.hasAttribute(i))}function Ti(...i){for(let e of i)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function Ci(...i){for(let e of i)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function yl(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 On(i){switch(i){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function wl(i){return i=="advance"||i=="replace"||i=="restore"}function $e(...i){let e=Li("data-turbo-action",...i);return wl(e)?e:null}function kn(i){return document.querySelector(`meta[name="${i}"]`)}function vt(i){let e=kn(i);return e&&e.content}function El(i,e){let t=kn(i);return t||(t=document.createElement("meta"),t.setAttribute("name",i),document.head.appendChild(t)),t.setAttribute("content",e),t}function mt(i,e){if(i instanceof Element)return i.closest(e)||mt(i.assignedSlot||i.getRootNode()?.host,e)}function ss(i){return!!i&&i.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof i.focus=="function"}function In(i){return Array.from(i.querySelectorAll("[autofocus]")).find(ss)}async function _l(i,e){let t=e();i(),await Ln();let r=e();return[t,r]}function Al(i){if(i.hasAttribute("target")){for(let e of document.getElementsByName(i.target))if(e instanceof HTMLIFrameElement)return!1}return!0}function Sl(i){return mt(i,"a[href]:not([target^=_]):not([download])")}function Pn(i){return G(i.getAttribute("href")||"")}function Ll(i,e){let t=null;return(...r)=>{let s=()=>i.apply(this,r);clearTimeout(t),t=setTimeout(s,e)}}var Or=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)}},Mn=new Or(20),Tl=window.fetch;function Rn(i,e={}){let t=new Headers(e.headers||{}),r=Ce();return Mn.add(r),t.append("X-Turbo-Request-Id",r),Tl(i,{...e,headers:t})}function ns(i){switch(i.toLowerCase()){case"get":return oe.get;case"post":return oe.post;case"put":return oe.put;case"patch":return oe.patch;case"delete":return oe.delete}}var oe={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function Cl(i){switch(i.toLowerCase()){case We.multipart:return We.multipart;case We.plain:return We.plain;default:return We.urlEncoded}}var We={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"},Ue=class{abortController=new AbortController;#e=e=>{};constructor(e,t,r,s=new URLSearchParams,n=null,o=We.urlEncoded){let[a,u]=yn(G(r),t,s,o);this.delegate=e,this.url=a,this.target=n,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t,headers:{...this.defaultHeaders},body:u,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=ns(e)||oe.get;this.url.search="";let[s,n]=yn(this.url,r,t,this.enctype);this.url=s,this.fetchOptions.body=n,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=Rn(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 kt(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 os(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(s=>this.#e=s),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 os(i){return ns(i)==oe.get}function yn(i,e,t,r){let s=Array.from(t).length>0?new URLSearchParams(Fn(t)):i.searchParams;return os(e)?[xl(i,s),null]:r==We.urlEncoded?[i,s]:[i,t]}function Fn(i){let e=[];for(let[t,r]of i)r instanceof File||e.push([t,r]);return e}function xl(i,e){let t=new URLSearchParams(Fn(e));return i.search=t.toString(),i}var kr=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)}},xe=class{static contentType="text/vnd.turbo-stream.html";static wrap(e){return typeof e=="string"?new this(ml(e)):e}constructor(e){this.fragment=Ol(e)}};function Ol(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(It(r));e.replaceWith(t)}return i}var kl=100,Ir=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},kl)}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}},Il=10*1e3,ft=new Ir,ut={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"},Pt=class i{state=ut.initialized;static confirmMethod(e,t,r){return Promise.resolve(confirm(e))}constructor(e,t,r,s=!1){let n=Bl(t,r),o=Dl(Fl(t,r),n),a=Pl(t,r),u=Hl(t,r);this.delegate=e,this.formElement=t,this.submitter=r,this.fetchRequest=new Ue(this,n,o,a,t,u),this.mustRedirect=s}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=G(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}=ut,r=Li("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}=ut;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){let t=Ml(vt("csrf-param"))||vt("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(xe.contentType)}requestStarted(e){this.state=ut.waiting,this.submitter?.setAttribute("disabled",""),this.setSubmitsWith(),Ti(this.formElement),q("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){ft.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(ft.clear(),this.requestMustRedirect(e)&&Rl(t)){let r=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,r)}else this.state=ut.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=ut.stopped,this.submitter?.removeAttribute("disabled"),this.resetSubmitterText(),Ci(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||bl("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}};function Pl(i,e){let t=new FormData(i),r=e?.getAttribute("name"),s=e?.getAttribute("value");return r&&t.append(r,s||""),t}function Ml(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 Rl(i){return i.statusCode==200&&!i.redirected}function Fl(i,e){let t=typeof i.action=="string"?i.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":i.getAttribute("action")||t||""}function Dl(i,e){let t=G(i);return os(e)&&(t.search=""),t}function Bl(i,e){let t=e?.getAttribute("formmethod")||i.getAttribute("method")||"";return ns(t.toLowerCase())||oe.get}function Hl(i,e){return Cl(e?.getAttribute("formenctype")||i.enctype)}var bt=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 In(this.element)}get permanentElements(){return Bn(this.element)}getPermanentElementById(e){return Dn(this.element,e)}getPermanentElementMapForSnapshot(e){let t={};for(let r of this.permanentElements){let{id:s}=r,n=e.getPermanentElementById(s);n&&(t[s]=[r,n])}return t}};function Dn(i,e){return i.querySelector(`#${e}[data-turbo-permanent]`)}function Bn(i){return i.querySelectorAll("[id][data-turbo-permanent]")}var Mt=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&&ql(t,r)&&Nl(t,r)&&this.delegate.willSubmitForm(t,r)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,r))}}};function ql(i,e){return(e?.getAttribute("formmethod")||i.getAttribute("method"))!="dialog"}function Nl(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 xi=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(ze(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:s,newSnapshot:n}=e,o=s;if(r)try{this.renderPromise=new Promise(d=>this.#e=d),this.renderer=e,await this.prepareToRenderSnapshot(e);let a=new Promise(d=>this.#t=d),u={resume:this.#t,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(n,u)||await a,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(n,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()}},Pr=class extends xi{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new bt(this.element)}},Oi=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}},ki=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=Sl(t);if(r&&Al(r)){let s=Pn(r);this.delegate.willFollowLinkToLocation(r,s,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(r,s))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}},Ii=class{constructor(e,t){this.delegate=e,this.linkInterceptor=new ki(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"),s="hidden";for(let[E,w]of t.searchParams)r.append(Object.assign(document.createElement("input"),{type:s,name:E,value:w}));let n=Object.assign(t,{search:""});r.setAttribute("data-turbo","true"),r.setAttribute("action",n.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 u=$e(e);u&&r.setAttribute("data-turbo-action",u);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())}},Pi=class{static async preservingPermanentElements(e,t,r){let s=new this(e,t);s.enter(),await r(),s.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=Vl(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 Vl(i){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",i.id),e}var Rt=class{#e=null;constructor(e,t,r,s,n=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=s,this.willRender=n,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 Pi.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"}},Ft=class extends Rt{static renderElement(e,t){let r=document.createRange();r.selectNodeContents(e),r.deleteContents();let s=t,n=s.ownerDocument?.createRange();n&&(n.selectNodeContents(s),e.appendChild(n.extractContents()))}constructor(e,t,r,s,n,o=!0){super(t,r,s,n,o),this.delegate=e}get shouldRender(){return!0}async render(){await pt(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await pt(),this.focusFirstAutofocusableElement(),await pt(),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=jl(this.currentElement.getAttribute("data-autoscroll-block"),"end"),r=Wl(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=It(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function jl(i,e){return i=="end"||i=="start"||i=="center"||i=="nearest"?i:e}function Wl(i,e){return i=="auto"||i=="smooth"?i:e}var Mr=class i{static animationDuration=300;static get defaultCSS(){return xn`
8
+ .turbo-progress-bar {
9
+ position: fixed;
10
+ display: block;
11
+ top: 0;
12
+ left: 0;
13
+ height: 3px;
14
+ background: #0076ff;
15
+ z-index: 2147483647;
16
+ transition:
17
+ width ${i.animationDuration}ms ease-out,
18
+ opacity ${i.animationDuration/2}ms ${i.animationDuration/2}ms ease-in;
19
+ transform: translate3d(0, 0, 0);
20
+ }
21
+ `}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 vt("csp-nonce")}},Rr=class extends bt{detailsByOuterHTML=this.children.filter(e=>!Kl(e)).map(e=>Jl(e)).reduce((e,t)=>{let{outerHTML:r}=t,s=r in e?e[r]:{type:zl(t),tracked:$l(t),elements:[]};return{...e,[r]:{...s,elements:[...s.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:s,elements:n}=this.detailsByOuterHTML[t];return r==null&&!s?[...e,...n]:n.length>1?[...e,...n.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:[s]}=this.detailsByOuterHTML[r];return Yl(s,e)?s:t},void 0|void 0)}};function zl(i){if(Ul(i))return"script";if(Xl(i))return"stylesheet"}function $l(i){return i.getAttribute("data-turbo-track")=="reload"}function Ul(i){return i.localName=="script"}function Kl(i){return i.localName=="noscript"}function Xl(i){let e=i.localName;return e=="style"||e=="link"&&i.getAttribute("rel")=="stylesheet"}function Yl(i,e){return i.localName=="meta"&&i.getAttribute("name")==e}function Jl(i){return i.hasAttribute("nonce")&&i.setAttribute("nonce",""),i}var ue=class i extends bt{static fromHTMLString(e=""){return this.fromDocument(Cn(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:r}){return new this(e,t,new Rr(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[s,n]of t.entries()){let o=r[s];for(let a of o.selectedOptions)a.selected=!1;for(let a of n.selectedOptions)o.options[a.index].selected=!0}for(let s of e.querySelectorAll('input[type="password"]'))s.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 G(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}`)}},Fr=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}},Gl={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},Si={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},ye={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},gt={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},Ql={advance:"forward",restore:"back",replace:"none"},Dr=class{identifier=Ce();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=ye.initialized;viewTransitioner=new Fr;constructor(e,t,r,s={}){this.delegate=e,this.location=t,this.restorationIdentifier=r||Ce();let{action:n,historyChanged:o,referrer:a,snapshot:u,snapshotHTML:f,response:d,visitCachedSnapshot:E,willRender:w,updateHistory:y,shouldCacheSnapshot:O,acceptsStreamResponse:L,direction:_}={...Gl,...s};this.action=n,this.historyChanged=o,this.referrer=a,this.snapshot=u,this.snapshotHTML=f,this.response=d,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=E,this.willRender=w,this.updateHistory=y,this.scrolled=!w,this.shouldCacheSnapshot=O,this.acceptsStreamResponse=L,this.direction=_||Ql[n]}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==ye.initialized&&(this.recordTimingMetric(Si.visitStart),this.state=ye.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==ye.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=ye.canceled)}complete(){this.state==ye.started&&(this.recordTimingMetric(Si.visitEnd),this.adapter.visitCompleted(this),this.state=ye.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==ye.started&&(this.state=ye.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=On(e);this.history.update(t,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new Ue(this,oe.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(Si.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;wn(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(Si.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,wn(e)&&t!=null){let r=ue.fromHTMLString(t);await this.renderPageSnapshot(r,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(ue.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!ze(this.location)||e.hasAnchor(ze(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return ue.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(xe.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let r=await t.responseHTML,{redirected:s,statusCode:n}=t;r==null?this.recordResponse({statusCode:gt.contentTypeMismatch,redirected:s}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:n,responseHTML:r,redirected:s}))}async requestFailedWithResponse(e,t){let r=await t.responseHTML,{redirected:s,statusCode:n}=t;r==null?this.recordResponse({statusCode:gt.contentTypeMismatch,redirected:s}):this.recordResponse({statusCode:n,responseHTML:r,redirected:s})}requestErrored(e,t){this.recordResponse({statusCode:gt.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=ze(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 pt(),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 wn(i){return i>=200&&i<300}var Br=class{progressBar=new Mr;constructor(e){this.session=e}visitProposedToLocation(e,t){Te(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||Ce(),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 gt.networkFailure:case gt.timeoutFailure:case gt.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}},Hr=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]}},qr=class{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new Oi(this,t),this.formSubmitObserver=new Mt(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 s=this.#i(e);s&&s.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=rs(e,t),s=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),n=G(s?.content??"/");return this.#t(e,t)&&Te(r,n)}#t(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){let s=this.#i(e,t);return s?s!=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 s=this.element.querySelector(`#${r}:not([disabled])`);if(s instanceof fe)return s}}},Nr=class{location;restorationIdentifier=Ce();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=Ce()){e===history.pushState&&++this.currentIndex;let s={turbo:{restorationIdentifier:r,restorationIndex:this.currentIndex}};e.call(history,s,"",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:s}=t;this.restorationIdentifier=r;let n=s>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,r,n),this.currentIndex=s}}};onPageLoad=async e=>{await gl(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},Vr=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.#s,{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.#s,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#r,!0),this.started=!0};#i=e=>{if(vt("turbo-prefetch")==="false")return;let t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&this.#a(t)){let s=t,n=Pn(s);if(this.delegate.canPrefetchRequestToLocation(s,n)){this.#e=s;let o=new Ue(this,oe.get,n,new URLSearchParams,t);ft.setLater(n.toString(),o,this.#o)}}};#s=e=>{e.target===this.#e&&this.#n()};#n=()=>{ft.clear(),this.#e=null};#r=e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="get"){let t=ft.get(e.detail.url.toString());t&&(e.detail.fetchRequest=t),ft.clear()}};prepareRequest(e){let t=e.target;e.headers["X-Sec-Purpose"]="prefetch";let r=t.closest("turbo-frame"),s=t.getAttribute("data-turbo-frame")||r?.getAttribute("target")||r?.id;s&&s!=="_top"&&(e.headers["Turbo-Frame"]=s)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#o(){return Number(vt("turbo-prefetch-cache-time"))||Il}#a(e){return!(!e.getAttribute("href")||Zl(e)||ec(e)||tc(e)||ic(e)||sc(e))}},Zl=i=>i.origin!==document.location.origin||!["http:","https:"].includes(i.protocol)||i.hasAttribute("target"),ec=i=>i.pathname+i.search===document.location.pathname+document.location.search||i.href.startsWith("#"),tc=i=>{if(i.getAttribute("data-turbo-prefetch")==="false"||i.getAttribute("data-turbo")==="false")return!0;let e=mt(i,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},ic=i=>{let e=i.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||rc(i)||i.hasAttribute("data-turbo-confirm")||i.hasAttribute("data-turbo-stream"))},rc=i=>i.hasAttribute("data-remote")||i.hasAttribute("data-behavior")||i.hasAttribute("data-confirm")||i.hasAttribute("data-method"),sc=i=>q("turbo:before-prefetch",{target:i,cancelable:!0}).defaultPrevented,jr=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 Dr(this,G(e),t,{referrer:this.location,...r}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new Pt(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 s=e.isSafe;s||this.view.clearSnapshotCache();let{statusCode:n,redirected:o}=t,u={action:this.#e(e,t),shouldCacheSnapshot:s,response:{statusCode:n,responseHTML:r,redirected:o}};this.proposeVisit(t.location,u)}}}async formSubmissionFailedWithResponse(e,t){let r=await t.responseHTML;if(r){let s=ue.fromHTMLString(r);t.serverError?await this.view.renderError(s,this.currentVisit):await this.view.renderPage(s,!1,!0,this.currentVisit),s.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=ze(e),s=ze(this.view.lastRenderedLocation),n=t==="restore"&&typeof r>"u";return t!=="replace"&&xr(e)===xr(this.view.lastRenderedLocation)&&(n||r!=null&&r!==s)}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:s}=e;return $e(r,s)||this.#t(t)}#t(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}},je={initial:0,loading:1,interactive:2,complete:3},Wr=class{stage=je.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==je.initial&&(this.stage=je.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==je.loading&&(this.stage=je.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==je.interactive&&(this.stage=je.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}},zr=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)}},$r=class{render({fragment:e}){Pi.preservingPermanentElements(this,nc(e),()=>{oc(e,()=>{ac(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}};function nc(i){let e=Bn(document.documentElement),t={};for(let r of e){let{id:s}=r;for(let n of i.querySelectorAll("turbo-stream")){let o=Dn(n.templateElement.content,s);o&&(t[s]=[r,o])}}return t}async function oc(i,e){let t=`turbo-stream-autofocus-${Ce()}`,r=i.querySelectorAll("turbo-stream"),s=lc(r),n=null;if(s&&(s.id?n=s.id:n=t,s.id=n),e(),await pt(),(document.activeElement==null||document.activeElement==document.body)&&n){let a=document.getElementById(n);ss(a)&&a.focus(),a&&a.id==t&&a.removeAttribute("id")}}async function ac(i){let[e,t]=await _l(i,()=>document.activeElement),r=e&&e.id;if(r){let s=document.getElementById(r);ss(s)&&s!=t&&s.focus()}}function lc(i){for(let e of i){let t=In(e.templateElement.content);if(t)return t}return null}var Ur=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=cc(e);t&&hc(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(xe.wrap(e))}};function cc(i){let e=i.detail?.fetchResponse;if(e instanceof kt)return e}function hc(i){return(i.contentType??"").startsWith(xe.contentType)}var Mi=class extends Rt{static renderElement(e,t){let{documentElement:r,body:s}=document;r.replaceChild(t,s)}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=It(e);t.replaceChild(r,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}},uc=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(l){return l.getAttribute("im-preserve")==="true"},shouldReAppend:function(l){return l.getAttribute("im-re-append")==="true"},shouldRemove:w,afterHeadMorphed:w}};function t(l,c,h={}){l instanceof Document&&(l=l.documentElement),typeof c=="string"&&(c=S(c));let p=T(c),m=O(l,p,h);return r(l,p,m)}function r(l,c,h){if(h.head.block){let p=l.querySelector("head"),m=c.querySelector("head");if(p&&m){let g=E(m,p,h);Promise.all(g).then(function(){r(l,c,Object.assign(h,{head:{block:!1,ignore:!0}}))});return}}if(h.morphStyle==="innerHTML")return o(c,l,h),l.children;if(h.morphStyle==="outerHTML"||h.morphStyle==null){let p=x(c,l,h),m=p?.previousSibling,g=p?.nextSibling,A=n(l,p,h);return p?v(m,A,g):[]}else throw"Do not understand how to morph style "+h.morphStyle}function s(l,c){return c.ignoreActiveValue&&l===document.activeElement&&l!==document.body}function n(l,c,h){if(!(h.ignoreActive&&l===document.activeElement))return c==null?h.callbacks.beforeNodeRemoved(l)===!1?l:(l.remove(),h.callbacks.afterNodeRemoved(l),null):_(l,c)?(h.callbacks.beforeNodeMorphed(l,c)===!1||(l instanceof HTMLHeadElement&&h.head.ignore||(l instanceof HTMLHeadElement&&h.head.style!=="morph"?E(c,l,h):(u(c,l,h),s(l,h)||o(c,l,h))),h.callbacks.afterNodeMorphed(l,c)),l):h.callbacks.beforeNodeRemoved(l)===!1||h.callbacks.beforeNodeAdded(c)===!1?l:(l.parentElement.replaceChild(c,l),h.callbacks.afterNodeAdded(c),h.callbacks.afterNodeRemoved(l),c)}function o(l,c,h){let p=l.firstChild,m=c.firstChild,g;for(;p;){if(g=p,p=g.nextSibling,m==null){if(h.callbacks.beforeNodeAdded(g)===!1)return;c.appendChild(g),h.callbacks.afterNodeAdded(g),$(h,g);continue}if(L(g,m,h)){n(m,g,h),m=m.nextSibling,$(h,g);continue}let A=k(l,c,g,m,h);if(A){m=C(m,A,h),n(A,g,h),$(h,g);continue}let F=I(l,c,g,m,h);if(F){m=C(m,F,h),n(F,g,h),$(h,g);continue}if(h.callbacks.beforeNodeAdded(g)===!1)return;c.insertBefore(g,m),h.callbacks.afterNodeAdded(g),$(h,g)}for(;m!==null;){let A=m;m=m.nextSibling,R(A,h)}}function a(l,c,h,p){return l==="value"&&p.ignoreActiveValue&&c===document.activeElement?!0:p.callbacks.beforeAttributeUpdated(l,c,h)===!1}function u(l,c,h){let p=l.nodeType;if(p===1){let m=l.attributes,g=c.attributes;for(let A of m)a(A.name,c,"update",h)||c.getAttribute(A.name)!==A.value&&c.setAttribute(A.name,A.value);for(let A=g.length-1;0<=A;A--){let F=g[A];a(F.name,c,"remove",h)||l.hasAttribute(F.name)||c.removeAttribute(F.name)}}(p===8||p===3)&&c.nodeValue!==l.nodeValue&&(c.nodeValue=l.nodeValue),s(c,h)||d(l,c,h)}function f(l,c,h,p){if(l[h]!==c[h]){let m=a(h,c,"update",p);m||(c[h]=l[h]),l[h]?m||c.setAttribute(h,l[h]):a(h,c,"remove",p)||c.removeAttribute(h)}}function d(l,c,h){if(l instanceof HTMLInputElement&&c instanceof HTMLInputElement&&l.type!=="file"){let p=l.value,m=c.value;f(l,c,"checked",h),f(l,c,"disabled",h),l.hasAttribute("value")?p!==m&&(a("value",c,"update",h)||(c.setAttribute("value",p),c.value=p)):a("value",c,"remove",h)||(c.value="",c.removeAttribute("value"))}else if(l instanceof HTMLOptionElement)f(l,c,"selected",h);else if(l instanceof HTMLTextAreaElement&&c instanceof HTMLTextAreaElement){let p=l.value,m=c.value;if(a("value",c,"update",h))return;p!==m&&(c.value=p),c.firstChild&&c.firstChild.nodeValue!==p&&(c.firstChild.nodeValue=p)}}function E(l,c,h){let p=[],m=[],g=[],A=[],F=h.head.style,ee=new Map;for(let M of l.children)ee.set(M.outerHTML,M);for(let M of c.children){let te=ee.has(M.outerHTML),ie=h.head.shouldReAppend(M),Oe=h.head.shouldPreserve(M);te||Oe?ie?m.push(M):(ee.delete(M.outerHTML),g.push(M)):F==="append"?ie&&(m.push(M),A.push(M)):h.head.shouldRemove(M)!==!1&&m.push(M)}A.push(...ee.values());let ae=[];for(let M of A){let te=document.createRange().createContextualFragment(M.outerHTML).firstChild;if(h.callbacks.beforeNodeAdded(te)!==!1){if(te.href||te.src){let ie=null,Oe=new Promise(function(Ri){ie=Ri});te.addEventListener("load",function(){ie()}),ae.push(Oe)}c.appendChild(te),h.callbacks.afterNodeAdded(te),p.push(te)}}for(let M of m)h.callbacks.beforeNodeRemoved(M)!==!1&&(c.removeChild(M),h.callbacks.afterNodeRemoved(M));return h.head.afterHeadMorphed(c,{added:p,kept:g,removed:m}),ae}function w(){}function y(l){let c={};return Object.assign(c,e),Object.assign(c,l),c.callbacks={},Object.assign(c.callbacks,e.callbacks),Object.assign(c.callbacks,l.callbacks),c.head={},Object.assign(c.head,e.head),Object.assign(c.head,l.head),c}function O(l,c,h){return h=y(h),{target:l,newContent:c,config:h,morphStyle:h.morphStyle,ignoreActive:h.ignoreActive,ignoreActiveValue:h.ignoreActiveValue,idMap:pe(l,c),deadIds:new Set,callbacks:h.callbacks,head:h.head}}function L(l,c,h){return l==null||c==null?!1:l.nodeType===c.nodeType&&l.tagName===c.tagName?l.id!==""&&l.id===c.id?!0:j(h,l,c)>0:!1}function _(l,c){return l==null||c==null?!1:l.nodeType===c.nodeType&&l.tagName===c.tagName}function C(l,c,h){for(;l!==c;){let p=l;l=l.nextSibling,R(p,h)}return $(h,c),c.nextSibling}function k(l,c,h,p,m){let g=j(m,h,c),A=null;if(g>0){let F=p,ee=0;for(;F!=null;){if(L(h,F,m))return F;if(ee+=j(m,F,l),ee>g)return null;F=F.nextSibling}}return A}function I(l,c,h,p,m){let g=p,A=h.nextSibling,F=0;for(;g!=null;){if(j(m,g,l)>0)return null;if(_(h,g))return g;if(_(A,g)&&(F++,A=A.nextSibling,F>=2))return null;g=g.nextSibling}return g}function S(l){let c=new DOMParser,h=l.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(h.match(/<\/html>/)||h.match(/<\/head>/)||h.match(/<\/body>/)){let p=c.parseFromString(l,"text/html");if(h.match(/<\/html>/))return p.generatedByIdiomorph=!0,p;{let m=p.firstChild;return m?(m.generatedByIdiomorph=!0,m):null}}else{let m=c.parseFromString("<body><template>"+l+"</template></body>","text/html").body.querySelector("template").content;return m.generatedByIdiomorph=!0,m}}function T(l){if(l==null)return document.createElement("div");if(l.generatedByIdiomorph)return l;if(l instanceof Node){let c=document.createElement("div");return c.append(l),c}else{let c=document.createElement("div");for(let h of[...l])c.append(h);return c}}function v(l,c,h){let p=[],m=[];for(;l!=null;)p.push(l),l=l.previousSibling;for(;p.length>0;){let g=p.pop();m.push(g),c.parentElement.insertBefore(g,c)}for(m.push(c);h!=null;)p.push(h),m.push(h),h=h.nextSibling;for(;p.length>0;)c.parentElement.insertBefore(p.pop(),c.nextSibling);return m}function x(l,c,h){let p;p=l.firstChild;let m=p,g=0;for(;p;){let A=P(p,c,h);A>g&&(m=p,g=A),p=p.nextSibling}return m}function P(l,c,h){return _(l,c)?.5+j(h,l,c):0}function R(l,c){$(c,l),c.callbacks.beforeNodeRemoved(l)!==!1&&(l.remove(),c.callbacks.afterNodeRemoved(l))}function V(l,c){return!l.deadIds.has(c)}function X(l,c,h){return(l.idMap.get(h)||i).has(c)}function $(l,c){let h=l.idMap.get(c)||i;for(let p of h)l.deadIds.add(p)}function j(l,c,h){let p=l.idMap.get(c)||i,m=0;for(let g of p)V(l,g)&&X(l,g,h)&&++m;return m}function de(l,c){let h=l.parentElement,p=l.querySelectorAll("[id]");for(let m of p){let g=m;for(;g!==h&&g!=null;){let A=c.get(g);A==null&&(A=new Set,c.set(g,A)),A.add(m.id),g=g.parentElement}}}function pe(l,c){let h=new Map;return de(l,h),de(c,h),h}return{morph:t,defaults:e}}(),yt=class extends Rt{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(yl(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(It(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,s]of t.entries()){if(e.tagName=="TITLE"){if(s.tagName!="TITLE")continue;if(e.innerHTML==s.innerHTML)return t.splice(r,1),!0}if(s.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=It(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")}},Kr=class extends yt{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),uc.morph(e,t,{morphStyle:r,callbacks:{beforeNodeAdded:this.#i,beforeNodeMorphed:this.#s,beforeAttributeUpdated:this.#n,beforeNodeRemoved:this.#o,afterNodeMorphed:this.#r}})}#i=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));#s=(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};#n=(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.#s(e);#a(){this.#d().forEach(e=>{this.#l(e)&&(this.#h(e),e.reload())})}#h(e){e.addEventListener("turbo:before-frame-render",t=>{t.detail.render=this.#u},{once:!0})}#u=(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]"))}},Xr=class{keys=[];snapshots={};constructor(e){this.size=e}has(e){return Ai(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[Ai(e)]}write(e,t){this.snapshots[Ai(e)]=t}touch(e){let t=Ai(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]}},Yr=class extends xi{snapshotCache=new Xr(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,r=!0,s){let o=this.isPageRefresh(s)&&this.snapshot.shouldMorphPage?Kr:yt,a=new o(this.snapshot,e,yt.renderElement,t,r);return a.shouldRender?s?.changeHistory():this.forceReloaded=!0,this.render(a)}renderError(e,t){t?.changeHistory();let r=new Mi(this.snapshot,e,Mi.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 Tn();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 ue.fromElement(this.element)}},Jr=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 Ue(this,oe.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{let r=await t.responseHTML,s=ue.fromHTMLString(r);this.snapshotCache.put(e.url,s)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#e=()=>{this.preloadOnLoadLinksForView(document.body)}},Gr=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){El("turbo-cache-control",e)}},Qr=class{navigator=new jr(this);history=new Nr(this);view=new Yr(this,document.documentElement);adapter=new Br(this);pageObserver=new Wr(this);cacheObserver=new Hr;linkPrefetchObserver=new Vr(this,document);linkClickObserver=new ki(this,window);formSubmitObserver=new Mt(this,document);scrollObserver=new zr(this);streamObserver=new Ur(this);formLinkClickObserver=new Ii(this,document.documentElement);frameRedirector=new qr(this,document.documentElement);streamMessageRenderer=new $r;cache=new Gr(this);drive=!0;enabled=!0;progressBarDelay=500;started=!1;formMode="on";#e=150;constructor(e){this.recentRequests=e,this.preloader=new Jr(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 fe){let s=t.action||$e(r);r.delegate.proposeVisitIfNavigatedWithAction(r,s),r.src=e.toString()}else this.navigator.proposeVisit(G(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(xe.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=Ll(this.debouncedRefresh.bind(this),e),this.#e=e}shouldPreloadLink(e){let t=e.hasAttribute("data-turbo-method"),r=e.hasAttribute("data-turbo-stream"),s=e.getAttribute("data-turbo-frame"),n=s=="_top"?null:document.getElementById(s)||mt(e,"turbo-frame:not([disabled])");if(t||r||n instanceof fe)return!1;{let o=new URL(e.href);return this.elementIsNavigatable(e)&&Te(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)&&Te(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&Te(t,this.snapshot.rootLocation)}willFollowLinkToLocation(e,t,r){return this.elementIsNavigatable(e)&&Te(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,r)}followedLinkToLocation(e,t){let r=this.getActionForLink(e),s=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:r,acceptsStreamResponse:s})}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){En(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(Ti(document.documentElement),this.view.markVisitDirection(e.direction)),En(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),Ci(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=rs(e,t);return this.submissionIsNavigatable(e,t)&&Te(G(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:s,detail:{render:n}}=r;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!s}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=mt(e,"[data-turbo]"),r=mt(e,"turbo-frame");return this.drive||r?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return $e(e)||"advance"}get snapshot(){return this.view.snapshot}};function En(i){Object.defineProperties(i,dc)}var dc={absoluteURL:{get(){return this.toString()}}},H=new Qr(Mn),{cache:fc,navigator:pc}=H;function Hn(){H.start()}function mc(i){H.registerAdapter(i)}function gc(i,e){H.visit(i,e)}function qn(i){H.connectStreamSource(i)}function Nn(i){H.disconnectStreamSource(i)}function vc(i){H.renderStreamMessage(i)}function bc(){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.`"),H.clearCache()}function yc(i){H.setProgressBarDelay(i)}function wc(i){Pt.confirmMethod=i}function Ec(i){H.setFormMode(i)}var _c=Object.freeze({__proto__:null,navigator:pc,session:H,cache:fc,PageRenderer:yt,PageSnapshot:ue,FrameRenderer:Ft,fetch:Rn,start:Hn,registerAdapter:mc,visit:gc,connectStreamSource:qn,disconnectStreamSource:Nn,renderStreamMessage:vc,clearCache:bc,setProgressBarDelay:yc,setConfirmMethod:wc,setFormMode:Ec}),Zr=class extends Error{},es=class{fetchResponseLoaded=e=>Promise.resolve();#e=null;#t=()=>{};#i=!1;#s=!1;#n=new Set;action=null;constructor(e){this.element=e,this.view=new Pr(this,this.element),this.appearanceObserver=new kr(this,this.element),this.formLinkClickObserver=new Ii(this,this.element),this.linkInterceptor=new Oi(this,this.element),this.restorationIdentifier=Ce(),this.formSubmitObserver=new Mt(this,this.element)}connect(){this.#i||(this.#i=!0,this.loadingStyle==dt.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==dt.eager&&this.#r()}sourceURLChanged(){this.#v("src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==dt.eager||this.#s)&&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==dt.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#r())}async#r(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#a(G(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#s=!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=Cn(t);ue.fromDocument(r).isVisitable?await this.#o(e,r):await this.#u(e)}}finally{this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,$e(e)),this.#r()}willSubmitFormLinkToLocation(e){return this.#f(e)}submittedFormLinkToLocation(e,t,r){let s=this.#c(e);s&&r.setAttribute("data-turbo-frame",s.id)}shouldInterceptLinkClick(e,t,r){return this.#f(e)}linkClickIntercepted(e,t){this.#h(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 Pt(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(xe.contentType)}requestStarted(e){Ti(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){Ci(this.element)}formSubmissionStarted({formElement:e}){Ti(e,this.#c(e))}formSubmissionSucceededWithResponse(e,t){let r=this.#c(e.formElement,e.submitter);r.delegate.proposeVisitIfNavigatedWithAction(r,$e(e.submitter,e.formElement,r)),r.delegate.loadResponse(t),e.isSafe||H.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),H.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){Ci(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:s,detail:{render:n}}=r;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!s}viewRenderedSnapshot(e,t,r){}preloadOnLoadLinksForView(e){H.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 s=new bt(r),n=new Ft(this,this.view.snapshot,s,Ft.renderElement,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(n),this.complete=!0,H.frameRendered(e,this.element),H.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#l(e)&&this.#d(e)}async#a(e){let t=new Ue(this,oe.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()})}#h(e,t,r){let s=this.#c(e,r);s.delegate.proposeVisitIfNavigatedWithAction(s,$e(r,e,s)),this.#y(e,()=>{s.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){let r=ue.fromElement(e).clone(),{visitCachedSnapshot:s}=e.delegate;e.delegate.fetchResponseLoaded=async n=>{if(e.src){let{statusCode:o,redirected:a}=n,u=await n.responseHTML,d={response:{statusCode:o,redirected:a,responseHTML:u},visitCachedSnapshot:s,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:r};this.action&&(d.action=this.action),H.visit(e.src,d)}}}}changeHistory(){if(this.action){let e=On(this.action);H.history.update(e,G(this.element.src||""),this.restorationIdentifier)}}async#u(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(n,o)=>{n instanceof Response?this.#p(n):H.visit(n,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 Zr(t)}async#p(e){let t=new kt(e),r=await t.responseHTML,{location:s,redirected:n,statusCode:o}=t;return H.visit(s,{response:{redirected:n,statusCode:o,responseHTML:r}})}#c(e,t){let r=Li("data-turbo-frame",t,e)||this.element.getAttribute("target");return _n(r)??this.element}async extractForeignFrameElement(e){let t,r=CSS.escape(this.id);try{if(t=An(e.querySelector(`turbo-frame#${r}`),this.sourceURL),t)return t;if(t=An(e.querySelector(`turbo-frame[src][recurse~=${r}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(s){return console.error(s),new fe}return null}#g(e,t){let r=rs(e,t);return Te(G(r),this.rootLocation)}#f(e,t){let r=Li("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 s=_n(r);if(s)return!s.disabled}return!(!H.elementIsNavigatable(e)||t&&!H.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 G(t)}#v(e){return this.#n.has(e)}#b(e,t){this.#n.add(e),t(),this.#n.delete(e)}#y(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}};function _n(i){if(i!=null){let e=document.getElementById(i);if(e instanceof fe)return e}}function An(i,e){if(i){let t=i.getAttribute("src");if(t!=null&&e!=null&&cl(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 fe)return i.connectedCallback(),i.disconnectedCallback(),i}}var Vn={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(){H.refresh(this.baseURI,this.requestId)}},ts=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 pt(),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=Vn[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):[]}},is=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),qn(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),Nn(this.streamSource))}get src(){return this.getAttribute("src")||""}};fe.delegateConstructor=es;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",fe);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",ts);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",is);(()=>{let i=document.currentScript;if(i&&!i.hasAttribute("data-turbo-suppress-warning"))for(i=i.parentElement;i;){if(i==document.body)return console.warn(xn`
22
+ You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
23
+
24
+ Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
25
+
26
+ For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements
27
+
28
+ ——
29
+ Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
30
+ `,i.outerHTML);i=i.parentElement}})();window.Turbo={..._c,StreamActions:Vn};Hn();eventNames=["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"];eventNames.forEach(i=>{document.addEventListener(i,e=>{console.log(e.type,e)})});var Ac=jt.start();bn(Ac);})();
31
+ /*! Bundled license information:
32
+
33
+ @hotwired/turbo/dist/turbo.es2017-esm.js:
34
+ (*!
35
+ Turbo 8.0.4
36
+ Copyright © 2024 37signals LLC
37
+ *)
38
+ */
39
+ //# sourceMappingURL=plutonium-app-6WILQCTT.js.map