vendor: 5,373 bytes, line 1
1(()=>{var Qt=Object.create;var gt=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames;var er=Object.getPrototypeOf,tr=Object.prototype.hasOwnProperty;var rr=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var sr=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Zt(e))!tr.call(r,i)&&i!==t&>(r,i,{get:()=>e[i],enumerable:!(s=Gt(e,i))||s.enumerable});return r};var ir=(r,e,t)=>(t=r!=null?Qt(er(r)):{},sr(e||!r||!r.__esModule?gt(t,"default",{value:r,enumerable:!0}):t,r));var $t=rr((de,pt)=>{(function(e,t){typeof de=="object"&&typeof pt=="object"?pt.exports=t():typeof define=="function"&&define.amd?define([],t):typeof de=="object"?de.ClipboardJS=t():e.ClipboardJS=t()})(de,function(){return(function(){var r={686:(function(s,i,n){"use strict";n.d(i,{default:function(){return Jt}});var l=n(279),m=n.n(l),S=n(370),q=n.n(S),k=n(817),B=n.n(k);function d(C){try{return document.execCommand(C)}catch{return!1}}var w=function(b){var g=B()(b);return d("cut"),g},p=w;function T(C){var b=document.documentElement.getAttribute("dir")==="rtl",g=document.createElement("textarea");g.style.fontSize="12pt",g.style.border="0",g.style.padding="0",g.style.margin="0",g.style.position="absolute",g.style[b?"right":"left"]="-9999px";var A=window.pageYOffset||document.documentElement.scrollTop;return g.style.top="".concat(A,"px"),g.setAttribute("readonly",""),g.value=C,g}var P=function(b,g){var A=T(b);g.container.appendChild(A);var L=B()(A);return d("copy"),A.remove(),L},E=function(b){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},A="";return typeof b=="string"?A=P(b,g):b instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(b?.type)?A=P(b.value,g):(A=B()(b),d("copy")),A},c=E;function f(C){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?f=function(g){return typeof g}:f=function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},f(C)}var o=function(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},g=b.action,A=g===void 0?"copy":g,L=b.container,M=b.target,W=b.text;if(A!=="copy"&&A!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(M!==void 0)if(M&&f(M)==="object"&&M.nodeType===1){if(A==="copy"&&M.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(A==="cut"&&(M.hasAttribute("readonly")||M.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(W)return c(W,{container:L});if(M)return A==="cut"?p(M):c(M,{container:L})},a=o;function h(C){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?h=function(g){return typeof g}:h=function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},h(C)}function u(C,b){if(!(C instanceof b))throw new TypeError("Cannot call a class as a function")}function v(C,b){for(var g=0;g<b.length;g++){var A=b[g];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(C,A.key,A)}}function y(C,b,g){return b&&v(C.prototype,b),g&&v(C,g),C}function R(C,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");C.prototype=Object.create(b&&b.prototype,{constructor:{value:C,writable:!0,configurable:!0}}),b&&I(C,b)}function I(C,b){return I=Object.setPrototypeOf||function(A,L){return A.__proto__=L,A},I(C,b)}function _(C){var b=Kt();return function(){var A=me(C),L;if(b){var M=me(this).constructor;L=Reflect.construct(A,arguments,M)}else L=A.apply(this,arguments);return fe(this,L)}}function fe(C,b){return b&&(h(b)==="object"||typeof b=="function")?b:D(C)}function D(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function Kt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function me(C){return me=Object.setPrototypeOf?Object.getPrototypeOf:function(g){return g.__proto__||Object.getPrototypeOf(g)},me(C)}function qe(C,b){var g="data-clipboard-".concat(C);if(b.hasAttribute(g))return b.getAttribute(g)}var Xt=(function(C){R(g,C);var b=_(g);function g(A,L){var M;return u(this,g),M=b.call(this),M.resolveOptions(L),M.listenClick(A),M}return y(g,[{key:"resolveOptions",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof L.action=="function"?L.action:this.defaultAction,this.target=typeof L.target=="function"?L.target:this.defaultTarget,this.text=typeof L.text=="function"?L.text:this.defaultText,this.container=h(L.container)==="object"?L.container:document.body}},{key:"listenClick",value:function(L){var M=this;this.listener=q()(L,"click",function(W){return M.onClick(W)})}},{key:"onClick",value:function(L){var M=L.delegateTarget||L.currentTarget,W=this.action(M)||"copy",pe=a({action:W,container:this.container,target:this.target(M),text:this.text(M)});
1this.emit(pe?"success":"error",{action:W,text:pe,trigger:M,clearSelection:function(){M&&M.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(L){return qe("action",L)}},{key:"defaultTarget",value:function(L){var M=qe("target",L);if(M)return document.querySelector(M)}},{key:"defaultText",value:function(L){return qe("text",L)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(L){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return c(L,M)}},{key:"cut",value:function(L){return p(L)}},{key:"isSupported",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],M=typeof L=="string"?[L]:L,W=!!document.queryCommandSupported;return M.forEach(function(pe){W=W&&!!document.queryCommandSupported(pe)}),W}}]),g})(m()),Jt=Xt}),828:(function(s){var i=9;if(typeof Element<"u"&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}function l(m,S){for(;m&&m.nodeType!==i;){if(typeof m.matches=="function"&&m.matches(S))return m;m=m.parentNode}}s.exports=l}),438:(function(s,i,n){var l=n(828);function m(k,B,d,w,p){var T=q.apply(this,arguments);return k.addEventListener(d,T,p),{destroy:function(){k.removeEventListener(d,T,p)}}}function S(k,B,d,w,p){return typeof k.addEventListener=="function"?m.apply(null,arguments):typeof d=="function"?m.bind(null,document).apply(null,arguments):(typeof k=="string"&&(k=document.querySelectorAll(k)),Array.prototype.map.call(k,function(T){return m(T,B,d,w,p)}))}function q(k,B,d,w){return function(p){p.delegateTarget=l(p.target,B),p.delegateTarget&&w.call(k,p)}}s.exports=S}),879:(function(s,i){i.node=function(n){return n!==void 0&&n instanceof HTMLElement&&n.nodeType===1},i.nodeList=function(n){var l=Object.prototype.toString.call(n);return n!==void 0&&(l==="[object NodeList]"||l==="[object HTMLCollection]")&&"length"in n&&(n.length===0||i.node(n[0]))},i.string=function(n){return typeof n=="string"||n instanceof String},i.fn=function(n){var l=Object.prototype.toString.call(n);return l==="[object Function]"}}),370:(function(s,i,n){var l=n(879),m=n(438);function S(d,w,p){if(!d&&!w&&!p)throw new Error("Missing required arguments");if(!l.string(w))throw new TypeError("Second argument must be a String");if(!l.fn(p))throw new TypeError("Third argument must be a Function");if(l.node(d))return q(d,w,p);if(l.nodeList(d))return k(d,w,p);if(l.string(d))return B(d,w,p);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function q(d,w,p){return d.addEventListener(w,p),{destroy:function(){d.removeEventListener(w,p)}}}function k(d,w,p){return Array.prototype.forEach.call(d,function(T){T.addEventListener(w,p)}),{destroy:function(){Array.prototype.forEach.call(d,function(T){T.removeEventListener(w,p)})}}}function B(d,w,p){return m(document.body,d,w,p)}s.exports=S}),817:(function(s){function i(n){var l;if(n.nodeName==="SELECT")n.focus(),l=n.value;else if(n.nodeName==="INPUT"||n.nodeName==="TEXTAREA"){var m=n.hasAttribute("readonly");m||n.setAttribute("readonly",""),n.select(),n.setSelectionRange(0,n.value.length),m||n.removeAttribute("readonly"),l=n.value}else{n.hasAttribute("contenteditable")&&n.focus();var S=window.getSelection(),q=document.createRange();q.selectNodeContents(n),S.removeAllRanges(),S.addRange(q),l=S.toString()}return l}s.exports=i}),279:(function(s){function i(){}i.prototype={on:function(n,l,m){var S=this.e||(this.e={});return(S[n]||(S[n]=[])).push({fn:l,ctx:m}),this},once:function(n,l,m){var S=this;function q(){S.off(n,q),l.apply(m,arguments)}return q._=l,this.on(n,q,m)},emit:function(n){var l=[].slice.call(arguments,1),m=((this.e||(this.e={}))[n]||[]).slice(),S=0,q=m.length;for(S;S<q;S++)m[S].fn.apply(m[S].ctx,l);return this},off:function(n,l){var m=this.e||(this.e={}),S=m[n],q=[];if(S&&l)for(var k=0,B=S.length;k<B;k++)S[k].fn!==l&&S[k].fn._!==l&&q.push(S[k]);return q.length?m[n]=q:delete m[n],this}},s.exports=i,s.exports.TinyEmitter=i})},e={};function t(s){if(e[s])return e[s].exports;var i=e[s]={exports:{}};return r[s](i,i.exports,t),i.exports}return(function(){t.n=function(s){var i=s&&s.__esModule?function(){return s.default}:function(){return s};return t.d(i,{a:i}),i}})(),(function(){t.d=function(s,i){for(var n in i)t.o(i,n)&&!t.o(s,n)&&Object.defineProperty(s,n,{enumerable:!0,get:i[n]})}})(),(function(){t.o=function(s,i){return Object.prototype.hasOwnProperty.call(s,i)}})(),t(686)})().default})});var Z={eager:"eager",lazy:"lazy"},V=class r extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new r.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(e){e=="loading"?this.delegate.loadingStyleChanged():e=="src"?this.delegate.sourceURLChanged():e=="disabled"&&this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(e){e?this.setAttribute("refresh",e):this.removeAttribute("refresh")}get shouldReloadWithMorph(){return this.src&&this.refresh==="morph"}get loading(){return nr(this.getAttribute("loading")||"")}set loading(e){e?this.setAttribute("loading",e):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(e){e?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){return this.ownerDocument?.documentElement?.hasAttribute("data-turbo-preview")}};function nr(r){return r.toLowerCase()==="lazy"?Z.lazy:Z.eager}var or={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 oe(r){if(r.getAttribute("data-turbo-eval")=="false")return r;{let e=document.createElement("script"),t=Pt();return t&&(e.nonce=t),e.textContent=r.textContent,e.async=!1,ar(e,r),e}}function ar(r,e){for(let{name:t,value:s}of e.attributes)r.setAttribute(t,s)}function cr(r){let e=document.createElement("template");return e.innerHTML=r,e.content}
1function F(r,{target:e,cancelable:t,detail:s}={}){let 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 bt(r){r.preventDefault(),r.stopImmediatePropagation()}function ie(){return document.visibilityState==="hidden"?Tt():At()}function At(){return new Promise(r=>requestAnimationFrame(()=>r()))}function Tt(){return new Promise(r=>setTimeout(()=>r(),0))}function Rt(r=""){return new DOMParser().parseFromString(r,"text/html")}function Lt(r,...e){let t=lr(r,e).replace(/^\n/,"").split(` 2`),s=t[0].match(/^\s+/),i=s?s[0].length:0;return t.map(n=>n.slice(i)).join(` 3`)}function lr(r,e){return r.reduce((t,s,i)=>{let n=e[i]==null?"":e[i];return t+s+n},"")}function $(){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()*16).toString(16)).join("")}function ve(r,...e){for(let t of e.map(s=>s?.getAttribute(r)))if(typeof t=="string")return t;return null}function hr(r,...e){return e.some(t=>t&&t.hasAttribute(r))}function ye(...r){for(let e of r)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function Se(...r){for(let e of r)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function ur(r,e=2e3){return new Promise(t=>{let 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 Ct(r){switch(r){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function dr(r){return r=="advance"||r=="replace"||r=="restore"}function J(...r){let e=ve("data-turbo-action",...r);return dr(e)?e:null}function lt(r){return document.querySelector(`meta[name="${r}"]`)}function we(r){let e=lt(r);return e&&e.content}function Pt(){let r=lt("csp-nonce");if(r){let{nonce:e,content:t}=r;return e==""?t:e}}
3function fr(r,e){let t=lt(r);return t||(t=document.createElement("meta"),t.setAttribute("name",r),document.head.appendChild(t)),t.setAttribute("content",e),t}function te(r,e){if(r instanceof Element)return r.closest(e)||te(r.assignedSlot||r.getRootNode()?.host,e)}function ht(r){return!!r&&r.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof r.focus=="function"}function Mt(r){return Array.from(r.querySelectorAll("[autofocus]")).find(ht)}async function mr(r,e){let t=e();r(),await At();let s=e();return[t,s]}function kt(r){if(r==="_blank")return!1;if(r){for(let e of document.getElementsByName(r))if(e instanceof HTMLIFrameElement)return!1;return!0}else return!0}function It(r){let e=te(r,"a[href], a[xlink\\:href]");if(!e||e.href.startsWith("#")||e.hasAttribute("download"))return null;let t=e.getAttribute("target");return t&&t!=="_self"?null:e}function pr(r,e){let t=null;return(...s)=>{let i=()=>r.apply(this,s);clearTimeout(t),t=setTimeout(i,e)}}var gr={"aria-disabled":{beforeSubmit:r=>{r.setAttribute("aria-disabled","true"),r.addEventListener("click",bt)},afterSubmit:r=>{r.removeAttribute("aria-disabled"),r.removeEventListener("click",bt)}},disabled:{beforeSubmit:r=>r.disabled=!0,afterSubmit:r=>r.disabled=!1}},Fe=class{#e=null;constructor(e){Object.assign(this,e)}get submitter(){return this.#e}set submitter(e){this.#e=gr[e]||e}},br=new Fe({mode:"on",submitter:"disabled"}),N={drive:or,forms:br};function O(r){return new URL(r.toString(),document.baseURI)}function ne(r){let e;if(r.hash)return r.hash.slice(1);if(e=r.href.match(/#(.*)$/))return e[1]}function ut(r,e){let t=e?.getAttribute("formaction")||r.getAttribute("action")||r.action;return O(t)}function vr(r){return(Er(r).match(/\.[^.]*$/)||[])[0]||""}function yr(r,e){let t=vt(e.origin+e.pathname);return vt(r.href)===t||r.href.startsWith(t)}function z(r,e){return yr(r,e)&&!N.drive.unvisitableExtensions.has(vr(r))}function qt(r){return O(r.getAttribute("href")||"")}function Sr(r){let e=ne(r);return e!=null?r.href.slice(0,-(e.length+1)):r.href}function be(r){return Sr(r)}function Ft(r,e){return O(r).href==O(e).href}function wr(r){return r.pathname.split("/").slice(1)}function Er(r){return wr(r).slice(-1)[0]}function vt(r){return r.endsWith("/")?r:r+"/"}var ae=class{constructor(e){this.response=e}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return O(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)}},He=class extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){let s=this.values().next().value;this.delete(s)}super.add(e)}},Ht=new He(20);function Bt(r,e={}){let t=new Headers(e.headers||{}),s=$();return Ht.add(s),t.append("X-Turbo-Request-Id",s),window.fetch(r,{...e,headers:t})}function dt(r){switch(r.toLowerCase()){case"get":return x.get;case"post":return x.post;case"put":return x.put;case"patch":return x.patch;case"delete":return x.delete}}var x={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function Ar(r){switch(r.toLowerCase()){case X.multipart:return X.multipart;case X.plain:return X.plain;default:return X.urlEncoded}}var X={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"},Q=class{abortController=new AbortController;#e=e=>{};constructor(e,t,s,i=new URLSearchParams,n=null,l=X.urlEncoded){let[m,S]=yt(O(s),t,i,l);this.delegate=e,this.url=m,this.target=n,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t.toUpperCase(),headers:{...this.defaultHeaders}
3,body:S,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=l}get method(){return this.fetchOptions.method}set method(e){let t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,s=dt(e)||x.get;this.url.search="";let[i,n]=yt(this.url,s,t,this.enctype);this.url=i,this.fetchOptions.body=n,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(){let{fetchOptions:e}=this;this.delegate.prepareRequest(this);let t=await this.#t(e);try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=Bt(this.url.href,e);let s=await this.response;return await this.receive(s)}catch(s){if(s.name!=="AbortError")throw this.#r(s)&&this.delegate.requestErrored(this,s),s}finally{this.delegate.requestFinished(this)}}async receive(e){let t=new ae(e);return F("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 ft(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#t(e){let t=new Promise(i=>this.#e=i),s=F("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#e},target:this.target});return this.url=s.detail.url,s.defaultPrevented&&await t,s}#r(e){return!F("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}};function ft(r){return dt(r)==x.get}function yt(r,e,t,s){let i=Array.from(t).length>0?new URLSearchParams(Nt(t)):r.searchParams;return ft(e)?[Tr(r,i),null]:s==X.urlEncoded?[r,i]:[r,t]}function Nt(r){let e=[];for(let[t,s]of r)s instanceof File||e.push([t,s]);return e}function Tr(r,e){let t=new URLSearchParams(Nt(e));return r.search=t.toString(),r}var Be=class{started=!1;constructor(e,t){this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}intersect=e=>{e.slice(-1)[0]?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)}},Y=class{static contentType="text/vnd.turbo-stream.html";static wrap(e){return typeof e=="string"?new this(cr(e)):e}constructor(e){this.fragment=Rr(e)}};function Rr(r){for(let e of r.querySelectorAll("turbo-stream")){let t=document.importNode(e,!0);for(let s of t.templateElement.content.querySelectorAll("script"))s.replaceWith(oe(s));e.replaceWith(t)}return r}var Lr=r=>r,Ee=class{keys=[];entries={};#e;constructor(e,t=Lr){this.size=e,this.#e=t}has(e){return this.#e(e)in this.entries}get(e){if(this.has(e)){let t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){for(let e of Object.keys(this.entries))this.evict(e)}read(e){return this.entries[this.#e(e)]}write(e,t){this.entries[this.#e(e)]=t}touch(e){e=this.#e(e);let t=this.keys.indexOf(e);t>-1&&this.keys.splice(t,1),this.keys.unshift(e),this.trim()}trim(){for(let e of this.keys.splice(this.size))this.evict(e)}evict(e){delete this.entries[e]}},Cr=100,Ne=class extends Ee{#e=null;#t={};constructor(e=1,t=Cr){super(e,be),this.prefetchDelay=t}putLater(e,t,s){this.#e=setTimeout(()=>{t.perform(),this.put(e,t,s),this.#e=null},this.prefetchDelay)}put(e,t,s=Ot){super.put(e,t),this.#t[be(e)]=new Date(new Date().getTime()+s)}clear(){super.clear(),this.#e&&clearTimeout(this.#e)}evict(e){super.evict(e),delete this.#t[e]}has(e){if(super.has(e)){let t=this.#t[be(e)];return t&&t>Date.now()}else return!1}},Ot=10*1e3,ee=new Ne,G={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"},Ae=class r{state=G.initialized;static confirmMethod(e){return Promise.resolve(confirm(e))}constructor(e,t,s,i=!1){let n=Fr(t,s),l=qr(Ir(t,s),n),m=Pr(t,s),S=Hr(t,s);this.delegate=e,this.formElement=t,this.submitter=s,this.fetchRequest=new Q(this,n,l,m,t,S),this.mustRedirect=i}get method(){return this.fetchRequest.method}set method(e){this.fetchRequest.method=e}get action(){return this.fetchRequest.url.toString()}set action(e){this.fetchRequest.url=O(e)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){let{initialized:e,requesting:t}=G,s=ve("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof s=="string"&&!await(typeof N.forms.confirm=="function"?N.forms.confirm:r.confirmMethod)(s,this.formElement,this.submitter))&&this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:t}=G;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){let t=Mr(we("csrf-param"))||we("
3csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(Y.contentType)}requestStarted(e){this.state=G.waiting,this.submitter&&N.forms.submitter.beforeSubmit(this.submitter),this.setSubmitsWith(),ye(this.formElement),F("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){ee.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(ee.clear(),this.requestMustRedirect(e)&&kr(t)){let s=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,s)}else this.state=G.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=G.stopped,this.submitter&&N.forms.submitter.afterSubmit(this.submitter),this.resetSubmitterText(),Se(this.formElement),F("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(!(!this.submitter||!this.submitsWith)){if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){let e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}}resetSubmitterText(){if(!(!this.submitter||!this.originalSubmitText)){if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){let e=this.submitter;e.value=this.originalSubmitText}}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||hr("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}};function Pr(r,e){let t=new FormData(r),s=e?.getAttribute("name"),i=e?.getAttribute("value");return s&&t.append(s,i||""),t}function Mr(r){if(r!=null){let t=(document.cookie?document.cookie.split("; "):[]).find(s=>s.startsWith(r));if(t){let s=t.split("=").slice(1).join("=");return s?decodeURIComponent(s):void 0}}}function kr(r){return r.statusCode==200&&!r.redirected}function Ir(r,e){let t=typeof r.action=="string"?r.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":r.getAttribute("action")||t||""}function qr(r,e){let t=O(r);return ft(e)&&(t.search=""),t}function Fr(r,e){let t=e?.getAttribute("formmethod")||r.getAttribute("method")||"";return dt(t.toLowerCase())||x.get}function Hr(r,e){return Ar(e?.getAttribute("formenctype")||r.enctype)}var se=class{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return this.getElementForAnchor(e)!=null}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return Mt(this.element)}get permanentElements(){return xt(this.element)}getPermanentElementById(e){return Dt(this.element,e)}getPermanentElementMapForSnapshot(e){let t={};for(let s of this.permanentElements){let{id:i}=s,n=e.getPermanentElementById(i);n&&(t[i]=[s,n])}return t}};function Dt(r,e){return r.querySelector(`#${e}[data-turbo-permanent]`)}function xt(r){return r.querySelectorAll("[id][data-turbo-permanent]")}var ce=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)};submitBubbled=e=>{if(!e.defaultPrevented){let t=e.target instanceof HTMLFormElement?e.target:void 0,s=e.submitter||void 0;t&&Br(t,s)&&Nr(t,s)&&this.delegate.willSubmitForm(t,s)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,s))}}};function Br(r,e){return(e?.getAttribute("formmethod")||r.getAttribute("method"))!="dialog"}function Nr(r,e){let t=e?.getAttribute("formtarget")||r.getAttribute("target");return kt(t)}var Te=class{#e=e=>{};#t=e=>{};constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){let t=this.snapshot.getElementForAnchor(e);t?(this.focusElement(t),this.scrollToElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(ne(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}
3async render(e){let{isPreview:t,shouldRender:s,willRender:i,newSnapshot:n}=e,l=i;if(s)try{this.renderPromise=new Promise(k=>this.#e=k),this.renderer=e,await this.prepareToRenderSnapshot(e);let m=new Promise(k=>this.#t=k),S={resume:this.#t,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(n,S)||await m,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(n,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#e(void 0),delete this.renderPromise}else l&&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()}},Oe=class extends Te{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new se(this.element)}},Re=class{constructor(e,t){this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}clickBubbled=e=>{this.clickEventIsSignificant(e)?this.clickEvent=e:delete this.clickEvent};linkClicked=e=>{this.clickEvent&&this.clickEventIsSignificant(e)&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url,e.detail.originalEvent)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.detail.url,e.detail.originalEvent)),delete this.clickEvent};willVisit=e=>{delete this.clickEvent};clickEventIsSignificant(e){let t=e.composed?e.target?.parentElement:e.target,s=It(t)||t;return s instanceof Element&&s.closest("turbo-frame, html")==this.element}},Le=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)};clickBubbled=e=>{if(e instanceof MouseEvent&&this.clickEventIsSignificant(e)){let t=e.composedPath&&e.composedPath()[0]||e.target,s=It(t);if(s&&kt(s.target)){let i=qt(s);this.delegate.willFollowLinkToLocation(s,i,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(s,i))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}},Ce=class{constructor(e,t){this.delegate=e,this.linkInterceptor=new Le(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){let s=document.createElement("form"),i="hidden";for(let[B,d]of t.searchParams)s.append(Object.assign(document.createElement("input"),{type:i,name:B,value:d}));let n=Object.assign(t,{search:""});s.setAttribute("data-turbo","true"),s.setAttribute("action",n.href),s.setAttribute("hidden","");let l=e.getAttribute("data-turbo-method");l&&s.setAttribute("method",l);let m=e.getAttribute("data-turbo-frame");m&&s.setAttribute("data-turbo-frame",m);let S=J(e);S&&s.setAttribute("data-turbo-action",S);let q=e.getAttribute("data-turbo-confirm");q&&s.setAttribute("data-turbo-confirm",q),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())}},Pe=class{static async preservingPermanentElements(e,t,s){let i=new this(e,t);i.enter(),await s(),i.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(let e in this.permanentElementMap){let[t,s]=this.permanentElementMap[e];this.delegate.enteringBardo(t,s),this.replaceNewPermanentElementWithPlaceholder(s)}}leave(){for(let e in this.permanentElementMap){let[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){let t=Or(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){let t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){this.getPlaceholderById(e.id)?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}};function Or(r){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",r.id),e}var le=class{#e=null;static renderElement(e,t){}
3constructor(e,t,s,i=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=s,this.willRender=i,this.renderElement=this.constructor.renderElement,this.promise=new Promise((n,l)=>this.resolvingFunctions={resolve:n,reject:l})}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 Pe.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){if(this.shouldAutofocus){let e=this.connectedSnapshot.firstAutofocusableElement;e&&e.focus()}}enteringBardo(e){this.#e||e.contains(this.currentSnapshot.activeElement)&&(this.#e=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.#e)&&this.#e instanceof HTMLElement&&(this.#e.focus(),this.#e=null)}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get renderMethod(){return"replace"}},he=class extends le{static renderElement(e,t){let s=document.createRange();s.selectNodeContents(e),s.deleteContents();let i=t,n=i.ownerDocument?.createRange();n&&(n.selectNodeContents(i),e.appendChild(n.extractContents()))}constructor(e,t,s,i,n,l=!0){super(t,s,i,n,l),this.delegate=e}get shouldRender(){return!0}async render(){await ie(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await ie(),this.focusFirstAutofocusableElement(),await ie(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){let e=this.currentElement.firstElementChild,t=Dr(this.currentElement.getAttribute("data-autoscroll-block"),"end"),s=xr(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:t,behavior:s}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let t=oe(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function Dr(r,e){return r=="end"||r=="start"||r=="center"||r=="nearest"?r:e}function xr(r,e){return r=="auto"||r=="smooth"?r:e}var Vr=(function(){let r=()=>{},e={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:r,afterNodeAdded:r,beforeNodeMorphed:r,afterNodeMorphed:r,beforeNodeRemoved:r,afterNodeRemoved:r,beforeAttributeUpdated:r},head:{style:"merge",shouldPreserve:d=>d.getAttribute("im-preserve")==="true",shouldReAppend:d=>d.getAttribute("im-re-append")==="true",shouldRemove:r,afterHeadMorphed:r},restoreFocus:!0};function t(d,w,p={}){d=k(d);let T=B(w),P=q(d,T,p),E=i(P,()=>m(P,d,T,c=>c.morphStyle==="innerHTML"?(n(c,d,T),Array.from(d.childNodes)):s(c,d,T)));return P.pantry.remove(),E}function s(d,w,p){let T=B(w);return n(d,T,p,w,w.nextSibling),Array.from(T.childNodes)}function i(d,w){if(!d.config.restoreFocus)return w();let p=document.activeElement;if(!(p instanceof HTMLInputElement||p instanceof HTMLTextAreaElement))return w();let{id:T,selectionStart:P,selectionEnd:E}=p,c=w();return T&&T!==document.activeElement?.getAttribute("id")&&(p=d.target.querySelector(`[id="${T}"]`),p?.focus()),p&&!p.selectionEnd&&E&&p.setSelectionRange(P,E),c}let n=(function(){function d(o,a,h,u=null,v=null){a instanceof HTMLTemplateElement&&h instanceof HTMLTemplateElement&&(a=a.content,h=h.content),u||=a.firstChild;for(let y of h.childNodes){if(u&&u!=v){let I=p(o,y,u,v);if(I){I!==u&&P(o,u,I),l(I,y,o),u=I.nextSibling;continue}}if(y instanceof Element){let I=y.getAttribute("id");if(o.persistentIds.has(I)){let _=E(a,I,u,o);l(_,y,o),u=_.nextSibling;continue}}let R=w(a,y,u,o);R&&(u=R.nextSibling)}for(;u&&u!=v;){let y=u;u=u.nextSibling,T(o,y)}}function w(o,a,h,u){if(u.callbacks.beforeNodeAdded(a)===!1)return null;
3if(u.idMap.has(a)){let v=document.createElement(a.tagName);return o.insertBefore(v,h),l(v,a,u),u.callbacks.afterNodeAdded(v),v}else{let v=document.importNode(a,!0);return o.insertBefore(v,h),u.callbacks.afterNodeAdded(v),v}}let p=(function(){function o(u,v,y,R){let I=null,_=v.nextSibling,fe=0,D=y;for(;D&&D!=R;){if(h(D,v)){if(a(u,D,v))return D;I===null&&(u.idMap.has(D)||(I=D))}if(I===null&&_&&h(D,_)&&(fe++,_=_.nextSibling,fe>=2&&(I=void 0)),u.activeElementAndParents.includes(D))break;D=D.nextSibling}return I||null}function a(u,v,y){let R=u.idMap.get(v),I=u.idMap.get(y);if(!I||!R)return!1;for(let _ of R)if(I.has(_))return!0;return!1}function h(u,v){let y=u,R=v;return y.nodeType===R.nodeType&&y.tagName===R.tagName&&(!y.getAttribute?.("id")||y.getAttribute?.("id")===R.getAttribute?.("id"))}return o})();function T(o,a){if(o.idMap.has(a))f(o.pantry,a,null);else{if(o.callbacks.beforeNodeRemoved(a)===!1)return;a.parentNode?.removeChild(a),o.callbacks.afterNodeRemoved(a)}}function P(o,a,h){let u=a;for(;u&&u!==h;){let v=u;u=u.nextSibling,T(o,v)}return u}function E(o,a,h,u){let v=u.target.getAttribute?.("id")===a&&u.target||u.target.querySelector(`[id="${a}"]`)||u.pantry.querySelector(`[id="${a}"]`);return c(v,u),f(o,v,h),v}function c(o,a){let h=o.getAttribute("id");for(;o=o.parentNode;){let u=a.idMap.get(o);u&&(u.delete(h),u.size||a.idMap.delete(o))}}function f(o,a,h){if(o.moveBefore)try{o.moveBefore(a,h)}catch{o.insertBefore(a,h)}else o.insertBefore(a,h)}return d})(),l=(function(){function d(c,f,o){return o.ignoreActive&&c===document.activeElement?null:(o.callbacks.beforeNodeMorphed(c,f)===!1||(c instanceof HTMLHeadElement&&o.head.ignore||(c instanceof HTMLHeadElement&&o.head.style!=="morph"?S(c,f,o):(w(c,f,o),E(c,o)||n(o,c,f))),o.callbacks.afterNodeMorphed(c,f)),c)}function w(c,f,o){let a=f.nodeType;if(a===1){let h=c,u=f,v=h.attributes,y=u.attributes;for(let R of y)P(R.name,h,"update",o)||h.getAttribute(R.name)!==R.value&&h.setAttribute(R.name,R.value);for(let R=v.length-1;0<=R;R--){let I=v[R];if(I&&!u.hasAttribute(I.name)){if(P(I.name,h,"remove",o))continue;h.removeAttribute(I.name)}}E(h,o)||p(h,u,o)}(a===8||a===3)&&c.nodeValue!==f.nodeValue&&(c.nodeValue=f.nodeValue)}function p(c,f,o){if(c instanceof HTMLInputElement&&f instanceof HTMLInputElement&&f.type!=="file"){let a=f.value,h=c.value;T(c,f,"checked",o),T(c,f,"disabled",o),f.hasAttribute("value")?h!==a&&(P("value",c,"update",o)||(c.setAttribute("value",a),c.value=a)):P("value",c,"remove",o)||(c.value="",c.removeAttribute("value"))}else if(c instanceof HTMLOptionElement&&f instanceof HTMLOptionElement)T(c,f,"selected",o);else if(c instanceof HTMLTextAreaElement&&f instanceof HTMLTextAreaElement){let a=f.value,h=c.value;if(P("value",c,"update",o))return;a!==h&&(c.value=a),c.firstChild&&c.firstChild.nodeValue!==a&&(c.firstChild.nodeValue=a)}}function T(c,f,o,a){let h=f[o],u=c[o];if(h!==u){let v=P(o,c,"update",a);v||(c[o]=f[o]),h?v||c.setAttribute(o,""):P(o,c,"remove",a)||c.removeAttribute(o)}}function P(c,f,o,a){return c==="value"&&a.ignoreActiveValue&&f===document.activeElement?!0:a.callbacks.beforeAttributeUpdated(c,f,o)===!1}function E(c,f){return!!f.ignoreActiveValue&&c===document.activeElement&&c!==document.body}return d})();function m(d,w,p,T){if(d.head.block){let P=w.querySelector("head"),E=p.querySelector("head");if(P&&E){let c=S(P,E,d);return Promise.all(c).then(()=>{let f=Object.assign(d,{head:{block:!1,ignore:!0}});return T(f)})}}return T(d)}function S(d,w,p){let T=[],P=[],E=[],c=[],f=new Map;for(let a of w.children)f.set(a.outerHTML,a);for(let a of d.children){let h=f.has(a.outerHTML),u=p.head.shouldReAppend(a),v=p.head.shouldPreserve(a);h||v?u?P.push(a):(f.delete(a.outerHTML),E.push(a)):p.head.style==="append"?u&&(P.push(a),c.push(a)):p.head.shouldRemove(a)!==!1&&P.push(a)}c.push(...f.values());let o=[];for(let a of c){let h=document.createRange().createContextualFragment(a.outerHTML).firstChild;if(p.callbacks.beforeNodeAdded(h)!==!1){if("href"in h&&h.href||"src"in h&&h.src){let u,v=new Promise(function(y){u=y});h.addEventListener("load",function(){u()}),o.push(v)}d.appendChild(h),p.callbacks.afterNodeAdded(h),T.push(h)}}for(let a of P)p.callbacks.beforeNodeRemoved(a)!==!1&&(d.removeChild(a),p.callbacks.afterNodeRemoved(a));return p.head.afterHeadMorphed(d,{added:T,kept:E,removed:P}),o}let q=(function(){function d(o,a,h){let{persistentIds:u,idMap:v}=c(o,a),y=w(h),R=y.morphStyle||"outerHTML";if(!["innerHTML","outerHTML"].includes(R))throw`Do not understand how to morph style ${R}`;return{target:o,newContent:a,config:y,morphStyle:R,ignoreActive:y.ignoreActive,ignoreActiveValue:y.ignoreActiveValue,restoreFocus:y.restoreFocus,idMap:v,persistentIds:u,pantry:p(),activeElementAndParents:T(o),callbacks:y.callbacks,head:y.head}}function w(o){let a=Object.assign({},e);return Object.assign(a,o),a.callbacks=Object.assign({},e.callbacks,o.callbacks),a.head=Object.assign({},e.head,o.head),a}function p(){let o=document.createElement("div");return o.hidden=!0,document.body.insertAdjacentElement("afterend",o),o}function T(o){let a=[],h=document.activeElement;if(h?.tagName!=="BODY"&&o.contains(h))for(;h&&(a.push(h),h!==o);)h=h.parentElement;return a}function P(o){let a=Array.from(o.querySelectorAll("[id]"));return o.getAttribute?.("id")&&a.push(o),a}function E(o,a,h,u){for(let v of u){let y=v.getAttribute("id");if(a.has(y)){let R=v;for(;R;){let I=o.get(R);
3if(I==null&&(I=new Set,o.set(R,I)),I.add(y),R===h)break;R=R.parentElement}}}}function c(o,a){let h=P(o),u=P(a),v=f(h,u),y=new Map;E(y,v,o,h);let R=a.__idiomorphRoot||a;return E(y,v,R,u),{persistentIds:v,idMap:y}}function f(o,a){let h=new Set,u=new Map;for(let{id:y,tagName:R}of o)u.has(y)?h.add(y):u.set(y,R);let v=new Set;for(let{id:y,tagName:R}of a)v.has(y)?h.add(y):u.get(y)===R&&v.add(y);for(let y of h)v.delete(y);return v}return d})(),{normalizeElement:k,normalizeParent:B}=(function(){let d=new WeakSet;function w(E){return E instanceof Document?E.documentElement:E}function p(E){if(E==null)return document.createElement("div");if(typeof E=="string")return p(P(E));if(d.has(E))return E;if(E instanceof Node){if(E.parentNode)return new T(E);{let c=document.createElement("div");return c.append(E),c}}else{let c=document.createElement("div");for(let f of[...E])c.append(f);return c}}class T{constructor(c){this.originalNode=c,this.realParentNode=c.parentNode,this.previousSibling=c.previousSibling,this.nextSibling=c.nextSibling}get childNodes(){let c=[],f=this.previousSibling?this.previousSibling.nextSibling:this.realParentNode.firstChild;for(;f&&f!=this.nextSibling;)c.push(f),f=f.nextSibling;return c}querySelectorAll(c){return this.childNodes.reduce((f,o)=>{if(o instanceof Element){o.matches(c)&&f.push(o);let a=o.querySelectorAll(c);for(let h=0;h<a.length;h++)f.push(a[h])}return f},[])}insertBefore(c,f){return this.realParentNode.insertBefore(c,f)}moveBefore(c,f){return this.realParentNode.moveBefore(c,f)}get __idiomorphRoot(){return this.originalNode}}function P(E){let c=new DOMParser,f=E.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(f.match(/<\/html>/)||f.match(/<\/head>/)||f.match(/<\/body>/)){let o=c.parseFromString(E,"text/html");if(f.match(/<\/html>/))return d.add(o),o;{let a=o.firstChild;return a&&d.add(a),a}}else{let a=c.parseFromString("<body><template>"+E+"</template></body>","text/html").body.querySelector("template").content;return d.add(a),a}}return{normalizeElement:w,normalizeParent:p}})();return{morph:t,defaults:e}})();function Ie(r,e,{callbacks:t,...s}={}){Vr.morph(r,e,{...s,callbacks:new De(t)})}function mt(r,e,t={}){Ie(r,e.childNodes,{...t,morphStyle:"innerHTML"})}function Vt(r,e){return r instanceof V&&r.shouldReloadWithMorph&&(!e||_r(r,e))&&!r.closest("[data-turbo-permanent]")}function _r(r,e){return e instanceof Element&&e.nodeName==="TURBO-FRAME"&&r.id===e.id&&(!e.getAttribute("src")||Ft(r.src,e.getAttribute("src")))}function _t(r){return r.parentElement.closest("turbo-frame[src][refresh=morph]")}var De=class{#e;constructor({beforeNodeMorphed:e}={}){this.#e=e||(()=>!0)}beforeNodeAdded=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));beforeNodeMorphed=(e,t)=>{if(e instanceof Element)return!e.hasAttribute("data-turbo-permanent")&&this.#e(e,t)?!F("turbo:before-morph-element",{cancelable:!0,target:e,detail:{currentElement:e,newElement:t}}).defaultPrevented:!1};beforeAttributeUpdated=(e,t,s)=>!F("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:s}}).defaultPrevented;beforeNodeRemoved=e=>this.beforeNodeMorphed(e);afterNodeMorphed=(e,t)=>{e instanceof Element&&F("turbo:morph-element",{target:e,detail:{currentElement:e,newElement:t}})}},Me=class extends he{static renderElement(e,t){F("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),mt(e,t,{callbacks:{beforeNodeMorphed:(s,i)=>Vt(s,i)&&_t(s)===e?(s.reload(),!1):!0}})}async preservingPermanentElements(e){return await e()}},xe=class r{static animationDuration=300;static get defaultCSS(){return Lt` 4 .turbo-progress-bar { 5 position: fixed; 6 display: block; 7 top: 0; 8 left: 0; 9 height: 3px; 10 background: #0076ff; 11 z-index: 2147483647; 12 transition: 13 width ${r.animationDuration}ms ease-out, 14 opacity ${r.animationDuration/2}ms ${r.animationDuration/2}ms ease-in; 15 transform: translate3d(0, 0, 0); 16 } 17 `}hiding=!1;value=0;visible=!1;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,r.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,r.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}trickle=()=>{this.setValue(this.value+Math.random()/100)};refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){let e=document.createElement("style");e.type="text/css",e.textContent=r.defaultCSS;let t=Pt();return t&&(e.nonce=t),e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}},Ve=class extends se{detailsByOuterHTML=this.children.filter(e=>!zr(e)).map(e=>Kr(e)).reduce((e,t)=>
17{let{outerHTML:s}=t,i=s in e?e[s]:{type:Wr(t),tracked:Ur(t),elements:[]};return{...e,[s]:{...i,elements:[...i.elements,t]}}},{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter(s=>!(s in t.detailsByOuterHTML)).map(s=>this.detailsByOuterHTML[s]).filter(({type:s})=>s==e).map(({elements:[s]})=>s)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:s,tracked:i,elements:n}=this.detailsByOuterHTML[t];return s==null&&!i?[...e,...n]:n.length>1?[...e,...n.slice(1)]:e},[])}getMetaValue(e){let t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,s)=>{let{elements:[i]}=this.detailsByOuterHTML[s];return Yr(i,e)?i:t},void 0|void 0)}};function Wr(r){if(jr(r))return"script";if($r(r))return"stylesheet"}function Ur(r){return r.getAttribute("data-turbo-track")=="reload"}function jr(r){return r.localName=="script"}function zr(r){return r.localName=="noscript"}function $r(r){let e=r.localName;return e=="style"||e=="link"&&r.getAttribute("rel")=="stylesheet"}function Yr(r,e){return r.localName=="meta"&&r.getAttribute("name")==e}function Kr(r){return r.hasAttribute("nonce")&&r.setAttribute("nonce",""),r}var U=class r extends se{static fromHTMLString(e=""){return this.fromDocument(Rt(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:s}){return new this(e,t,new Ve(s))}constructor(e,t,s){super(t),this.documentElement=e,this.headSnapshot=s}clone(){let e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),s=e.querySelectorAll("select");for(let[i,n]of t.entries()){let l=s[i];for(let m of l.selectedOptions)m.selected=!1;for(let m of n.selectedOptions)l.options[m.index].selected=!0}for(let i of e.querySelectorAll('input[type="password"]'))i.value="";for(let i of e.querySelectorAll("noscript"))i.remove();return new r(this.documentElement,e,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get dir(){return this.documentElement.getAttribute("dir")}get headElement(){return this.headSnapshot.element}get rootLocation(){let e=this.getSetting("root")??"/";return O(e)}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}get prefersViewTransitions(){return(this.getSetting("view-transition")==="true"||this.headSnapshot.getMetaValue("view-transition")==="same-origin")&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches}get refreshMethod(){return this.getSetting("refresh-method")}get refreshScroll(){return this.getSetting("refresh-scroll")}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},_e=class{#e=!1;#t=Promise.resolve();renderChange(e,t){return e&&this.viewTransitionsAvailable&&!this.#e?(this.#e=!0,this.#t=this.#t.then(async()=>{await document.startViewTransition(t).finished})):this.#t=this.#t.then(t),this.#t}get viewTransitionsAvailable(){return document.startViewTransition}},Xr={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1,refresh:{}},ge={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},j={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},re={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},Jr={advance:"forward",restore:"back",replace:"none"},We=class{identifier=$();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=j.initialized;viewTransitioner=new _e;constructor(e,t,s,i={}){this.delegate=e,this.location=t,this.restorationIdentifier=s||$();let{action:n,historyChanged:l,referrer:m,snapshot:S,snapshotHTML:q,response:k,visitCachedSnapshot:B,willRender:d,updateHistory:w,shouldCacheSnapshot:p,acceptsStreamResponse:T,direction:P,refresh:E}={...Xr,...i};this.action=n,this.historyChanged=l,this.referrer=m,this.snapshot=S,this.snapshotHTML=q,this.response=k,this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=B,this.willRender=d,this.updateHistory=w,this.scrolled=!d,this.shouldCacheSnapshot=p,this.acceptsStreamResponse=T,this.direction=P||Jr[n],this.refresh=E}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)}start(){this.state==j.initialized&&(this.recordTimingMetric(ge.visitStart),this.state=j.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==j.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=j.canceled)}complete(){this.state==j.started&&(this.recordTimingMetric(ge.visitEnd),this.adapter.visitCompleted(this),this.state=j.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==j.started&&(this.state=j.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){let e=this.location.href===this.referrer?.href?"replace":this.action,t=Ct(e);this.history.update(t,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new Q(this,x.get,this.location),this.request.perform())}
17simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(ge.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;St(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(ge.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,St(e)&&t!=null){let s=U.fromHTMLString(t);await this.renderPageSnapshot(s,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(U.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!ne(this.location)||e.hasAnchor(ne(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return U.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){let e=this.getCachedSnapshot();if(e){let t=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(e,t),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&this.response?.redirected&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(Y.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let s=await t.responseHTML,{redirected:i,statusCode:n}=t;s==null?this.recordResponse({statusCode:re.contentTypeMismatch,redirected:i}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:n,responseHTML:s,redirected:i}))}async requestFailedWithResponse(e,t){let s=await t.responseHTML,{redirected:i,statusCode:n}=t;s==null?this.recordResponse({statusCode:re.contentTypeMismatch,redirected:i}):this.recordResponse({statusCode:n,responseHTML:s,redirected:i})}requestErrored(e,t){this.recordResponse({statusCode:re.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.scrolled=!0)}scrollToRestoredPosition(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=ne(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.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 St(r){return r>=200&&r<300}var Ue=class{progressBar=new xe;constructor(e){this.session=e}visitProposedToLocation(e,t){z(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||$(),t):window.location.href=e.toString()}visitStarted(e){this.location=e.location,this.redirectedToLocation=null,e.loadCachedSnapshot(),e.issueRequest()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||e.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse(),e.response.redirected&&(this.redirectedToLocation=e.redirectedToLocation)}visitRequestFailedWithStatusCode(e,t){switch(t){case re.networkFailure:case re.timeoutFailure:case re.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}
17formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){this.formProgressBarTimeout==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}showProgressBar=()=>{this.progressBar.show()};reload(e){F("turbo:reload",{detail:e}),window.location.href=(this.redirectedToLocation||this.location)?.toString()||window.location.href}get navigator(){return this.session.navigator}},je=class{selector="[data-turbo-temporary]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=e=>{for(let t of this.temporaryElements)t.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector)]}},ze=class{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new Re(this,t),this.formSubmitObserver=new ce(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,s){return this.#t(e)}linkClickIntercepted(e,t,s){let i=this.#r(e);i&&i.delegate.linkClickIntercepted(e,t,s)}willSubmitForm(e,t){return e.closest("turbo-frame")==null&&this.#e(e,t)&&this.#t(e,t)}formSubmitted(e,t){let s=this.#r(e,t);s&&s.delegate.formSubmitted(e,t)}#e(e,t){let s=ut(e,t),i=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),n=O(i?.content??"/");return this.#t(e,t)&&z(s,n)}#t(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){let i=this.#r(e,t);return i?i!=e.closest("turbo-frame"):!1}else return!1}#r(e,t){let s=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(s&&s!="_top"){let i=this.element.querySelector(`#${s}:not([disabled])`);if(i instanceof V)return i}}},$e=class{location;restorationIdentifier=$();restorationData={};started=!1;currentIndex=0;constructor(e){this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),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=$()){e===history.pushState&&++this.currentIndex;let 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){let{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)}onPopState=e=>{let{turbo:t}=e.state||{};if(this.location=new URL(window.location.href),t){let{restorationIdentifier:s,restorationIndex:i}=t;this.restorationIdentifier=s;let n=i>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,s,n),this.currentIndex=i}else this.currentIndex++,this.delegate.historyPoppedWithEmptyState(this.location)}},Ye=class{started=!1;#e=null;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.readyState==="loading"?this.eventTarget.addEventListener("DOMContentLoaded",this.#t,{once:!0}):this.#t())}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",this.#r,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#o,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#i,!0),this.started=!1)}#t=()=>{this.eventTarget.addEventListener("mouseenter",this.#r,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#o,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#i,!0),this.started=!0};#r=e=>{if(we("turbo-prefetch")==="false")return;let t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&this.#c(t)){let i=t,n=qt(i);if(this.delegate.canPrefetchRequestToLocation(i,n)){this.#e=i;let l=new Q(this,x.get,n,new URLSearchParams,t);l.fetchOptions.priority="low",ee.putLater(n,l,this.#s)}}};#o=e=>{e.target===this.#e&&this.#a()};#a=()=>{ee.clear(),this.#e=null};#i=e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="GET"){let t=ee.get(e.detail.url);t&&(e.detail.fetchRequest=t),ee.clear()}};prepareRequest(e){let t=e.target;e.headers["X-Sec-Purpose"]="prefetch";let s=t.closest("turbo-frame"),i=t.getAttribute("data-turbo-frame")||s?.getAttribute("target")||s?.id;i&&i!=="_top"&&(e.headers["Turbo-Frame"]=i)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#s(){return Number(we("turbo-prefetch-cache-time"))||Ot}#c(e){return!(!e.getAttribute("href")||Qr(e)||Gr(e)||Zr(e)||es(e)||rs(e))}},Qr=r=>r.origin!==document.location.origin||!["http:","https:"].includes(r.protocol)||r.hasAttribute("target"),Gr=r=>r.pathname+r.search===document.location.pathname+document.location.search||r.href.startsWith("#"),Zr=r=>{if(r.getAttribute("data-turbo-prefetch")==="false"||r.getAttribute("data-turbo")==="false")return!0;let e=te(r,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},es=r=>{let e=r.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||ts(r)||r.hasAttribute("data-turbo-confirm")||r.hasAttribute("data-turbo-stream"))},ts=r=>r.hasAttribute("data-remote")||r.hasAttribute("data-behavior")||r.hasAttribute("data-confirm")||r.hasAttribute("data-method"),rs=r=>F("turbo:before-prefetch",{target:r,cancelable:!0}).defaultPrevented,Ke=class{constructor(e){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 We(this,O(e),t,{referrer:this.location,...s}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new Ae(this,e,t,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(e){typeof this.adapter.formSubmissionStarted=="function"&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){let s=await t.responseHTML;if(s){let i=e.isSafe;i||this.view.clearSnapshotCache();let{statusCode:n,redirected:l}=t,S={action:this.#e(e,t),shouldCacheSnapshot:i,response:{statusCode:n,responseHTML:s,redirected:l}};this.proposeVisit(t.location,S)}}}async formSubmissionFailedWithResponse(e,t){let s=await t.responseHTML;if(s){let i=U.fromHTMLString(s);t.serverError?await this.view.renderError(i,this.currentVisit):await this.view.renderPage(i,!1,!0,this.currentVisit),i.refreshScroll!=="preserve"&&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){return!1}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#e(e,t){let{submitter:s,formElement:i}=e;return J(s,i)||this.#t(t)}#t(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}},K={initial:0,loading:1,interactive:2,complete:3},Xe=class{stage=K.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==K.initial&&(this.stage=K.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=>{let{readyState:e}=this;
17e=="interactive"?this.pageIsInteractive():e=="complete"&&this.pageIsComplete()};pageIsInteractive(){this.stage==K.loading&&(this.stage=K.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==K.interactive&&(this.stage=K.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}},Je=class{started=!1;constructor(e){this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}},Qe=class{render({fragment:e}){Pe.preservingPermanentElements(this,ss(e),()=>{is(e,()=>{ns(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}};function ss(r){let e=xt(document.documentElement),t={};for(let s of e){let{id:i}=s;for(let n of r.querySelectorAll("turbo-stream")){let l=Dt(n.templateElement.content,i);l&&(t[i]=[s,l])}}return t}async function is(r,e){let t=`turbo-stream-autofocus-${$()}`,s=r.querySelectorAll("turbo-stream"),i=os(s),n=null;if(i&&(i.id?n=i.id:n=t,i.id=n),e(),await ie(),(document.activeElement==null||document.activeElement==document.body)&&n){let m=document.getElementById(n);ht(m)&&m.focus(),m&&m.id==t&&m.removeAttribute("id")}}async function ns(r){let[e,t]=await mr(r,()=>document.activeElement),s=e&&e.id;if(s){let i=document.getElementById(s);ht(i)&&i!=t&&i.focus()}}function os(r){for(let e of r){let t=Mt(e.templateElement.content);if(t)return t}return null}var Ge=class{sources=new Set;#e=!1;constructor(e){this.delegate=e}start(){this.#e||(this.#e=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.#e&&(this.#e=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}inspectFetchResponse=e=>{let t=as(e);t&&cs(t)&&(e.preventDefault(),this.receiveMessageResponse(t))};receiveMessageEvent=e=>{this.#e&&typeof e.data=="string"&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){let t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(Y.wrap(e))}};function as(r){let e=r.detail?.fetchResponse;if(e instanceof ae)return e}function cs(r){return(r.contentType??"").startsWith(Y.contentType)}var Ze=class extends le{static renderElement(e,t){let{documentElement:s,body:i}=document;s.replaceChild(t,i)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){let{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(let e of this.scriptElements){let t=e.parentNode;if(t){let s=oe(e);t.replaceChild(s,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}},ue=class extends le{static renderElement(e,t){document.body&&t instanceof HTMLBodyElement?document.body.replaceWith(t):document.documentElement.appendChild(t)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){if(!this.newSnapshot.isVisitable)return{reason:"turbo_visit_control_is_reload"};if(!this.trackedElementsAreIdentical)return{reason:"tracked_element_mismatch"}}async prepareToRender(){this.#e(),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}
17get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#e(){let{documentElement:e}=this.currentSnapshot,{dir:t,lang:s}=this.newSnapshot;s?e.setAttribute("lang",s):e.removeAttribute("lang"),t?e.setAttribute("dir",t):e.removeAttribute("dir")}async mergeHead(){let e=this.mergeProvisionalElements(),t=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await e,await t,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){let e=[];for(let t of this.newHeadStylesheetElements)e.push(ur(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(oe(e))}removeUnusedDynamicStylesheetElements(){for(let e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){let e=[...this.newHeadProvisionalElements];for(let t of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(t,e)||document.head.removeChild(t);for(let t of e)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(let[s,i]of t.entries()){if(e.tagName=="TITLE"){if(i.tagName!="TITLE")continue;if(e.innerHTML==i.innerHTML)return t.splice(s,1),!0}if(i.isEqualNode(e))return t.splice(s,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(let e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.removeNoscriptElements(),this.activateNewBodyScriptElements()}removeNoscriptElements(){for(let e of this.newElement.querySelectorAll("noscript"))e.remove()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let t=oe(e);e.replaceWith(t)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(e=>e.getAttribute("data-turbo-track")==="dynamic")}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}},ke=class extends ue{static renderElement(e,t){Ie(e,t,{callbacks:{beforeNodeMorphed:(s,i)=>Vt(s,i)&&!_t(s)?(s.reload(),!1):!0}}),F("turbo:morph",{detail:{currentElement:e,newElement:t}})}async preservingPermanentElements(e){return await e()}get renderMethod(){return"morph"}get shouldAutofocus(){return!1}},et=class extends Ee{constructor(e){super(e,be)}get snapshots(){return this.entries}},tt=class extends Te{snapshotCache=new et(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,s=!0,i){let l=this.isPageRefresh(i)&&(i?.refresh?.method||this.snapshot.refreshMethod)==="morph"?ke:ue,m=new l(this.snapshot,e,t,s);return m.shouldRender?i?.changeHistory():this.forceReloaded=!0,this.render(m)}renderError(e,t){t?.changeHistory();let s=new Ze(this.snapshot,e,!1);return this.render(s)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();let{lastRenderedLocation:t}=this;await Tt();let s=e.clone();return this.snapshotCache.put(t,s),s}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}isPageRefresh(e){return!e||this.lastRenderedLocation.pathname===e.location.pathname&&e.action==="replace"}shouldPreserveScrollPosition(e){return this.isPageRefresh(e)&&(e?.refresh?.scroll||this.snapshot.refreshScroll)==="preserve"}get snapshot(){return U.fromElement(this.element)}},rt=class{selector="a[data-turbo-preload]";constructor(e,t){this.delegate=e,this.snapshotCache=t}start(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.#e):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",this.#e)}preloadOnLoadLinksForView(e){for(let t of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(t)&&this.preloadURL(t)}async preloadURL(e){let t=new URL(e.href);if(this.snapshotCache.has(t))return;await new Q(this,x.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{let s=await t.responseHTML,i=U.fromHTMLString(s);this.snapshotCache.put(e.url,i)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#e=()=>{this.preloadOnLoadLinksForView(document.body)}},st=class{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.#e("")}exemptPageFromCache(){this.#e("no-cache")}exemptPageFromPreview(){this.#e("no-preview")}#e(e){fr("turbo-cache-control",e)}},it=class{navigator=new Ke(this);history=new $e(this);view=new tt(this,document.documentElement);
17adapter=new Ue(this);pageObserver=new Xe(this);cacheObserver=new je;linkPrefetchObserver=new Ye(this,document);linkClickObserver=new Le(this,window);formSubmitObserver=new ce(this,document);scrollObserver=new Je(this);streamObserver=new Ge(this);formLinkClickObserver=new Ce(this,document.documentElement);frameRedirector=new ze(this,document.documentElement);streamMessageRenderer=new Qe;cache=new st(this);enabled=!0;started=!1;#e=150;constructor(e){this.recentRequests=e,this.preloader=new rt(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){let s=t.frame?document.getElementById(t.frame):null;if(s instanceof V){let i=t.action||J(s);s.delegate.proposeVisitIfNavigatedWithAction(s,i),s.src=e.toString()}else this.navigator.proposeVisit(O(e),t)}refresh(e,t={}){t=typeof t=="string"?{requestId:t}:t;let{method:s,requestId:i,scroll:n}=t,l=i&&this.recentRequests.has(i),m=e===document.baseURI;!l&&!this.navigator.currentVisit&&m&&this.visit(e,{action:"replace",shouldCacheSnapshot:!1,refresh:{method:s,scroll:n}})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(Y.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){N.drive.progressBarDelay=e}get progressBarDelay(){return N.drive.progressBarDelay}set drive(e){N.drive.enabled=e}get drive(){return N.drive.enabled}set formMode(e){N.forms.mode=e}get formMode(){return N.forms.mode}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#e}set pageRefreshDebouncePeriod(e){this.refresh=pr(this.debouncedRefresh.bind(this),e),this.#e=e}shouldPreloadLink(e){let t=e.hasAttribute("data-turbo-method"),s=e.hasAttribute("data-turbo-stream"),i=e.getAttribute("data-turbo-frame"),n=i=="_top"?null:document.getElementById(i)||te(e,"turbo-frame:not([disabled])");if(t||s||n instanceof V)return!1;{let l=new URL(e.href);return this.elementIsNavigatable(e)&&z(l,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"})}historyPoppedWithEmptyState(e){this.history.replace(e),this.view.lastRenderedLocation=e,this.view.cacheSnapshot()}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){let s=this.getActionForLink(e),i=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:s,acceptsStreamResponse:i})}allowsVisitingLocationWithAction(e,t){return this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){wt(e),this.adapter.visitProposedToLocation(e,t)}
17visitStarted(e){e.acceptsStreamResponse||(ye(document.documentElement),this.view.markVisitDirection(e.direction)),wt(e.location),this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),Se(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}willSubmitForm(e,t){let s=ut(e,t);return this.submissionIsNavigatable(e,t)&&z(O(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(){this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){let s=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:i,detail:{render:n}}=s;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!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 F("turbo:click",{target:e,detail:{url:t.href,originalEvent:s},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return F("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return F("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return F("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return F("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return F("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return F("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterFrameLoad(e){return F("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return F("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if(N.forms.mode=="off")return!1;{let s=t?this.elementIsNavigatable(t):!0;return N.forms.mode=="optin"?s&&e.closest('[data-turbo="true"]')!=null:s&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){let t=te(e,"[data-turbo]"),s=te(e,"turbo-frame");return N.drive.enabled||s?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return J(e)||"advance"}get snapshot(){return this.view.snapshot}};function wt(r){Object.defineProperties(r,ls)}var ls={absoluteURL:{get(){return this.toString()}}},H=new it(Ht),{cache:hs,navigator:us}=H;function Wt(){H.start()}function ds(r){H.registerAdapter(r)}function fs(r,e){H.visit(r,e)}function Ut(r){H.connectStreamSource(r)}function jt(r){H.disconnectStreamSource(r)}function ms(r){H.renderStreamMessage(r)}function ps(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.`"),N.drive.progressBarDelay=r}function gs(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.`"),N.forms.confirm=r}function bs(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.`"),N.forms.mode=r}function vs(r,e){ke.renderElement(r,e)}function ys(r,e){Me.renderElement(r,e)}var Ss=Object.freeze({__proto__:null,navigator:us,session:H,cache:hs,PageRenderer:ue,PageSnapshot:U,FrameRenderer:he,fetch:Bt,config:N,start:Wt,registerAdapter
17:ds,visit:fs,connectStreamSource:Ut,disconnectStreamSource:jt,renderStreamMessage:ms,setProgressBarDelay:ps,setConfirmMethod:gs,setFormMode:bs,morphBodyElements:vs,morphTurboFrameElements:ys,morphChildren:mt,morphElements:Ie}),nt=class extends Error{},ot=class{fetchResponseLoaded=e=>Promise.resolve();#e=null;#t=()=>{};#r=!1;#o=!1;#a=new Set;#i=!1;action=null;constructor(e){this.element=e,this.view=new Oe(this,this.element),this.appearanceObserver=new Be(this,this.element),this.formLinkClickObserver=new Ce(this,this.element),this.linkInterceptor=new Re(this,this.element),this.restorationIdentifier=$(),this.formSubmitObserver=new ce(this,this.element)}connect(){this.#r||(this.#r=!0,this.loadingStyle==Z.lazy?this.appearanceObserver.start():this.#s(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#r&&(this.#r=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop(),this.element.hasAttribute("recurse")||this.#e?.cancel())}disabledChanged(){this.disabled?this.#e?.cancel():this.loadingStyle==Z.eager&&this.#s()}sourceURLChanged(){this.#y("src")||(this.sourceURL||this.#e?.cancel(),this.element.isConnected&&(this.complete=!1),(this.loadingStyle==Z.eager||this.#o)&&this.#s())}sourceURLReloaded(){let{refresh:e,src:t}=this.element;return this.#i=t&&e==="morph",this.element.removeAttribute("complete"),this.element.src=null,this.element.src=t,this.element.loaded}loadingStyleChanged(){this.loadingStyle==Z.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#s())}async#s(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#d(O(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#o=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{let t=await e.responseHTML;if(t){let s=Rt(t);U.fromDocument(s).isVisitable?await this.#c(e,s):await this.#m(e)}}finally{this.#i=!1,this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,J(e)),this.#s()}willSubmitFormLinkToLocation(e){return this.#l(e)}submittedFormLinkToLocation(e,t,s){let i=this.#n(e);i&&s.setAttribute("data-turbo-frame",i.id)}shouldInterceptLinkClick(e,t,s){return this.#l(e)}linkClickIntercepted(e,t){this.#f(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.#l(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new Ae(this,e,t);let{fetchRequest:s}=this.formSubmission,i=this.#n(e,t);this.prepareRequest(s,i),this.formSubmission.start()}prepareRequest(e,t=this){e.headers["Turbo-Frame"]=t.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&&e.acceptResponseType(Y.contentType)}requestStarted(e){ye(this.element)}requestPreventedHandlingResponse(e,t){this.#t()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.#t()}async requestFailedWithResponse(e,t){await this.loadResponse(t),this.#t()}requestErrored(e,t){console.error(t),this.#t()}requestFinished(e){Se(this.element)}formSubmissionStarted({formElement:e}){ye(e,this.#n(e))}formSubmissionSucceededWithResponse(e,t){let s=this.#n(e.formElement,e.submitter);s.delegate.proposeVisitIfNavigatedWithAction(s,J(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}){Se(e,this.#n(e))}allowsImmediateRender({element:e},t){let s=F("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0}),{defaultPrevented:i,detail:{render:n}}=s;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!i}viewRenderedSnapshot(e,t,s){}preloadOnLoadLinksForView(e){H.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>
17{let t=e.querySelector("#"+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#c(e,t){let s=await this.extractForeignFrameElement(t.body),i=this.#i?Me:he;if(s){let n=new se(s),l=new i(this,this.view.snapshot,n,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(l),this.complete=!0,H.frameRendered(e,this.element),H.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#p(e)&&this.#g(e)}async#d(e){let t=new Q(this,x.get,e,new URLSearchParams,this.element);return this.#e?.cancel(),this.#e=t,new Promise(s=>{this.#t=()=>{this.#t=()=>{},this.#e=null,s()},t.perform()})}#f(e,t,s){let i=this.#n(e,s);i.delegate.proposeVisitIfNavigatedWithAction(i,J(s,e,i)),this.#w(e,()=>{i.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){let s=U.fromElement(e).clone(),{visitCachedSnapshot:i}=e.delegate;e.delegate.fetchResponseLoaded=async n=>{if(e.src){let{statusCode:l,redirected:m}=n,S=await n.responseHTML,k={response:{statusCode:l,redirected:m,responseHTML:S},visitCachedSnapshot:i,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:s};this.action&&(k.action=this.action),H.visit(e.src,k)}}}}changeHistory(){if(this.action){let e=Ct(this.action);H.history.update(e,O(this.element.src||""),this.restorationIdentifier)}}async#m(e){console.warn(`The response (${e.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await this.#h(e.response)}#p(e){this.element.setAttribute("complete","");let t=e.response,s=async(n,l)=>{n instanceof Response?this.#h(n):H.visit(n,l)};return!F("turbo:frame-missing",{target:this.element,detail:{response:t,visit:s},cancelable:!0}).defaultPrevented}#g(e){this.view.missing(),this.#b(e)}#b(e){let t=`The response (${e.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new nt(t)}async#h(e){let t=new ae(e),s=await t.responseHTML,{location:i,redirected:n,statusCode:l}=t;return H.visit(i,{response:{redirected:n,statusCode:l,responseHTML:s}})}#n(e,t){let s=ve("data-turbo-frame",t,e)||this.element.getAttribute("target"),i=this.#u(s);return i instanceof V?i:this.element}async extractForeignFrameElement(e){let t,s=CSS.escape(this.id);try{if(t=Et(e.querySelector(`turbo-frame#${s}`),this.sourceURL),t)return t;if(t=Et(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 V}return null}#v(e,t){let s=ut(e,t);return z(O(s),this.rootLocation)}#l(e,t){let s=ve("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#v(e,t)||!this.enabled||s=="_top")return!1;if(s){let i=this.#u(s);if(i)return!i.disabled;if(s=="_parent")return!1}return!(!H.elementIsNavigatable(e)||t&&!H.elementIsNavigatable(t))}get id(){return this.element.id}get disabled(){return this.element.disabled}get enabled(){return!this.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(e){this.#S("src",()=>{this.element.src=e??null})}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||this.#t()!==void 0}get complete(){return this.element.hasAttribute("complete")}set complete(e){e?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&this.#r}get rootLocation(){let t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]')?.content??"/";return O(t)}#y(e){return this.#a.has(e)}#S(e,t){this.#a.add(e),t(),this.#a.delete(e)}#w(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}#u(e){if(e!=null){let t=e==="_parent"?this.element.parentElement.closest("turbo-frame"):document.getElementById(e);if(t instanceof V)return t}}};function Et(r,e){if(r){let t=r.getAttribute("src");if(t!=null&&e!=null&&Ft(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 V)return r.connectedCallback(),r.disconnectedCallback(),r}}var zt={after(){this.removeDuplicateTargetSiblings(),this.targetElements.forEac
17h(r=>r.parentElement?.insertBefore(this.templateContent,r.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(r=>r.append(this.templateContent))},before(){this.removeDuplicateTargetSiblings(),this.targetElements.forEach(r=>r.parentElement?.insertBefore(this.templateContent,r))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(r=>r.prepend(this.templateContent))},remove(){this.targetElements.forEach(r=>r.remove())},replace(){let r=this.getAttribute("method");this.targetElements.forEach(e=>{r==="morph"?Ie(e,this.templateContent):e.replaceWith(this.templateContent)})},update(){let r=this.getAttribute("method");this.targetElements.forEach(e=>{r==="morph"?mt(e,this.templateContent):(e.innerHTML="",e.append(this.templateContent))})},refresh(){let r=this.getAttribute("method"),e=this.requestId,t=this.getAttribute("scroll");H.refresh(this.baseURI,{method:r,requestId:e,scroll:t})}},at=class r extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=>{let e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await ie(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){let e=this.targetElements.flatMap(s=>[...s.children]).filter(s=>!!s.getAttribute("id")),t=[...this.templateContent?.children||[]].filter(s=>!!s.getAttribute("id")).map(s=>s.getAttribute("id"));return e.filter(s=>t.includes(s.getAttribute("id")))}removeDuplicateTargetSiblings(){this.duplicateSiblings.forEach(e=>e.remove())}get duplicateSiblings(){let e=this.targetElements.flatMap(s=>[...s.parentElement.children]).filter(s=>!!s.id),t=[...this.templateContent?.children||[]].filter(s=>!!s.id).map(s=>s.id);return e.filter(s=>t.includes(s.id))}get performAction(){if(this.action){let e=zt[this.action];if(e)return e;this.#e("unknown action")}this.#e("action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;this.#e("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild===null){let e=this.ownerDocument.createElement("template");return this.appendChild(e),e}else if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.#e("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}#e(e){throw new Error(`${this.description}: ${e}`)}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:r.renderElement}})}get targetElementsById(){let e=this.ownerDocument?.getElementById(this.target);return e!==null?[e]:[]}get targetElementsByQuery(){let e=this.ownerDocument?.querySelectorAll(this.targets);return e.length!==0?Array.prototype.slice.call(e):[]}},ct=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),Ut(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),jt(this.streamSource))}get src(){return this.getAttribute("src")||""}};V.delegateConstructor=ot;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",V);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",at);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",ct);(()=>{let r=document.currentScript;if(!r||r.hasAttribute("data-turbo-suppress-warning"))return;let e=r.parentElement;for(;e;){if(e==document.body)return console.warn(Lt` 18 You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do! 19 20 Load your applicationâs JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change. 21 22 For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements 23 24 ââ 25 Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s 26 `,r.outerHTML);e=e.parentElement}})();window.Turbo={...Ss,StreamActions:zt};Wt();var Yt=ir($t());document.addEventListener("turbo:load",()=>{new Yt.default(".copy-btn")});})(); 27/*! Bundled license information: 28 29clipboard/dist/clipboard.js: 30 (*! 31 * clipboard.js v2.0.11 32 * https://clipboardjs.com/ 33 * 34 * Licensed MIT © Zeno Rocha 35 *) 36 37@hotwired/turbo/dist/turbo.es2017-esm.js: 38 (*! 39 Turbo 8.0.21 40 Copyright © 2026 37signals LLC 41 *) 42*/
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.