PageSourceSearch

https://www.schloss-allstedt.de/_assets/168defa00504c36dfb5bfee5f1b657a0/JavaScript/topwire.1781690184.js

js schloss-allstedt.de collected 2026-10-08 11:02:47 UTC 103,650 bytes, 29 lines download raw bytes

1var Hr=Object.defineProperty;var Ct=r=>{throw TypeError(r)};var Br=(r,e,t)=>e in r?Hr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var u=(r,e,t)=>Br(r,typeof e!="symbol"?e+"":e,t),ct=(r,e,t)=>e.has(r)||Ct("Cannot "+t);var v=(r,e,t)=>(ct(r,e,"read from private field"),t?t.call(r):e.get(r)),C=(r,e,t)=>e.has(r)?Ct("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),M=(r,e,t,s)=>(ct(r,e,"write to private field"),s?s.call(r,t):e.set(r,t),t),w=(r,e,t)=>(ct(r,e,"access private method"),t);function mt(r,e,t){Vr();let s,i,o,b,L,I,N,B,x;function y(n={}){let a=p=>p.getAttribute("key"),c=()=>{};b=n.updating||c,L=n.updated||c,I=n.removing||c,N=n.removed||c,B=n.adding||c,x=n.added||c,i=n.key||a,o=n.lookahead||!1}function k(n,a){if(A(n,a))return R(n,a);let c=!1,p=!1;if(!Nr(b,()=>p=!0,n,a,()=>c=!0)){if(n.nodeType===1&&window.Alpine&&(window.Alpine.cloneNode(n,a),n._x_teleport&&a._x_teleport&&k(n._x_teleport,a._x_teleport)),Dr(a)){T(n,a),L(n,a);return}c||S(n,a),L(n,a),p||f(n,a)}}function A(n,a){return n.nodeType!=a.nodeType||n.nodeName!=a.nodeName||d(n)!=d(a)}function R(n,a){if(Re(I,n))return;let c=a.cloneNode(!0);Re(B,c)||(n.replaceWith(c),N(n),x(c))}function T(n,a){let c=a.nodeValue;n.nodeValue!==c&&(n.nodeValue=c)}function S(n,a){if(n._x_transitioning||n._x_isShown&&!a._x_isShown||!n._x_isShown&&a._x_isShown)return;let c=Array.from(n.attributes),p=Array.from(a.attributes);for(let g=c.length-1;g>=0;g--){let m=c[g].name;a.hasAttribute(m)||n.removeAttribute(m)}for(let g=p.length-1;g>=0;g--){let m=p[g].name,W=p[g].value;n.getAttribute(m)!==W&&n.setAttribute(m,W)}}function f(n,a){let c=l(n.children),p={},g=Mt(a),m=Mt(n);for(;g;){xr(g,m);let V=d(g),F=d(m);if(!m)if(V&&p[V]){let P=p[V];n.appendChild(P),m=P,F=d(m)}else{if(!Re(B,g)){let P=g.cloneNode(!0);n.appendChild(P),x(P)}g=_(a,g);continue}let $e=P=>P&&P.nodeType===8&&P.textContent==="[if BLOCK]><![endif]",ze=P=>P&&P.nodeType===8&&P.textContent==="[if ENDBLOCK]><![endif]";if($e(g)&&$e(m)){let P=0,je=m;for(;m;){let z=_(n,m);if($e(z))P++;else if(ze(z)&&P>0)P--;else if(ze(z)&&P===0){m=z;break}m=z}let Mr=m;P=0;let kr=g;for(;g;){let z=_(a,g);if($e(z))P++;else if(ze(z)&&P>0)P--;else if(ze(z)&&P===0){g=z;break}g=z}let Ir=g,Fr=new lt(je,Mr),qr=new lt(kr,Ir);f(Fr,qr);continue}if(m.nodeType===1&&o&&!m.isEqualNode(g)){let P=_(a,g),je=!1;for(;!je&&P;)P.nodeType===1&&m.isEqualNode(P)&&(je=!0,m=h(n,g,m),F=d(m)),P=_(a,P)}if(V!==F){if(!V&&F){p[F]=m,m=h(n,g,m),p[F].remove(),m=_(n,m),g=_(a,g);continue}if(V&&!F&&c[V]&&(m.replaceWith(c[V]),m=c[V],F=d(m)),V&&F){let P=c[V];if(P)p[F]=m,m.replaceWith(P),m=P,F=d(m);else{p[F]=m,m=h(n,g,m),p[F].remove(),m=_(n,m),g=_(a,g);continue}}}let Pr=m&&_(n,m);k(m,g),g=g&&_(a,g),m=Pr}let W=[];for(;m;)Re(I,m)||W.push(m),m=_(n,m);for(;W.length;){let V=W.shift();V.remove(),N(V)}}function d(n){return n&&n.nodeType===1&&i(n)}function l(n){let a={};for(let c of n){let p=d(c);p&&(a[p]=c)}return a}function h(n,a,c){if(!Re(B,a)){let p=a.cloneNode(!0);return n.insertBefore(p,c),x(p),p}return a}return y(t),s=typeof e=="string"?Or(e):e,window.Alpine&&window.Alpine.closestDataStack&&!r._x_dataStack&&(s._x_dataStack=window.Alpine.closestDataStack(r),s._x_dataStack&&window.Alpine.cloneNode(r,s)),k(r,s),s=void 0,r}mt.step=()=>{};mt.log=()=>{};function Re(r,...e){let t=!1;return r(...e,()=>t=!0),t}function Nr(r,e,...t){let s=!1;return r(...t,()=>s=!0,e),s}var Pt=!1;function Or(r){const e=document.createElement("template");return e.innerHTML=r,e.content.firstElementChild}function Dr(r){return r.nodeType===3||r.nodeType===8}var lt=class{constructor(r,e){this.startComment=r,this.endComment=e}get children(){let r=[],e=this.startComment.nextSibling;for(;e&&e!==this.endComment;)r.push(e),e=e.nextSibling;return r}appendChild(r){this.endComment.before(r)}get firstChild(){let r=this.startComment.nextSibling;if(r!==this.endComment)return r}nextNode(r){let e=r.nextSibling;if(e!==this.endComment)return e}insertBefore(r,e){return e.before(r),r}};function Mt(r){return r.firstChild}function _(r,e){let t;return r instanceof lt?t=r.nextNode(e):t=e.nextSibling,t}function Vr(){if(Pt)return;Pt=!0;let r=Element.prototype.setAttribute,e=document.createElement("div");
1Element.prototype.setAttribute=function(s,i){if(!s.includes("@"))return r.call(this,s,i);e.innerHTML=`<span ${s}="${i}"></span>`;let o=e.firstElementChild.getAttributeNode(s);e.firstElementChild.removeAttributeNode(o),this.setAttributeNode(o)}}function xr(r,e){let t=e&&e._x_bindings&&e._x_bindings.id;t&&r.setAttribute&&(r.setAttribute("id",t),r.id=t)}function Wr(r){r.morph=mt}document.addEventListener("turbo:before-fetch-request",async r=>{var s;r.preventDefault();const e=r.detail.fetchOptions.headers;if(r.target.tagName==="HTML"){r.detail.resume();return}const t=r.target.tagName==="turbo-frame"?r.target:r.target.closest("turbo-frame");if(!e["Turbo-Frame"]||!((s=t==null?void 0:t.dataset)!=null&&s.topwireContext)){r.detail.resume();return}e["Topwire-Context"]=t.dataset.topwireContext,r.detail.fetchOptions.headers=e,r.detail.resume()});document.addEventListener("turbo:before-frame-render",async r=>{const e=r.detail.render;r.detail.render=(t,s)=>{var o,b,L,I,N,B,x;let i=e;(o=t.dataset)!=null&&o.topwireMorph&&(i=Wr,(b=s.dataset)!=null&&b.topwireMorph||s.setAttribute("data-topwire-morph",(L=t.dataset)==null?void 0:L.topwireMorph)),i(t,s),(I=s.dataset)!=null&&I.topwirePageTitle&&(((N=t.dataset)==null?void 0:N.turboAction)==="advance"||((B=t.dataset)==null?void 0:B.turboAction)==="replace")&&(document.querySelector("title").innerText=(x=s.dataset)==null?void 0:x.topwirePageTitle)}});/*!
2Turbo 8.0.13
3Copyright © 2025 37signals LLC
4 */(function(r){if(typeof r.requestSubmit=="function")return;r.requestSubmit=function(s){s?(e(s,this),s.click()):(s=document.createElement("input"),s.type="submit",s.hidden=!0,this.appendChild(s),s.click(),this.removeChild(s))};function e(s,i){s instanceof HTMLElement||t(TypeError,"parameter 1 is not of type 'HTMLElement'"),s.type=="submit"||t(TypeError,"The specified element is not a submit button"),s.form==i||t(DOMException,"The specified element is not owned by this form element","NotFoundError")}function t(s,i,o){throw new s("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+i+".",o)}})(HTMLFormElement.prototype);const Ot=new WeakMap;function _r(r){const e=r instanceof Element?r:r instanceof Node?r.parentElement:null,t=e?e.closest("input, button"):null;return(t==null?void 0:t.type)=="submit"?t:null}function Ur(r){const e=_r(r.target);e&&e.form&&Ot.set(e.form,e)}(function(){if("submitter"in Event.prototype)return;let r=window.Event.prototype;if("SubmitEvent"in window){const e=window.SubmitEvent.prototype;if(/Apple Computer/.test(navigator.vendor)&&!("submitter"in e))r=e;else return}addEventListener("click",Ur,!0),Object.defineProperty(r,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return Ot.get(this.target)}})})();const me={eager:"eager",lazy:"lazy"},st=class st extends HTMLElement{constructor(){super();u(this,"loaded",Promise.resolve());this.delegate=new st.delegateConstructor(this)}static get observedAttributes(){return["disabled","loading","src"]}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(t){t=="loading"?this.delegate.loadingStyleChanged():t=="src"?this.delegate.sourceURLChanged():t=="disabled"&&this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(t){t?this.setAttribute("refresh",t):this.removeAttribute("refresh")}get shouldReloadWithMorph(){return this.src&&this.refresh==="morph"}get loading(){return $r(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,s;return(s=(t=this.ownerDocument)==null?void 0:t.documentElement)==null?void 0:s.hasAttribute("data-turbo-preview")}};u(st,"delegateConstructor");let K=st;function $r(r){switch(r.toLowerCase()){case"lazy":return me.lazy;default:return me.eager}}const zr={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 Me(r){if(r.getAttribute("data-turbo-eval")=="false")return r;{const e=document.createElement("script"),t=Ut();return t&&(e.nonce=t),e.textContent=r.textContent,e.async=!1,jr(e,r),e}}function jr(r,e){for(const{name:t,value:s}of e.attributes)r.setAttribute(t,s)}function Kr(r){const e=document.createElement("template");return e.innerHTML=r,e.content}
4function q(r,{target:e,cancelable:t,detail:s}={}){const i=new CustomEvent(r,{cancelable:t,bubbles:!0,composed:!0,detail:s});return e&&e.isConnected?e.dispatchEvent(i):document.documentElement.dispatchEvent(i),i}function kt(r){r.preventDefault(),r.stopImmediatePropagation()}function Pe(){return document.visibilityState==="hidden"?Vt():Dt()}function Dt(){return new Promise(r=>requestAnimationFrame(()=>r()))}function Vt(){return new Promise(r=>setTimeout(()=>r(),0))}function Xr(){return Promise.resolve()}function xt(r=""){return new DOMParser().parseFromString(r,"text/html")}function Wt(r,...e){const t=Yr(r,e).replace(/^\n/,"").split(`
5`),s=t[0].match(/^\s+/),i=s?s[0].length:0;return t.map(o=>o.slice(i)).join(`
6`)}function Yr(r,e){return r.reduce((t,s,i)=>{const o=e[i]==null?"":e[i];return t+s+o},"")}function se(){return Array.from({length:36}).map((r,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 Ze(r,...e){for(const t of e.map(s=>s==null?void 0:s.getAttribute(r)))if(typeof t=="string")return t;return null}function Gr(r,...e){return e.some(t=>t&&t.hasAttribute(r))}function et(...r){for(const e of r)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function tt(...r){for(const e of r)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function Jr(r,e=2e3){return new Promise(t=>{const s=()=>{r.removeEventListener("error",s),r.removeEventListener("load",s),t()};r.addEventListener("load",s,{once:!0}),r.addEventListener("error",s,{once:!0}),setTimeout(t,e)})}function _t(r){switch(r){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function Qr(r){return r=="advance"||r=="replace"||r=="restore"}function ce(...r){const e=Ze("data-turbo-action",...r);return Qr(e)?e:null}function pt(r){return document.querySelector(`meta[name="${r}"]`)}function rt(r){const e=pt(r);return e&&e.content}function Ut(){const r=pt("csp-nonce");if(r){const{nonce:e,content:t}=r;return e==""?t:e}}
6function Zr(r,e){let t=pt(r);return t||(t=document.createElement("meta"),t.setAttribute("name",r),document.head.appendChild(t)),t.setAttribute("content",e),t}function ge(r,e){var t;if(r instanceof Element)return r.closest(e)||ge(r.assignedSlot||((t=r.getRootNode())==null?void 0:t.host),e)}function gt(r){return!!r&&r.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof r.focus=="function"}function $t(r){return Array.from(r.querySelectorAll("[autofocus]")).find(gt)}async function es(r,e){const t=e();r(),await Dt();const s=e();return[t,s]}function zt(r){if(r==="_blank")return!1;if(r){for(const e of document.getElementsByName(r))if(e instanceof HTMLIFrameElement)return!1;return!0}else return!0}function jt(r){return ge(r,"a[href]:not([target^=_]):not([download])")}function Kt(r){return D(r.getAttribute("href")||"")}function ts(r,e){let t=null;return(...s)=>{const i=()=>r.apply(this,s);clearTimeout(t),t=setTimeout(i,e)}}const rs={"aria-disabled":{beforeSubmit:r=>{r.setAttribute("aria-disabled","true"),r.addEventListener("click",kt)},afterSubmit:r=>{r.removeAttribute("aria-disabled"),r.removeEventListener("click",kt)}},disabled:{beforeSubmit:r=>r.disabled=!0,afterSubmit:r=>r.disabled=!1}};var ke;class ss{constructor(e){C(this,ke,null);Object.assign(this,e)}get submitter(){return v(this,ke)}set submitter(e){M(this,ke,rs[e]||e)}}ke=new WeakMap;const is=new ss({mode:"on",submitter:"disabled"}),O={drive:zr,forms:is};function D(r){return new URL(r.toString(),document.baseURI)}function le(r){let e;if(r.hash)return r.hash.slice(1);if(e=r.href.match(/#(.*)$/))return e[1]}function bt(r,e){const t=(e==null?void 0:e.getAttribute("formaction"))||r.getAttribute("action")||r.action;return D(t)}function ns(r){return(ls(r).match(/\.[^.]*$/)||[])[0]||""}function os(r,e){const t=hs(e);return r.href===D(t).href||r.href.startsWith(t)}function Z(r,e){return os(r,e)&&!O.drive.unvisitableExtensions.has(ns(r))}function ht(r){const e=le(r);return e!=null?r.href.slice(0,-(e.length+1)):r.href}function Ke(r){return ht(r)}function as(r,e){return D(r).href==D(e).href}function cs(r){return r.pathname.split("/").slice(1)}function ls(r){return cs(r).slice(-1)[0]}function hs(r){return ds(r.origin+r.pathname)}function ds(r){return r.endsWith("/")?r:r+"/"}class vt{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 D(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 us extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){const s=this.values().next().value;this.delete(s)}super.add(e)}}const Xt=new us(20),fs=window.fetch;function Yt(r,e={}){const t=new Headers(e.headers||{}),s=se();return Xt.add(s),t.append("X-Turbo-Request-Id",s),fs(r,{...e,headers:t})}function St(r){switch(r.toLowerCase()){case"get":return U.get;case"post":return U.post;case"put":return U.put;case"patch":return U.patch;case"delete":return U.delete}}const U={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function ms(r){switch(r.toLowerCase()){case ne.multipart:return ne.multipart;case ne.plain:return ne.plain;default:return ne.urlEncoded}}const ne={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"};var Ie,Ae,Gt,Jt;class Ue{constructor(e,t,s,i=new URLSearchParams,o=null,b=ne.urlEncoded){C(this,Ae);u(this,"abortController",new AbortController);C(this,Ie,e=>{});var N;const[L,I]=It(D(s),t,i,b);this.delegate=e,this.url=L,this.target=o,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t.toUpperCase(),headers:{...this.defaultHeaders}
6,body:I,signal:this.abortSignal,referrer:(N=this.delegate.referrer)==null?void 0:N.href},this.enctype=b}get method(){return this.fetchOptions.method}set method(e){const t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,s=St(e)||U.get;this.url.search="";const[i,o]=It(this.url,s,t,this.enctype);this.url=i,this.fetchOptions.body=o,this.fetchOptions.method=s.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 w(this,Ae,Gt).call(this,e);try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=Yt(this.url.href,e);const s=await this.response;return await this.receive(s)}catch(s){if(s.name!=="AbortError")throw w(this,Ae,Jt).call(this,s)&&this.delegate.requestErrored(this,s),s}finally{this.delegate.requestFinished(this)}}async receive(e){const t=new vt(e);return q("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return wt(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}}Ie=new WeakMap,Ae=new WeakSet,Gt=async function(e){const t=new Promise(i=>M(this,Ie,i)),s=q("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:v(this,Ie)},target:this.target});return this.url=s.detail.url,s.defaultPrevented&&await t,s},Jt=function(e){return!q("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented};function wt(r){return St(r)==U.get}function It(r,e,t,s){const i=Array.from(t).length>0?new URLSearchParams(Qt(t)):r.searchParams;return wt(e)?[ps(r,i),null]:s==ne.urlEncoded?[r,i]:[r,t]}function Qt(r){const e=[];for(const[t,s]of r)s instanceof File||e.push([t,s]);return e}function ps(r,e){const t=new URLSearchParams(Qt(e));return r.search=t.toString(),r}class gs{constructor(e,t){u(this,"started",!1);u(this,"intersect",e=>{const t=e.slice(-1)[0];t!=null&&t.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)});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))}}class he{static wrap(e){return typeof e=="string"?new this(Kr(e)):e}constructor(e){this.fragment=bs(e)}}u(he,"contentType","text/vnd.turbo-stream.html");function bs(r){for(const e of r.querySelectorAll("turbo-stream")){const t=document.importNode(e,!0);for(const s of t.templateElement.content.querySelectorAll("script"))s.replaceWith(Me(s));e.replaceWith(t)}return r}const vs=100;var oe,J;class Ss{constructor(){C(this,oe,null);C(this,J,null)}get(e){if(v(this,J)&&v(this,J).url===e&&v(this,J).expire>Date.now())return v(this,J).request}setLater(e,t,s){this.clear(),M(this,oe,setTimeout(()=>{t.perform(),this.set(e,t,s),M(this,oe,null)},vs))}set(e,t,s){M(this,J,{url:e,request:t,expire:new Date(new Date().getTime()+s)})}clear(){v(this,oe)&&clearTimeout(v(this,oe)),M(this,J,null)}}oe=new WeakMap,J=new WeakMap;const ws=10*1e3,pe=new Ss,de={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"};class ot{constructor(e,t,s,i=!1){u(this,"state",de.initialized);const o=Rs(t,s),b=Ls(Ts(t,s),o),L=ys(t,s),I=Cs(t,s);this.delegate=e,this.formElement=t,this.submitter=s,this.fetchRequest=new Ue(this,o,b,L,t,I),this.mustRedirect=i}static confirmMethod(e){return Promise.resolve(confirm(e))}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=D(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}=de,s=Ze("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof s=="string"&&!await(typeof O.forms.confirm=="function"?O.forms.confirm:ot.confirmMethod)(s,this.formElement,this.submitter))&&this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){const{stopping:e,stopped:t}=de;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){const t=Es(rt("csrf-param"))||rt("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(he.contentType)}requestStarted(e){this.state=de.waiting,this.submitter&&O.forms.submitter.beforeSubmit(this.submitter),this.setSubmitsWith(),et(this.formElement),q("turbo:submit-start",{target:this.formElement,detail
6:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){pe.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(pe.clear(),this.requestMustRedirect(e)&&As(t)){const s=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,s)}else this.state=de.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=de.stopped,this.submitter&&O.forms.submitter.afterSubmit(this.submitter),this.resetSubmitterText(),tt(this.formElement),q("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(!(!this.submitter||!this.submitsWith)){if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){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||Gr("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){var e;return(e=this.submitter)==null?void 0:e.getAttribute("data-turbo-submits-with")}}function ys(r,e){const t=new FormData(r),s=e==null?void 0:e.getAttribute("name"),i=e==null?void 0:e.getAttribute("value");return s&&t.append(s,i||""),t}function Es(r){if(r!=null){const t=(document.cookie?document.cookie.split("; "):[]).find(s=>s.startsWith(r));if(t){const s=t.split("=").slice(1).join("=");return s?decodeURIComponent(s):void 0}}}function As(r){return r.statusCode==200&&!r.redirected}function Ts(r,e){const t=typeof r.action=="string"?r.action:null;return e!=null&&e.hasAttribute("formaction")?e.getAttribute("formaction")||"":r.getAttribute("action")||t||""}function Ls(r,e){const t=D(r);return wt(e)&&(t.search=""),t}function Rs(r,e){const t=(e==null?void 0:e.getAttribute("formmethod"))||r.getAttribute("method")||"";return St(t.toLowerCase())||U.get}function Cs(r,e){return ms((e==null?void 0:e.getAttribute("formenctype"))||r.enctype)}class at{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 $t(this.element)}get permanentElements(){return er(this.element)}getPermanentElementById(e){return Zt(this.element,e)}getPermanentElementMapForSnapshot(e){const t={};for(const s of this.permanentElements){const{id:i}=s,o=e.getPermanentElementById(i);o&&(t[i]=[s,o])}return t}}function Zt(r,e){return r.querySelector(`#${e}[data-turbo-permanent]`)}function er(r){return r.querySelectorAll("[id][data-turbo-permanent]")}class yt{constructor(e,t){u(this,"started",!1);u(this,"submitCaptured",()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)});u(this,"submitBubbled",e=>{if(!e.defaultPrevented){const t=e.target instanceof HTMLFormElement?e.target:void 0,s=e.submitter||void 0;t&&Ps(t,s)&&Ms(t,s)&&this.delegate.willSubmitForm(t,s)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,s))}});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)}}function Ps(r,e){return((e==null?void 0:e.getAttribute("formmethod"))||r.getAttribute("method"))!="dialog"}function Ms(r,e){const t=(e==null?void 0:e.getAttribute("formtarget"))||r.getAttribute("target");return zt(t)}var Fe,qe;class tr{constructor(e,t){C(this,Fe,e=>{});C(this,qe,e=>{});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(le(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}
6async render(e){const{isPreview:t,shouldRender:s,willRender:i,newSnapshot:o}=e,b=i;if(s)try{this.renderPromise=new Promise(B=>M(this,Fe,B)),this.renderer=e,await this.prepareToRenderSnapshot(e);const L=new Promise(B=>M(this,qe,B)),I={resume:v(this,qe),render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(o,I)||await L,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(o,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,v(this,Fe).call(this,void 0),delete this.renderPromise}else b&&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()}}Fe=new WeakMap,qe=new WeakMap;class ks extends tr{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new at(this.element)}}class rr{constructor(e,t){u(this,"clickBubbled",e=>{this.clickEventIsSignificant(e)?this.clickEvent=e:delete this.clickEvent});u(this,"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});u(this,"willVisit",e=>{delete this.clickEvent});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)}clickEventIsSignificant(e){var i;const t=e.composed?(i=e.target)==null?void 0:i.parentElement:e.target,s=jt(t)||t;return s instanceof Element&&s.closest("turbo-frame, html")==this.element}}class sr{constructor(e,t){u(this,"started",!1);u(this,"clickCaptured",()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)});u(this,"clickBubbled",e=>{if(e instanceof MouseEvent&&this.clickEventIsSignificant(e)){const t=e.composedPath&&e.composedPath()[0]||e.target,s=jt(t);if(s&&zt(s.target)){const i=Kt(s);this.delegate.willFollowLinkToLocation(s,i,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(s,i))}}});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)}clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}}class ir{constructor(e,t){this.delegate=e,this.linkInterceptor=new sr(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,s){return this.delegate.willSubmitFormLinkToLocation(e,t,s)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,t){const s=document.createElement("form"),i="hidden";for(const[x,y]of t.searchParams)s.append(Object.assign(document.createElement("input"),{type:i,name:x,value:y}));const o=Object.assign(t,{search:""});s.setAttribute("data-turbo","true"),s.setAttribute("action",o.href),s.setAttribute("hidden","");const b=e.getAttribute("data-turbo-method");b&&s.setAttribute("method",b);const L=e.getAttribute("data-turbo-frame");L&&s.setAttribute("data-turbo-frame",L);const I=ce(e);I&&s.setAttribute("data-turbo-action",I);const N=e.getAttribute("data-turbo-confirm");N&&s.setAttribute("data-turbo-confirm",N),e.hasAttribute("data-turbo-stream")&&s.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,s),document.body.appendChild(s),s.addEventListener("turbo:submit-end",()=>s.remove(),{once:!0}),requestAnimationFrame(()=>s.requestSubmit())}}class nr{static async preservingPermanentElements(e,t,s){const i=new this(e,t);i.enter(),await s(),i.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(const e in this.permanentElementMap){const[t,s]=this.permanentElementMap[e];this.delegate.enteringBardo(t,s),this.replaceNewPermanentElementWithPlaceholder(s)}}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=Is(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){const t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){const t=this.getPlaceholderById(e.id);t==null||t.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}}function Is(r){const e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",r.id),e}var Q;class Et{constructor(e,t,s,i=!0){C(this,Q,null);
6this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=s,this.willRender=i,this.renderElement=this.constructor.renderElement,this.promise=new Promise((o,b)=>this.resolvingFunctions={resolve:o,reject:b})}static renderElement(e,t){}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 nr.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){if(this.shouldAutofocus){const e=this.connectedSnapshot.firstAutofocusableElement;e&&e.focus()}}enteringBardo(e){v(this,Q)||e.contains(this.currentSnapshot.activeElement)&&M(this,Q,this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(v(this,Q))&&v(this,Q)instanceof HTMLElement&&(v(this,Q).focus(),M(this,Q,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"}}Q=new WeakMap;class At extends Et{static renderElement(e,t){var b;const s=document.createRange();s.selectNodeContents(e),s.deleteContents();const i=t,o=(b=i.ownerDocument)==null?void 0:b.createRange();o&&(o.selectNodeContents(i),e.appendChild(o.extractContents()))}constructor(e,t,s,i,o,b=!0){super(t,s,i,o,b),this.delegate=e}get shouldRender(){return!0}async render(){await Pe(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await Pe(),this.focusFirstAutofocusableElement(),await Pe(),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=Fs(this.currentElement.getAttribute("data-autoscroll-block"),"end"),s=qs(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:t,behavior:s}),!0}return!1}activateScriptElements(){for(const e of this.newScriptElements){const t=Me(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}}function Fs(r,e){return r=="end"||r=="start"||r=="center"||r=="nearest"?r:e}function qs(r,e){return r=="auto"||r=="smooth"?r:e}var Hs=function(){const r=()=>{},e={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:r,afterNodeAdded:r,beforeNodeMorphed:r,afterNodeMorphed:r,beforeNodeRemoved:r,afterNodeRemoved:r,beforeAttributeUpdated:r},head:{style:"merge",shouldPreserve:y=>y.getAttribute("im-preserve")==="true",shouldReAppend:y=>y.getAttribute("im-re-append")==="true",shouldRemove:r,afterHeadMorphed:r},restoreFocus:!0};function t(y,k,A={}){y=B(y);const R=x(k),T=N(y,R,A),S=i(T,()=>L(T,y,R,f=>f.morphStyle==="innerHTML"?(o(f,y,R),Array.from(y.childNodes)):s(f,y,R)));return T.pantry.remove(),S}function s(y,k,A){const R=x(k);let T=Array.from(R.childNodes);const S=T.indexOf(k),f=T.length-(S+1);return o(y,R,A,k,k.nextSibling),T=Array.from(R.childNodes),T.slice(S,T.length-f)}function i(y,k){var d;if(!y.config.restoreFocus)return k();let A=document.activeElement;if(!(A instanceof HTMLInputElement||A instanceof HTMLTextAreaElement))return k();const{id:R,selectionStart:T,selectionEnd:S}=A,f=k();return R&&R!==((d=document.activeElement)==null?void 0:d.id)&&(A=y.target.querySelector(`#${R}`),A==null||A.focus()),A&&!A.selectionEnd&&S&&A.setSelectionRange(T,S),f}const o=function(){function y(l,h,n,a=null,c=null){h instanceof HTMLTemplateElement&&n instanceof HTMLTemplateElement&&(h=h.content,n=n.content),a||(a=h.firstChild);for(const p of n.childNodes){if(a&&a!=c){const m=A(l,p,a,c);if(m){m!==a&&T(l,a,m),b(m,p,l),a=m.nextSibling;continue}}if(p instanceof Element&&l.persistentIds.has(p.id)){const m=S(h,p.id,a,l);b(m,p,l),a=m.nextSibling;continue}const g=k(h,p,a,l);g&&(a=g.nextSibling)}for(;a&&a!=c;){const p=a;a=a.nextSibling,R(l,p)}}function k(l,h,n,a){if(a.callbacks.beforeNodeAdded(h)===!1)return null;if(a.idMap.has(h)){const c=document.createElement(h.tagName);return l.insertBefore(c,n),b(c,h,a),a.callbacks.afterNodeAdded(c),c}else{const c=document.importNode(h,!0);return l.insertBefore(c,n),a.callbacks.afterNodeAdded(c),c}}const A=function(){function l(a,c,p,g){let m=null,W=c.nextSibling,V=0,F=p;for(;F&&F!=g;){if(n(F,c)){if(h(a,F,c))return F;m===null&&(a.idMap.has(F)||(m=F))}if(m===null&&W&&n(F,W)&&(V++,W=W.nextSibling,V>=2&&(m=void 0)),F.contains(document.activeElement))break;F=F.nextSibling}return m||null}function h(a,c,p){let g=a.idMap.get(c),m=a.idMap.get(p);if(!m||!g)return!1;for(const W of g)if(m.has(W))return!0;return!1}function n(a,c){const p=a,g=c;return p.nodeType===g.nodeType&&p.tagName===g.tagName&&(!p.id||p.id===g.id)}return l}();function R(l,h){var n;if(l.idMap.has(h))d(l.pantry,h,null);else{if(l.callbacks.beforeNodeRemoved(h)===!1)return;(n=h.parentNode)==null||n.removeChild(h),l.callbacks.afterNodeRemoved(h)}}function T(l,h,n){let a=h;for(;a&&a!==n;){let c=a;a=a.nextSibling,R(l,c)}return a}function S(l,h,n,a){const c=a.target.querySelector(`#${h}`)||a.pantry.querySelector(`#${h}`);return f(c,a),d(l,c,n),c}function f(l,h){const n=l.id;for(;l=l.parentNode;){let a=h.idMap.get(l);a&&(a.delete(n),a.size||h.idMap.delete(l))}}
6function d(l,h,n){if(l.moveBefore)try{l.moveBefore(h,n)}catch{l.insertBefore(h,n)}else l.insertBefore(h,n)}return y}(),b=function(){function y(f,d,l){return l.ignoreActive&&f===document.activeElement?null:(l.callbacks.beforeNodeMorphed(f,d)===!1||(f instanceof HTMLHeadElement&&l.head.ignore||(f instanceof HTMLHeadElement&&l.head.style!=="morph"?I(f,d,l):(k(f,d,l),S(f,l)||o(l,f,d))),l.callbacks.afterNodeMorphed(f,d)),f)}function k(f,d,l){let h=d.nodeType;if(h===1){const n=f,a=d,c=n.attributes,p=a.attributes;for(const g of p)T(g.name,n,"update",l)||n.getAttribute(g.name)!==g.value&&n.setAttribute(g.name,g.value);for(let g=c.length-1;0<=g;g--){const m=c[g];if(m&&!a.hasAttribute(m.name)){if(T(m.name,n,"remove",l))continue;n.removeAttribute(m.name)}}S(n,l)||A(n,a,l)}(h===8||h===3)&&f.nodeValue!==d.nodeValue&&(f.nodeValue=d.nodeValue)}function A(f,d,l){if(f instanceof HTMLInputElement&&d instanceof HTMLInputElement&&d.type!=="file"){let h=d.value,n=f.value;R(f,d,"checked",l),R(f,d,"disabled",l),d.hasAttribute("value")?n!==h&&(T("value",f,"update",l)||(f.setAttribute("value",h),f.value=h)):T("value",f,"remove",l)||(f.value="",f.removeAttribute("value"))}else if(f instanceof HTMLOptionElement&&d instanceof HTMLOptionElement)R(f,d,"selected",l);else if(f instanceof HTMLTextAreaElement&&d instanceof HTMLTextAreaElement){let h=d.value,n=f.value;if(T("value",f,"update",l))return;h!==n&&(f.value=h),f.firstChild&&f.firstChild.nodeValue!==h&&(f.firstChild.nodeValue=h)}}function R(f,d,l,h){const n=d[l],a=f[l];if(n!==a){const c=T(l,f,"update",h);c||(f[l]=d[l]),n?c||f.setAttribute(l,""):T(l,f,"remove",h)||f.removeAttribute(l)}}function T(f,d,l,h){return f==="value"&&h.ignoreActiveValue&&d===document.activeElement?!0:h.callbacks.beforeAttributeUpdated(f,d,l)===!1}function S(f,d){return!!d.ignoreActiveValue&&f===document.activeElement&&f!==document.body}return y}();function L(y,k,A,R){if(y.head.block){const T=k.querySelector("head"),S=A.querySelector("head");if(T&&S){const f=I(T,S,y);return Promise.all(f).then(()=>{const d=Object.assign(y,{head:{block:!1,ignore:!0}});return R(d)})}}return R(y)}function I(y,k,A){let R=[],T=[],S=[],f=[],d=new Map;for(const h of k.children)d.set(h.outerHTML,h);for(const h of y.children){let n=d.has(h.outerHTML),a=A.head.shouldReAppend(h),c=A.head.shouldPreserve(h);n||c?a?T.push(h):(d.delete(h.outerHTML),S.push(h)):A.head.style==="append"?a&&(T.push(h),f.push(h)):A.head.shouldRemove(h)!==!1&&T.push(h)}f.push(...d.values());let l=[];for(const h of f){let n=document.createRange().createContextualFragment(h.outerHTML).firstChild;if(A.callbacks.beforeNodeAdded(n)!==!1){if("href"in n&&n.href||"src"in n&&n.src){let a,c=new Promise(function(p){a=p});n.addEventListener("load",function(){a()}),l.push(c)}y.appendChild(n),A.callbacks.afterNodeAdded(n),R.push(n)}}for(const h of T)A.callbacks.beforeNodeRemoved(h)!==!1&&(y.removeChild(h),A.callbacks.afterNodeRemoved(h));return A.head.afterHeadMorphed(y,{added:R,kept:S,removed:T}),l}const N=function(){function y(d,l,h){const{persistentIds:n,idMap:a}=S(d,l),c=k(h),p=c.morphStyle||"outerHTML";if(!["innerHTML","outerHTML"].includes(p))throw`Do not understand how to morph style ${p}`;return{target:d,newContent:l,config:c,morphStyle:p,ignoreActive:c.ignoreActive,ignoreActiveValue:c.ignoreActiveValue,restoreFocus:c.restoreFocus,idMap:a,persistentIds:n,pantry:A(),callbacks:c.callbacks,head:c.head}}function k(d){let l=Object.assign({},e);return Object.assign(l,d),l.callbacks=Object.assign({},e.callbacks,d.callbacks),l.head=Object.assign({},e.head,d.head),l}function A(){const d=document.createElement("div");return d.hidden=!0,document.body.insertAdjacentElement("afterend",d),d}function R(d){let l=Array.from(d.querySelectorAll("[id]"));return d.id&&l.push(d),l}function T(d,l,h,n){for(const a of n)if(l.has(a.id)){let c=a;for(;c;){let p=d.get(c);if(p==null&&(p=new Set,d.set(c,p)),p.add(a.id),c===h)break;c=c.parentElement}}}function S(d,l){const h=R(d),n=R(l),a=f(h,n);let c=new Map;T(c,a,d,h);const p=l.__idiomorphRoot||l;return T(c,a,p,n),{persistentIds:a,idMap:c}}function f(d,l){let h=new Set,n=new Map;for(const{id:c,tagName:p}of d)n.has(c)?h.add(c):n.set(c,p);let a=new Set;for(const{id:c,tagName:p}of l)a.has(c)?h.add(c):n.get(c)===p&&a.add(c);for(const c of h)a.delete(c);return a}return y}(),{normalizeElement:B,normalizeParent:x}=function(){const y=new WeakSet;function k(S){return S instanceof Document?S.documentElement:S}function A(S){if(S==null)return document.createElement("div");if(typeof S=="string")return A(T(S));if(y.has(S))return S;
6if(S instanceof Node){if(S.parentNode)return R(S);{const f=document.createElement("div");return f.append(S),f}}else{const f=document.createElement("div");for(const d of[...S])f.append(d);return f}}function R(S){return{childNodes:[S],querySelectorAll:f=>{const d=S.querySelectorAll(f);return S.matches(f)?[S,...d]:d},insertBefore:(f,d)=>S.parentNode.insertBefore(f,d),moveBefore:(f,d)=>S.parentNode.moveBefore(f,d),get __idiomorphRoot(){return S}}}function T(S){let f=new DOMParser,d=S.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(d.match(/<\/html>/)||d.match(/<\/head>/)||d.match(/<\/body>/)){let l=f.parseFromString(S,"text/html");if(d.match(/<\/html>/))return y.add(l),l;{let h=l.firstChild;return h&&y.add(h),h}}else{let h=f.parseFromString("<body><template>"+S+"</template></body>","text/html").body.querySelector("template").content;return y.add(h),h}}return{normalizeElement:k,normalizeParent:A}}();return{morph:t,defaults:e}}();function Tt(r,e,{callbacks:t,...s}={}){Hs.morph(r,e,{...s,callbacks:new Bs(t)})}function or(r,e){Tt(r,e.childNodes,{morphStyle:"innerHTML"})}var He;class Bs{constructor({beforeNodeMorphed:e}={}){C(this,He);u(this,"beforeNodeAdded",e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id)));u(this,"beforeNodeMorphed",(e,t)=>{if(e instanceof Element)return!e.hasAttribute("data-turbo-permanent")&&v(this,He).call(this,e,t)?!q("turbo:before-morph-element",{cancelable:!0,target:e,detail:{currentElement:e,newElement:t}}).defaultPrevented:!1});u(this,"beforeAttributeUpdated",(e,t,s)=>!q("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:s}}).defaultPrevented);u(this,"beforeNodeRemoved",e=>this.beforeNodeMorphed(e));u(this,"afterNodeMorphed",(e,t)=>{e instanceof Element&&q("turbo:morph-element",{target:e,detail:{currentElement:e,newElement:t}})});M(this,He,e||(()=>!0))}}He=new WeakMap;class Ns extends At{static renderElement(e,t){q("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),or(e,t)}async preservingPermanentElements(e){return await e()}}const G=class G{constructor(){u(this,"hiding",!1);u(this,"value",0);u(this,"visible",!1);u(this,"trickle",()=>{this.setValue(this.value+Math.random()/100)});this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}static get defaultCSS(){return Wt`
7      .turbo-progress-bar {
8        position: fixed;
9        display: block;
10        top: 0;
11        left: 0;
12        height: 3px;
13        background: #0076ff;
14        z-index: 2147483647;
15        transition:
16          width ${G.animationDuration}ms ease-out,
17          opacity ${G.animationDuration/2}ms ${G.animationDuration/2}ms ease-in;
18        transform: translate3d(0, 0, 0);
19      }
20    `}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,G.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,G.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){const e=document.createElement("style");e.type="text/css",e.textContent=G.defaultCSS;const t=Ut();return t&&(e.nonce=t),e}createProgressElement(){const e=document.createElement("div");return e.className="turbo-progress-bar",e}};u(G,"animationDuration",300);let dt=G;class Os extends at{constructor(){super(...arguments);u(this,"detailsByOuterHTML",this.children.filter(t=>!Ws(t)).map(t=>$s(t)).reduce((t,s)=>{const{outerHTML:i}=s,o=i in t?t[i]:{type:Ds(s),tracked:Vs(s),elements:[]};return{...t,[i]:{...o,elements:[...o.elements,s]}}},{}))}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,s){return Object.keys(this.detailsByOuterHTML).filter(i=>!(i in s.detailsByOuterHTML)).map(i=>this.detailsByOuterHTML[i]).filter(({type:i})=>i==t).map(({elements:[i]})=>i)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((t,s)=>{const{type:i,tracked:o,elements:b}=this.detailsByOuterHTML[s];return i==null&&!o?[...t,...b]:b.length>1?[...t,...b.slice(1)]:t},[])}getMetaValue(t){const s=this.findMetaElementByName(t);return s?s.getAttribute("content"):null}findMetaElementByName(t){return Object.keys(this.detailsByOuterHTML).reduce((s,i)=>{const{elements:[o]}=this.detailsByOuterHTML[i];return Us(o,t)?o:s},void 0|void 0)}}function Ds(r){if(xs(r))return"script";if(_s(r))return"stylesheet"}function Vs(r){return r.getAttribute("data-turbo-track")=="reload"}function xs(r){return r.localName=="script"}function Ws(r){return r.localName=="noscript"}function _s(r){const e=r.localName;return e=="style"||e=="link"&&r.getAttribute("rel")=="stylesheet"}function Us(r,e){return r.localName=="meta"&&r.getAttribute("name")==e}function $s(r){return r.hasAttribute("nonce")&&r.setAttribute("nonce",""),r}class j extends at{static fromHTMLString(e=""){return this.fromDocument(xt(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:s}){return new this(e,t,new Os(s))}constructor(e,t,s){super(t),this.documentElement=e,this.headSnapshot=s}clone(){const e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),s=e.querySelectorAll("select");for(const[i,o]of t.entries()){const b=s[i];for(const L of b.selectedOptions)L.selected=!1;for(const L of o.selectedOptions)b.options[L.index].selected=!0}for(const i of e.querySelectorAll('input[type="password"]'))i.value="";return new j(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 D(e)}
20get 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}`)}}var Be,ee;class zs{constructor(){C(this,Be,!1);C(this,ee,Promise.resolve())}renderChange(e,t){return e&&this.viewTransitionsAvailable&&!v(this,Be)?(M(this,Be,!0),M(this,ee,v(this,ee).then(async()=>{await document.startViewTransition(t).finished}))):M(this,ee,v(this,ee).then(t)),v(this,ee)}get viewTransitionsAvailable(){return document.startViewTransition}}Be=new WeakMap,ee=new WeakMap;const js={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},Xe={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},Y={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},be={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},Ks={advance:"forward",restore:"back",replace:"none"};class Xs{constructor(e,t,s,i={}){u(this,"identifier",se());u(this,"timingMetrics",{});u(this,"followedRedirect",!1);u(this,"historyChanged",!1);u(this,"scrolled",!1);u(this,"shouldCacheSnapshot",!0);u(this,"acceptsStreamResponse",!1);u(this,"snapshotCached",!1);u(this,"state",Y.initialized);u(this,"viewTransitioner",new zs);this.delegate=e,this.location=t,this.restorationIdentifier=s||se();const{action:o,historyChanged:b,referrer:L,snapshot:I,snapshotHTML:N,response:B,visitCachedSnapshot:x,willRender:y,updateHistory:k,shouldCacheSnapshot:A,acceptsStreamResponse:R,direction:T}={...js,...i};this.action=o,this.historyChanged=b,this.referrer=L,this.snapshot=I,this.snapshotHTML=N,this.response=B,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=x,this.willRender=y,this.updateHistory=k,this.scrolled=!y,this.shouldCacheSnapshot=A,this.acceptsStreamResponse=R,this.direction=T||Ks[o]}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==Y.initialized&&(this.recordTimingMetric(Xe.visitStart),this.state=Y.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==Y.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=Y.canceled)}complete(){this.state==Y.started&&(this.recordTimingMetric(Xe.visitEnd),this.adapter.visitCompleted(this),this.state=Y.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==Y.started&&(this.state=Y.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){var e;if(!this.historyChanged&&this.updateHistory){const t=this.location.href===((e=this.referrer)==null?void 0:e.href)?"replace":this.action,s=_t(t);this.history.update(s,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new Ue(this,U.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(Xe.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){const{statusCode:t}=e;Ft(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(Xe.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){const{statusCode:e,responseHTML:t}=this.response;this.render(async()=>
20{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,Ft(e)&&t!=null){const s=j.fromHTMLString(t);await this.renderPageSnapshot(s,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(j.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){const e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!le(this.location)||e.hasAnchor(le(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return j.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(){var e;this.redirectedToLocation&&!this.followedRedirect&&((e=this.response)!=null&&e.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(he.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){const s=await t.responseHTML,{redirected:i,statusCode:o}=t;s==null?this.recordResponse({statusCode:be.contentTypeMismatch,redirected:i}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:o,responseHTML:s,redirected:i}))}async requestFailedWithResponse(e,t){const s=await t.responseHTML,{redirected:i,statusCode:o}=t;s==null?this.recordResponse({statusCode:be.contentTypeMismatch,redirected:i}):this.recordResponse({statusCode:o,responseHTML:s,redirected:i})}requestErrored(e,t){this.recordResponse({statusCode:be.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=le(this.location);if(e!=null)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=new Date().getTime()}getTimingMetrics(){return{...this.timingMetrics}}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 Ft(r){return r>=200&&r<300}class Ys{constructor(e){u(this,"progressBar",new dt);u(this,"showProgressBar",()=>{this.progressBar.show()});this.session=e}visitProposedToLocation(e,t){Z(e,this.navigator.rootLocation)?this.navigator.startVisit(e,(t==null?void 0:t.restorationIdentifier)||se(),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 be.networkFailure:case be.timeoutFailure:case be.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){}linkPrefetchingIsEnabledForLocation(e){return!0}
20formSubmissionStarted(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)}reload(e){var t;q("turbo:reload",{detail:e}),window.location.href=((t=this.location)==null?void 0:t.toString())||window.location.href}get navigator(){return this.session.navigator}}class Gs{constructor(){u(this,"selector","[data-turbo-temporary]");u(this,"deprecatedSelector","[data-turbo-cache=false]");u(this,"started",!1);u(this,"removeTemporaryElements",e=>{for(const t of this.temporaryElements)t.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 e=document.querySelectorAll(this.deprecatedSelector);return e.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...e]}}var $,ar,Ye,Ge;class Js{constructor(e,t){C(this,$);this.session=e,this.element=t,this.linkInterceptor=new rr(this,t),this.formSubmitObserver=new yt(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,s){return w(this,$,Ye).call(this,e)}linkClickIntercepted(e,t,s){const i=w(this,$,Ge).call(this,e);i&&i.delegate.linkClickIntercepted(e,t,s)}willSubmitForm(e,t){return e.closest("turbo-frame")==null&&w(this,$,ar).call(this,e,t)&&w(this,$,Ye).call(this,e,t)}formSubmitted(e,t){const s=w(this,$,Ge).call(this,e,t);s&&s.delegate.formSubmitted(e,t)}}$=new WeakSet,ar=function(e,t){const s=bt(e,t),i=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),o=D((i==null?void 0:i.content)??"/");return w(this,$,Ye).call(this,e,t)&&Z(s,o)},Ye=function(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){const i=w(this,$,Ge).call(this,e,t);return i?i!=e.closest("turbo-frame"):!1}else return!1},Ge=function(e,t){const s=(t==null?void 0:t.getAttribute("data-turbo-frame"))||e.getAttribute("data-turbo-frame");if(s&&s!="_top"){const i=this.element.querySelector(`#${s}:not([disabled])`);if(i instanceof K)return i}};class Qs{constructor(e){u(this,"location");u(this,"restorationIdentifier",se());u(this,"restorationData",{});u(this,"started",!1);u(this,"pageLoaded",!1);u(this,"currentIndex",0);u(this,"onPopState",e=>{if(this.shouldHandlePopState()){const{turbo:t}=e.state||{};if(t){this.location=new URL(window.location.href);const{restorationIdentifier:s,restorationIndex:i}=t;this.restorationIdentifier=s;const o=i>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,s,o),this.currentIndex=i}}});u(this,"onPageLoad",async e=>{await Xr(),this.pageLoaded=!0});this.delegate=e}start(){var e,t;this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.currentIndex=((t=(e=history.state)==null?void 0:e.turbo)==null?void 0:t.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,s=se()){e===history.pushState&&++this.currentIndex;const i={turbo:{restorationIdentifier:s,restorationIndex:this.currentIndex}};e.call(history,i,"",t.href),this.location=t,this.restorationIdentifier=s}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){const{restorationIdentifier:t}=this,s=this.restorationData[t];this.restorationData[t]={...s,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"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"}}var ve,Ne,Oe,De,it,Ve,Te,cr,lr;class Zs{constructor(e,t){C(this,Te);u(this,"started",!1);C(this,ve,null);C(this,Ne,()=>{this.eventTarget.addEventListener("mouseenter",v(this,Oe),{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",v(this,De),{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",v(this,Ve),!0),this.started=!0});C(this,Oe,e=>{if(rt("turbo-prefetch")==="false")return;const t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&w(this,Te,lr).call(this,t)){const i=t,o=Kt(i);if(this.delegate.canPrefetchRequestToLocation(i,o)){M(this,ve,i);const b=new Ue(this,U.get,o,new URLSearchParams,t);pe.setLater(o.toString(),b,v(this,Te,cr))}}});C(this,De,e=>{e.target===v(this,ve)&&v(this,it).call(this)});C(this,it,()=>{pe.clear(),M(this,ve,null)});C(this,Ve,e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="GET"){const t=pe.get(e.detail.url.toString());t&&(e.detail.fetchRequest=t),pe.clear()}});this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.readyState==="loading"?this.eventTarget.addEventListener("DOMContentLoaded",v(this,Ne),{once:!0}):v(this,Ne).call(this))}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",v(this,Oe),{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",v(this,De),{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",v(this,Ve),!0),this.started=!1)}prepareRequest(e){const t=e.target;e.headers["X-Sec-Purpose"]="prefetch";const s=t.closest("turbo-frame"),i=t.getAttribute("data-turbo-frame")||(s==null?void 0:s.getAttribute("target"))||(s==null?void 0:s.id);i&&i!=="_top"&&(e.headers["Turbo-Frame"]=i)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}}ve=new WeakMap,Ne=new WeakMap,Oe=new WeakMap,De=new WeakMap,it=new WeakMap,Ve=new WeakMap,Te=new WeakSet,cr=function(){return Number(rt("turbo-prefetch-cache-time"))||ws},lr=function(e){return!(!e.getAttribute("href")||ei(e)||ti(e)||ri(e)||si(e)||ni(e))};const ei=r=>r.origin!==document.location.origin||!["http:","https:"].includes(r.protocol)||r.hasAttribute("target"),ti=r=>r.pathname+r.search===document.location.pathname+document.location.search||r.href.startsWith("#"),ri=r=>{if(r.getAttribute("data-turbo-prefetch")==="false"||r.getAttribute("data-turbo")==="false")return!0;const e=ge(r,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},si=r=>{const e=r.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||ii(r)||r.hasAttribute("data-turbo-confirm")||r.hasAttribute("data-turbo-stream"))},ii=r=>r.hasAttribute("data-remote")||r.hasAttribute("data-behavior")||r.hasAttribute("data-confirm")||r.hasAttribute("data-method"),ni=r=>q("turbo:before-prefetch",{target:r,cancelable:!0}).defaultPrevented;var Le,hr,dr;class oi{constructor(e){C(this,Le);this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,s={}){this.stop(),this.currentVisit=new Xs(this,D(e),t,{referrer:this.location,...s}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new ot(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 s=await t.responseHTML;if(s){const i=e.isSafe;i||this.view.clearSnapshotCache();const{statusCode:o,redirected:b}=t,I={action:w(this,Le,hr).call(this,e,t),shouldCacheSnapshot:i,response:{statusCode:o,responseHTML:s,redirected:b}};this.proposeVisit(t.location,I)}}}async formSubmissionFailedWithResponse(e,t){const s=await t.responseHTML;if(s){const i=j.fromHTMLString(s);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)}linkPrefetchingIsEnabledForLocation(e){return typeof this.adapter.linkPrefetchingIsEnabledForLocation=="function"?this.adapter.linkPrefetchingIsEnabledForLocation(e):!0}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e),delete this.currentVisit}locationWithActionIsSamePage(e,t){const s=le(e),i=le(this.view.lastRenderedLocation),o=t==="restore"&&typeof s>"u";return t!=="replace"&&ht(e)===ht(this.view.lastRenderedLocation)&&(o||s!=null&&s!==i)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}}Le=new WeakSet,hr=function(e,t){const{submitter:s,formElement:i}=e;return ce(s,i)||w(this,Le,dr).call(this,t)},dr=function(e){var s;return e.redirected&&e.location.href===((s=this.location)==null?void 0:s.href)?"replace":"advance"};const ie={initial:0,loading:1,interactive:2,complete:3};class ai{constructor(e){u(this,"stage",ie.initial);u(this,"started",!1);u(this,"interpretReadyState",()=>{const{readyState:e}=this;
20e=="interactive"?this.pageIsInteractive():e=="complete"&&this.pageIsComplete()});u(this,"pageWillUnload",()=>{this.delegate.pageWillUnload()});this.delegate=e}start(){this.started||(this.stage==ie.initial&&(this.stage=ie.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==ie.loading&&(this.stage=ie.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==ie.interactive&&(this.stage=ie.complete,this.delegate.pageLoaded())}get readyState(){return document.readyState}}class ci{constructor(e){u(this,"started",!1);u(this,"onScroll",()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})});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)}updatePosition(e){this.delegate.scrollPositionChanged(e)}}class li{render({fragment:e}){nr.preservingPermanentElements(this,hi(e),()=>{di(e,()=>{ui(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}}function hi(r){const e=er(document.documentElement),t={};for(const s of e){const{id:i}=s;for(const o of r.querySelectorAll("turbo-stream")){const b=Zt(o.templateElement.content,i);b&&(t[i]=[s,b])}}return t}async function di(r,e){const t=`turbo-stream-autofocus-${se()}`,s=r.querySelectorAll("turbo-stream"),i=fi(s);let o=null;if(i&&(i.id?o=i.id:o=t,i.id=o),e(),await Pe(),(document.activeElement==null||document.activeElement==document.body)&&o){const L=document.getElementById(o);gt(L)&&L.focus(),L&&L.id==t&&L.removeAttribute("id")}}async function ui(r){const[e,t]=await es(r,()=>document.activeElement),s=e&&e.id;if(s){const i=document.getElementById(s);gt(i)&&i!=t&&i.focus()}}function fi(r){for(const e of r){const t=$t(e.templateElement.content);if(t)return t}return null}var te;class mi{constructor(e){u(this,"sources",new Set);C(this,te,!1);u(this,"inspectFetchResponse",e=>{const t=pi(e);t&&gi(t)&&(e.preventDefault(),this.receiveMessageResponse(t))});u(this,"receiveMessageEvent",e=>{v(this,te)&&typeof e.data=="string"&&this.receiveMessageHTML(e.data)});this.delegate=e}start(){v(this,te)||(M(this,te,!0),addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){v(this,te)&&(M(this,te,!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)}async receiveMessageResponse(e){const t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(he.wrap(e))}}te=new WeakMap;function pi(r){var t;const e=(t=r.detail)==null?void 0:t.fetchResponse;if(e instanceof vt)return e}function gi(r){return(r.contentType??"").startsWith(he.contentType)}class bi extends Et{static renderElement(e,t){const{documentElement:s,body:i}=document;s.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 s=Me(e);t.replaceChild(s,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}}var nt,ur;class Lt extends Et{constructor(){super(...arguments);C(this,nt)}static renderElement(t,s){document.body&&s instanceof HTMLBodyElement?document.body.replaceWith(s):document.documentElement.appendChild(s)}
20get 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(){w(this,nt,ur).call(this),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(),s=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await t,await s,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 t=[];for(const s of this.newHeadStylesheetElements)t.push(Jr(s)),document.head.appendChild(s);await Promise.all(t)}copyNewHeadScriptElements(){for(const t of this.newHeadScriptElements)document.head.appendChild(Me(t))}removeUnusedDynamicStylesheetElements(){for(const t of this.unusedDynamicStylesheetElements)document.head.removeChild(t)}async mergeProvisionalElements(){const t=[...this.newHeadProvisionalElements];for(const s of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(s,t)||document.head.removeChild(s);for(const s of t)document.head.appendChild(s)}isCurrentElementInElementList(t,s){for(const[i,o]of s.entries()){if(t.tagName=="TITLE"){if(o.tagName!="TITLE")continue;if(t.innerHTML==o.innerHTML)return s.splice(i,1),!0}if(o.isEqualNode(t))return s.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 s=Me(t);t.replaceWith(s)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(t=>t.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")}}nt=new WeakSet,ur=function(){const{documentElement:t}=this.currentSnapshot,{lang:s}=this.newSnapshot;s?t.setAttribute("lang",s):t.removeAttribute("lang")};class vi extends Lt{static renderElement(e,t){Tt(e,t,{callbacks:{beforeNodeMorphed:s=>!qt(s)}});for(const s of e.querySelectorAll("turbo-frame"))qt(s)&&s.reload();q("turbo:morph",{detail:{currentElement:e,newElement:t}})}async preservingPermanentElements(e){return await e()}get renderMethod(){return"morph"}get shouldAutofocus(){return!1}}function qt(r){return r instanceof K&&r.src&&r.refresh==="morph"&&!r.closest("[data-turbo-permanent]")}class Si{constructor(e){u(this,"keys",[]);u(this,"snapshots",{});this.size=e}has(e){return Ke(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[Ke(e)]}write(e,t){this.snapshots[Ke(e)]=t}touch(e){const t=Ke(e),s=this.keys.indexOf(t);s>-1&&this.keys.splice(s,1),this.keys.unshift(t),this.trim()}trim(){for(const e of this.keys.splice(this.size))delete this.snapshots[e]}}class wi extends tr{constructor(){super(...arguments);u(this,"snapshotCache",new Si(10));u(this,"lastRenderedLocation",new URL(location.href));u(this,"forceReloaded",!1)}shouldTransitionTo(t){return this.snapshot.prefersViewTransitions&&t.prefersViewTransitions}renderPage(t,s=!1,i=!0,o){const L=this.isPageRefresh(o)&&this.snapshot.shouldMorphPage?vi:Lt,I=new L(this.snapshot,t,s,i);return I.shouldRender?o==null||o.changeHistory():this.forceReloaded=!0,this.render(I)}
20renderError(t,s){s==null||s.changeHistory();const i=new bi(this.snapshot,t,!1);return this.render(i)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(t=this.snapshot){if(t.isCacheable){this.delegate.viewWillCacheSnapshot();const{lastRenderedLocation:s}=this;await Vt();const i=t.clone();return this.snapshotCache.put(s,i),i}}getCachedSnapshotForLocation(t){return this.snapshotCache.get(t)}isPageRefresh(t){return!t||this.lastRenderedLocation.pathname===t.location.pathname&&t.action==="replace"}shouldPreserveScrollPosition(t){return this.isPageRefresh(t)&&this.snapshot.shouldPreserveScrollPosition}get snapshot(){return j.fromElement(this.element)}}var xe;class yi{constructor(e,t){u(this,"selector","a[data-turbo-preload]");C(this,xe,()=>{this.preloadOnLoadLinksForView(document.body)});this.delegate=e,this.snapshotCache=t}start(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",v(this,xe)):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",v(this,xe))}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 Ue(this,U.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{const s=await t.responseHTML,i=j.fromHTMLString(s);this.snapshotCache.put(e.url,i)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}}xe=new WeakMap;var Se,Je;class Ei{constructor(e){C(this,Se);this.session=e}clear(){this.session.clearCache()}resetCacheControl(){w(this,Se,Je).call(this,"")}exemptPageFromCache(){w(this,Se,Je).call(this,"no-cache")}exemptPageFromPreview(){w(this,Se,Je).call(this,"no-preview")}}Se=new WeakSet,Je=function(e){Zr("turbo-cache-control",e)};var We;class Ai{constructor(e){u(this,"navigator",new oi(this));u(this,"history",new Qs(this));u(this,"view",new wi(this,document.documentElement));u(this,"adapter",new Ys(this));u(this,"pageObserver",new ai(this));u(this,"cacheObserver",new Gs);u(this,"linkPrefetchObserver",new Zs(this,document));u(this,"linkClickObserver",new sr(this,window));u(this,"formSubmitObserver",new yt(this,document));u(this,"scrollObserver",new ci(this));u(this,"streamObserver",new mi(this));u(this,"formLinkClickObserver",new ir(this,document.documentElement));u(this,"frameRedirector",new Js(this,document.documentElement));u(this,"streamMessageRenderer",new li);u(this,"cache",new Ei(this));u(this,"enabled",!0);u(this,"started",!1);C(this,We,150);this.recentRequests=e,this.preloader=new yi(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 s=t.frame?document.getElementById(t.frame):null;if(s instanceof K){const i=t.action||ce(s);s.delegate.proposeVisitIfNavigatedWithAction(s,i),s.src=e.toString()}else this.navigator.proposeVisit(D(e),t)}refresh(e,t){const s=t&&this.recentRequests.has(t),i=e===document.baseURI;!s&&!this.navigator.currentVisit&&i&&this.visit(e,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(he.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){console.warn("Please replace `session.setProgressBarDelay(delay)` with `session.progressBarDelay = delay`. The function is deprecated and will be removed in a future version of Turbo.`"),this.progressBarDelay=e}set progressBarDelay(e){O.drive.progressBarDelay=e}get progressBarDelay(){return O.drive.progressBarDelay}set drive(e){O.drive.enabled=e}get drive(){return O.drive.enabled}set formMode(e){O.forms.mode=e}get formMode(){return O.forms.mode}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return v(this,We)}set pageRefreshDebouncePeriod(e){this.refresh=ts(this.debouncedRefresh.bind(this),e),M(this,We,e)}shouldPreloadLink(e){const t=e.hasAttribute("data-turbo-method"),s=e.hasAttribute("data-turbo-stream"),i=e.getAttribute("data-turbo-frame"),o=i=="_top"?null:d
20ocument.getElementById(i)||ge(e,"turbo-frame:not([disabled])");if(t||s||o instanceof K)return!1;{const b=new URL(e.href);return this.elementIsNavigatable(e)&&Z(b,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,t,s){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0,direction:s}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&Z(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&Z(t,this.snapshot.rootLocation)&&this.navigator.linkPrefetchingIsEnabledForLocation(t)}willFollowLinkToLocation(e,t,s){return this.elementIsNavigatable(e)&&Z(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,s)}followedLinkToLocation(e,t){const s=this.getActionForLink(e),i=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:s,acceptsStreamResponse:i})}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){Ht(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(et(document.documentElement),this.view.markVisitDirection(e.direction)),Ht(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),tt(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 s=bt(e,t);return this.submissionIsNavigatable(e,t)&&Z(D(s),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(){var e;(e=this.navigator.currentVisit)!=null&&e.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){const s=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:i,detail:{render:o}}=s;return this.view.renderer&&o&&(this.view.renderer.renderElement=o),!i}viewRenderedSnapshot(e,t,s){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(s)}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,s){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,s).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,s){return q("turbo:click",{target:e,detail:{url:t.href,originalEvent:s},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return q("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return q("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return q("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return q("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return q("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return q("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return q("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return q("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if(O.forms.mode=="off")return!1;{const s=t?this.elementIsNavigatable(t):!0;return O.forms.mode=="optin"?s&&e.closest('[data-turbo="true"]')!=null:s&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){const t=ge(e,"[data-turbo]"),s=ge(e,"turbo-frame");return O.drive.enabled||s?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return ce(e)||"advance"}get snapshot(){return this.view.snapshot}}We=new WeakMap;function Ht(r){Object.defineProperties(r,Ti)}const Ti={absoluteURL:{get(){return this.toString()}}},H=new Ai(Xt),{cache:Li,navigator:Ri}
20=H;function fr(){H.start()}function Ci(r){H.registerAdapter(r)}function Pi(r,e){H.visit(r,e)}function mr(r){H.connectStreamSource(r)}function pr(r){H.disconnectStreamSource(r)}function Mi(r){H.renderStreamMessage(r)}function ki(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),H.clearCache()}function Ii(r){console.warn("Please replace `Turbo.setProgressBarDelay(delay)` with `Turbo.config.drive.progressBarDelay = delay`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),O.drive.progressBarDelay=r}function Fi(r){console.warn("Please replace `Turbo.setConfirmMethod(confirmMethod)` with `Turbo.config.forms.confirm = confirmMethod`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),O.forms.confirm=r}function qi(r){console.warn("Please replace `Turbo.setFormMode(mode)` with `Turbo.config.forms.mode = mode`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),O.forms.mode=r}var Hi=Object.freeze({__proto__:null,navigator:Ri,session:H,cache:Li,PageRenderer:Lt,PageSnapshot:j,FrameRenderer:At,fetch:Yt,config:O,start:fr,registerAdapter:Ci,visit:Pi,connectStreamSource:mr,disconnectStreamSource:pr,renderStreamMessage:Mi,clearCache:ki,setProgressBarDelay:Ii,setConfirmMethod:Fi,setFormMode:qi});class Bi extends Error{}var we,X,re,_e,ye,Ee,E,ue,gr,br,vr,Sr,wr,yr,Er,ut,fe,Ar,Qe,Tr,Lr,Rr;class Ni{constructor(e){C(this,E);u(this,"fetchResponseLoaded",e=>Promise.resolve());C(this,we,null);C(this,X,()=>{});C(this,re,!1);C(this,_e,!1);C(this,ye,new Set);C(this,Ee,!1);u(this,"action",null);u(this,"visitCachedSnapshot",({element:e})=>{const t=e.querySelector("#"+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement});this.element=e,this.view=new ks(this,this.element),this.appearanceObserver=new gs(this,this.element),this.formLinkClickObserver=new ir(this,this.element),this.linkInterceptor=new rr(this,this.element),this.restorationIdentifier=se(),this.formSubmitObserver=new yt(this,this.element)}connect(){v(this,re)||(M(this,re,!0),this.loadingStyle==me.lazy?this.appearanceObserver.start():w(this,E,ue).call(this),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){v(this,re)&&(M(this,re,!1),this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==me.eager&&w(this,E,ue).call(this)}sourceURLChanged(){w(this,E,Tr).call(this,"src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==me.eager||v(this,_e))&&w(this,E,ue).call(this))}sourceURLReloaded(){const{refresh:e,src:t}=this.element;return M(this,Ee,t&&e==="morph"),this.element.removeAttribute("complete"),this.element.src=null,this.element.src=t,this.element.loaded}loadingStyleChanged(){this.loadingStyle==me.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),w(this,E,ue).call(this))}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{const t=await e.responseHTML;if(t){const s=xt(t);j.fromDocument(s).isVisitable?await w(this,E,gr).call(this,e,s):await w(this,E,Sr).call(this,e)}}finally{M(this,Ee,!1),this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,ce(e)),w(this,E,ue).call(this)}willSubmitFormLinkToLocation(e){return w(this,E,Qe).call(this,e)}submittedFormLinkToLocation(e,t,s){const i=w(this,E,fe).call(this,e);i&&s.setAttribute("data-turbo-frame",i.id)}shouldInterceptLinkClick(e,t,s){return w(this,E,Qe).call(this,e)}linkClickIntercepted(e,t){w(this,E,vr).call(this,e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&w(this,E,Qe).call(this,e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new ot(this,e,t);const{fetchRequest:s}=this.formSubmission;this.prepareRequest(s),this.formSubmission.start()}prepareRequest(e){var t;e.headers["Turbo-Frame"]=this.id,(t=this.currentNavigationElement)!=null&&t.hasAttribute("data-turbo-stream")&&e.acceptResponseType(he.contentType)}requestStarted(e){et(this.element)}
20requestPreventedHandlingResponse(e,t){v(this,X).call(this)}async requestSucceededWithResponse(e,t){await this.loadResponse(t),v(this,X).call(this)}async requestFailedWithResponse(e,t){await this.loadResponse(t),v(this,X).call(this)}requestErrored(e,t){console.error(t),v(this,X).call(this)}requestFinished(e){tt(this.element)}formSubmissionStarted({formElement:e}){et(e,w(this,E,fe).call(this,e))}formSubmissionSucceededWithResponse(e,t){const s=w(this,E,fe).call(this,e.formElement,e.submitter);s.delegate.proposeVisitIfNavigatedWithAction(s,ce(e.submitter,e.formElement,s)),s.delegate.loadResponse(t),e.isSafe||H.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),H.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){tt(e,w(this,E,fe).call(this,e))}allowsImmediateRender({element:e},t){const s=q("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0}),{defaultPrevented:i,detail:{render:o}}=s;return this.view.renderer&&o&&(this.view.renderer.renderElement=o),!i}viewRenderedSnapshot(e,t,s){}preloadOnLoadLinksForView(e){H.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){const s=j.fromElement(e).clone(),{visitCachedSnapshot:i}=e.delegate;e.delegate.fetchResponseLoaded=async o=>{if(e.src){const{statusCode:b,redirected:L}=o,I=await o.responseHTML,B={response:{statusCode:b,redirected:L,responseHTML:I},visitCachedSnapshot:i,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:s};this.action&&(B.action=this.action),H.visit(e.src,B)}}}}changeHistory(){if(this.action){const e=_t(this.action);H.history.update(e,D(this.element.src||""),this.restorationIdentifier)}}async extractForeignFrameElement(e){let t;const s=CSS.escape(this.id);try{if(t=Nt(e.querySelector(`turbo-frame#${s}`),this.sourceURL),t)return t;if(t=Nt(e.querySelector(`turbo-frame[src][recurse~=${s}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(i){return console.error(i),new K}return null}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){w(this,E,Lr).call(this,"src",()=>{this.element.src=e??null})}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||v(this,X).call(this)!==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&&v(this,re)}get rootLocation(){const e=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),t=(e==null?void 0:e.content)??"/";return D(t)}}we=new WeakMap,X=new WeakMap,re=new WeakMap,_e=new WeakMap,ye=new WeakMap,Ee=new WeakMap,E=new WeakSet,ue=async function(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=w(this,E,br).call(this,D(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,M(this,_e,!0))},gr=async function(e,t){const s=await this.extractForeignFrameElement(t.body),i=v(this,Ee)?Ns:At;if(s){const o=new at(s),b=new i(this,this.view.snapshot,o,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(b),this.complete=!0,H.frameRendered(e,this.element),H.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else w(this,E,wr).call(this,e)&&w(this,E,yr).call(this,e)},br=async function(e){var s;const t=new Ue(this,U.get,e,new URLSearchParams,this.element);return(s=v(this,we))==null||s.cancel(),M(this,we,t),new Promise(i=>{M(this,X,()=>{M(this,X,()=>{}),M(this,we,null),i()}),t.perform()})},vr=function(e,t,s){const i=w(this,E,fe).call(this,e,s);i.delegate.proposeVisitIfNavigatedWithAction(i,ce(s,e,i)),w(this,E,Rr).call(this,e,()=>{i.src=t})},Sr=async function(e){console.warn(`The response (${e.statusCode}
20) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await w(this,E,ut).call(this,e.response)},wr=function(e){this.element.setAttribute("complete","");const t=e.response,s=async(o,b)=>{o instanceof Response?w(this,E,ut).call(this,o):H.visit(o,b)};return!q("turbo:frame-missing",{target:this.element,detail:{response:t,visit:s},cancelable:!0}).defaultPrevented},yr=function(e){this.view.missing(),w(this,E,Er).call(this,e)},Er=function(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 Bi(t)},ut=async function(e){const t=new vt(e),s=await t.responseHTML,{location:i,redirected:o,statusCode:b}=t;return H.visit(i,{response:{redirected:o,statusCode:b,responseHTML:s}})},fe=function(e,t){const s=Ze("data-turbo-frame",t,e)||this.element.getAttribute("target");return Bt(s)??this.element},Ar=function(e,t){const s=bt(e,t);return Z(D(s),this.rootLocation)},Qe=function(e,t){const s=Ze("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!w(this,E,Ar).call(this,e,t)||!this.enabled||s=="_top")return!1;if(s){const i=Bt(s);if(i)return!i.disabled}return!(!H.elementIsNavigatable(e)||t&&!H.elementIsNavigatable(t))},Tr=function(e){return v(this,ye).has(e)},Lr=function(e,t){v(this,ye).add(e),t(),v(this,ye).delete(e)},Rr=function(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement};function Bt(r){if(r!=null){const e=document.getElementById(r);if(e instanceof K)return e}}function Nt(r,e){if(r){const t=r.getAttribute("src");if(t!=null&&e!=null&&as(t,e))throw new Error(`Matching <turbo-frame id="${r.id}"> element has a source URL which references itself`);if(r.ownerDocument!==document&&(r=document.importNode(r,!0)),r instanceof K)return r.connectedCallback(),r.disconnectedCallback(),r}}const Cr={after(){this.targetElements.forEach(r=>{var e;return(e=r.parentElement)==null?void 0:e.insertBefore(this.templateContent,r.nextSibling)})},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(r=>r.append(this.templateContent))},before(){this.targetElements.forEach(r=>{var e;return(e=r.parentElement)==null?void 0:e.insertBefore(this.templateContent,r)})},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(r=>r.prepend(this.templateContent))},remove(){this.targetElements.forEach(r=>r.remove())},replace(){const r=this.getAttribute("method");this.targetElements.forEach(e=>{r==="morph"?Tt(e,this.templateContent):e.replaceWith(this.templateContent)})},update(){const r=this.getAttribute("method");this.targetElements.forEach(e=>{r==="morph"?or(e,this.templateContent):(e.innerHTML="",e.append(this.templateContent))})},refresh(){H.refresh(this.baseURI,this.requestId)}};var ae,Ce;const Rt=class Rt extends HTMLElement{constructor(){super(...arguments);C(this,ae)}static async renderElement(t){await t.performAction()}async connectedCallback(){try{await this.render()}catch(t){console.error(t)}finally{this.disconnect()}}async render(){return this.renderPromise??(this.renderPromise=(async()=>{const t=this.beforeRenderEvent;this.dispatchEvent(t)&&(await Pe(),await t.detail.render(this))})())}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(t=>t.remove())}get duplicateChildren(){var i;const t=this.targetElements.flatMap(o=>[...o.children]).filter(o=>!!o.getAttribute("id")),s=[...((i=this.templateContent)==null?void 0:i.children)||[]].filter(o=>!!o.getAttribute("id")).map(o=>o.getAttribute("id"));return t.filter(o=>s.includes(o.getAttribute("id")))}get performAction(){if(this.action){const t=Cr[this.action];if(t)return t;w(this,ae,Ce).call(this,"unknown action")}w(this,ae,Ce).call(this,"action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;w(this,ae,Ce).call(this,"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;w(this,ae,Ce).call(this,"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")}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:Rt.renderElement}})}get targetElementsById(){var s;const t=(s=this.ownerDocument)==null?void 0:s.getElementById(this.target);return t!==null?[t]:[]}get targetElementsByQuery(){var s;const t=(s=this.ownerDocument)==null?void 0:s.querySelectorAll(this.targets);return t.length!==0?Array.prototype.slice.call(t):[]}};ae=new WeakSet,Ce=function(t){throw new Error(`${this.description}: ${t}`)};let ft=Rt;class Oi extends HTMLElement{constructor(){super(...arguments);u(this,"streamSource",null)}connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),mr(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),pr(this.streamSource))}get src(){return this.getAttribute("src")||""}}K.delegateConstructor=Ni;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",K);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",ft);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",Oi);(()=>{let r=document.currentScript;if(r&&!r.hasAttribute("data-turbo-suppress-warning"))for(r=r.parentElement;r;){if(r==document.body)return console.warn(Wt`
21        You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
22
23        Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
24
25        For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements
26
27        ——
28        Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
29      `,r.outerHTML);r=r.parentElement}})();window.Turbo={...Hi,StreamActions:Cr};fr();H.drive=!1;

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.