PageSourceSearch

https://sklep.keeza.pl/application/assets/storefront/chunk-vendor-turbo.1YpwTQ9.js

js keeza.pl collected 2026-10-09 01:22:06 UTC 91,587 bytes, 26 lines download raw bytes

1(function(s){if(typeof s.requestSubmit=="function")return;s.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,i){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==i||t(DOMException,"The specified element is not owned by this form element","NotFoundError")}function t(r,i,l){throw new r("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+i+".",l)}})(HTMLFormElement.prototype);const He=new WeakMap;function bt(s){const e=s instanceof Element?s:s instanceof Node?s.parentElement:null,t=e?e.closest("input, button"):null;return t?.type=="submit"?t:null}function vt(s){const e=bt(s.target);e&&e.form&&He.set(e.form,e)}(function(){if("submitter"in Event.prototype)return;let s=window.Event.prototype;if("SubmitEvent"in window){const e=window.SubmitEvent.prototype;if(/Apple Computer/.test(navigator.vendor)&&!("submitter"in e))s=e;else return}addEventListener("click",vt,!0),Object.defineProperty(s,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return He.get(this.target)}})})();const x={eager:"eager",lazy:"lazy"};class T extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new T.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 shouldReloadWithMorph(){return this.src&&this.refresh==="morph"}get loading(){return St(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 St(s){return s.toLowerCase()==="lazy"?x.lazy:x.eager}const wt={enabled:!0,progressBarDelay:500,unvisitableExtensions:new Set([".7z",".aac",".apk",".avi",".bmp",".bz2",".css",".csv",".deb",".dmg",".doc",".docx",".exe",".gif",".gz",".heic",".heif",".ico",".iso",".jpeg",".jpg",".js",".json",".m4a",".mkv",".mov",".mp3",".mp4",".mpeg",".mpg",".msi",".ogg",".ogv",".pdf",".pkg",".png",".ppt",".pptx",".rar",".rtf",".svg",".tar",".tif",".tiff",".txt",".wav",".webm",".webp",".wma",".wmv",".xls",".xlsx",".xml",".zip"])};function J(s){if(s.getAttribute("data-turbo-eval")=="false")return s;{const e=document.createElement("script"),t=We();return t&&(e.nonce=t),e.textContent=s.textContent,e.async=!1,Et(e,s),e}}function Et(s,e){for(const{name:t,value:r}of e.attributes)s.setAttribute(t,r)}function yt(s){const e=document.createElement("template");return e.innerHTML=s,e.content}function p(s,{target:e,cancelable:t,detail:r}={}){const i=new CustomEvent(s,{cancelable:t,bubbles:!0,composed:!0,detail:r});return e&&e.isConnected?e.dispatchEvent(i):document.documentElement.dispatchEvent(i),i}function Pe(s){s.preventDefault(),s.stopImmediatePropagation()}function Y(){return document.visibilityState==="hidden"?Be():Oe()}function Oe(){return new Promise(s=>requestAnimationFrame(()=>s()))}function Be(){return new Promise(s=>setTimeout(()=>s(),0))}function Rt(){return Promise.resolve()}function De(s=""){return new DOMParser().parseFromString(s,"text/html")}function Ve(s,...e){const t=At(s,e).replace(/^\n/,"").split(`
2`),r=t[0].match(/^\s+/),i=r?r[0].length:0;return t.map(l=>l.slice(i)).join(`
3`)}function At(s,e){return s.reduce((t,r,i)=>{const l=e[i]==null?"":e[i];return t+r+l},"")}function I(){return Array.from({length:36}).map((s,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 te(s,...e){for(const t of e.map(r=>r?.getAttribute(s)))if(typeof t=="string")return t;return null}function Lt(s,...e){return e.some(t=>t&&t.hasAttribute(s))}function se(...s){for(const e of s)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function re(...s){for(const e of s)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function Tt(s,e=2e3){return new Promise(t=>{const r=()=>{s.removeEventListener("error",r),s.removeEventListener("load",r),t()};s.addEventListener("load",r,{once:!0}),s.addEventListener("error",r,{once:!0}),setTimeout(t,e)})}function Ne(s){switch(s){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function Pt(s){return s=="advance"||s=="replace"||s=="restore"}function D(...s){const e=te("data-turbo-action",...s);return Pt(e)?e:null}function ue(s){return document.querySelector(`meta[name="${s}"]`)}function ie(s){const e=ue(s);return e&&e.content}
3function We(){const s=ue("csp-nonce");if(s){const{nonce:e,content:t}=s;return e==""?t:e}}function Ct(s,e){let t=ue(s);return t||(t=document.createElement("meta"),t.setAttribute("name",s),document.head.appendChild(t)),t.setAttribute("content",e),t}function j(s,e){if(s instanceof Element)return s.closest(e)||j(s.assignedSlot||s.getRootNode()?.host,e)}function de(s){return!!s&&s.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof s.focus=="function"}function Ue(s){return Array.from(s.querySelectorAll("[autofocus]")).find(de)}async function Mt(s,e){const t=e();s(),await Oe();const r=e();return[t,r]}function xe(s){if(s==="_blank")return!1;if(s){for(const e of document.getElementsByName(s))if(e instanceof HTMLIFrameElement)return!1;return!0}else return!0}function _e(s){return j(s,"a[href]:not([target^=_]):not([download])")}function je(s){return w(s.getAttribute("href")||"")}function kt(s,e){let t=null;return(...r)=>{const i=()=>s.apply(this,r);clearTimeout(t),t=setTimeout(i,e)}}const Ft={"aria-disabled":{beforeSubmit:s=>{s.setAttribute("aria-disabled","true"),s.addEventListener("click",Pe)},afterSubmit:s=>{s.removeAttribute("aria-disabled"),s.removeEventListener("click",Pe)}},disabled:{beforeSubmit:s=>s.disabled=!0,afterSubmit:s=>s.disabled=!1}};class It{#e=null;constructor(e){Object.assign(this,e)}get submitter(){return this.#e}set submitter(e){this.#e=Ft[e]||e}}const qt=new It({mode:"on",submitter:"disabled"}),S={drive:wt,forms:qt};function w(s){return new URL(s.toString(),document.baseURI)}function V(s){let e;if(s.hash)return s.hash.slice(1);if(e=s.href.match(/#(.*)$/))return e[1]}function me(s,e){const t=e?.getAttribute("formaction")||s.getAttribute("action")||s.action;return w(t)}function Ht(s){return(Vt(s).match(/\.[^.]*$/)||[])[0]||""}function Ot(s,e){const t=Nt(e);return s.href===w(t).href||s.href.startsWith(t)}function F(s,e){return Ot(s,e)&&!S.drive.unvisitableExtensions.has(Ht(s))}function he(s){const e=V(s);return e!=null?s.href.slice(0,-(e.length+1)):s.href}function Z(s){return he(s)}function Bt(s,e){return w(s).href==w(e).href}function Dt(s){return s.pathname.split("/").slice(1)}function Vt(s){return Dt(s).slice(-1)[0]}function Nt(s){return Wt(s.origin+s.pathname)}function Wt(s){return s.endsWith("/")?s:s+"/"}class fe{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 w(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)}}class Ut extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){const r=this.values().next().value;this.delete(r)}super.add(e)}}const ze=new Ut(20),xt=window.fetch;function $e(s,e={}){const t=new Headers(e.headers||{}),r=I();return ze.add(r),t.append("X-Turbo-Request-Id",r),xt(s,{...e,headers:t})}function pe(s){switch(s.toLowerCase()){case"get":return R.get;case"post":return R.post;case"put":return R.put;case"patch":return R.patch;case"delete":return R.delete}}const R={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function _t(s){switch(s.toLowerCase()){case B.multipart:return B.multipart;case B.plain:return B.plain;default:return B.urlEncoded}}const B={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"};class Q{abortController=new AbortController;#e=e=>{};constructor(e,t,r,i=new URLSearchParams,l=null,d=B.urlEncoded){const[f,E]=Ce(w(r),t,i,d);this.delegate=e,this.url=f,this.target=l,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t.toUpperCase(),headers:{...this.defaultHeaders}
3,body:E,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=d}get method(){return this.fetchOptions.method}set method(e){const t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,r=pe(e)||R.get;this.url.search="";const[i,l]=Ce(this.url,r,t,this.enctype);this.url=i,this.fetchOptions.body=l,this.fetchOptions.method=r.toUpperCase()}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(){const{fetchOptions:e}=this;this.delegate.prepareRequest(this);const t=await this.#t(e);try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=$e(this.url.href,e);const r=await this.response;return await this.receive(r)}catch(r){if(r.name!=="AbortError")throw this.#s(r)&&this.delegate.requestErrored(this,r),r}finally{this.delegate.requestFinished(this)}}async receive(e){const t=new fe(e);return p("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 ge(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#t(e){const t=new Promise(i=>this.#e=i),r=p("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}#s(e){return!p("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}}function ge(s){return pe(s)==R.get}function Ce(s,e,t,r){const i=Array.from(t).length>0?new URLSearchParams(Ke(t)):s.searchParams;return ge(e)?[jt(s,i),null]:r==B.urlEncoded?[s,i]:[s,t]}function Ke(s){const e=[];for(const[t,r]of s)r instanceof File||e.push([t,r]);return e}function jt(s,e){const t=new URLSearchParams(Ke(e));return s.search=t.toString(),s}class zt{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)}}class ${static contentType="text/vnd.turbo-stream.html";static wrap(e){return typeof e=="string"?new this(yt(e)):e}constructor(e){this.fragment=$t(e)}}function $t(s){for(const e of s.querySelectorAll("turbo-stream")){const t=document.importNode(e,!0);for(const r of t.templateElement.content.querySelectorAll("script"))r.replaceWith(J(r));e.replaceWith(t)}return s}const Kt=100;class Xt{#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},Kt)}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}}const Yt=10*1e3,_=new Xt,U={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"};class ne{state=U.initialized;static confirmMethod(e){return Promise.resolve(confirm(e))}constructor(e,t,r,i=!1){const l=ts(t,r),d=es(Zt(t,r),l),f=Jt(t,r),E=ss(t,r);this.delegate=e,this.formElement=t,this.submitter=r,this.fetchRequest=new Q(this,l,d,f,t,E),this.mustRedirect=i}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=w(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(){const{initialized:e,requesting:t}=U,r=te("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof r=="string"&&!await(typeof S.forms.confirm=="function"?S.forms.confirm:ne.confirmMethod)(r,this.formElement,this.submitter))&&this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){const{stopping:e,stopped:t}=U;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){const t=Qt(ie("csrf-param"))||ie("
3csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType($.contentType)}requestStarted(e){this.state=U.waiting,this.submitter&&S.forms.submitter.beforeSubmit(this.submitter),this.setSubmitsWith(),se(this.formElement),p("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){_.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(_.clear(),this.requestMustRedirect(e)&&Gt(t)){const r=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,r)}else this.state=U.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=U.stopped,this.submitter&&S.forms.submitter.afterSubmit(this.submitter),this.resetSubmitterText(),re(this.formElement),p("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")){const 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")){const e=this.submitter;e.value=this.originalSubmitText}}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||Lt("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}}function Jt(s,e){const t=new FormData(s),r=e?.getAttribute("name"),i=e?.getAttribute("value");return r&&t.append(r,i||""),t}function Qt(s){if(s!=null){const t=(document.cookie?document.cookie.split("; "):[]).find(r=>r.startsWith(s));if(t){const r=t.split("=").slice(1).join("=");return r?decodeURIComponent(r):void 0}}}function Gt(s){return s.statusCode==200&&!s.redirected}function Zt(s,e){const t=typeof s.action=="string"?s.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":s.getAttribute("action")||t||""}function es(s,e){const t=w(s);return ge(e)&&(t.search=""),t}function ts(s,e){const t=e?.getAttribute("formmethod")||s.getAttribute("method")||"";return pe(t.toLowerCase())||R.get}function ss(s,e){return _t(e?.getAttribute("formenctype")||s.enctype)}class oe{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 Ue(this.element)}get permanentElements(){return Ye(this.element)}getPermanentElementById(e){return Xe(this.element,e)}getPermanentElementMapForSnapshot(e){const t={};for(const r of this.permanentElements){const{id:i}=r,l=e.getPermanentElementById(i);l&&(t[i]=[r,l])}return t}}function Xe(s,e){return s.querySelector(`#${e}[data-turbo-permanent]`)}function Ye(s){return s.querySelectorAll("[id][data-turbo-permanent]")}class be{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){const t=e.target instanceof HTMLFormElement?e.target:void 0,r=e.submitter||void 0;t&&rs(t,r)&&is(t,r)&&this.delegate.willSubmitForm(t,r)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,r))}}}function rs(s,e){return(e?.getAttribute("formmethod")||s.getAttribute("method"))!="dialog"}function is(s,e){const t=e?.getAttribute("formtarget")||s.getAttribute("target");return xe(t)}class Je{#e=e=>{};#t=e=>{};constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){const t=this.snapshot.getElementForAnchor(e);t?(this.scrollToElement(t),this.focusElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(V(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}
3async render(e){const{isPreview:t,shouldRender:r,willRender:i,newSnapshot:l}=e,d=i;if(r)try{this.renderPromise=new Promise(A=>this.#e=A),this.renderer=e,await this.prepareToRenderSnapshot(e);const f=new Promise(A=>this.#t=A),E={resume:this.#t,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(l,E)||await f,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(l,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#e(void 0),delete this.renderPromise}else d&&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()}}class ns extends Je{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new oe(this.element)}}class Qe{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.clickEventIsSignificant(e)?this.clickEvent=e:delete this.clickEvent};linkClicked=e=>{this.clickEvent&&this.clickEventIsSignificant(e)&&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};clickEventIsSignificant(e){const t=e.composed?e.target?.parentElement:e.target,r=_e(t)||t;return r instanceof Element&&r.closest("turbo-frame, html")==this.element}}class Ge{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)){const t=e.composedPath&&e.composedPath()[0]||e.target,r=_e(t);if(r&&xe(r.target)){const i=je(r);this.delegate.willFollowLinkToLocation(r,i,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(r,i))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}}class Ze{constructor(e,t){this.delegate=e,this.linkInterceptor=new Ge(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){const r=document.createElement("form"),i="hidden";for(const[N,y]of t.searchParams)r.append(Object.assign(document.createElement("input"),{type:i,name:N,value:y}));const l=Object.assign(t,{search:""});r.setAttribute("data-turbo","true"),r.setAttribute("action",l.href),r.setAttribute("hidden","");const d=e.getAttribute("data-turbo-method");d&&r.setAttribute("method",d);const f=e.getAttribute("data-turbo-frame");f&&r.setAttribute("data-turbo-frame",f);const E=D(e);E&&r.setAttribute("data-turbo-action",E);const P=e.getAttribute("data-turbo-confirm");P&&r.setAttribute("data-turbo-confirm",P),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())}}class et{static async preservingPermanentElements(e,t,r){const i=new this(e,t);i.enter(),await r(),i.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(const e in this.permanentElementMap){const[t,r]=this.permanentElementMap[e];this.delegate.enteringBardo(t,r),this.replaceNewPermanentElementWithPlaceholder(r)}}leave(){for(const e in this.permanentElementMap){const[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){const t=os(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){const 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 os(s){const e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",s.id),e}class ve{#e=null;static renderElement(e,t){}
3constructor(e,t,r,i=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=r,this.willRender=i,this.renderElement=this.constructor.renderElement,this.promise=new Promise((l,d)=>this.resolvingFunctions={resolve:l,reject:d})}get shouldRender(){return!0}get shouldAutofocus(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await et.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){if(this.shouldAutofocus){const 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"}}class Se extends ve{static renderElement(e,t){const r=document.createRange();r.selectNodeContents(e),r.deleteContents();const i=t,l=i.ownerDocument?.createRange();l&&(l.selectNodeContents(i),e.appendChild(l.extractContents()))}constructor(e,t,r,i,l,d=!0){super(t,r,i,l,d),this.delegate=e}get shouldRender(){return!0}async render(){await Y(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await Y(),this.focusFirstAutofocusableElement(),await Y(),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 e=this.currentElement.firstElementChild,t=as(this.currentElement.getAttribute("data-autoscroll-block"),"end"),r=ls(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:t,behavior:r}),!0}return!1}activateScriptElements(){for(const e of this.newScriptElements){const t=J(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}}function as(s,e){return s=="end"||s=="start"||s=="center"||s=="nearest"?s:e}function ls(s,e){return s=="auto"||s=="smooth"?s:e}var cs=(function(){let s=new Set,e={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:y,afterNodeAdded:y,beforeNodeMorphed:y,afterNodeMorphed:y,beforeNodeRemoved:y,afterNodeRemoved:y,beforeAttributeUpdated:y},head:{style:"merge",shouldPreserve:function(n){return n.getAttribute("im-preserve")==="true"},shouldReAppend:function(n){return n.getAttribute("im-re-append")==="true"},shouldRemove:y,afterHeadMorphed:y}};function t(n,o,a={}){n instanceof Document&&(n=n.documentElement),typeof o=="string"&&(o=lt(o
3));let c=ct(o),h=le(n,c,a);return r(n,c,h)}function r(n,o,a){if(a.head.block){let c=n.querySelector("head"),h=o.querySelector("head");if(c&&h){let u=N(h,c,a);Promise.all(u).then(function(){r(n,o,Object.assign(a,{head:{block:!1,ignore:!0}}))});return}}if(a.morphStyle==="innerHTML")return d(o,n,a),n.children;if(a.morphStyle==="outerHTML"||a.morphStyle==null){let c=ut(o,n,a),h=c?.previousSibling,u=c?.nextSibling,m=l(n,c,a);return c?ht(h,m,u):[]}else throw"Do not understand how to morph style "+a.morphStyle}function i(n,o){return o.ignoreActiveValue&&n===document.activeElement&&n!==document.body}function l(n,o,a){if(!(a.ignoreActive&&n===document.activeElement))return o==null?a.callbacks.beforeNodeRemoved(n)===!1?n:(n.remove(),a.callbacks.afterNodeRemoved(n),null):W(n,o)?(a.callbacks.beforeNodeMorphed(n,o)===!1||(n instanceof HTMLHeadElement&&a.head.ignore||(n instanceof HTMLHeadElement&&a.head.style!=="morph"?N(o,n,a):(E(o,n,a),i(n,a)||d(o,n,a))),a.callbacks.afterNodeMorphed(n,o)),n):a.callbacks.beforeNodeRemoved(n)===!1||a.callbacks.beforeNodeAdded(o)===!1?n:(n.parentElement.replaceChild(o,n),a.callbacks.afterNodeAdded(o),a.callbacks.afterNodeRemoved(n),o)}function d(n,o,a){let c=n.firstChild,h=o.firstChild,u;for(;c;){if(u=c,c=u.nextSibling,h==null){if(a.callbacks.beforeNodeAdded(u)===!1)return;o.appendChild(u),a.callbacks.afterNodeAdded(u),q(a,u);continue}if(G(u,h,a)){l(h,u,a),h=h.nextSibling,q(a,u);continue}let m=ot(n,o,u,h,a);if(m){h=Re(h,m,a),l(m,u,a),q(a,u);continue}let b=at(n,o,u,h,a);if(b){h=Re(h,b,a),l(b,u,a),q(a,u);continue}if(a.callbacks.beforeNodeAdded(u)===!1)return;o.insertBefore(u,h),a.callbacks.afterNodeAdded(u),q(a,u)}for(;h!==null;){let m=h;h=h.nextSibling,Ae(m,a)}}function f(n,o,a,c){return n==="value"&&c.ignoreActiveValue&&o===document.activeElement?!0:c.callbacks.beforeAttributeUpdated(n,o,a)===!1}function E(n,o,a){let c=n.nodeType;if(c===1){const h=n.attributes,u=o.attributes;for(const m of h)f(m.name,o,"update",a)||o.getAttribute(m.name)!==m.value&&o.setAttribute(m.name,m.value);for(let m=u.length-1;0<=m;m--){const b=u[m];f(b.name,o,"remove",a)||n.hasAttribute(b.name)||o.removeAttribute(b.name)}}(c===8||c===3)&&o.nodeValue!==n.nodeValue&&(o.nodeValue=n.nodeValue),i(o,a)||A(n,o,a)}function P(n,o,a,c){if(n[a]!==o[a]){let h=f(a,o,"update",c);h||(o[a]=n[a]),n[a]?h||o.setAttribute(a,n[a]):f(a,o,"remove",c)||o.removeAttribute(a)}}function A(n,o,a){if(n instanceof HTMLInputElement&&o instanceof HTMLInputElement&&n.type!=="file"){let c=n.value,h=o.value;P(n,o,"checked",a),P(n,o,"disabled",a),n.hasAttribute("value")?c!==h&&(f("value",o,"update",a)||(o.setAttribute("value",c),o.value=c)):f("value",o,"remove",a)||(o.value="",o.removeAttribute("value"))}else if(n instanceof HTMLOptionElement)P(n,o,"selected",a);else if(n instanceof HTMLTextAreaElement&&o instanceof HTMLTextAreaElement){let c=n.value,h=o.value;if(f("value",o,"update",a))return;c!==h&&(o.value=c),o.firstChild&&o.firstChild.nodeValue!==c&&(o.firstChild.nodeValue=c)}}function N(n,o,a){let c=[],h=[],u=[],m=[],b=a.head.style,H=new Map;for(const v of n.children)H.set(v.outerHTML,v);for(const v of o.children){let C=H.has(v.outerHTML),X=a.head.shouldReAppend(v),ce=a.head.shouldPreserve(v);C||ce?X?h.push(v):(H.delete(v.outerHTML),u.push(v)):b==="append"?X&&(h.push(v),m.push(v)):a.head.shouldRemove(v)!==!1&&h.push(v)}m.push(...H.values());let Te=[];for(const v of m){let C=document.createRange().createContextualFragment(v.outerHTML).firstChild;if(a.callbacks.beforeNodeAdded(C)!==!1){if(C.href||C.src){let X=null,ce=new Promise(function(gt){X=gt});C.addEventListener("load",function(){X()}),Te.push(ce)}o.appendChild(C),a.callbacks.afterNodeAdded(C),c.push(C)}}for(const v of h)a.callbacks.beforeNodeRemoved(v)!==!1&&(o.removeChild(v),a.callbacks.afterNodeRemoved(v));return a.head.afterHeadMorphed(o,{added:c,kept:u,removed:h}),Te}function y(){}function ae(n){let o={};return Object.assign(o,e),Object.assign(o,n),o.callbacks={},Object.assign(o.callbacks,e.callbacks),Object.assign(o.callbacks,n.callbacks),o.head={},Object.assign(o.head,e.head),Object.assign(o.head,n.head),o}function le(n,o,a){return a=ae(a),{target:n,newContent:o,config:a,morphStyle:a.morphStyle,ignoreActive:a.ignoreActive,ignoreActiveValue:a.ignoreActiveValue,idMap:pt(n,o),deadIds:new Set,callbacks:a.callbacks,head:a.head}}function G(n,o,a){return n==null||o==null?!1:n.nodeType===o.nodeType&&n.tagName===o.tagName?n.id!==""&&n.id===o.id?!0:K(a,n,o)>0:!1}function W(n,o){return n==null||o==null?!1:n.nodeType===o.nodeType&&n.tagName===o.tagName}function Re(n,o,a){for(;n!==o;){let c=n;n=n.nextSibling,Ae(c,a)}return q(a,o),o.nextSibling}function ot(n,o,a,c,h){let u=K(h,a,o),m=null;if(u>0){let b=c,H=0;for(;b!=null;){if(G(a,b,h))return b;if(H+=K(h,b,n),H>u)return null;b=b.nextSibling}}return m}function at(n,o,a,c,h){let u=c,m=a.nextSibling,b=0;for(;u!=null;
3){if(K(h,u,n)>0)return null;if(W(a,u))return u;if(W(m,u)&&(b++,m=m.nextSibling,b>=2))return null;u=u.nextSibling}return u}function lt(n){let o=new DOMParser,a=n.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(a.match(/<\/html>/)||a.match(/<\/head>/)||a.match(/<\/body>/)){let c=o.parseFromString(n,"text/html");if(a.match(/<\/html>/))return c.generatedByIdiomorph=!0,c;{let h=c.firstChild;return h?(h.generatedByIdiomorph=!0,h):null}}else{let h=o.parseFromString("<body><template>"+n+"</template></body>","text/html").body.querySelector("template").content;return h.generatedByIdiomorph=!0,h}}function ct(n){if(n==null)return document.createElement("div");if(n.generatedByIdiomorph)return n;if(n instanceof Node){const o=document.createElement("div");return o.append(n),o}else{const o=document.createElement("div");for(const a of[...n])o.append(a);return o}}function ht(n,o,a){let c=[],h=[];for(;n!=null;)c.push(n),n=n.previousSibling;for(;c.length>0;){let u=c.pop();h.push(u),o.parentElement.insertBefore(u,o)}for(h.push(o);a!=null;)c.push(a),h.push(a),a=a.nextSibling;for(;c.length>0;)o.parentElement.insertBefore(c.pop(),o.nextSibling);return h}function ut(n,o,a){let c;c=n.firstChild;let h=c,u=0;for(;c;){let m=dt(c,o,a);m>u&&(h=c,u=m),c=c.nextSibling}return h}function dt(n,o,a){return W(n,o)?.5+K(a,n,o):0}function Ae(n,o){q(o,n),o.callbacks.beforeNodeRemoved(n)!==!1&&(n.remove(),o.callbacks.afterNodeRemoved(n))}function mt(n,o){return!n.deadIds.has(o)}function ft(n,o,a){return(n.idMap.get(a)||s).has(o)}function q(n,o){let a=n.idMap.get(o)||s;for(const c of a)n.deadIds.add(c)}function K(n,o,a){let c=n.idMap.get(o)||s,h=0;for(const u of c)mt(n,u)&&ft(n,u,a)&&++h;return h}function Le(n,o){let a=n.parentElement,c=n.querySelectorAll("[id]");for(const h of c){let u=h;for(;u!==a&&u!=null;){let m=o.get(u);m==null&&(m=new Set,o.set(u,m)),m.add(h.id),u=u.parentElement}}}function pt(n,o){let a=new Map;return Le(n,a),Le(o,a),a}return{morph:t,defaults:e}})();function we(s,e,{callbacks:t,...r}={}){cs.morph(s,e,{...r,callbacks:new hs(t)})}function tt(s,e){we(s,e.children,{morphStyle:"innerHTML"})}class hs{#e;constructor({beforeNodeMorphed:e}={}){this.#e=e||(()=>!0)}beforeNodeAdded=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));beforeNodeMorphed=(e,t)=>{if(e instanceof Element)return!e.hasAttribute("data-turbo-permanent")&&this.#e(e,t)?!p("turbo:before-morph-element",{cancelable:!0,target:e,detail:{currentElement:e,newElement:t}}).defaultPrevented:!1};beforeAttributeUpdated=(e,t,r)=>!p("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:r}}).defaultPrevented;beforeNodeRemoved=e=>this.beforeNodeMorphed(e);afterNodeMorphed=(e,t)=>{e instanceof Element&&p("turbo:morph-element",{target:e,detail:{currentElement:e,newElement:t}})}}class us extends Se{static renderElement(e,t){p("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),tt(e,t)}async preservingPermanentElements(e){return await e()}}class k{static animationDuration=300;static get defaultCSS(){return Ve`
4      .turbo-progress-bar {
5        position: fixed;
6        display: block;
7        top: 0;
8        left: 0;
9        height: 3px;
10        background: #0076ff;
11        z-index: 2147483647;
12        transition:
13          width ${k.animationDuration}ms ease-out,
14          opacity ${k.animationDuration/2}ms ${k.animationDuration/2}ms ease-in;
15        transform: translate3d(0, 0, 0);
16      }
17    `}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,k.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,k.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(){const e=document.createElement("style");e.type="text/css",e.textContent=k.defaultCSS;const t=We();return t&&(e.nonce=t),e}createProgressElement(){const e=document.createElement("div");return e.className="turbo-progress-bar",e}}class ds extends oe{detailsByOuterHTML=this.children.filter(e=>!gs(e)).map(e=>Ss(e)).reduce((e,t)=>
17{const{outerHTML:r}=t,i=r in e?e[r]:{type:ms(t),tracked:fs(t),elements:[]};return{...e,[r]:{...i,elements:[...i.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)=>{const{type:r,tracked:i,elements:l}=this.detailsByOuterHTML[t];return r==null&&!i?[...e,...l]:l.length>1?[...e,...l.slice(1)]:e},[])}getMetaValue(e){const t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,r)=>{const{elements:[i]}=this.detailsByOuterHTML[r];return vs(i,e)?i:t},void 0|void 0)}}function ms(s){if(ps(s))return"script";if(bs(s))return"stylesheet"}function fs(s){return s.getAttribute("data-turbo-track")=="reload"}function ps(s){return s.localName=="script"}function gs(s){return s.localName=="noscript"}function bs(s){const e=s.localName;return e=="style"||e=="link"&&s.getAttribute("rel")=="stylesheet"}function vs(s,e){return s.localName=="meta"&&s.getAttribute("name")==e}function Ss(s){return s.hasAttribute("nonce")&&s.setAttribute("nonce",""),s}class L extends oe{static fromHTMLString(e=""){return this.fromDocument(De(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:r}){return new this(e,t,new ds(r))}constructor(e,t,r){super(t),this.documentElement=e,this.headSnapshot=r}clone(){const e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),r=e.querySelectorAll("select");for(const[i,l]of t.entries()){const d=r[i];for(const f of d.selectedOptions)f.selected=!1;for(const f of l.selectedOptions)d.options[f.index].selected=!0}for(const i of e.querySelectorAll('input[type="password"]'))i.value="";return new L(this.documentElement,e,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get headElement(){return this.headSnapshot.element}get rootLocation(){const e=this.getSetting("root")??"/";return w(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}`)}}class ws{#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}}const Es={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},ee={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},M={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},z={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},ys={advance:"forward",restore:"back",replace:"none"};class Rs{identifier=I();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=M.initialized;viewTransitioner=new ws;constructor(e,t,r,i={}){this.delegate=e,this.location=t,this.restorationIdentifier=r||I();const{action:l,historyChanged:d,referrer:f,snapshot:E,snapshotHTML:P,response:A,visitCachedSnapshot:N,willRender:y,updateHistory:ae,shouldCacheSnapshot:le,acceptsStreamResponse:G,direction:W}={...Es,...i};this.action=l,this.historyChanged=d,this.referrer=f,this.snapshot=E,this.snapshotHTML=P,this.response=A,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=N,this.willRender=y,this.updateHistory=ae,this.scrolled=!y,this.shouldCacheSnapshot=le,this.acceptsStreamResponse=G,this.direction=W||ys[l]}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==M.initialized&&(this.recordTimingMetric(ee.visitStart),this.state=M.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==M.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=M.canceled)}complete(){this.state==M.started&&(this.recordTimingMetric(ee.visitEnd),this.adapter.visitCompleted(this),this.state=M.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==M.started&&(this.state=M.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){const e=this.location.href===this.referrer?.href?"replace":this.action,t=Ne(e);this.history.update(t,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new Q(this,R.get,this.location),this.request.perform())}
17simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(ee.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){const{statusCode:t}=e;Me(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(ee.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){const{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,Me(e)&&t!=null){const r=L.fromHTMLString(t);await this.renderPageSnapshot(r,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(L.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){const e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!V(this.location)||e.hasAnchor(V(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return L.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){const e=this.getCachedSnapshot();if(e){const 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($.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){const r=await t.responseHTML,{redirected:i,statusCode:l}=t;r==null?this.recordResponse({statusCode:z.contentTypeMismatch,redirected:i}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:l,responseHTML:r,redirected:i}))}async requestFailedWithResponse(e,t){const r=await t.responseHTML,{redirected:i,statusCode:l}=t;r==null?this.recordResponse({statusCode:z.contentTypeMismatch,redirected:i}):this.recordResponse({statusCode:l,responseHTML:r,redirected:i})}requestErrored(e,t){this.recordResponse({statusCode:z.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(){const{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){const e=V(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(),await new Promise(t=>{this.frame=document.visibilityState==="hidden"?setTimeout(()=>t(),0):requestAnimationFrame(()=>t())}),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 Me(s){return s>=200&&s<300}class As{progressBar=new k;constructor(e){this.session=e}visitProposedToLocation(e,t){F(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||I(),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 z.networkFailure:case z.timeoutFailure:case z.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){}
17formSubmissionStarted(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){p("turbo:reload",{detail:e}),window.location.href=this.location?.toString()||window.location.href}get navigator(){return this.session.navigator}}class Ls{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(const t of this.temporaryElements)t.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){return[...document.querySelectorAll(this.deprecatedSelector)]}}class Ts{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new Qe(this,t),this.formSubmitObserver=new be(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){const i=this.#s(e);i&&i.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){const r=this.#s(e,t);r&&r.delegate.formSubmitted(e,t)}#e(e,t){const r=me(e,t),i=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),l=w(i?.content??"/");return this.#t(e,t)&&F(r,l)}#t(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){const i=this.#s(e,t);return i?i!=e.closest("turbo-frame"):!1}else return!1}#s(e,t){const r=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(r&&r!="_top"){const i=this.element.querySelector(`#${r}:not([disabled])`);if(i instanceof T)return i}}}class Ps{location;restorationIdentifier=I();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=I()){e===history.pushState&&++this.currentIndex;const i={turbo:{restorationIdentifier:r,restorationIndex:this.currentIndex}};e.call(history,i,"",t.href),this.location=t,this.restorationIdentifier=r}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){const{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()){const{turbo:t}=e.state||{};if(t){this.location=new URL(window.location.href);const{restorationIdentifier:r,restorationIndex:i}=t;this.restorationIdentifier=r;const l=i>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,r,l),this.currentIndex=i}}};onPageLoad=async e=>{await Rt(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}}class Cs{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.#s,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#i,!0),this.started=!1)}#t=()=>{this.eventTarget.addEventListener("mouseenter",this.#s,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#i,!0),this.started=!0};#s=e=>{if(ie("turbo-prefetch")==="false")return;const t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&this.#l(t)){const i=t,l=je(i);if(this.delegate.canPrefetchRequestToLocation(i,l)){this.#e=i;const d=new Q(this,R.get,l,new URLSearchParams,t);_.setLater(l.toString(),d,this.#r)}}};#n=e=>{e.target===this.#e&&this.#o()};#o=()=>{_.clear(),this.#e=null};#i=e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="GET"){const t=_.get(e.detail.url.toString());t&&(e.detail.fetchRequest=t),_.clear()}};prepareRequest(e){const t=e.target;e.headers["X-Sec-Purpose"]="prefetch";const r=t.closest("turbo-frame"),i=t.getAttribute("data-turbo-frame")||r?.getAttribute("target")||r?.id;i&&i!=="_top"&&(e.headers["Turbo-Frame"]=i)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#r(){return Number(ie("turbo-prefetch-cache-time"))||Yt}#l(e){return!(!e.getAttribute("href")||Ms(e)||ks(e)||Fs(e)||Is(e)||Hs(e))}}const Ms=s=>s.origin!==document.location.origin||!["http:","https:"].includes(s.protocol)||s.hasAttribute("target"),ks=s=>s.pathname+s.search===document.location.pathname+document.location.search||s.href.startsWith("#"),Fs=s=>{if(s.getAttribute("data-turbo-prefetch")==="false"||s.getAttribute("data-turbo")==="false")return!0;const e=j(s,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},Is=s=>{const e=s.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||qs(s)||s.hasAttribute("data-turbo-confirm")||s.hasAttribute("data-turbo-stream"))},qs=s=>s.hasAttribute("data-remote")||s.hasAttribute("data-behavior")||s.hasAttribute("data-confirm")||s.hasAttribute("data-method"),Hs=s=>p("turbo:before-prefetch",{target:s,cancelable:!0}).defaultPrevented;class Os{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 Rs(this,w(e),t,{referrer:this.location,...r}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new ne(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){const r=await t.responseHTML;if(r){const i=e.isSafe;i||this.view.clearSnapshotCache();const{statusCode:l,redirected:d}=t,E={action:this.#e(e,t),shouldCacheSnapshot:i,response:{statusCode:l,responseHTML:r,redirected:d}};this.proposeVisit(t.location,E)}}}async formSubmissionFailedWithResponse(e,t){const r=await t.responseHTML;if(r){const i=L.fromHTMLString(r);t.serverError?await this.view.renderError(i,this.currentVisit):await this.view.renderPage(i,!1,!0,this.currentVisit),i.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),delete this.currentVisit}locationWithActionIsSamePage(e,t){const r=V(e),i=V(this.view.lastRenderedLocation),l=t==="restore"&&typeof r>"u";return t!=="replace"&&he(e)===he(this.view.lastRenderedLocation)&&(l||r!=null&&r!==i)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#e(e,t){const{submitter:r,formElement:i}=e;return D(r,i)||this.#t(t)}#t(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}}const O={initial:0,loading:1,interactive:2,complete:3};class Bs{stage=O.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==O.initial&&(this.stage=O.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=()=>{const{readyState:e}=this;
17e=="interactive"?this.pageIsInteractive():e=="complete"&&this.pageIsComplete()};pageIsInteractive(){this.stage==O.loading&&(this.stage=O.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==O.interactive&&(this.stage=O.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}}class Ds{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)}}class Vs{render({fragment:e}){et.preservingPermanentElements(this,Ns(e),()=>{Ws(e,()=>{Us(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}}function Ns(s){const e=Ye(document.documentElement),t={};for(const r of e){const{id:i}=r;for(const l of s.querySelectorAll("turbo-stream")){const d=Xe(l.templateElement.content,i);d&&(t[i]=[r,d])}}return t}async function Ws(s,e){const t=`turbo-stream-autofocus-${I()}`,r=s.querySelectorAll("turbo-stream"),i=xs(r);let l=null;if(i&&(i.id?l=i.id:l=t,i.id=l),e(),await Y(),(document.activeElement==null||document.activeElement==document.body)&&l){const f=document.getElementById(l);de(f)&&f.focus(),f&&f.id==t&&f.removeAttribute("id")}}async function Us(s){const[e,t]=await Mt(s,()=>document.activeElement),r=e&&e.id;if(r){const i=document.getElementById(r);de(i)&&i!=t&&i.focus()}}function xs(s){for(const e of s){const t=Ue(e.templateElement.content);if(t)return t}return null}class _s{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=>{const t=js(e);t&&zs(t)&&(e.preventDefault(),this.receiveMessageResponse(t))};receiveMessageEvent=e=>{this.#e&&typeof e.data=="string"&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){const t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream($.wrap(e))}}function js(s){const e=s.detail?.fetchResponse;if(e instanceof fe)return e}function zs(s){return(s.contentType??"").startsWith($.contentType)}class $s extends ve{static renderElement(e,t){const{documentElement:r,body:i}=document;r.replaceChild(t,i)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){const{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(const e of this.scriptElements){const t=e.parentNode;if(t){const r=J(e);t.replaceChild(r,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}}class Ee extends ve{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}
17get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#e(){const{documentElement:e}=this.currentSnapshot,{lang:t}=this.newSnapshot;t?e.setAttribute("lang",t):e.removeAttribute("lang")}async mergeHead(){const 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(){const e=[];for(const t of this.newHeadStylesheetElements)e.push(Tt(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(const e of this.newHeadScriptElements)document.head.appendChild(J(e))}removeUnusedDynamicStylesheetElements(){for(const e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){const e=[...this.newHeadProvisionalElements];for(const t of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(t,e)||document.head.removeChild(t);for(const t of e)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(const[r,i]of t.entries()){if(e.tagName=="TITLE"){if(i.tagName!="TITLE")continue;if(e.innerHTML==i.innerHTML)return t.splice(r,1),!0}if(i.isEqualNode(e))return t.splice(r,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(const e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(const e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(const e of this.newBodyScriptElements){const t=J(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")}}
17class Ks extends Ee{static renderElement(e,t){we(e,t,{callbacks:{beforeNodeMorphed:r=>!ke(r)}});for(const r of e.querySelectorAll("turbo-frame"))ke(r)&&r.reload();p("turbo:morph",{detail:{currentElement:e,newElement:t}})}async preservingPermanentElements(e){return await e()}get renderMethod(){return"morph"}get shouldAutofocus(){return!1}}function ke(s){return s instanceof T&&s.src&&s.refresh==="morph"&&!s.closest("[data-turbo-permanent]")}class Xs{keys=[];snapshots={};constructor(e){this.size=e}has(e){return Z(e)in this.snapshots}get(e){if(this.has(e)){const 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[Z(e)]}write(e,t){this.snapshots[Z(e)]=t}touch(e){const t=Z(e),r=this.keys.indexOf(t);r>-1&&this.keys.splice(r,1),this.keys.unshift(t),this.trim()}trim(){for(const e of this.keys.splice(this.size))delete this.snapshots[e]}}class Ys extends Je{snapshotCache=new Xs(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,r=!0,i){const d=this.isPageRefresh(i)&&this.snapshot.shouldMorphPage?Ks:Ee,f=new d(this.snapshot,e,t,r);return f.shouldRender?i?.changeHistory():this.forceReloaded=!0,this.render(f)}renderError(e,t){t?.changeHistory();const r=new $s(this.snapshot,e,!1);return this.render(r)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();const{lastRenderedLocation:t}=this;await Be();const 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 L.fromElement(this.element)}}class Js{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(const t of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(t)&&this.preloadURL(t)}async preloadURL(e){const t=new URL(e.href);if(this.snapshotCache.has(t))return;await new Q(this,R.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{const r=await t.responseHTML,i=L.fromHTMLString(r);this.snapshotCache.put(e.url,i)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#e=()=>{this.preloadOnLoadLinksForView(document.body)}}class Qs{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.#e("")}exemptPageFromCache(){this.#e("no-cache")}exemptPageFromPreview(){this.#e("no-preview")}#e(e){Ct("turbo-cache-control",e)}}class Gs{navigator=new Os(this);history=new Ps(this);view=new Ys(this,document.documentElement);adapter=new As(this);pageObserver=new Bs(this);cacheObserver=new Ls;linkPrefetchObserver=new Cs(this,document);linkClickObserver=new Ge(this,window);formSubmitObserver=new be(this,document);scrollObserver=new Ds(this);streamObserver=new _s(this);formLinkClickObserver=new Ze(this,document.documentElement);frameRedirector=new Ts(this,document.documentElement);streamMessageRenderer=new Vs;cache=new Qs(this);enabled=!0;started=!1;#e=150;constructor(e){this.recentRequests=e,this.preloader=new Js(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={}){const r=t.frame?document.getElementById(t.frame):null;if(r instanceof T){const i=t.action||D(r);r.delegate.proposeVisitIfNavigatedWithAction(r,i),r.src=e.toString()}else this.navigator.proposeVisit(w(e),t)}refresh(e,t){!(t&&this.recentRequests.has(t))&&!this.navigator.currentVisit&&this.visit(e,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render($.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){this.progressBarDelay=e}set progressBarDelay(e){S.drive.progressBarDelay=e}get progressBarDelay(){return S.drive.progressBarDelay}set drive(e){S.drive.enabled=e}get drive(){return S.drive.enabled}set formMode(e){S.forms.mode=e}get formMode(){return S.forms.mode}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#e}set pageRefreshDebouncePeriod(e){this.refresh=kt(this.debouncedRefresh.bind(this),e),this.#e=e}shouldPreloadLink(e){const t=e.hasAttribute("data-turbo-method"),r=e.hasAttribute("data-turbo-stream"),i=e.getAttribute("data-turbo-frame"),l=i=="_top"?null:d
17ocument.getElementById(i)||j(e,"turbo-frame:not([disabled])");if(t||r||l instanceof T)return!1;{const d=new URL(e.href);return this.elementIsNavigatable(e)&&F(d,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)&&F(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&F(t,this.snapshot.rootLocation)}willFollowLinkToLocation(e,t,r){return this.elementIsNavigatable(e)&&F(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,r)}followedLinkToLocation(e,t){const r=this.getActionForLink(e),i=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:r,acceptsStreamResponse:i})}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){Fe(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(se(document.documentElement),this.view.markVisitDirection(e.direction)),Fe(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),re(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){const r=me(e,t);return this.submissionIsNavigatable(e,t)&&F(w(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){const r=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:i,detail:{render:l}}=r;return this.view.renderer&&l&&(this.view.renderer.renderElement=l),!i}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 p("turbo:click",{target:e,detail:{url:t.href,originalEvent:r},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return p("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return p("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return p("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return p("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return p("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return p("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 p("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return p("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if(S.forms.mode=="off")return!1;{const r=t?this.elementIsNavigatable(t):!0;return S.forms.mode=="optin"?r&&e.closest('[data-turbo="true"]')!=null:r&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){const t=j(e,"[data-turbo]"),r=j(e,"turbo-frame");return S.drive.enabled||r?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return D(e)||"advance"}get snapshot(){return this.view.snapshot}}function Fe(s){Object.defineProperties(s,Zs)}const Zs={absoluteURL:{get(){return this.toString()}}},g=new Gs(ze),{cache:er,navigator:tr}=g;function st(){g.start()}function sr(s){g.registerAdapter(s)}function rr(s,e){g.visit(s,e)}function rt(s){g.connectStreamSource(s)}function it(s){g.disconnectStreamSource(s)}function ir(s){g.renderStreamMessage(s)}function nr(){g.clearCache()}function or(s){S.drive.progressBarDelay=s}function ar(s){S.forms.confirm=s}function lr(s){S.forms.mode=s}var cr=Object.freeze({__proto__:null,navigator:tr,session:g,cache:er,PageRenderer:Ee,PageSnapshot:L,FrameRenderer:Se,fetch:$e,config:S,start:st,registerAdapter
17:sr,visit:rr,connectStreamSource:rt,disconnectStreamSource:it,renderStreamMessage:ir,clearCache:nr,setProgressBarDelay:or,setConfirmMethod:ar,setFormMode:lr});class hr extends Error{}class ur{fetchResponseLoaded=e=>Promise.resolve();#e=null;#t=()=>{};#s=!1;#n=!1;#o=new Set;#i=!1;action=null;constructor(e){this.element=e,this.view=new ns(this,this.element),this.appearanceObserver=new zt(this,this.element),this.formLinkClickObserver=new Ze(this,this.element),this.linkInterceptor=new Qe(this,this.element),this.restorationIdentifier=I(),this.formSubmitObserver=new be(this,this.element)}connect(){this.#s||(this.#s=!0,this.loadingStyle==x.lazy?this.appearanceObserver.start():this.#r(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#s&&(this.#s=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==x.eager&&this.#r()}sourceURLChanged(){this.#v("src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==x.eager||this.#n)&&this.#r())}sourceURLReloaded(){const{refresh:e,src:t}=this.element;return this.#i=t&&e==="morph",this.element.removeAttribute("complete"),this.element.src=null,this.element.src=t,this.element.loaded}loadingStyleChanged(){this.loadingStyle==x.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#r())}async#r(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#u(w(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#n=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{const t=await e.responseHTML;if(t){const r=De(t);L.fromDocument(r).isVisitable?await this.#l(e,r):await this.#m(e)}}finally{this.#i=!1,this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,D(e)),this.#r()}willSubmitFormLinkToLocation(e){return this.#c(e)}submittedFormLinkToLocation(e,t,r){const i=this.#a(e);i&&r.setAttribute("data-turbo-frame",i.id)}shouldInterceptLinkClick(e,t,r){return this.#c(e)}linkClickIntercepted(e,t){this.#d(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.#c(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new ne(this,e,t);const{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($.contentType)}requestStarted(e){se(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){re(this.element)}formSubmissionStarted({formElement:e}){se(e,this.#a(e))}formSubmissionSucceededWithResponse(e,t){const r=this.#a(e.formElement,e.submitter);r.delegate.proposeVisitIfNavigatedWithAction(r,D(e.submitter,e.formElement,r)),r.delegate.loadResponse(t),e.isSafe||g.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),g.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){re(e,this.#a(e))}allowsImmediateRender({element:e},t){const r=p("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0}),{defaultPrevented:i,detail:{render:l}}=r;return this.view.renderer&&l&&(this.view.renderer.renderElement=l),!i}viewRenderedSnapshot(e,t,r){}preloadOnLoadLinksForView(e){g.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>{const t=e.querySelector("#"+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#l(e,t){const r=await this.extractForeignFrameElement(t.body),i=this.#i?us:Se;if(r){const l=new oe(r),d=new i(this,this.view.snapshot,l,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(d),this.complete=!0,g.frameRendered(e,this.element),g.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#f(e)&&this.#p(e)}async#u(e){const t=new Q(this,R.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()})}#d(e,t,r){const i=this.#a(e,r);i.delegate.proposeVisitIfNavigatedWithAction(i,D(r,e,i)),this.#w(e,()=>{i.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){const r=L.fromElement(e).clone(),{visitCachedSnapshot:i}=e.delegate;e.delegate.fetchResponseLoaded=async l=>{if(e.src){const{statusCode:d,redirected:f}=l,E=await l.responseHTML,A={response:{statusCode:d,redirected:f,responseHTML:E},visitCachedSnapshot:i,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:r};this.action&&(A.action=this.action),g.visit(e.src,A)}}}}changeHistory(){if(this.action){const e=Ne(this.action);g.history.update(e,w(this.element.src||""),this.restorationIdentifier)}}async#m(e){await this.#h(e.response)}#f(e){this.element.setAttribute("complete","");const t=e.response,r=async(l,d)=>{l instanceof Response?this.#h(l):g.visit(l,d)};
17return!p("turbo:frame-missing",{target:this.element,detail:{response:t,visit:r},cancelable:!0}).defaultPrevented}#p(e){this.view.missing(),this.#g(e)}#g(e){const 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 hr(t)}async#h(e){const t=new fe(e),r=await t.responseHTML,{location:i,redirected:l,statusCode:d}=t;return g.visit(i,{response:{redirected:l,statusCode:d,responseHTML:r}})}#a(e,t){const r=te("data-turbo-frame",t,e)||this.element.getAttribute("target");return Ie(r)??this.element}async extractForeignFrameElement(e){let t;const r=CSS.escape(this.id);try{if(t=qe(e.querySelector(`turbo-frame#${r}`),this.sourceURL),t)return t;if(t=qe(e.querySelector(`turbo-frame[src][recurse~=${r}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(i){return console.error(i),new T}return null}#b(e,t){const r=me(e,t);return F(w(r),this.rootLocation)}#c(e,t){const r=te("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#b(e,t)||!this.enabled||r=="_top")return!1;if(r){const i=Ie(r);if(i)return!i.disabled}return!(!g.elementIsNavigatable(e)||t&&!g.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.#S("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.#s}get rootLocation(){const t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]')?.content??"/";return w(t)}#v(e){return this.#o.has(e)}#S(e,t){this.#o.add(e),t(),this.#o.delete(e)}#w(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}}function Ie(s){if(s!=null){const e=document.getElementById(s);if(e instanceof T)return e}}function qe(s,e){if(s){const t=s.getAttribute("src");if(t!=null&&e!=null&&Bt(t,e))throw new Error(`Matching <turbo-frame id="${s.id}"> element has a source URL which references itself`);if(s.ownerDocument!==document&&(s=document.importNode(s,!0)),s instanceof T)return s.connectedCallback(),s.disconnectedCallback(),s}}const nt={after(){this.targetElements.forEach(s=>s.parentElement?.insertBefore(this.templateContent,s.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(s=>s.append(this.templateContent))},before(){this.targetElements.forEach(s=>s.parentElement?.insertBefore(this.templateContent,s))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(s=>s.prepend(this.templateContent))},remove(){this.targetElements.forEach(s=>s.remove())},replace(){const s=this.getAttribute("method");this.targetElements.forEach(e=>{s==="morph"?we(e,this.templateContent):e.replaceWith(this.templateContent)})},update(){const s=this.getAttribute("method");this.targetElements.forEach(e=>{s==="morph"?tt(e,this.templateContent):(e.innerHTML="",e.append(this.templateContent))})},refresh(){g.refresh(this.baseURI,this.requestId)}};class ye 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()=>{const e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await Y(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){const 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){const e=nt[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){const 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:ye.renderElement}})}get targetElementsById(){const e=this.ownerDocument?.getElementById(this.target);return e!==null?[e]:[]}get targetElementsByQuery(){const e=this.ownerDocument?.querySelectorAll(this.targets);return e.length!==0?Array.prototype.slice.call(e):[]}}class dr extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),rt(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),it(this.streamSource))}get src(){return this.getAttribute("src")||""}}T.delegateConstructor=ur;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",T);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",ye);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",dr);(()=>{let s=document.currentScript;if(s&&!s.hasAttribute("data-turbo-suppress-warning"))for(s=s.parentElement;s;){if(s==document.body)return console.warn(Ve`
18        You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
19
20        Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
21
22        For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements
23
24        ——
25        Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
26      `,s.outerHTML);s=s.parentElement}})();window.Turbo={...cr,StreamActions:nt};st();export{B as FetchEnctype,R as FetchMethod,Q as FetchRequest,fe as FetchResponse,T as FrameElement,x as FrameLoadingStyle,Se as FrameRenderer,Ee as PageRenderer,L as PageSnapshot,nt as StreamActions,ye as StreamElement,dr as StreamSourceElement,er as cache,nr as clearCache,S as config,rt as connectStreamSource,it as disconnectStreamSource,$e as fetch,_t as fetchEnctypeFromString,pe as fetchMethodFromString,ge as isSafe,tr as navigator,sr as registerAdapter,ir as render
26StreamMessage,g as session,ar as setConfirmMethod,lr as setFormMode,or as setProgressBarDelay,st as start,rr as visit};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.