diff --git a/content/trees/.gitkeep b/content/trees/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json index 961fb99..cb0bfc8 100644 --- a/package.json +++ b/package.json @@ -1,24 +1,15 @@ { "private": true, "scripts": { - "dev": "mix", - "development": "mix", - "watch": "mix watch", - "watch-poll": "mix watch -- --watch-options-poll=1000", - "hot": "mix watch --hot", - "prod": "mix --production", - "production": "mix --production" + "dev": "vite", + "build": "vite build" }, "devDependencies": { - "autoprefixer": "^10.2.5", - "cross-env": "^7.0", - "laravel-mix": "^6.0", - "postcss": "^8.2.9", - "postcss-import": "^14.0.1", - "postcss-nested": "^5.0.5", - "postcss-preset-env": "^6.7.0", - "tailwindcss": "^2.1.1", - "vue-template-compiler": "^2.6.12" + "autoprefixer": "^10.4.14", + "laravel-vite-plugin": "^0.7.2", + "postcss": "^8.4.23", + "tailwindcss": "^3.3.2", + "vite": "^4.0.0" }, "dependencies": { "@hotwired/turbo": "^7.0.0-rc.1", diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..825cb18 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,8 @@ +module.exports = { + plugins: { + 'postcss-import': {}, + 'tailwindcss/nesting': {}, + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/public/build/assets/site-381f6df3.js b/public/build/assets/site-381f6df3.js new file mode 100644 index 0000000..9027cb1 --- /dev/null +++ b/public/build/assets/site-381f6df3.js @@ -0,0 +1,86 @@ +(function(){if(window.Reflect===void 0||window.customElements===void 0||window.customElements.polyfillWrapFlushCallback)return;const e=HTMLElement,t={HTMLElement:function(){return Reflect.construct(e,[],this.constructor)}};window.HTMLElement=t.HTMLElement,HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)})();(function(e){if(typeof e.requestSubmit=="function")return;e.requestSubmit=function(i){i?(t(i,this),i.click()):(i=document.createElement("input"),i.type="submit",i.hidden=!0,this.appendChild(i),i.click(),this.removeChild(i))};function t(i,n){i instanceof HTMLElement||r(TypeError,"parameter 1 is not of type 'HTMLElement'"),i.type=="submit"||r(TypeError,"The specified element is not a submit button"),i.form==n||r(DOMException,"The specified element is not owned by this form element","NotFoundError")}function r(i,n,s){throw new i("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+n+".",s)}})(HTMLFormElement.prototype);const Xa=new WeakMap;function Cf(e){const t=e instanceof Element?e:e instanceof Node?e.parentElement:null,r=t?t.closest("input, button"):null;return(r==null?void 0:r.type)=="submit"?r:null}function Af(e){const t=Cf(e.target);t&&t.form&&Xa.set(t.form,t)}(function(){if("submitter"in Event.prototype)return;let e=window.Event.prototype;if("SubmitEvent"in window&&/Apple Computer/.test(navigator.vendor))e=window.SubmitEvent.prototype;else if("SubmitEvent"in window)return;addEventListener("click",Af,!0),Object.defineProperty(e,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return Xa.get(this.target)}})})();var it;(function(e){e.eager="eager",e.lazy="lazy"})(it||(it={}));class Ke extends HTMLElement{static get observedAttributes(){return["disabled","complete","loading","src"]}constructor(){super(),this.loaded=Promise.resolve(),this.delegate=new Ke.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(t){t=="loading"?this.delegate.loadingStyleChanged():t=="complete"?this.delegate.completeChanged():t=="src"?this.delegate.sourceURLChanged():this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get loading(){return xf(this.getAttribute("loading")||"")}set loading(t){t?this.setAttribute("loading",t):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(t){t?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){var t,r;return(r=(t=this.ownerDocument)===null||t===void 0?void 0:t.documentElement)===null||r===void 0?void 0:r.hasAttribute("data-turbo-preview")}}function xf(e){switch(e.toLowerCase()){case"lazy":return it.lazy;default:return it.eager}}function Te(e){return new URL(e.toString(),document.baseURI)}function bt(e){let t;if(e.hash)return e.hash.slice(1);if(t=e.href.match(/#(.*)$/))return t[1]}function _n(e,t){const r=(t==null?void 0:t.getAttribute("formaction"))||e.getAttribute("action")||e.action;return Te(r)}function Pf(e){return(If(e).match(/\.[^.]*$/)||[])[0]||""}function Lf(e){return!!Pf(e).match(/^(?:|\.(?:htm|html|xhtml|php))$/)}function Mf(e,t){const r=Nf(t);return e.href===Te(r).href||e.href.startsWith(r)}function Ft(e,t){return Mf(e,t)&&Lf(e)}function zi(e){const t=bt(e);return t!=null?e.href.slice(0,-(t.length+1)):e.href}function xr(e){return zi(e)}function Rf(e,t){return Te(e).href==Te(t).href}function $f(e){return e.pathname.split("/").slice(1)}function If(e){return $f(e).slice(-1)[0]}function Nf(e){return Of(e.origin+e.pathname)}function Of(e){return e.endsWith("/")?e:e+"/"}class Sn{constructor(t){this.response=t}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 Te(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(t){return this.response.headers.get(t)}}function ir(e){if(e.getAttribute("data-turbo-eval")=="false")return e;{const t=document.createElement("script"),r=Or("csp-nonce");return r&&(t.nonce=r),t.textContent=e.textContent,t.async=!1,Ff(t,e),t}}function Ff(e,t){for(const{name:r,value:i}of t.attributes)e.setAttribute(r,i)}function Hf(e){const t=document.createElement("template");return t.innerHTML=e,t.content}function Se(e,{target:t,cancelable:r,detail:i}={}){const n=new CustomEvent(e,{cancelable:r,bubbles:!0,composed:!0,detail:i});return t&&t.isConnected?t.dispatchEvent(n):document.documentElement.dispatchEvent(n),n}function Lr(){return new Promise(e=>requestAnimationFrame(()=>e()))}function qf(){return new Promise(e=>setTimeout(()=>e(),0))}function Df(){return Promise.resolve()}function Ja(e=""){return new DOMParser().parseFromString(e,"text/html")}function Qa(e,...t){const r=Bf(e,t).replace(/^\n/,"").split(` +`),i=r[0].match(/^\s+/),n=i?i[0].length:0;return r.map(s=>s.slice(n)).join(` +`)}function Bf(e,t){return e.reduce((r,i,n)=>{const s=t[n]==null?"":t[n];return r+i+s},"")}function Ht(){return Array.from({length:36}).map((e,t)=>t==8||t==13||t==18||t==23?"-":t==14?"4":t==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}function Nr(e,...t){for(const r of t.map(i=>i==null?void 0:i.getAttribute(e)))if(typeof r=="string")return r;return null}function jf(e,...t){return t.some(r=>r&&r.hasAttribute(e))}function Ki(...e){for(const t of e)t.localName=="turbo-frame"&&t.setAttribute("busy",""),t.setAttribute("aria-busy","true")}function Gi(...e){for(const t of e)t.localName=="turbo-frame"&&t.removeAttribute("busy"),t.removeAttribute("aria-busy")}function Vf(e,t=2e3){return new Promise(r=>{const i=()=>{e.removeEventListener("error",i),e.removeEventListener("load",i),r()};e.addEventListener("load",i,{once:!0}),e.addEventListener("error",i,{once:!0}),setTimeout(r,t)})}function Za(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function Wf(e){return e=="advance"||e=="replace"||e=="restore"}function Ur(...e){const t=Nr("data-turbo-action",...e);return Wf(t)?t:null}function eo(e){return document.querySelector(`meta[name="${e}"]`)}function Or(e){const t=eo(e);return t&&t.content}function Uf(e,t){let r=eo(e);return r||(r=document.createElement("meta"),r.setAttribute("name",e),document.head.appendChild(r)),r.setAttribute("content",t),r}function Fr(e,t){var r;if(e instanceof Element)return e.closest(t)||Fr(e.assignedSlot||((r=e.getRootNode())===null||r===void 0?void 0:r.host),t)}var xe;(function(e){e[e.get=0]="get",e[e.post=1]="post",e[e.put=2]="put",e[e.patch=3]="patch",e[e.delete=4]="delete"})(xe||(xe={}));function zf(e){switch(e.toLowerCase()){case"get":return xe.get;case"post":return xe.post;case"put":return xe.put;case"patch":return xe.patch;case"delete":return xe.delete}}class kn{constructor(t,r,i,n=new URLSearchParams,s=null){this.abortController=new AbortController,this.resolveRequestPromise=l=>{},this.delegate=t,this.method=r,this.headers=this.defaultHeaders,this.body=n,this.url=i,this.target=s}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(){const{fetchOptions:t}=this;this.delegate.prepareRequest(this),await this.allowRequestToBeIntercepted(t);try{this.delegate.requestStarted(this);const r=await fetch(this.url.href,t);return await this.receive(r)}catch(r){if(r.name!=="AbortError")throw this.willDelegateErrorHandling(r)&&this.delegate.requestErrored(this,r),r}finally{this.delegate.requestFinished(this)}}async receive(t){const r=new Sn(t);return Se("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:r},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,r):r.succeeded?this.delegate.requestSucceededWithResponse(this,r):this.delegate.requestFailedWithResponse(this,r),r}get fetchOptions(){var t;return{method:xe[this.method].toUpperCase(),credentials:"same-origin",headers:this.headers,redirect:"follow",body:this.isSafe?null:this.body,signal:this.abortSignal,referrer:(t=this.delegate.referrer)===null||t===void 0?void 0:t.href}}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return this.method===xe.get}get abortSignal(){return this.abortController.signal}acceptResponseType(t){this.headers.Accept=[t,this.headers.Accept].join(", ")}async allowRequestToBeIntercepted(t){const r=new Promise(n=>this.resolveRequestPromise=n);Se("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:t,url:this.url,resume:this.resolveRequestPromise},target:this.target}).defaultPrevented&&await r}willDelegateErrorHandling(t){return!Se("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:t}}).defaultPrevented}}class Kf{constructor(t,r){this.started=!1,this.intersect=i=>{const n=i.slice(-1)[0];n!=null&&n.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)},this.delegate=t,this.element=r,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))}}class St{static wrap(t){return typeof t=="string"?new this(Hf(t)):t}constructor(t){this.fragment=Gf(t)}}St.contentType="text/vnd.turbo-stream.html";function Gf(e){for(const t of e.querySelectorAll("turbo-stream")){const r=document.importNode(t,!0);for(const i of r.templateElement.content.querySelectorAll("script"))i.replaceWith(ir(i));t.replaceWith(r)}return e}var Ze;(function(e){e[e.initialized=0]="initialized",e[e.requesting=1]="requesting",e[e.waiting=2]="waiting",e[e.receiving=3]="receiving",e[e.stopping=4]="stopping",e[e.stopped=5]="stopped"})(Ze||(Ze={}));var et;(function(e){e.urlEncoded="application/x-www-form-urlencoded",e.multipart="multipart/form-data",e.plain="text/plain"})(et||(et={}));function Yf(e){switch(e.toLowerCase()){case et.multipart:return et.multipart;case et.plain:return et.plain;default:return et.urlEncoded}}class ur{static confirmMethod(t,r,i){return Promise.resolve(confirm(t))}constructor(t,r,i,n=!1){this.state=Ze.initialized,this.delegate=t,this.formElement=r,this.submitter=i,this.formData=Xf(r,i),this.location=Te(this.action),this.method==xe.get&&Zf(this.location,[...this.body.entries()]),this.fetchRequest=new kn(this,this.method,this.location,this.body,this.formElement),this.mustRedirect=n}get method(){var t;const r=((t=this.submitter)===null||t===void 0?void 0:t.getAttribute("formmethod"))||this.formElement.getAttribute("method")||"";return zf(r.toLowerCase())||xe.get}get action(){var t;const r=typeof this.formElement.action=="string"?this.formElement.action:null;return!((t=this.submitter)===null||t===void 0)&&t.hasAttribute("formaction")?this.submitter.getAttribute("formaction")||"":this.formElement.getAttribute("action")||r||""}get body(){return this.enctype==et.urlEncoded||this.method==xe.get?new URLSearchParams(this.stringFormData):this.formData}get enctype(){var t;return Yf(((t=this.submitter)===null||t===void 0?void 0:t.getAttribute("formenctype"))||this.formElement.enctype)}get isSafe(){return this.fetchRequest.isSafe}get stringFormData(){return[...this.formData].reduce((t,[r,i])=>t.concat(typeof i=="string"?[[r,i]]:[]),[])}async start(){const{initialized:t,requesting:r}=Ze,i=Nr("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof i=="string"&&!await ur.confirmMethod(i,this.formElement,this.submitter))&&this.state==t)return this.state=r,this.fetchRequest.perform()}stop(){const{stopping:t,stopped:r}=Ze;if(this.state!=t&&this.state!=r)return this.state=t,this.fetchRequest.cancel(),!0}prepareRequest(t){if(!t.isSafe){const r=Jf(Or("csrf-param"))||Or("csrf-token");r&&(t.headers["X-CSRF-Token"]=r)}this.requestAcceptsTurboStreamResponse(t)&&t.acceptResponseType(St.contentType)}requestStarted(t){var r;this.state=Ze.waiting,(r=this.submitter)===null||r===void 0||r.setAttribute("disabled",""),this.setSubmitsWith(),Se("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(t,r){this.result={success:r.succeeded,fetchResponse:r}}requestSucceededWithResponse(t,r){if(r.clientError||r.serverError)this.delegate.formSubmissionFailedWithResponse(this,r);else if(this.requestMustRedirect(t)&&Qf(r)){const i=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,i)}else this.state=Ze.receiving,this.result={success:!0,fetchResponse:r},this.delegate.formSubmissionSucceededWithResponse(this,r)}requestFailedWithResponse(t,r){this.result={success:!1,fetchResponse:r},this.delegate.formSubmissionFailedWithResponse(this,r)}requestErrored(t,r){this.result={success:!1,error:r},this.delegate.formSubmissionErrored(this,r)}requestFinished(t){var r;this.state=Ze.stopped,(r=this.submitter)===null||r===void 0||r.removeAttribute("disabled"),this.resetSubmitterText(),Se("turbo:submit-end",{target:this.formElement,detail:Object.assign({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")){const t=this.submitter;this.originalSubmitText=t.value,t.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")){const t=this.submitter;t.value=this.originalSubmitText}}}requestMustRedirect(t){return!t.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(t){return!t.isSafe||jf("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){var t;return(t=this.submitter)===null||t===void 0?void 0:t.getAttribute("data-turbo-submits-with")}}function Xf(e,t){const r=new FormData(e),i=t==null?void 0:t.getAttribute("name"),n=t==null?void 0:t.getAttribute("value");return i&&r.append(i,n||""),r}function Jf(e){if(e!=null){const r=(document.cookie?document.cookie.split("; "):[]).find(i=>i.startsWith(e));if(r){const i=r.split("=").slice(1).join("=");return i?decodeURIComponent(i):void 0}}}function Qf(e){return e.statusCode==200&&!e.redirected}function Zf(e,t){const r=new URLSearchParams;for(const[i,n]of t)n instanceof File||r.append(i,n);return e.search=r.toString(),e}class zr{constructor(t){this.element=t}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(t){return this.getElementForAnchor(t)!=null}getElementForAnchor(t){return t?this.element.querySelector(`[id='${t}'], a[name='${t}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){const t="[inert], :disabled, [hidden], details:not([open]), dialog:not([open])";for(const r of this.element.querySelectorAll("[autofocus]"))if(r.closest(t)==null)return r;return null}get permanentElements(){return ro(this.element)}getPermanentElementById(t){return to(this.element,t)}getPermanentElementMapForSnapshot(t){const r={};for(const i of this.permanentElements){const{id:n}=i,s=t.getPermanentElementById(n);s&&(r[n]=[i,s])}return r}}function to(e,t){return e.querySelector(`#${t}[data-turbo-permanent]`)}function ro(e){return e.querySelectorAll("[id][data-turbo-permanent]")}class Tn{constructor(t,r){this.started=!1,this.submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)},this.submitBubbled=i=>{if(!i.defaultPrevented){const n=i.target instanceof HTMLFormElement?i.target:void 0,s=i.submitter||void 0;n&&ep(n,s)&&tp(n,s)&&this.delegate.willSubmitForm(n,s)&&(i.preventDefault(),i.stopImmediatePropagation(),this.delegate.formSubmitted(n,s))}},this.delegate=t,this.eventTarget=r}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)}}function ep(e,t){return((t==null?void 0:t.getAttribute("formmethod"))||e.getAttribute("method"))!="dialog"}function tp(e,t){if(t!=null&&t.hasAttribute("formtarget")||e.hasAttribute("target")){const r=(t==null?void 0:t.getAttribute("formtarget"))||e.target;for(const i of document.getElementsByName(r))if(i instanceof HTMLIFrameElement)return!1;return!0}else return!0}class io{constructor(t,r){this.resolveRenderPromise=i=>{},this.resolveInterceptionPromise=i=>{},this.delegate=t,this.element=r}scrollToAnchor(t){const r=this.snapshot.getElementForAnchor(t);r?(this.scrollToElement(r),this.focusElement(r)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(t){this.scrollToAnchor(bt(t))}scrollToElement(t){t.scrollIntoView()}focusElement(t){t instanceof HTMLElement&&(t.hasAttribute("tabindex")?t.focus():(t.setAttribute("tabindex","-1"),t.focus(),t.removeAttribute("tabindex")))}scrollToPosition({x:t,y:r}){this.scrollRoot.scrollTo(t,r)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(t){const{isPreview:r,shouldRender:i,newSnapshot:n}=t;if(i)try{this.renderPromise=new Promise(f=>this.resolveRenderPromise=f),this.renderer=t,await this.prepareToRenderSnapshot(t);const s=new Promise(f=>this.resolveInterceptionPromise=f),l={resume:this.resolveInterceptionPromise,render:this.renderer.renderElement};this.delegate.allowsImmediateRender(n,l)||await s,await this.renderSnapshot(t),this.delegate.viewRenderedSnapshot(n,r),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(t)}finally{delete this.renderer,this.resolveRenderPromise(void 0),delete this.renderPromise}else this.invalidate(t.reloadReason)}invalidate(t){this.delegate.viewInvalidated(t)}async prepareToRenderSnapshot(t){this.markAsPreview(t.isPreview),await t.prepareToRender()}markAsPreview(t){t?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}async renderSnapshot(t){await t.render()}finishRenderingSnapshot(t){t.finishRendering()}}class rp extends io{missing(){this.element.innerHTML='Content missing'}get snapshot(){return new zr(this.element)}}class no{constructor(t,r){this.clickBubbled=i=>{this.respondsToEventTarget(i.target)?this.clickEvent=i:delete this.clickEvent},this.linkClicked=i=>{this.clickEvent&&this.respondsToEventTarget(i.target)&&i.target instanceof Element&&this.delegate.shouldInterceptLinkClick(i.target,i.detail.url,i.detail.originalEvent)&&(this.clickEvent.preventDefault(),i.preventDefault(),this.delegate.linkClickIntercepted(i.target,i.detail.url,i.detail.originalEvent)),delete this.clickEvent},this.willVisit=i=>{delete this.clickEvent},this.delegate=t,this.element=r}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)}respondsToEventTarget(t){const r=t instanceof Element?t:t instanceof Node?t.parentElement:null;return r&&r.closest("turbo-frame, html")==this.element}}class so{constructor(t,r){this.started=!1,this.clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)},this.clickBubbled=i=>{if(i instanceof MouseEvent&&this.clickEventIsSignificant(i)){const n=i.composedPath&&i.composedPath()[0]||i.target,s=this.findLinkFromClickTarget(n);if(s&&ip(s)){const l=this.getLocationForLink(s);this.delegate.willFollowLinkToLocation(s,l,i)&&(i.preventDefault(),this.delegate.followedLinkToLocation(s,l))}}},this.delegate=t,this.eventTarget=r}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)}clickEventIsSignificant(t){return!(t.target&&t.target.isContentEditable||t.defaultPrevented||t.which>1||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)}findLinkFromClickTarget(t){return Fr(t,"a[href]:not([target^=_]):not([download])")}getLocationForLink(t){return Te(t.getAttribute("href")||"")}}function ip(e){if(e.hasAttribute("target")){for(const t of document.getElementsByName(e.target))if(t instanceof HTMLIFrameElement)return!1;return!0}else return!0}class ao{constructor(t,r){this.delegate=t,this.linkInterceptor=new so(this,r)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}willFollowLinkToLocation(t,r,i){return this.delegate.willSubmitFormLinkToLocation(t,r,i)&&t.hasAttribute("data-turbo-method")}followedLinkToLocation(t,r){const i=document.createElement("form"),n="hidden";for(const[T,_]of r.searchParams)i.append(Object.assign(document.createElement("input"),{type:n,name:T,value:_}));const s=Object.assign(r,{search:""});i.setAttribute("data-turbo","true"),i.setAttribute("action",s.href),i.setAttribute("hidden","");const l=t.getAttribute("data-turbo-method");l&&i.setAttribute("method",l);const u=t.getAttribute("data-turbo-frame");u&&i.setAttribute("data-turbo-frame",u);const f=Ur(t);f&&i.setAttribute("data-turbo-action",f);const v=t.getAttribute("data-turbo-confirm");v&&i.setAttribute("data-turbo-confirm",v),t.hasAttribute("data-turbo-stream")&&i.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(t,r,i),document.body.appendChild(i),i.addEventListener("turbo:submit-end",()=>i.remove(),{once:!0}),requestAnimationFrame(()=>i.requestSubmit())}}class oo{static async preservingPermanentElements(t,r,i){const n=new this(t,r);n.enter(),await i(),n.leave()}constructor(t,r){this.delegate=t,this.permanentElementMap=r}enter(){for(const t in this.permanentElementMap){const[r,i]=this.permanentElementMap[t];this.delegate.enteringBardo(r,i),this.replaceNewPermanentElementWithPlaceholder(i)}}leave(){for(const t in this.permanentElementMap){const[r]=this.permanentElementMap[t];this.replaceCurrentPermanentElementWithClone(r),this.replacePlaceholderWithPermanentElement(r),this.delegate.leavingBardo(r)}}replaceNewPermanentElementWithPlaceholder(t){const r=np(t);t.replaceWith(r)}replaceCurrentPermanentElementWithClone(t){const r=t.cloneNode(!0);t.replaceWith(r)}replacePlaceholderWithPermanentElement(t){const r=this.getPlaceholderById(t.id);r==null||r.replaceWith(t)}getPlaceholderById(t){return this.placeholders.find(r=>r.content==t)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}}function np(e){const t=document.createElement("meta");return t.setAttribute("name","turbo-permanent-placeholder"),t.setAttribute("content",e.id),t}class Cn{constructor(t,r,i,n,s=!0){this.activeElement=null,this.currentSnapshot=t,this.newSnapshot=r,this.isPreview=n,this.willRender=s,this.renderElement=i,this.promise=new Promise((l,u)=>this.resolvingFunctions={resolve:l,reject:u})}get shouldRender(){return!0}get reloadReason(){}prepareToRender(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(t){await oo.preservingPermanentElements(this,this.permanentElementMap,t)}focusFirstAutofocusableElement(){const t=this.connectedSnapshot.firstAutofocusableElement;sp(t)&&t.focus()}enteringBardo(t){this.activeElement||t.contains(this.currentSnapshot.activeElement)&&(this.activeElement=this.currentSnapshot.activeElement)}leavingBardo(t){t.contains(this.activeElement)&&this.activeElement instanceof HTMLElement&&(this.activeElement.focus(),this.activeElement=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)}}function sp(e){return e&&typeof e.focus=="function"}class Yi extends Cn{static renderElement(t,r){var i;const n=document.createRange();n.selectNodeContents(t),n.deleteContents();const s=r,l=(i=s.ownerDocument)===null||i===void 0?void 0:i.createRange();l&&(l.selectNodeContents(s),t.appendChild(l.extractContents()))}constructor(t,r,i,n,s,l=!0){super(r,i,n,s,l),this.delegate=t}get shouldRender(){return!0}async render(){await Lr(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await Lr(),this.focusFirstAutofocusableElement(),await Lr(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){const t=this.currentElement.firstElementChild,r=ap(this.currentElement.getAttribute("data-autoscroll-block"),"end"),i=op(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(t)return t.scrollIntoView({block:r,behavior:i}),!0}return!1}activateScriptElements(){for(const t of this.newScriptElements){const r=ir(t);t.replaceWith(r)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}}function ap(e,t){return e=="end"||e=="start"||e=="center"||e=="nearest"?e:t}function op(e,t){return e=="auto"||e=="smooth"?e:t}class We{static get defaultCSS(){return Qa` + .turbo-progress-bar { + position: fixed; + display: block; + top: 0; + left: 0; + height: 3px; + background: #0076ff; + z-index: 2147483647; + transition: + width ${We.animationDuration}ms ease-out, + opacity ${We.animationDuration/2}ms ${We.animationDuration/2}ms ease-in; + transform: translate3d(0, 0, 0); + } + `}constructor(){this.hiding=!1,this.value=0,this.visible=!1,this.trickle=()=>{this.setValue(this.value+Math.random()/100)},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(t){this.value=t,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(t){this.progressElement.style.opacity="0",setTimeout(t,We.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,We.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){const t=document.createElement("style");return t.type="text/css",t.textContent=We.defaultCSS,this.cspNonce&&(t.nonce=this.cspNonce),t}createProgressElement(){const t=document.createElement("div");return t.className="turbo-progress-bar",t}get cspNonce(){return Or("csp-nonce")}}We.animationDuration=300;class lp extends zr{constructor(){super(...arguments),this.detailsByOuterHTML=this.children.filter(t=>!dp(t)).map(t=>mp(t)).reduce((t,r)=>{const{outerHTML:i}=r,n=i in t?t[i]:{type:cp(r),tracked:up(r),elements:[]};return Object.assign(Object.assign({},t),{[i]:Object.assign(Object.assign({},n),{elements:[...n.elements,r]})})},{})}get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(t=>this.detailsByOuterHTML[t].tracked).join("")}getScriptElementsNotInSnapshot(t){return this.getElementsMatchingTypeNotInSnapshot("script",t)}getStylesheetElementsNotInSnapshot(t){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",t)}getElementsMatchingTypeNotInSnapshot(t,r){return Object.keys(this.detailsByOuterHTML).filter(i=>!(i in r.detailsByOuterHTML)).map(i=>this.detailsByOuterHTML[i]).filter(({type:i})=>i==t).map(({elements:[i]})=>i)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((t,r)=>{const{type:i,tracked:n,elements:s}=this.detailsByOuterHTML[r];return i==null&&!n?[...t,...s]:s.length>1?[...t,...s.slice(1)]:t},[])}getMetaValue(t){const r=this.findMetaElementByName(t);return r?r.getAttribute("content"):null}findMetaElementByName(t){return Object.keys(this.detailsByOuterHTML).reduce((r,i)=>{const{elements:[n]}=this.detailsByOuterHTML[i];return pp(n,t)?n:r},void 0)}}function cp(e){if(hp(e))return"script";if(fp(e))return"stylesheet"}function up(e){return e.getAttribute("data-turbo-track")=="reload"}function hp(e){return e.localName=="script"}function dp(e){return e.localName=="noscript"}function fp(e){const t=e.localName;return t=="style"||t=="link"&&e.getAttribute("rel")=="stylesheet"}function pp(e,t){return e.localName=="meta"&&e.getAttribute("name")==t}function mp(e){return e.hasAttribute("nonce")&&e.setAttribute("nonce",""),e}class Ne extends zr{static fromHTMLString(t=""){return this.fromDocument(Ja(t))}static fromElement(t){return this.fromDocument(t.ownerDocument)}static fromDocument({head:t,body:r}){return new this(r,new lp(t))}constructor(t,r){super(t),this.headSnapshot=r}clone(){const t=this.element.cloneNode(!0),r=this.element.querySelectorAll("select"),i=t.querySelectorAll("select");for(const[n,s]of r.entries()){const l=i[n];for(const u of l.selectedOptions)u.selected=!1;for(const u of s.selectedOptions)l.options[u.index].selected=!0}for(const n of t.querySelectorAll('input[type="password"]'))n.value="";return new Ne(t,this.headSnapshot)}get headElement(){return this.headSnapshot.element}get rootLocation(){var t;const r=(t=this.getSetting("root"))!==null&&t!==void 0?t:"/";return Te(r)}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"}getSetting(t){return this.headSnapshot.getMetaValue(`turbo-${t}`)}}var Ot;(function(e){e.visitStart="visitStart",e.requestStart="requestStart",e.requestEnd="requestEnd",e.visitEnd="visitEnd"})(Ot||(Ot={}));var $e;(function(e){e.initialized="initialized",e.started="started",e.canceled="canceled",e.failed="failed",e.completed="completed"})($e||($e={}));const gp={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1};var at;(function(e){e[e.networkFailure=0]="networkFailure",e[e.timeoutFailure=-1]="timeoutFailure",e[e.contentTypeMismatch=-2]="contentTypeMismatch"})(at||(at={}));class vp{constructor(t,r,i,n={}){this.identifier=Ht(),this.timingMetrics={},this.followedRedirect=!1,this.historyChanged=!1,this.scrolled=!1,this.shouldCacheSnapshot=!0,this.acceptsStreamResponse=!1,this.snapshotCached=!1,this.state=$e.initialized,this.delegate=t,this.location=r,this.restorationIdentifier=i||Ht();const{action:s,historyChanged:l,referrer:u,snapshot:f,snapshotHTML:v,response:w,visitCachedSnapshot:T,willRender:_,updateHistory:N,shouldCacheSnapshot:H,acceptsStreamResponse:S}=Object.assign(Object.assign({},gp),n);this.action=s,this.historyChanged=l,this.referrer=u,this.snapshot=f,this.snapshotHTML=v,this.response=w,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.visitCachedSnapshot=T,this.willRender=_,this.updateHistory=N,this.scrolled=!_,this.shouldCacheSnapshot=H,this.acceptsStreamResponse=S}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==$e.initialized&&(this.recordTimingMetric(Ot.visitStart),this.state=$e.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==$e.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=$e.canceled)}complete(){this.state==$e.started&&(this.recordTimingMetric(Ot.visitEnd),this.state=$e.completed,this.followRedirect(),this.followedRedirect||(this.adapter.visitCompleted(this),this.delegate.visitCompleted(this)))}fail(){this.state==$e.started&&(this.state=$e.failed,this.adapter.visitFailed(this))}changeHistory(){var t;if(!this.historyChanged&&this.updateHistory){const r=this.location.href===((t=this.referrer)===null||t===void 0?void 0:t.href)?"replace":this.action,i=Za(r);this.history.update(i,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new kn(this,xe.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(Ot.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(t=this.response){if(this.response=t,t){const{statusCode:r}=t;xa(r)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,r)}}finishRequest(){this.recordTimingMetric(Ot.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){const{statusCode:t,responseHTML:r}=this.response;this.render(async()=>{this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,xa(t)&&r!=null?(await this.view.renderPage(Ne.fromHTMLString(r),!1,this.willRender,this),this.performScroll(),this.adapter.visitRendered(this),this.complete()):(await this.view.renderError(Ne.fromHTMLString(r),this),this.adapter.visitRendered(this),this.fail())})}}getCachedSnapshot(){const t=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(t&&(!bt(this.location)||t.hasAnchor(bt(this.location)))&&(this.action=="restore"||t.isPreviewable))return t}getPreloadedSnapshot(){if(this.snapshotHTML)return Ne.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){const t=this.getCachedSnapshot();if(t){const r=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.view.renderPage(t,r,this.willRender,this),this.performScroll(),this.adapter.visitRendered(this),r||this.complete())})}}followRedirect(){var t;this.redirectedToLocation&&!this.followedRedirect&&(!((t=this.response)===null||t===void 0)&&t.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(t){this.acceptsStreamResponse&&t.acceptResponseType(St.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(t,r){}async requestSucceededWithResponse(t,r){const i=await r.responseHTML,{redirected:n,statusCode:s}=r;i==null?this.recordResponse({statusCode:at.contentTypeMismatch,redirected:n}):(this.redirectedToLocation=r.redirected?r.location:void 0,this.recordResponse({statusCode:s,responseHTML:i,redirected:n}))}async requestFailedWithResponse(t,r){const i=await r.responseHTML,{redirected:n,statusCode:s}=r;i==null?this.recordResponse({statusCode:at.contentTypeMismatch,redirected:n}):this.recordResponse({statusCode:s,responseHTML:i,redirected:n})}requestErrored(t,r){this.recordResponse({statusCode:at.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){!this.scrolled&&!this.view.forceReloaded&&(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(){const{scrollPosition:t}=this.restorationData;if(t)return this.view.scrollToPosition(t),!0}scrollToAnchor(){const t=bt(this.location);if(t!=null)return this.view.scrollToAnchor(t),!0}recordTimingMetric(t){this.timingMetrics[t]=new Date().getTime()}getTimingMetrics(){return Object.assign({},this.timingMetrics)}getHistoryMethodForAction(t){switch(t){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(t=>t&&this.visitCachedSnapshot(t)),this.snapshotCached=!0)}async render(t){this.cancelRender(),await new Promise(r=>{this.frame=requestAnimationFrame(()=>r())}),await t(),delete this.frame}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}}function xa(e){return e>=200&&e<300}class bp{constructor(t){this.progressBar=new We,this.showProgressBar=()=>{this.progressBar.show()},this.session=t}visitProposedToLocation(t,r){this.navigator.startVisit(t,(r==null?void 0:r.restorationIdentifier)||Ht(),r)}visitStarted(t){this.location=t.location,t.loadCachedSnapshot(),t.issueRequest(),t.goToSamePageAnchor()}visitRequestStarted(t){this.progressBar.setValue(0),t.hasCachedSnapshot()||t.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(t){t.loadResponse()}visitRequestFailedWithStatusCode(t,r){switch(r){case at.networkFailure:case at.timeoutFailure:case at.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:r}});default:return t.loadResponse()}}visitRequestFinished(t){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitCompleted(t){}pageInvalidated(t){this.reload(t)}visitFailed(t){}visitRendered(t){}formSubmissionStarted(t){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(t){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)}reload(t){var r;Se("turbo:reload",{detail:t}),window.location.href=((r=this.location)===null||r===void 0?void 0:r.toString())||window.location.href}get navigator(){return this.session.navigator}}class yp{constructor(){this.selector="[data-turbo-temporary]",this.deprecatedSelector="[data-turbo-cache=false]",this.started=!1,this.removeTemporaryElements=t=>{for(const r of this.temporaryElements)r.remove()}}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))}get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){const t=document.querySelectorAll(this.deprecatedSelector);return t.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...t]}}class wp{constructor(t,r){this.session=t,this.element=r,this.linkInterceptor=new no(this,r),this.formSubmitObserver=new Tn(this,r)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(t,r,i){return this.shouldRedirect(t)}linkClickIntercepted(t,r,i){const n=this.findFrameElement(t);n&&n.delegate.linkClickIntercepted(t,r,i)}willSubmitForm(t,r){return t.closest("turbo-frame")==null&&this.shouldSubmit(t,r)&&this.shouldRedirect(t,r)}formSubmitted(t,r){const i=this.findFrameElement(t,r);i&&i.delegate.formSubmitted(t,r)}shouldSubmit(t,r){var i;const n=_n(t,r),s=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),l=Te((i=s==null?void 0:s.content)!==null&&i!==void 0?i:"/");return this.shouldRedirect(t,r)&&Ft(n,l)}shouldRedirect(t,r){if(t instanceof HTMLFormElement?this.session.submissionIsNavigatable(t,r):this.session.elementIsNavigatable(t)){const n=this.findFrameElement(t,r);return n?n!=t.closest("turbo-frame"):!1}else return!1}findFrameElement(t,r){const i=(r==null?void 0:r.getAttribute("data-turbo-frame"))||t.getAttribute("data-turbo-frame");if(i&&i!="_top"){const n=this.element.querySelector(`#${i}:not([disabled])`);if(n instanceof Ke)return n}}}class Ep{constructor(t){this.restorationIdentifier=Ht(),this.restorationData={},this.started=!1,this.pageLoaded=!1,this.onPopState=r=>{if(this.shouldHandlePopState()){const{turbo:i}=r.state||{};if(i){this.location=new URL(window.location.href);const{restorationIdentifier:n}=i;this.restorationIdentifier=n,this.delegate.historyPoppedToLocationWithRestorationIdentifier(this.location,n)}}},this.onPageLoad=async r=>{await Df(),this.pageLoaded=!0},this.delegate=t}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),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(t,r){this.update(history.pushState,t,r)}replace(t,r){this.update(history.replaceState,t,r)}update(t,r,i=Ht()){const n={turbo:{restorationIdentifier:i}};t.call(history,n,"",r.href),this.location=r,this.restorationIdentifier=i}getRestorationDataForIdentifier(t){return this.restorationData[t]||{}}updateRestorationData(t){const{restorationIdentifier:r}=this,i=this.restorationData[r];this.restorationData[r]=Object.assign(Object.assign({},i),t)}assumeControlOfScrollRestoration(){var t;this.previousScrollRestoration||(this.previousScrollRestoration=(t=history.scrollRestoration)!==null&&t!==void 0?t:"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}}class _p{constructor(t){this.delegate=t}proposeVisit(t,r={}){this.delegate.allowsVisitingLocationWithAction(t,r.action)&&(Ft(t,this.view.snapshot.rootLocation)?this.delegate.visitProposedToLocation(t,r):window.location.href=t.toString())}startVisit(t,r,i={}){this.stop(),this.currentVisit=new vp(this,Te(t),r,Object.assign({referrer:this.location},i)),this.currentVisit.start()}submitForm(t,r){this.stop(),this.formSubmission=new ur(this,t,r,!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 history(){return this.delegate.history}formSubmissionStarted(t){typeof this.adapter.formSubmissionStarted=="function"&&this.adapter.formSubmissionStarted(t)}async formSubmissionSucceededWithResponse(t,r){if(t==this.formSubmission){const i=await r.responseHTML;if(i){const n=t.isSafe;n||this.view.clearSnapshotCache();const{statusCode:s,redirected:l}=r,f={action:this.getActionForFormSubmission(t),shouldCacheSnapshot:n,response:{statusCode:s,responseHTML:i,redirected:l}};this.proposeVisit(r.location,f)}}}async formSubmissionFailedWithResponse(t,r){const i=await r.responseHTML;if(i){const n=Ne.fromHTMLString(i);r.serverError?await this.view.renderError(n,this.currentVisit):await this.view.renderPage(n,!1,!0,this.currentVisit),this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(t,r){console.error(r)}formSubmissionFinished(t){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(t)}visitStarted(t){this.delegate.visitStarted(t)}visitCompleted(t){this.delegate.visitCompleted(t)}locationWithActionIsSamePage(t,r){const i=bt(t),n=bt(this.view.lastRenderedLocation),s=r==="restore"&&typeof i>"u";return r!=="replace"&&zi(t)===zi(this.view.lastRenderedLocation)&&(s||i!=null&&i!==n)}visitScrolledToSamePageLocation(t,r){this.delegate.visitScrolledToSamePageLocation(t,r)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}getActionForFormSubmission({submitter:t,formElement:r}){return Ur(t,r)||"advance"}}var Ve;(function(e){e[e.initial=0]="initial",e[e.loading=1]="loading",e[e.interactive=2]="interactive",e[e.complete=3]="complete"})(Ve||(Ve={}));class Sp{constructor(t){this.stage=Ve.initial,this.started=!1,this.interpretReadyState=()=>{const{readyState:r}=this;r=="interactive"?this.pageIsInteractive():r=="complete"&&this.pageIsComplete()},this.pageWillUnload=()=>{this.delegate.pageWillUnload()},this.delegate=t}start(){this.started||(this.stage==Ve.initial&&(this.stage=Ve.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)}pageIsInteractive(){this.stage==Ve.loading&&(this.stage=Ve.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==Ve.interactive&&(this.stage=Ve.complete,this.delegate.pageLoaded())}get readyState(){return document.readyState}}class kp{constructor(t){this.started=!1,this.onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})},this.delegate=t}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}updatePosition(t){this.delegate.scrollPositionChanged(t)}}class Tp{render({fragment:t}){oo.preservingPermanentElements(this,Cp(t),()=>document.documentElement.appendChild(t))}enteringBardo(t,r){r.replaceWith(t.cloneNode(!0))}leavingBardo(){}}function Cp(e){const t=ro(document.documentElement),r={};for(const i of t){const{id:n}=i;for(const s of e.querySelectorAll("turbo-stream")){const l=to(s.templateElement.content,n);l&&(r[n]=[i,l])}}return r}class Ap{constructor(t){this.sources=new Set,this.started=!1,this.inspectFetchResponse=r=>{const i=xp(r);i&&Pp(i)&&(r.preventDefault(),this.receiveMessageResponse(i))},this.receiveMessageEvent=r=>{this.started&&typeof r.data=="string"&&this.receiveMessageHTML(r.data)},this.delegate=t}start(){this.started||(this.started=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(t){this.streamSourceIsConnected(t)||(this.sources.add(t),t.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(t){this.streamSourceIsConnected(t)&&(this.sources.delete(t),t.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(t){return this.sources.has(t)}async receiveMessageResponse(t){const r=await t.responseHTML;r&&this.receiveMessageHTML(r)}receiveMessageHTML(t){this.delegate.receivedMessageFromStream(St.wrap(t))}}function xp(e){var t;const r=(t=e.detail)===null||t===void 0?void 0:t.fetchResponse;if(r instanceof Sn)return r}function Pp(e){var t;return((t=e.contentType)!==null&&t!==void 0?t:"").startsWith(St.contentType)}class Pa extends Cn{static renderElement(t,r){const{documentElement:i,body:n}=document;i.replaceChild(r,n)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){const{documentElement:t,head:r}=document;t.replaceChild(this.newHead,r),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(const t of this.scriptElements){const r=t.parentNode;if(r){const i=ir(t);r.replaceChild(i,t)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}}class Xi extends Cn{static renderElement(t,r){document.body&&r instanceof HTMLBodyElement?document.body.replaceWith(r):document.documentElement.appendChild(r)}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(){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}async mergeHead(){const t=this.mergeProvisionalElements(),r=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await t,await r}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){const t=[];for(const r of this.newHeadStylesheetElements)t.push(Vf(r)),document.head.appendChild(r);await Promise.all(t)}copyNewHeadScriptElements(){for(const t of this.newHeadScriptElements)document.head.appendChild(ir(t))}async mergeProvisionalElements(){const t=[...this.newHeadProvisionalElements];for(const r of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(r,t)||document.head.removeChild(r);for(const r of t)document.head.appendChild(r)}isCurrentElementInElementList(t,r){for(const[i,n]of r.entries()){if(t.tagName=="TITLE"){if(n.tagName!="TITLE")continue;if(t.innerHTML==n.innerHTML)return r.splice(i,1),!0}if(n.isEqualNode(t))return r.splice(i,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(const t of this.currentHeadProvisionalElements)document.head.removeChild(t)}copyNewHeadProvisionalElements(){for(const t of this.newHeadProvisionalElements)document.head.appendChild(t)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(const t of this.newBodyScriptElements){const r=ir(t);t.replaceWith(r)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}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")}}class Lp{constructor(t){this.keys=[],this.snapshots={},this.size=t}has(t){return xr(t)in this.snapshots}get(t){if(this.has(t)){const r=this.read(t);return this.touch(t),r}}put(t,r){return this.write(t,r),this.touch(t),r}clear(){this.snapshots={}}read(t){return this.snapshots[xr(t)]}write(t,r){this.snapshots[xr(t)]=r}touch(t){const r=xr(t),i=this.keys.indexOf(r);i>-1&&this.keys.splice(i,1),this.keys.unshift(r),this.trim()}trim(){for(const t of this.keys.splice(this.size))delete this.snapshots[t]}}class Mp extends io{constructor(){super(...arguments),this.snapshotCache=new Lp(10),this.lastRenderedLocation=new URL(location.href),this.forceReloaded=!1}renderPage(t,r=!1,i=!0,n){const s=new Xi(this.snapshot,t,Xi.renderElement,r,i);return s.shouldRender?n==null||n.changeHistory():this.forceReloaded=!0,this.render(s)}renderError(t,r){r==null||r.changeHistory();const i=new Pa(this.snapshot,t,Pa.renderElement,!1);return this.render(i)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(t=this.snapshot){if(t.isCacheable){this.delegate.viewWillCacheSnapshot();const{lastRenderedLocation:r}=this;await qf();const i=t.clone();return this.snapshotCache.put(r,i),i}}getCachedSnapshotForLocation(t){return this.snapshotCache.get(t)}get snapshot(){return Ne.fromElement(this.element)}}class Rp{constructor(t){this.selector="a[data-turbo-preload]",this.delegate=t}get snapshotCache(){return this.delegate.navigator.view.snapshotCache}start(){if(document.readyState==="loading")return document.addEventListener("DOMContentLoaded",()=>{this.preloadOnLoadLinksForView(document.body)});this.preloadOnLoadLinksForView(document.body)}preloadOnLoadLinksForView(t){for(const r of t.querySelectorAll(this.selector))this.preloadURL(r)}async preloadURL(t){const r=new URL(t.href);if(!this.snapshotCache.has(r))try{const n=await(await fetch(r.toString(),{headers:{"VND.PREFETCH":"true",Accept:"text/html"}})).text(),s=Ne.fromHTMLString(n);this.snapshotCache.put(r,s)}catch{}}}class $p{constructor(){this.navigator=new _p(this),this.history=new Ep(this),this.preloader=new Rp(this),this.view=new Mp(this,document.documentElement),this.adapter=new bp(this),this.pageObserver=new Sp(this),this.cacheObserver=new yp,this.linkClickObserver=new so(this,window),this.formSubmitObserver=new Tn(this,document),this.scrollObserver=new kp(this),this.streamObserver=new Ap(this),this.formLinkClickObserver=new ao(this,document.documentElement),this.frameRedirector=new wp(this,document.documentElement),this.streamMessageRenderer=new Tp,this.drive=!0,this.enabled=!0,this.progressBarDelay=500,this.started=!1,this.formMode="on"}start(){this.started||(this.pageObserver.start(),this.cacheObserver.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.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.started=!1)}registerAdapter(t){this.adapter=t}visit(t,r={}){const i=r.frame?document.getElementById(r.frame):null;i instanceof Ke?(i.src=t.toString(),i.loaded):this.navigator.proposeVisit(Te(t),r)}connectStreamSource(t){this.streamObserver.connectStreamSource(t)}disconnectStreamSource(t){this.streamObserver.disconnectStreamSource(t)}renderStreamMessage(t){this.streamMessageRenderer.render(St.wrap(t))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(t){this.progressBarDelay=t}setFormMode(t){this.formMode=t}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}historyPoppedToLocationWithRestorationIdentifier(t,r){this.enabled?this.navigator.startVisit(t,r,{action:"restore",historyChanged:!0}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(t){this.history.updateRestorationData({scrollPosition:t})}willSubmitFormLinkToLocation(t,r){return this.elementIsNavigatable(t)&&Ft(r,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}willFollowLinkToLocation(t,r,i){return this.elementIsNavigatable(t)&&Ft(r,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(t,r,i)}followedLinkToLocation(t,r){const i=this.getActionForLink(t),n=t.hasAttribute("data-turbo-stream");this.visit(r.href,{action:i,acceptsStreamResponse:n})}allowsVisitingLocationWithAction(t,r){return this.locationWithActionIsSamePage(t,r)||this.applicationAllowsVisitingLocation(t)}visitProposedToLocation(t,r){La(t),this.adapter.visitProposedToLocation(t,r)}visitStarted(t){t.acceptsStreamResponse||Ki(document.documentElement),La(t.location),t.silent||this.notifyApplicationAfterVisitingLocation(t.location,t.action)}visitCompleted(t){Gi(document.documentElement),this.notifyApplicationAfterPageLoad(t.getTimingMetrics())}locationWithActionIsSamePage(t,r){return this.navigator.locationWithActionIsSamePage(t,r)}visitScrolledToSamePageLocation(t,r){this.notifyApplicationAfterVisitingSamePageLocation(t,r)}willSubmitForm(t,r){const i=_n(t,r);return this.submissionIsNavigatable(t,r)&&Ft(Te(i),this.snapshot.rootLocation)}formSubmitted(t,r){this.navigator.submitForm(t,r)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(t){this.renderStreamMessage(t)}viewWillCacheSnapshot(){var t;!((t=this.navigator.currentVisit)===null||t===void 0)&&t.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:t},r){const i=this.notifyApplicationBeforeRender(t,r),{defaultPrevented:n,detail:{render:s}}=i;return this.view.renderer&&s&&(this.view.renderer.renderElement=s),!n}viewRenderedSnapshot(t,r){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender()}preloadOnLoadLinksForView(t){this.preloader.preloadOnLoadLinksForView(t)}viewInvalidated(t){this.adapter.pageInvalidated(t)}frameLoaded(t){this.notifyApplicationAfterFrameLoad(t)}frameRendered(t,r){this.notifyApplicationAfterFrameRender(t,r)}applicationAllowsFollowingLinkToLocation(t,r,i){return!this.notifyApplicationAfterClickingLinkToLocation(t,r,i).defaultPrevented}applicationAllowsVisitingLocation(t){return!this.notifyApplicationBeforeVisitingLocation(t).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(t,r,i){return Se("turbo:click",{target:t,detail:{url:r.href,originalEvent:i},cancelable:!0})}notifyApplicationBeforeVisitingLocation(t){return Se("turbo:before-visit",{detail:{url:t.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(t,r){return Se("turbo:visit",{detail:{url:t.href,action:r}})}notifyApplicationBeforeCachingSnapshot(){return Se("turbo:before-cache")}notifyApplicationBeforeRender(t,r){return Se("turbo:before-render",{detail:Object.assign({newBody:t},r),cancelable:!0})}notifyApplicationAfterRender(){return Se("turbo:render")}notifyApplicationAfterPageLoad(t={}){return Se("turbo:load",{detail:{url:this.location.href,timing:t}})}notifyApplicationAfterVisitingSamePageLocation(t,r){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:t.toString(),newURL:r.toString()}))}notifyApplicationAfterFrameLoad(t){return Se("turbo:frame-load",{target:t})}notifyApplicationAfterFrameRender(t,r){return Se("turbo:frame-render",{detail:{fetchResponse:t},target:r,cancelable:!0})}submissionIsNavigatable(t,r){if(this.formMode=="off")return!1;{const i=r?this.elementIsNavigatable(r):!0;return this.formMode=="optin"?i&&t.closest('[data-turbo="true"]')!=null:i&&this.elementIsNavigatable(t)}}elementIsNavigatable(t){const r=Fr(t,"[data-turbo]"),i=Fr(t,"turbo-frame");return this.drive||i?r?r.getAttribute("data-turbo")!="false":!0:r?r.getAttribute("data-turbo")=="true":!1}getActionForLink(t){return Ur(t)||"advance"}get snapshot(){return this.view.snapshot}}function La(e){Object.defineProperties(e,Ip)}const Ip={absoluteURL:{get(){return this.toString()}}};class Np{constructor(t){this.session=t}clear(){this.session.clearCache()}resetCacheControl(){this.setCacheControl("")}exemptPageFromCache(){this.setCacheControl("no-cache")}exemptPageFromPreview(){this.setCacheControl("no-preview")}setCacheControl(t){Uf("turbo-cache-control",t)}}const lo={after(){this.targetElements.forEach(e=>{var t;return(t=e.parentElement)===null||t===void 0?void 0:t.insertBefore(this.templateContent,e.nextSibling)})},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(e=>e.append(this.templateContent))},before(){this.targetElements.forEach(e=>{var t;return(t=e.parentElement)===null||t===void 0?void 0:t.insertBefore(this.templateContent,e)})},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(e=>e.prepend(this.templateContent))},remove(){this.targetElements.forEach(e=>e.remove())},replace(){this.targetElements.forEach(e=>e.replaceWith(this.templateContent))},update(){this.targetElements.forEach(e=>{e.innerHTML="",e.append(this.templateContent)})}},ce=new $p,Op=new Np(ce),{navigator:Fp}=ce;function co(){ce.start()}function Hp(e){ce.registerAdapter(e)}function qp(e,t){ce.visit(e,t)}function uo(e){ce.connectStreamSource(e)}function ho(e){ce.disconnectStreamSource(e)}function Dp(e){ce.renderStreamMessage(e)}function Bp(){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.`"),ce.clearCache()}function jp(e){ce.setProgressBarDelay(e)}function Vp(e){ur.confirmMethod=e}function Wp(e){ce.setFormMode(e)}var Up=Object.freeze({__proto__:null,navigator:Fp,session:ce,cache:Op,PageRenderer:Xi,PageSnapshot:Ne,FrameRenderer:Yi,start:co,registerAdapter:Hp,visit:qp,connectStreamSource:uo,disconnectStreamSource:ho,renderStreamMessage:Dp,clearCache:Bp,setProgressBarDelay:jp,setConfirmMethod:Vp,setFormMode:Wp,StreamActions:lo});class zp extends Error{}class Kp{constructor(t){this.fetchResponseLoaded=r=>{},this.currentFetchRequest=null,this.resolveVisitPromise=()=>{},this.connected=!1,this.hasBeenLoaded=!1,this.ignoredAttributes=new Set,this.action=null,this.visitCachedSnapshot=({element:r})=>{const i=r.querySelector("#"+this.element.id);i&&this.previousFrameElement&&i.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement},this.element=t,this.view=new rp(this,this.element),this.appearanceObserver=new Kf(this,this.element),this.formLinkClickObserver=new ao(this,this.element),this.linkInterceptor=new no(this,this.element),this.restorationIdentifier=Ht(),this.formSubmitObserver=new Tn(this,this.element)}connect(){this.connected||(this.connected=!0,this.loadingStyle==it.lazy?this.appearanceObserver.start():this.loadSourceURL(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.connected&&(this.connected=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==it.eager&&this.loadSourceURL()}sourceURLChanged(){this.isIgnoringChangesTo("src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==it.eager||this.hasBeenLoaded)&&this.loadSourceURL())}sourceURLReloaded(){const{src:t}=this.element;return this.ignoringChangesToAttribute("complete",()=>{this.element.removeAttribute("complete")}),this.element.src=null,this.element.src=t,this.element.loaded}completeChanged(){this.isIgnoringChangesTo("complete")||this.loadSourceURL()}loadingStyleChanged(){this.loadingStyle==it.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.loadSourceURL())}async loadSourceURL(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.visit(Te(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.hasBeenLoaded=!0)}async loadResponse(t){(t.redirected||t.succeeded&&t.isHTML)&&(this.sourceURL=t.response.url);try{const r=await t.responseHTML;if(r){const i=Ja(r);Ne.fromDocument(i).isVisitable?await this.loadFrameResponse(t,i):await this.handleUnvisitableFrameResponse(t)}}finally{this.fetchResponseLoaded=()=>{}}}elementAppearedInViewport(t){this.proposeVisitIfNavigatedWithAction(t,t),this.loadSourceURL()}willSubmitFormLinkToLocation(t){return this.shouldInterceptNavigation(t)}submittedFormLinkToLocation(t,r,i){const n=this.findFrameElement(t);n&&i.setAttribute("data-turbo-frame",n.id)}shouldInterceptLinkClick(t,r,i){return this.shouldInterceptNavigation(t)}linkClickIntercepted(t,r){this.navigateFrame(t,r)}willSubmitForm(t,r){return t.closest("turbo-frame")==this.element&&this.shouldInterceptNavigation(t,r)}formSubmitted(t,r){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new ur(this,t,r);const{fetchRequest:i}=this.formSubmission;this.prepareRequest(i),this.formSubmission.start()}prepareRequest(t){var r;t.headers["Turbo-Frame"]=this.id,!((r=this.currentNavigationElement)===null||r===void 0)&&r.hasAttribute("data-turbo-stream")&&t.acceptResponseType(St.contentType)}requestStarted(t){Ki(this.element)}requestPreventedHandlingResponse(t,r){this.resolveVisitPromise()}async requestSucceededWithResponse(t,r){await this.loadResponse(r),this.resolveVisitPromise()}async requestFailedWithResponse(t,r){await this.loadResponse(r),this.resolveVisitPromise()}requestErrored(t,r){console.error(r),this.resolveVisitPromise()}requestFinished(t){Gi(this.element)}formSubmissionStarted({formElement:t}){Ki(t,this.findFrameElement(t))}formSubmissionSucceededWithResponse(t,r){const i=this.findFrameElement(t.formElement,t.submitter);i.delegate.proposeVisitIfNavigatedWithAction(i,t.formElement,t.submitter),i.delegate.loadResponse(r),t.isSafe||ce.clearCache()}formSubmissionFailedWithResponse(t,r){this.element.delegate.loadResponse(r),ce.clearCache()}formSubmissionErrored(t,r){console.error(r)}formSubmissionFinished({formElement:t}){Gi(t,this.findFrameElement(t))}allowsImmediateRender({element:t},r){const i=Se("turbo:before-frame-render",{target:this.element,detail:Object.assign({newFrame:t},r),cancelable:!0}),{defaultPrevented:n,detail:{render:s}}=i;return this.view.renderer&&s&&(this.view.renderer.renderElement=s),!n}viewRenderedSnapshot(t,r){}preloadOnLoadLinksForView(t){ce.preloadOnLoadLinksForView(t)}viewInvalidated(){}willRenderFrame(t,r){this.previousFrameElement=t.cloneNode(!0)}async loadFrameResponse(t,r){const i=await this.extractForeignFrameElement(r.body);if(i){const n=new zr(i),s=new Yi(this,this.view.snapshot,n,Yi.renderElement,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(s),this.complete=!0,ce.frameRendered(t,this.element),ce.frameLoaded(this.element),this.fetchResponseLoaded(t)}else this.willHandleFrameMissingFromResponse(t)&&this.handleFrameMissingFromResponse(t)}async visit(t){var r;const i=new kn(this,xe.get,t,new URLSearchParams,this.element);return(r=this.currentFetchRequest)===null||r===void 0||r.cancel(),this.currentFetchRequest=i,new Promise(n=>{this.resolveVisitPromise=()=>{this.resolveVisitPromise=()=>{},this.currentFetchRequest=null,n()},i.perform()})}navigateFrame(t,r,i){const n=this.findFrameElement(t,i);n.delegate.proposeVisitIfNavigatedWithAction(n,t,i),this.withCurrentNavigationElement(t,()=>{n.src=r})}proposeVisitIfNavigatedWithAction(t,r,i){if(this.action=Ur(i,r,t),this.action){const n=Ne.fromElement(t).clone(),{visitCachedSnapshot:s}=t.delegate;t.delegate.fetchResponseLoaded=l=>{if(t.src){const{statusCode:u,redirected:f}=l,v=t.ownerDocument.documentElement.outerHTML,T={response:{statusCode:u,redirected:f,responseHTML:v},visitCachedSnapshot:s,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:n};this.action&&(T.action=this.action),ce.visit(t.src,T)}}}}changeHistory(){if(this.action){const t=Za(this.action);ce.history.update(t,Te(this.element.src||""),this.restorationIdentifier)}}async handleUnvisitableFrameResponse(t){console.warn(`The response (${t.statusCode}) from is performing a full page visit due to turbo-visit-control.`),await this.visitResponse(t.response)}willHandleFrameMissingFromResponse(t){this.element.setAttribute("complete","");const r=t.response,i=async(s,l={})=>{s instanceof Response?this.visitResponse(s):ce.visit(s,l)};return!Se("turbo:frame-missing",{target:this.element,detail:{response:r,visit:i},cancelable:!0}).defaultPrevented}handleFrameMissingFromResponse(t){this.view.missing(),this.throwFrameMissingError(t)}throwFrameMissingError(t){const r=`The response (${t.statusCode}) did not contain the expected and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new zp(r)}async visitResponse(t){const r=new Sn(t),i=await r.responseHTML,{location:n,redirected:s,statusCode:l}=r;return ce.visit(n,{response:{redirected:s,statusCode:l,responseHTML:i}})}findFrameElement(t,r){var i;const n=Nr("data-turbo-frame",r,t)||this.element.getAttribute("target");return(i=Ma(n))!==null&&i!==void 0?i:this.element}async extractForeignFrameElement(t){let r;const i=CSS.escape(this.id);try{if(r=Ra(t.querySelector(`turbo-frame#${i}`),this.sourceURL),r)return r;if(r=Ra(t.querySelector(`turbo-frame[src][recurse~=${i}]`),this.sourceURL),r)return await r.loaded,await this.extractForeignFrameElement(r)}catch(n){return console.error(n),new Ke}return null}formActionIsVisitable(t,r){const i=_n(t,r);return Ft(Te(i),this.rootLocation)}shouldInterceptNavigation(t,r){const i=Nr("data-turbo-frame",r,t)||this.element.getAttribute("target");if(t instanceof HTMLFormElement&&!this.formActionIsVisitable(t,r)||!this.enabled||i=="_top")return!1;if(i){const n=Ma(i);if(n)return!n.disabled}return!(!ce.elementIsNavigatable(t)||r&&!ce.elementIsNavigatable(r))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(t){this.ignoringChangesToAttribute("src",()=>{this.element.src=t??null})}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||this.resolveVisitPromise()!==void 0}get complete(){return this.element.hasAttribute("complete")}set complete(t){this.ignoringChangesToAttribute("complete",()=>{t?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")})}get isActive(){return this.element.isActive&&this.connected}get rootLocation(){var t;const r=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),i=(t=r==null?void 0:r.content)!==null&&t!==void 0?t:"/";return Te(i)}isIgnoringChangesTo(t){return this.ignoredAttributes.has(t)}ignoringChangesToAttribute(t,r){this.ignoredAttributes.add(t),r(),this.ignoredAttributes.delete(t)}withCurrentNavigationElement(t,r){this.currentNavigationElement=t,r(),delete this.currentNavigationElement}}function Ma(e){if(e!=null){const t=document.getElementById(e);if(t instanceof Ke)return t}}function Ra(e,t){if(e){const r=e.getAttribute("src");if(r!=null&&t!=null&&Rf(r,t))throw new Error(`Matching element has a source URL which references itself`);if(e.ownerDocument!==document&&(e=document.importNode(e,!0)),e instanceof Ke)return e.connectedCallback(),e.disconnectedCallback(),e}}class An extends HTMLElement{static async renderElement(t){await t.performAction()}async connectedCallback(){try{await this.render()}catch(t){console.error(t)}finally{this.disconnect()}}async render(){var t;return(t=this.renderPromise)!==null&&t!==void 0?t:this.renderPromise=(async()=>{const r=this.beforeRenderEvent;this.dispatchEvent(r)&&(await Lr(),await r.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(t=>t.remove())}get duplicateChildren(){var t;const r=this.targetElements.flatMap(n=>[...n.children]).filter(n=>!!n.id),i=[...((t=this.templateContent)===null||t===void 0?void 0:t.children)||[]].filter(n=>!!n.id).map(n=>n.id);return r.filter(n=>i.includes(n.id))}get performAction(){if(this.action){const t=lo[this.action];if(t)return t;this.raise("unknown action")}this.raise("action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;this.raise("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild===null){const t=this.ownerDocument.createElement("template");return this.appendChild(t),t}else if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.raise("first child element must be a