together-theme 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/assets/js/main.js +3 -3
- data/together-theme.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 676f683034260bd681a3832f61809d1a7dda6f8455b49264682d74f1bad3b055
|
4
|
+
data.tar.gz: 38d3f370a43781040d7b97d7a7d837eae146c5a16063713de8ed1a9ef42f42ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 718ff344326b45ed3b45228efa895db0cae28a9b9b95e3b507213015f6928e1ba3631c057c2f2060e53f7cf6db4177a7f51b06bc3e6057513adcb1c8d59b868c
|
7
|
+
data.tar.gz: f6a06a49ee4482efed4cbbe85ea8315bcc9a3382c042108e69113d6790d78c1c3aa091e8399bf253be35f32aa76b199a0993645cc7cecb1a29f2feed501d2960
|
data/assets/js/main.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
(()=>{(function(){if(window.Reflect===void 0||window.customElements===void 0||window.customElements.polyfillWrapFlushCallback)return;let s=HTMLElement,e={HTMLElement:function(){return Reflect.construct(s,[],this.constructor)}};window.HTMLElement=e.HTMLElement,HTMLElement.prototype=s.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,s)})();(function(s){if(typeof s.requestSubmit=="function")return;s.requestSubmit=function(i){i?(e(i,this),i.click()):(i=document.createElement("input"),i.type="submit",i.hidden=!0,this.appendChild(i),i.click(),this.removeChild(i))};function e(i,r){i instanceof HTMLElement||t(TypeError,"parameter 1 is not of type 'HTMLElement'"),i.type=="submit"||t(TypeError,"The specified element is not a submit button"),i.form==r||t(DOMException,"The specified element is not owned by this form element","NotFoundError")}function t(i,r,n){throw new i("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+r+".",n)}})(HTMLFormElement.prototype);var G=new WeakMap;function ke(s){let e=s instanceof Element?s:s instanceof Node?s.parentElement:null,t=e?e.closest("input, button"):null;return t?.type=="submit"?t:null}function Ie(s){let e=ke(s.target);e&&e.form&&G.set(e.form,e)}(function(){if("submitter"in Event.prototype)return;let s;if("SubmitEvent"in window&&/Apple Computer/.test(navigator.vendor))s=window.SubmitEvent.prototype;else{if("SubmitEvent"in window)return;s=window.Event.prototype}addEventListener("click",Ie,!0),Object.defineProperty(s,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return G.get(this.target)}})})();var w;(function(s){s.eager="eager",s.lazy="lazy"})(w||(w={}));var g=class extends HTMLElement{constructor(){super();this.loaded=Promise.resolve(),this.delegate=new g.delegateConstructor(this)}static get observedAttributes(){return["disabled","loading","src"]}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){let{src:e}=this;this.src=null,this.src=e}attributeChangedCallback(e){e=="loading"?this.delegate.loadingStyleChanged():e=="src"?this.delegate.sourceURLChanged():this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get loading(){return Me(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(){var e,t;return(t=(e=this.ownerDocument)===null||e===void 0?void 0:e.documentElement)===null||t===void 0?void 0:t.hasAttribute("data-turbo-preview")}};function Me(s){switch(s.toLowerCase()){case"lazy":return w.lazy;default:return w.eager}}function c(s){return new URL(s.toString(),document.baseURI)}function S(s){let e;if(s.hash)return s.hash.slice(1);if(e=s.href.match(/#(.*)$/))return e[1]}function V(s,e){let t=e?.getAttribute("formaction")||s.getAttribute("action")||s.action;return c(t)}function Fe(s){return(De(s).match(/\.[^.]*$/)||[])[0]||""}function qe(s){return!!Fe(s).match(/^(?:|\.(?:htm|html|xhtml))$/)}function He(s,e){let t=Ne(e);return s.href===c(t).href||s.href.startsWith(t)}function C(s,e){return He(s,e)&&qe(s)}function O(s){let e=S(s);return e!=null?s.href.slice(0,-(e.length+1)):s.href}function P(s){return O(s)}function Be(s,e){return c(s).href==c(e).href}function Oe(s){return s.pathname.split("/").slice(1)}function De(s){return Oe(s).slice(-1)[0]}function Ne(s){return Ve(s.origin+s.pathname)}function Ve(s){return s.endsWith("/")?s:s+"/"}var W=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 c(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}};function h(s,{target:e,cancelable:t,detail:i}={}){let r=new CustomEvent(s,{cancelable:t,bubbles:!0,detail:i});return e&&e.isConnected?e.dispatchEvent(r):document.documentElement.dispatchEvent(r),r}function k(){return new Promise(s=>requestAnimationFrame(()=>s()))}function We(){return new Promise(s=>setTimeout(()=>s(),0))}function xe(){return Promise.resolve()}function Z(s=""){return new DOMParser().parseFromString(s,"text/html")}function ee(s,...e){let t=Ue(s,e).replace(/^\n/,"").split(`
|
2
2
|
`),i=t[0].match(/^\s+/),r=i?i[0].length:0;return t.map(n=>n.slice(r)).join(`
|
3
|
-
`)}function Ue(s,e){return s.reduce((t,i,r)=>{let n=e[r]==null?"":e[r];return t+i+n},"")}function T(){return Array.apply(null,{length:36}).map((s,e)=>e==8||e==13||e==18||e==23?"-":e==14?"4":e==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}function I(s,...e){for(let t of e.map(i=>i?.getAttribute(s)))if(typeof t=="string")return t;return null}function D(...s){for(let e of s)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function N(...s){for(let e of s)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}var a;(function(s){s[s.get=0]="get",s[s.post=1]="post",s[s.put=2]="put",s[s.patch=3]="patch",s[s.delete=4]="delete"})(a||(a={}));function _e(s){switch(s.toLowerCase()){case"get":return a.get;case"post":return a.post;case"put":return a.put;case"patch":return a.patch;case"delete":return a.delete}}var M=class{constructor(e,t,i,r=new URLSearchParams,n=null){this.abortController=new AbortController,this.resolveRequestPromise=o=>{},this.delegate=e,this.method=t,this.headers=this.defaultHeaders,this.body=r,this.url=i,this.target=n}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(){var e,t;let{fetchOptions:i}=this;(t=(e=this.delegate).prepareHeadersForRequest)===null||t===void 0||t.call(e,this.headers,this),await this.allowRequestToBeIntercepted(i);try{this.delegate.requestStarted(this);let r=await fetch(this.url.href,i);return await this.receive(r)}catch(r){if(r.name!=="AbortError")throw this.delegate.requestErrored(this,r),r}finally{this.delegate.requestFinished(this)}}async receive(e){let t=new W(e);return h("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 fetchOptions(){var e;return{method:a[this.method].toUpperCase(),credentials:"same-origin",headers:this.headers,redirect:"follow",body:this.isIdempotent?null:this.body,signal:this.abortSignal,referrer:(e=this.delegate.referrer)===null||e===void 0?void 0:e.href}}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isIdempotent(){return this.method==a.get}get abortSignal(){return this.abortController.signal}async allowRequestToBeIntercepted(e){let t=new Promise(r=>this.resolveRequestPromise=r);h("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.resolveRequestPromise},target:this.target}).defaultPrevented&&await t}},te=class{constructor(e,t){this.started=!1,this.intersect=i=>{let r=i.slice(-1)[0];r?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)},this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}},L=class{constructor(e){this.templateElement=document.createElement("template"),this.templateElement.innerHTML=e}static wrap(e){return typeof e=="string"?new this(e):e}get fragment(){let e=document.createDocumentFragment();for(let t of this.foreignElements)e.appendChild(document.importNode(t,!0));return e}get foreignElements(){return this.templateChildren.reduce((e,t)=>t.tagName.toLowerCase()=="turbo-stream"?[...e,t]:e,[])}get templateChildren(){return Array.from(this.templateElement.content.children)}};L.contentType="text/vnd.turbo-stream.html";var v;(function(s){s[s.initialized=0]="initialized",s[s.requesting=1]="requesting",s[s.waiting=2]="waiting",s[s.receiving=3]="receiving",s[s.stopping=4]="stopping",s[s.stopped=5]="stopped"})(v||(v={}));var b;(function(s){s.urlEncoded="application/x-www-form-urlencoded",s.multipart="multipart/form-data",s.plain="text/plain"})(b||(b={}));function $e(s){switch(s.toLowerCase()){case b.multipart:return b.multipart;case b.plain:return b.plain;default:return b.urlEncoded}}var R=class{constructor(e,t,i,r=!1){this.state=v.initialized,this.delegate=e,this.formElement=t,this.submitter=i,this.formData=je(t,i),this.location=c(this.action),this.method==a.get&&Qe(this.location,[...this.body.entries()]),this.fetchRequest=new M(this,this.method,this.location,this.body,this.formElement),this.mustRedirect=r}static confirmMethod(e,t){return confirm(e)}get method(){var e;let t=((e=this.submitter)===null||e===void 0?void 0:e.getAttribute("formmethod"))||this.formElement.getAttribute("method")||"";return _e(t.toLowerCase())||a.get}get action(){var e;let t=typeof this.formElement.action=="string"?this.formElement.action:null;return((e=this.submitter)===null||e===void 0?void 0:e.getAttribute("formaction"))||this.formElement.getAttribute("action")||t||""}get body(){return this.enctype==b.urlEncoded||this.method==a.get?new URLSearchParams(this.stringFormData):this.formData}get enctype(){var e;return $e(((e=this.submitter)===null||e===void 0?void 0:e.getAttribute("formenctype"))||this.formElement.enctype)}get isIdempotent(){return this.fetchRequest.isIdempotent}get stringFormData(){return[...this.formData].reduce((e,[t,i])=>e.concat(typeof i=="string"?[[t,i]]:[]),[])}get confirmationMessage(){return this.formElement.getAttribute("data-turbo-confirm")}get needsConfirmation(){return this.confirmationMessage!==null}async start(){let{initialized:e,requesting:t}=v;if(!(this.needsConfirmation&&!R.confirmMethod(this.confirmationMessage,this.formElement))&&this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:t}=v;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareHeadersForRequest(e,t){if(!t.isIdempotent){let i=ze(K("csrf-param"))||K("csrf-token");i&&(e["X-CSRF-Token"]=i),e.Accept=[L.contentType,e.Accept].join(", ")}}requestStarted(e){var t;this.state=v.waiting,(t=this.submitter)===null||t===void 0||t.setAttribute("disabled",""),h("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError)this.delegate.formSubmissionFailedWithResponse(this,t);else if(this.requestMustRedirect(e)&&Ke(t)){let i=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,i)}else this.state=v.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){var t;this.state=v.stopped,(t=this.submitter)===null||t===void 0||t.removeAttribute("disabled"),h("turbo:submit-end",{target:this.formElement,detail:Object.assign({formSubmission:this},this.result)}),this.delegate.formSubmissionFinished(this)}requestMustRedirect(e){return!e.isIdempotent&&this.mustRedirect}};function je(s,e){let t=new FormData(s),i=e?.getAttribute("name"),r=e?.getAttribute("value");return i&&r!=null&&t.get(i)!=r&&t.append(i,r),t}function ze(s){if(s!=null){let t=(document.cookie?document.cookie.split("; "):[]).find(i=>i.startsWith(s));if(t){let i=t.split("=").slice(1).join("=");return i?decodeURIComponent(i):void 0}}}function K(s){let e=document.querySelector(`meta[name="${s}"]`);return e&&e.content}function Ke(s){return s.statusCode==200&&!s.redirected}function Qe(s,e){let t=new URLSearchParams;for(let[i,r]of e)r instanceof File||t.append(i,r);return s.search=t.toString(),s}var A=class{constructor(e){this.element=e}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 this.element.querySelector("[autofocus]")}get permanentElements(){return[...this.element.querySelectorAll("[id][data-turbo-permanent]")]}getPermanentElementById(e){return this.element.querySelector(`#${e}[data-turbo-permanent]`)}getPermanentElementMapForSnapshot(e){let t={};for(let i of this.permanentElements){let{id:r}=i,n=e.getPermanentElementById(r);n&&(t[r]=[i,n])}return t}},x=class{constructor(e,t){this.submitBubbled=i=>{let r=i.target;if(!i.defaultPrevented&&r instanceof HTMLFormElement&&r.closest("turbo-frame, html")==this.element){let n=i.submitter||void 0;(n?.getAttribute("formmethod")||r.method)!="dialog"&&this.delegate.shouldInterceptFormSubmission(r,n)&&(i.preventDefault(),i.stopImmediatePropagation(),this.delegate.formSubmissionIntercepted(r,n))}},this.delegate=e,this.element=t}start(){this.element.addEventListener("submit",this.submitBubbled)}stop(){this.element.removeEventListener("submit",this.submitBubbled)}},U=class{constructor(e,t){this.resolveRenderPromise=i=>{},this.resolveInterceptionPromise=i=>{},this.delegate=e,this.element=t}scrollToAnchor(e){let t=this.snapshot.getElementForAnchor(e);t?(this.scrollToElement(t),this.focusElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(S(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){let{isPreview:t,shouldRender:i,newSnapshot:r}=e;if(i)try{this.renderPromise=new Promise(d=>this.resolveRenderPromise=d),this.renderer=e,this.prepareToRenderSnapshot(e);let n=new Promise(d=>this.resolveInterceptionPromise=d);this.delegate.allowsImmediateRender(r,this.resolveInterceptionPromise)||await n,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(r,t),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.resolveRenderPromise(void 0),delete this.renderPromise}else this.invalidate()}invalidate(){this.delegate.viewInvalidated()}prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}},se=class extends U{invalidate(){this.element.innerHTML=""}get snapshot(){return new A(this.element)}},_=class{constructor(e,t){this.clickBubbled=i=>{this.respondsToEventTarget(i.target)?this.clickEvent=i:delete this.clickEvent},this.linkClicked=i=>{this.clickEvent&&this.respondsToEventTarget(i.target)&&i.target instanceof Element&&this.delegate.shouldInterceptLinkClick(i.target,i.detail.url)&&(this.clickEvent.preventDefault(),i.preventDefault(),this.delegate.linkClickIntercepted(i.target,i.detail.url)),delete this.clickEvent},this.willVisit=()=>{delete this.clickEvent},this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}respondsToEventTarget(e){let t=e instanceof Element?e:e instanceof Node?e.parentElement:null;return t&&t.closest("turbo-frame, html")==this.element}},ie=class{constructor(e){this.permanentElementMap=e}static preservingPermanentElements(e,t){let i=new this(e);i.enter(),t(),i.leave()}enter(){for(let e in this.permanentElementMap){let[,t]=this.permanentElementMap[e];this.replaceNewPermanentElementWithPlaceholder(t)}}leave(){for(let e in this.permanentElementMap){let[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t)}}replaceNewPermanentElementWithPlaceholder(e){let t=Xe(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){let t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){let t=this.getPlaceholderById(e.id);t?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}};function Xe(s){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",s.id),e}var F=class{constructor(e,t,i,r=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=i,this.willRender=r,this.promise=new Promise((n,o)=>this.resolvingFunctions={resolve:n,reject:o})}get shouldRender(){return!0}prepareToRender(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}createScriptElement(e){if(e.getAttribute("data-turbo-eval")=="false")return e;{let t=document.createElement("script");return this.cspNonce&&(t.nonce=this.cspNonce),t.textContent=e.textContent,t.async=!1,Ye(t,e),t}}preservingPermanentElements(e){ie.preservingPermanentElements(this.permanentElementMap,e)}focusFirstAutofocusableElement(){let e=this.connectedSnapshot.firstAutofocusableElement;Je(e)&&e.focus()}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 cspNonce(){var e;return(e=document.head.querySelector('meta[name="csp-nonce"]'))===null||e===void 0?void 0:e.getAttribute("content")}};function Ye(s,e){for(let{name:t,value:i}of[...e.attributes])s.setAttribute(t,i)}function Je(s){return s&&typeof s.focus=="function"}var re=class extends F{get shouldRender(){return!0}async render(){await k(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await k(),this.focusFirstAutofocusableElement(),await k(),this.activateScriptElements()}loadFrameElement(){var e;let t=document.createRange();t.selectNodeContents(this.currentElement),t.deleteContents();let i=this.newElement,r=(e=i.ownerDocument)===null||e===void 0?void 0:e.createRange();r&&(r.selectNodeContents(i),this.currentElement.appendChild(r.extractContents()))}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){let e=this.currentElement.firstElementChild,t=Ge(this.currentElement.getAttribute("data-autoscroll-block"),"end");if(e)return e.scrollIntoView({block:t}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let t=this.createScriptElement(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function Ge(s,e){return s=="end"||s=="start"||s=="center"||s=="nearest"?s:e}var m=class{constructor(){this.hiding=!1,this.value=0,this.visible=!1,this.trickle=()=>{this.setValue(this.value+Math.random()/100)},this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}static get defaultCSS(){return ee`
|
3
|
+
`)}function Ue(s,e){return s.reduce((t,i,r)=>{let n=e[r]==null?"":e[r];return t+i+n},"")}function T(){return Array.apply(null,{length:36}).map((s,e)=>e==8||e==13||e==18||e==23?"-":e==14?"4":e==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}function I(s,...e){for(let t of e.map(i=>i?.getAttribute(s)))if(typeof t=="string")return t;return null}function D(...s){for(let e of s)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function N(...s){for(let e of s)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}var a;(function(s){s[s.get=0]="get",s[s.post=1]="post",s[s.put=2]="put",s[s.patch=3]="patch",s[s.delete=4]="delete"})(a||(a={}));function _e(s){switch(s.toLowerCase()){case"get":return a.get;case"post":return a.post;case"put":return a.put;case"patch":return a.patch;case"delete":return a.delete}}var M=class{constructor(e,t,i,r=new URLSearchParams,n=null){this.abortController=new AbortController,this.resolveRequestPromise=o=>{},this.delegate=e,this.method=t,this.headers=this.defaultHeaders,this.body=r,this.url=i,this.target=n}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(){var e,t;let{fetchOptions:i}=this;(t=(e=this.delegate).prepareHeadersForRequest)===null||t===void 0||t.call(e,this.headers,this),await this.allowRequestToBeIntercepted(i);try{this.delegate.requestStarted(this);let r=await fetch(this.url.href,i);return await this.receive(r)}catch(r){if(r.name!=="AbortError")throw this.delegate.requestErrored(this,r),r}finally{this.delegate.requestFinished(this)}}async receive(e){let t=new W(e);return h("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 fetchOptions(){var e;return{method:a[this.method].toUpperCase(),credentials:"same-origin",headers:this.headers,redirect:"follow",body:this.isIdempotent?null:this.body,signal:this.abortSignal,referrer:(e=this.delegate.referrer)===null||e===void 0?void 0:e.href}}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isIdempotent(){return this.method==a.get}get abortSignal(){return this.abortController.signal}async allowRequestToBeIntercepted(e){let t=new Promise(r=>this.resolveRequestPromise=r);h("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.resolveRequestPromise},target:this.target}).defaultPrevented&&await t}},te=class{constructor(e,t){this.started=!1,this.intersect=i=>{let r=i.slice(-1)[0];r?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)},this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}},L=class{constructor(e){this.templateElement=document.createElement("template"),this.templateElement.innerHTML=e}static wrap(e){return typeof e=="string"?new this(e):e}get fragment(){let e=document.createDocumentFragment();for(let t of this.foreignElements)e.appendChild(document.importNode(t,!0));return e}get foreignElements(){return this.templateChildren.reduce((e,t)=>t.tagName.toLowerCase()=="turbo-stream"?[...e,t]:e,[])}get templateChildren(){return Array.from(this.templateElement.content.children)}};L.contentType="text/vnd.turbo-stream.html";var v;(function(s){s[s.initialized=0]="initialized",s[s.requesting=1]="requesting",s[s.waiting=2]="waiting",s[s.receiving=3]="receiving",s[s.stopping=4]="stopping",s[s.stopped=5]="stopped"})(v||(v={}));var b;(function(s){s.urlEncoded="application/x-www-form-urlencoded",s.multipart="multipart/form-data",s.plain="text/plain"})(b||(b={}));function je(s){switch(s.toLowerCase()){case b.multipart:return b.multipart;case b.plain:return b.plain;default:return b.urlEncoded}}var R=class{constructor(e,t,i,r=!1){this.state=v.initialized,this.delegate=e,this.formElement=t,this.submitter=i,this.formData=$e(t,i),this.location=c(this.action),this.method==a.get&&Qe(this.location,[...this.body.entries()]),this.fetchRequest=new M(this,this.method,this.location,this.body,this.formElement),this.mustRedirect=r}static confirmMethod(e,t){return confirm(e)}get method(){var e;let t=((e=this.submitter)===null||e===void 0?void 0:e.getAttribute("formmethod"))||this.formElement.getAttribute("method")||"";return _e(t.toLowerCase())||a.get}get action(){var e;let t=typeof this.formElement.action=="string"?this.formElement.action:null;return((e=this.submitter)===null||e===void 0?void 0:e.getAttribute("formaction"))||this.formElement.getAttribute("action")||t||""}get body(){return this.enctype==b.urlEncoded||this.method==a.get?new URLSearchParams(this.stringFormData):this.formData}get enctype(){var e;return je(((e=this.submitter)===null||e===void 0?void 0:e.getAttribute("formenctype"))||this.formElement.enctype)}get isIdempotent(){return this.fetchRequest.isIdempotent}get stringFormData(){return[...this.formData].reduce((e,[t,i])=>e.concat(typeof i=="string"?[[t,i]]:[]),[])}get confirmationMessage(){return this.formElement.getAttribute("data-turbo-confirm")}get needsConfirmation(){return this.confirmationMessage!==null}async start(){let{initialized:e,requesting:t}=v;if(!(this.needsConfirmation&&!R.confirmMethod(this.confirmationMessage,this.formElement))&&this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:t}=v;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareHeadersForRequest(e,t){if(!t.isIdempotent){let i=ze(K("csrf-param"))||K("csrf-token");i&&(e["X-CSRF-Token"]=i),e.Accept=[L.contentType,e.Accept].join(", ")}}requestStarted(e){var t;this.state=v.waiting,(t=this.submitter)===null||t===void 0||t.setAttribute("disabled",""),h("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError)this.delegate.formSubmissionFailedWithResponse(this,t);else if(this.requestMustRedirect(e)&&Ke(t)){let i=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,i)}else this.state=v.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){var t;this.state=v.stopped,(t=this.submitter)===null||t===void 0||t.removeAttribute("disabled"),h("turbo:submit-end",{target:this.formElement,detail:Object.assign({formSubmission:this},this.result)}),this.delegate.formSubmissionFinished(this)}requestMustRedirect(e){return!e.isIdempotent&&this.mustRedirect}};function $e(s,e){let t=new FormData(s),i=e?.getAttribute("name"),r=e?.getAttribute("value");return i&&r!=null&&t.get(i)!=r&&t.append(i,r),t}function ze(s){if(s!=null){let t=(document.cookie?document.cookie.split("; "):[]).find(i=>i.startsWith(s));if(t){let i=t.split("=").slice(1).join("=");return i?decodeURIComponent(i):void 0}}}function K(s){let e=document.querySelector(`meta[name="${s}"]`);return e&&e.content}function Ke(s){return s.statusCode==200&&!s.redirected}function Qe(s,e){let t=new URLSearchParams;for(let[i,r]of e)r instanceof File||t.append(i,r);return s.search=t.toString(),s}var A=class{constructor(e){this.element=e}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 this.element.querySelector("[autofocus]")}get permanentElements(){return[...this.element.querySelectorAll("[id][data-turbo-permanent]")]}getPermanentElementById(e){return this.element.querySelector(`#${e}[data-turbo-permanent]`)}getPermanentElementMapForSnapshot(e){let t={};for(let i of this.permanentElements){let{id:r}=i,n=e.getPermanentElementById(r);n&&(t[r]=[i,n])}return t}},x=class{constructor(e,t){this.submitBubbled=i=>{let r=i.target;if(!i.defaultPrevented&&r instanceof HTMLFormElement&&r.closest("turbo-frame, html")==this.element){let n=i.submitter||void 0;(n?.getAttribute("formmethod")||r.method)!="dialog"&&this.delegate.shouldInterceptFormSubmission(r,n)&&(i.preventDefault(),i.stopImmediatePropagation(),this.delegate.formSubmissionIntercepted(r,n))}},this.delegate=e,this.element=t}start(){this.element.addEventListener("submit",this.submitBubbled)}stop(){this.element.removeEventListener("submit",this.submitBubbled)}},U=class{constructor(e,t){this.resolveRenderPromise=i=>{},this.resolveInterceptionPromise=i=>{},this.delegate=e,this.element=t}scrollToAnchor(e){let t=this.snapshot.getElementForAnchor(e);t?(this.scrollToElement(t),this.focusElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(S(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){let{isPreview:t,shouldRender:i,newSnapshot:r}=e;if(i)try{this.renderPromise=new Promise(d=>this.resolveRenderPromise=d),this.renderer=e,this.prepareToRenderSnapshot(e);let n=new Promise(d=>this.resolveInterceptionPromise=d);this.delegate.allowsImmediateRender(r,this.resolveInterceptionPromise)||await n,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(r,t),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.resolveRenderPromise(void 0),delete this.renderPromise}else this.invalidate()}invalidate(){this.delegate.viewInvalidated()}prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}},se=class extends U{invalidate(){this.element.innerHTML=""}get snapshot(){return new A(this.element)}},_=class{constructor(e,t){this.clickBubbled=i=>{this.respondsToEventTarget(i.target)?this.clickEvent=i:delete this.clickEvent},this.linkClicked=i=>{this.clickEvent&&this.respondsToEventTarget(i.target)&&i.target instanceof Element&&this.delegate.shouldInterceptLinkClick(i.target,i.detail.url)&&(this.clickEvent.preventDefault(),i.preventDefault(),this.delegate.linkClickIntercepted(i.target,i.detail.url)),delete this.clickEvent},this.willVisit=()=>{delete this.clickEvent},this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}respondsToEventTarget(e){let t=e instanceof Element?e:e instanceof Node?e.parentElement:null;return t&&t.closest("turbo-frame, html")==this.element}},ie=class{constructor(e){this.permanentElementMap=e}static preservingPermanentElements(e,t){let i=new this(e);i.enter(),t(),i.leave()}enter(){for(let e in this.permanentElementMap){let[,t]=this.permanentElementMap[e];this.replaceNewPermanentElementWithPlaceholder(t)}}leave(){for(let e in this.permanentElementMap){let[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t)}}replaceNewPermanentElementWithPlaceholder(e){let t=Xe(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){let t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){let t=this.getPlaceholderById(e.id);t?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}};function Xe(s){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",s.id),e}var F=class{constructor(e,t,i,r=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=i,this.willRender=r,this.promise=new Promise((n,o)=>this.resolvingFunctions={resolve:n,reject:o})}get shouldRender(){return!0}prepareToRender(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}createScriptElement(e){if(e.getAttribute("data-turbo-eval")=="false")return e;{let t=document.createElement("script");return this.cspNonce&&(t.nonce=this.cspNonce),t.textContent=e.textContent,t.async=!1,Ye(t,e),t}}preservingPermanentElements(e){ie.preservingPermanentElements(this.permanentElementMap,e)}focusFirstAutofocusableElement(){let e=this.connectedSnapshot.firstAutofocusableElement;Je(e)&&e.focus()}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 cspNonce(){var e;return(e=document.head.querySelector('meta[name="csp-nonce"]'))===null||e===void 0?void 0:e.getAttribute("content")}};function Ye(s,e){for(let{name:t,value:i}of[...e.attributes])s.setAttribute(t,i)}function Je(s){return s&&typeof s.focus=="function"}var re=class extends F{get shouldRender(){return!0}async render(){await k(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await k(),this.focusFirstAutofocusableElement(),await k(),this.activateScriptElements()}loadFrameElement(){var e;let t=document.createRange();t.selectNodeContents(this.currentElement),t.deleteContents();let i=this.newElement,r=(e=i.ownerDocument)===null||e===void 0?void 0:e.createRange();r&&(r.selectNodeContents(i),this.currentElement.appendChild(r.extractContents()))}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){let e=this.currentElement.firstElementChild,t=Ge(this.currentElement.getAttribute("data-autoscroll-block"),"end");if(e)return e.scrollIntoView({block:t}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let t=this.createScriptElement(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function Ge(s,e){return s=="end"||s=="start"||s=="center"||s=="nearest"?s:e}var m=class{constructor(){this.hiding=!1,this.value=0,this.visible=!1,this.trickle=()=>{this.setValue(this.value+Math.random()/100)},this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}static get defaultCSS(){return ee`
|
4
4
|
.turbo-progress-bar {
|
5
5
|
position: fixed;
|
6
6
|
display: block;
|
@@ -14,7 +14,7 @@
|
|
14
14
|
opacity ${m.animationDuration/2}ms ${m.animationDuration/2}ms ease-in;
|
15
15
|
transform: translate3d(0, 0, 0);
|
16
16
|
}
|
17
|
-
`}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,m.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,m.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){let e=document.createElement("style");return e.type="text/css",e.textContent=m.defaultCSS,e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}};m.animationDuration=300;var ne=class extends A{constructor(){super(...arguments);this.detailsByOuterHTML=this.children.filter(e=>!st(e)).map(e=>nt(e)).reduce((e,t)=>{let{outerHTML:i}=t,r=i in e?e[i]:{type:Ze(t),tracked:et(t),elements:[]};return Object.assign(Object.assign({},e),{[i]:Object.assign(Object.assign({},r),{elements:[...r.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(i=>!(i in t.detailsByOuterHTML)).map(i=>this.detailsByOuterHTML[i]).filter(({type:i})=>i==e).map(({elements:[i]})=>i)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:i,tracked:r,elements:n}=this.detailsByOuterHTML[t];return i==null&&!r?[...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,i)=>{let{elements:[r]}=this.detailsByOuterHTML[i];return rt(r,e)?r:t},void 0)}};function Ze(s){if(tt(s))return"script";if(it(s))return"stylesheet"}function et(s){return s.getAttribute("data-turbo-track")=="reload"}function tt(s){return s.tagName.toLowerCase()=="script"}function st(s){return s.tagName.toLowerCase()=="noscript"}function it(s){let e=s.tagName.toLowerCase();return e=="style"||e=="link"&&s.getAttribute("rel")=="stylesheet"}function rt(s,e){return s.tagName.toLowerCase()=="meta"&&s.getAttribute("name")==e}function nt(s){return s.hasAttribute("nonce")&&s.setAttribute("nonce",""),s}var f=class extends A{constructor(e,t){super(e);this.headSnapshot=t}static fromHTMLString(e=""){return this.fromDocument(Z(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({head:e,body:t}){return new this(t,new ne(e))}clone(){return new f(this.element.cloneNode(!0),this.headSnapshot)}get headElement(){return this.headSnapshot.element}get rootLocation(){var e;let t=(e=this.getSetting("root"))!==null&&e!==void 0?e:"/";return c(t)}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},y;(function(s){s.visitStart="visitStart",s.requestStart="requestStart",s.requestEnd="requestEnd",s.visitEnd="visitEnd"})(y||(y={}));var u;(function(s){s.initialized="initialized",s.started="started",s.canceled="canceled",s.failed="failed",s.completed="completed"})(u||(u={}));var ot={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0},E;(function(s){s[s.networkFailure=0]="networkFailure",s[s.timeoutFailure=-1]="timeoutFailure",s[s.contentTypeMismatch=-2]="contentTypeMismatch"})(E||(E={}));var oe=class{constructor(e,t,i,r={}){this.identifier=T(),this.timingMetrics={},this.followedRedirect=!1,this.historyChanged=!1,this.scrolled=!1,this.snapshotCached=!1,this.state=u.initialized,this.delegate=e,this.location=t,this.restorationIdentifier=i||T();let{action:n,historyChanged:o,referrer:d,snapshotHTML:q,response:H,visitCachedSnapshot:B,willRender:z}=Object.assign(Object.assign({},ot),r);this.action=n,this.historyChanged=o,this.referrer=d,this.snapshotHTML=q,this.response=H,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.visitCachedSnapshot=B,this.willRender=z,this.scrolled=!z}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==u.initialized&&(this.recordTimingMetric(y.visitStart),this.state=u.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==u.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=u.canceled)}complete(){this.state==u.started&&(this.recordTimingMetric(y.visitEnd),this.state=u.completed,this.adapter.visitCompleted(this),this.delegate.visitCompleted(this),this.followRedirect())}fail(){this.state==u.started&&(this.state=u.failed,this.adapter.visitFailed(this))}changeHistory(){var e;if(!this.historyChanged){let t=this.location.href===((e=this.referrer)===null||e===void 0?void 0:e.href)?"replace":this.action,i=this.getHistoryMethodForAction(t);this.history.update(i,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new M(this,a.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(y.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;Q(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(y.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,Q(e)&&t!=null?(await this.view.renderPage(f.fromHTMLString(t),!1,this.willRender),this.adapter.visitRendered(this),this.complete()):(await this.view.renderError(f.fromHTMLString(t)),this.adapter.visitRendered(this),this.fail())})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!S(this.location)||e.hasAnchor(S(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return f.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){let e=this.getCachedSnapshot();if(e){let t=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.view.renderPage(e,t,this.willRender),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){var e;this.redirectedToLocation&&!this.followedRedirect&&((e=this.response)===null||e===void 0?void 0:e.redirected)&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.adapter.visitRendered(this)})}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let i=await t.responseHTML,{redirected:r,statusCode:n}=t;i==null?this.recordResponse({statusCode:E.contentTypeMismatch,redirected:r}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:n,responseHTML:i,redirected:r}))}async requestFailedWithResponse(e,t){let i=await t.responseHTML,{redirected:r,statusCode:n}=t;i==null?this.recordResponse({statusCode:E.contentTypeMismatch,redirected:r}):this.recordResponse({statusCode:n,responseHTML:i,redirected:r})}requestErrored(e,t){this.recordResponse({statusCode:E.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){this.scrolled||(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=S(this.location);if(e!=null)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=new Date().getTime()}getTimingMetrics(){return Object.assign({},this.timingMetrics)}getHistoryMethodForAction(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return typeof this.response=="object"}shouldIssueRequest(){return this.isSamePage?!1:this.action=="restore"?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot().then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),await new Promise(t=>{this.frame=requestAnimationFrame(()=>t())}),await e(),delete this.frame,this.performScroll()}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};function Q(s){return s>=200&&s<300}var ae=class{constructor(e){this.progressBar=new m,this.showProgressBar=()=>{this.progressBar.show()},this.session=e}visitProposedToLocation(e,t){this.navigator.startVisit(e,T(),t)}visitStarted(e){e.loadCachedSnapshot(),e.issueRequest(),e.changeHistory(),e.goToSamePageAnchor()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||e.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case E.networkFailure:case E.timeoutFailure:case E.contentTypeMismatch:return this.reload();default:return e.loadResponse()}}visitRequestFinished(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitCompleted(e){}pageInvalidated(){this.reload()}visitFailed(e){}visitRendered(e){}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){this.formProgressBarTimeout==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}reload(){window.location.reload()}get navigator(){return this.session.navigator}},le=class{constructor(){this.started=!1}start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeStaleElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeStaleElements,!1))}removeStaleElements(){let e=[...document.querySelectorAll('[data-turbo-cache="false"]')];for(let t of e)t.remove()}},ce=class{constructor(e){this.started=!1,this.submitCaptured=()=>{removeEventListener("submit",this.submitBubbled,!1),addEventListener("submit",this.submitBubbled,!1)},this.submitBubbled=t=>{if(!t.defaultPrevented){let i=t.target instanceof HTMLFormElement?t.target:void 0,r=t.submitter||void 0;i&&(r?.getAttribute("formmethod")||i.getAttribute("method"))!="dialog"&&this.delegate.willSubmitForm(i,r)&&(t.preventDefault(),this.delegate.formSubmitted(i,r))}},this.delegate=e}start(){this.started||(addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}},he=class{constructor(e){this.element=e,this.linkInterceptor=new _(this,e),this.formInterceptor=new x(this,e)}start(){this.linkInterceptor.start(),this.formInterceptor.start()}stop(){this.linkInterceptor.stop(),this.formInterceptor.stop()}shouldInterceptLinkClick(e,t){return this.shouldRedirect(e)}linkClickIntercepted(e,t){let i=this.findFrameElement(e);i&&i.delegate.linkClickIntercepted(e,t)}shouldInterceptFormSubmission(e,t){return this.shouldSubmit(e,t)}formSubmissionIntercepted(e,t){let i=this.findFrameElement(e,t);i&&(i.removeAttribute("reloadable"),i.delegate.formSubmissionIntercepted(e,t))}shouldSubmit(e,t){var i;let r=V(e,t),n=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),o=c((i=n?.content)!==null&&i!==void 0?i:"/");return this.shouldRedirect(e,t)&&C(r,o)}shouldRedirect(e,t){let i=this.findFrameElement(e,t);return i?i!=e.closest("turbo-frame"):!1}findFrameElement(e,t){let i=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(i&&i!="_top"){let r=this.element.querySelector(`#${i}:not([disabled])`);if(r instanceof g)return r}}},de=class{constructor(e){this.restorationIdentifier=T(),this.restorationData={},this.started=!1,this.pageLoaded=!1,this.onPopState=t=>{if(this.shouldHandlePopState()){let{turbo:i}=t.state||{};if(i){this.location=new URL(window.location.href);let{restorationIdentifier:r}=i;this.restorationIdentifier=r,this.delegate.historyPoppedToLocationWithRestorationIdentifier(this.location,r)}}},this.onPageLoad=async t=>{await xe(),this.pageLoaded=!0},this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,i=T()){let r={turbo:{restorationIdentifier:i}};e.call(history,r,"",t.href),this.location=t,this.restorationIdentifier=i}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){let{restorationIdentifier:t}=this,i=this.restorationData[t];this.restorationData[t]=Object.assign(Object.assign({},i),e)}assumeControlOfScrollRestoration(){var e;this.previousScrollRestoration||(this.previousScrollRestoration=(e=history.scrollRestoration)!==null&&e!==void 0?e:"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},ue=class{constructor(e){this.started=!1,this.clickCaptured=()=>{removeEventListener("click",this.clickBubbled,!1),addEventListener("click",this.clickBubbled,!1)},this.clickBubbled=t=>{if(this.clickEventIsSignificant(t)){let i=t.composedPath&&t.composedPath()[0]||t.target,r=this.findLinkFromClickTarget(i);if(r){let n=this.getLocationForLink(r);this.delegate.willFollowLinkToLocation(r,n)&&(t.preventDefault(),this.delegate.followedLinkToLocation(r,n))}}},this.delegate=e}start(){this.started||(addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}findLinkFromClickTarget(e){if(e instanceof Element)return e.closest("a[href]:not([target^=_]):not([download])")}getLocationForLink(e){return c(e.getAttribute("href")||"")}};function $(s){return s=="advance"||s=="replace"||s=="restore"}var me=class{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&(C(e,this.view.snapshot.rootLocation)?this.delegate.visitProposedToLocation(e,t):window.location.href=e.toString())}startVisit(e,t,i={}){this.stop(),this.currentVisit=new oe(this,c(e),t,Object.assign({referrer:this.location},i)),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new R(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 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 i=await t.responseHTML;if(i){e.method!=a.get&&this.view.clearSnapshotCache();let{statusCode:r,redirected:n}=t,d={action:this.getActionForFormSubmission(e),response:{statusCode:r,responseHTML:i,redirected:n}};this.proposeVisit(t.location,d)}}}async formSubmissionFailedWithResponse(e,t){let i=await t.responseHTML;if(i){let r=f.fromHTMLString(i);t.serverError?await this.view.renderError(r):await this.view.renderPage(r),this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e)}locationWithActionIsSamePage(e,t){let i=S(e),r=S(this.view.lastRenderedLocation),n=t==="restore"&&typeof i>"u";return t!=="replace"&&O(e)===O(this.view.lastRenderedLocation)&&(n||i!=null&&i!==r)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}getActionForFormSubmission(e){let{formElement:t,submitter:i}=e,r=I("data-turbo-action",i,t);return $(r)?r:"advance"}},p;(function(s){s[s.initial=0]="initial",s[s.loading=1]="loading",s[s.interactive=2]="interactive",s[s.complete=3]="complete"})(p||(p={}));var pe=class{constructor(e){this.stage=p.initial,this.started=!1,this.interpretReadyState=()=>{let{readyState:t}=this;t=="interactive"?this.pageIsInteractive():t=="complete"&&this.pageIsComplete()},this.pageWillUnload=()=>{this.delegate.pageWillUnload()},this.delegate=e}start(){this.started||(this.stage==p.initial&&(this.stage=p.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}pageIsInteractive(){this.stage==p.loading&&(this.stage=p.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==p.interactive&&(this.stage=p.complete,this.delegate.pageLoaded())}get readyState(){return document.readyState}},fe=class{constructor(e){this.started=!1,this.onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})},this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}updatePosition(e){this.delegate.scrollPositionChanged(e)}},ge=class{constructor(e){this.sources=new Set,this.started=!1,this.inspectFetchResponse=t=>{let i=at(t);i&<(i)&&(t.preventDefault(),this.receiveMessageResponse(i))},this.receiveMessageEvent=t=>{this.started&&typeof t.data=="string"&&this.receiveMessageHTML(t.data)},this.delegate=e}start(){this.started||(this.started=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}async receiveMessageResponse(e){let t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(new L(e))}};function at(s){var e;let t=(e=s.detail)===null||e===void 0?void 0:e.fetchResponse;if(t instanceof W)return t}function lt(s){var e;return((e=s.contentType)!==null&&e!==void 0?e:"").startsWith(L.contentType)}var ve=class extends F{async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){let{documentElement:e,head:t,body:i}=document;e.replaceChild(this.newHead,t),e.replaceChild(this.newElement,i)}activateScriptElements(){for(let e of this.scriptElements){let t=e.parentNode;if(t){let i=this.createScriptElement(e);t.replaceChild(i,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return[...document.documentElement.querySelectorAll("script")]}},j=class extends F{get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}prepareToRender(){this.mergeHead()}async render(){this.willRender&&this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}mergeHead(){this.copyNewHeadStylesheetElements(),this.copyNewHeadScriptElements(),this.removeCurrentHeadProvisionalElements(),this.copyNewHeadProvisionalElements()}replaceBody(){this.preservingPermanentElements(()=>{this.activateNewBody(),this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}copyNewHeadStylesheetElements(){for(let e of this.newHeadStylesheetElements)document.head.appendChild(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(this.createScriptElement(e))}removeCurrentHeadProvisionalElements(){for(let e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let t=this.createScriptElement(e);e.replaceWith(t)}}assignNewBody(){document.body&&this.newElement instanceof HTMLBodyElement?document.body.replaceWith(this.newElement):document.documentElement.appendChild(this.newElement)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}},be=class{constructor(e){this.keys=[],this.snapshots={},this.size=e}has(e){return P(e)in this.snapshots}get(e){if(this.has(e)){let t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){this.snapshots={}}read(e){return this.snapshots[P(e)]}write(e,t){this.snapshots[P(e)]=t}touch(e){let t=P(e),i=this.keys.indexOf(t);i>-1&&this.keys.splice(i,1),this.keys.unshift(t),this.trim()}trim(){for(let e of this.keys.splice(this.size))delete this.snapshots[e]}},we=class extends U{constructor(){super(...arguments);this.snapshotCache=new be(10),this.lastRenderedLocation=new URL(location.href)}renderPage(e,t=!1,i=!0){let r=new j(this.snapshot,e,t,i);return this.render(r)}renderError(e){let t=new ve(this.snapshot,e,!1);return this.render(t)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(){if(this.shouldCacheSnapshot){this.delegate.viewWillCacheSnapshot();let{snapshot:e,lastRenderedLocation:t}=this;await We();let i=e.clone();return this.snapshotCache.put(t,i),i}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}get snapshot(){return f.fromElement(this.element)}get shouldCacheSnapshot(){return this.snapshot.isCacheable}},Ee=class{constructor(){this.navigator=new me(this),this.history=new de(this),this.view=new we(this,document.documentElement),this.adapter=new ae(this),this.pageObserver=new pe(this),this.cacheObserver=new le,this.linkClickObserver=new ue(this),this.formSubmitObserver=new ce(this),this.scrollObserver=new fe(this),this.streamObserver=new ge(this),this.frameRedirector=new he(document.documentElement),this.drive=!0,this.enabled=!0,this.progressBarDelay=500,this.started=!1}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){this.navigator.proposeVisit(c(e),t)}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){document.documentElement.appendChild(L.wrap(e).fragment)}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){this.progressBarDelay=e}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}historyPoppedToLocationWithRestorationIdentifier(e,t){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0}):this.adapter.pageInvalidated()}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willFollowLinkToLocation(e,t){return this.elementDriveEnabled(e)&&C(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t)}followedLinkToLocation(e,t){let i=this.getActionForLink(e);this.convertLinkWithMethodClickToFormSubmission(e)||this.visit(t.href,{action:i})}convertLinkWithMethodClickToFormSubmission(e){let t=e.getAttribute("data-turbo-method");if(t){let i=document.createElement("form");i.method=t,i.action=e.getAttribute("href")||"undefined",i.hidden=!0,e.hasAttribute("data-turbo-confirm")&&i.setAttribute("data-turbo-confirm",e.getAttribute("data-turbo-confirm"));let r=this.getTargetFrameForLink(e);return r?(i.setAttribute("data-turbo-frame",r),i.addEventListener("turbo:submit-start",()=>i.remove())):i.addEventListener("submit",()=>i.remove()),document.body.appendChild(i),h("submit",{cancelable:!0,target:i})}else return!1}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){X(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){X(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){let i=V(e,t);return this.elementDriveEnabled(e)&&(!t||this.elementDriveEnabled(t))&&C(c(i),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){var e;!((e=this.navigator.currentVisit)===null||e===void 0)&&e.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){return!this.notifyApplicationBeforeRender(e,t).defaultPrevented}viewRenderedSnapshot(e,t){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender()}viewInvalidated(){this.adapter.pageInvalidated()}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t){return!this.notifyApplicationAfterClickingLinkToLocation(e,t).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t){return h("turbo:click",{target:e,detail:{url:t.href},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return h("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return D(document.documentElement),h("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return h("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return h("turbo:before-render",{detail:{newBody:e,resume:t},cancelable:!0})}notifyApplicationAfterRender(){return h("turbo:render")}notifyApplicationAfterPageLoad(e={}){return N(document.documentElement),h("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return h("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return h("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}elementDriveEnabled(e){let t=e?.closest("[data-turbo]");return this.drive?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){let t=e.getAttribute("data-turbo-action");return $(t)?t:"advance"}getTargetFrameForLink(e){let t=e.getAttribute("data-turbo-frame");if(t)return t;{let i=e.closest("turbo-frame");if(i)return i.id}}get snapshot(){return this.view.snapshot}};function X(s){Object.defineProperties(s,ct)}var ct={absoluteURL:{get(){return this.toString()}}},l=new Ee,{navigator:ht}=l;function Se(){l.start()}function dt(s){l.registerAdapter(s)}function ut(s,e){l.visit(s,e)}function mt(s){l.connectStreamSource(s)}function pt(s){l.disconnectStreamSource(s)}function ft(s){l.renderStreamMessage(s)}function gt(){l.clearCache()}function vt(s){l.setProgressBarDelay(s)}function bt(s){R.confirmMethod=s}var wt=Object.freeze({__proto__:null,navigator:ht,session:l,PageRenderer:j,PageSnapshot:f,start:Se,registerAdapter:dt,visit:ut,connectStreamSource:mt,disconnectStreamSource:pt,renderStreamMessage:ft,clearCache:gt,setProgressBarDelay:vt,setConfirmMethod:bt}),ye=class{constructor(e){this.fetchResponseLoaded=t=>{},this.currentFetchRequest=null,this.resolveVisitPromise=()=>{},this.connected=!1,this.hasBeenLoaded=!1,this.settingSourceURL=!1,this.element=e,this.view=new se(this,this.element),this.appearanceObserver=new te(this,this.element),this.linkInterceptor=new _(this,this.element),this.formInterceptor=new x(this,this.element)}connect(){this.connected||(this.connected=!0,this.reloadable=!1,this.loadingStyle==w.lazy&&this.appearanceObserver.start(),this.linkInterceptor.start(),this.formInterceptor.start(),this.sourceURLChanged())}disconnect(){this.connected&&(this.connected=!1,this.appearanceObserver.stop(),this.linkInterceptor.stop(),this.formInterceptor.stop())}disabledChanged(){this.loadingStyle==w.eager&&this.loadSourceURL()}sourceURLChanged(){(this.loadingStyle==w.eager||this.hasBeenLoaded)&&this.loadSourceURL()}loadingStyleChanged(){this.loadingStyle==w.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.loadSourceURL())}async loadSourceURL(){if(!this.settingSourceURL&&this.enabled&&this.isActive&&(this.reloadable||this.sourceURL!=this.currentURL)){let e=this.currentURL;if(this.currentURL=this.sourceURL,this.sourceURL)try{this.element.loaded=this.visit(c(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.hasBeenLoaded=!0}catch(t){throw this.currentURL=e,t}}}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{let t=await e.responseHTML;if(t){let{body:i}=Z(t),r=new A(await this.extractForeignFrameElement(i)),n=new re(this.view.snapshot,r,!1,!1);this.view.renderPromise&&await this.view.renderPromise,await this.view.render(n),l.frameRendered(e,this.element),l.frameLoaded(this.element),this.fetchResponseLoaded(e)}}catch(t){console.error(t),this.view.invalidate()}finally{this.fetchResponseLoaded=()=>{}}}elementAppearedInViewport(e){this.loadSourceURL()}shouldInterceptLinkClick(e,t){return e.hasAttribute("data-turbo-method")?!1:this.shouldInterceptNavigation(e)}linkClickIntercepted(e,t){this.reloadable=!0,this.navigateFrame(e,t)}shouldInterceptFormSubmission(e,t){return this.shouldInterceptNavigation(e,t)}formSubmissionIntercepted(e,t){this.formSubmission&&this.formSubmission.stop(),this.reloadable=!1,this.formSubmission=new R(this,e,t);let{fetchRequest:i}=this.formSubmission;this.prepareHeadersForRequest(i.headers,i),this.formSubmission.start()}prepareHeadersForRequest(e,t){e["Turbo-Frame"]=this.id}requestStarted(e){D(this.element)}requestPreventedHandlingResponse(e,t){this.resolveVisitPromise()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.resolveVisitPromise()}requestFailedWithResponse(e,t){console.error(t),this.resolveVisitPromise()}requestErrored(e,t){console.error(t),this.resolveVisitPromise()}requestFinished(e){N(this.element)}formSubmissionStarted({formElement:e}){D(e,this.findFrameElement(e))}formSubmissionSucceededWithResponse(e,t){let i=this.findFrameElement(e.formElement,e.submitter);this.proposeVisitIfNavigatedWithAction(i,e.formElement,e.submitter),i.delegate.loadResponse(t)}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t)}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){N(e,this.findFrameElement(e))}allowsImmediateRender(e,t){return!0}viewRenderedSnapshot(e,t){}viewInvalidated(){}async visit(e){var t;let i=new M(this,a.get,e,new URLSearchParams,this.element);return(t=this.currentFetchRequest)===null||t===void 0||t.cancel(),this.currentFetchRequest=i,new Promise(r=>{this.resolveVisitPromise=()=>{this.resolveVisitPromise=()=>{},this.currentFetchRequest=null,r()},i.perform()})}navigateFrame(e,t,i){let r=this.findFrameElement(e,i);this.proposeVisitIfNavigatedWithAction(r,e,i),r.setAttribute("reloadable",""),r.src=t}proposeVisitIfNavigatedWithAction(e,t,i){let r=I("data-turbo-action",i,t,e);if($(r)){let{visitCachedSnapshot:n}=new Le(e);e.delegate.fetchResponseLoaded=o=>{if(e.src){let{statusCode:d,redirected:q}=o,H=e.ownerDocument.documentElement.outerHTML,B={statusCode:d,redirected:q,responseHTML:H};l.visit(e.src,{action:r,response:B,visitCachedSnapshot:n,willRender:!1})}}}}findFrameElement(e,t){var i;let r=I("data-turbo-frame",t,e)||this.element.getAttribute("target");return(i=Y(r))!==null&&i!==void 0?i:this.element}async extractForeignFrameElement(e){let t,i=CSS.escape(this.id);try{if(t=J(e.querySelector(`turbo-frame#${i}`),this.currentURL))return t;if(t=J(e.querySelector(`turbo-frame[src][recurse~=${i}]`),this.currentURL))return await t.loaded,await this.extractForeignFrameElement(t);console.error(`Response has no matching <turbo-frame id="${i}"> element`)}catch(r){console.error(r)}return new g}formActionIsVisitable(e,t){let i=V(e,t);return C(c(i),this.rootLocation)}shouldInterceptNavigation(e,t){let i=I("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.formActionIsVisitable(e,t)||!this.enabled||i=="_top")return!1;if(i){let r=Y(i);if(r)return!r.disabled}return!(!l.elementDriveEnabled(e)||t&&!l.elementDriveEnabled(t))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}get reloadable(){return this.findFrameElement(this.element).hasAttribute("reloadable")}set reloadable(e){let t=this.findFrameElement(this.element);e?t.setAttribute("reloadable",""):t.removeAttribute("reloadable")}set sourceURL(e){this.settingSourceURL=!0,this.element.src=e??null,this.currentURL=this.element.src,this.settingSourceURL=!1}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||this.resolveVisitPromise()!==void 0}get isActive(){return this.element.isActive&&this.connected}get rootLocation(){var e;let t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),i=(e=t?.content)!==null&&e!==void 0?e:"/";return c(i)}},Le=class{constructor(e){this.visitCachedSnapshot=({element:t})=>{var i;let{id:r,clone:n}=this;(i=t.querySelector("#"+r))===null||i===void 0||i.replaceWith(n)},this.clone=e.cloneNode(!0),this.id=e.id}};function Y(s){if(s!=null){let e=document.getElementById(s);if(e instanceof g)return e}}function J(s,e){if(s){let t=s.getAttribute("src");if(t!=null&&e!=null&&Be(t,e))throw new Error(`Matching <turbo-frame id="${s.id}"> element has a source URL which references itself`);if(s.ownerDocument!==document&&(s=document.importNode(s,!0)),s instanceof g)return s.connectedCallback(),s.disconnectedCallback(),s}}var Et={after(){this.targetElements.forEach(s=>{var e;return(e=s.parentElement)===null||e===void 0?void 0:e.insertBefore(this.templateContent,s.nextSibling)})},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(s=>s.append(this.templateContent))},before(){this.targetElements.forEach(s=>{var e;return(e=s.parentElement)===null||e===void 0?void 0:e.insertBefore(this.templateContent,s)})},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(s=>s.prepend(this.templateContent))},remove(){this.targetElements.forEach(s=>s.remove())},replace(){this.targetElements.forEach(s=>s.replaceWith(this.templateContent))},update(){this.targetElements.forEach(s=>{s.innerHTML="",s.append(this.templateContent)})}},Re=class extends HTMLElement{async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){var e;return(e=this.renderPromise)!==null&&e!==void 0?e:this.renderPromise=(async()=>{this.dispatchEvent(this.beforeRenderEvent)&&(await k(),this.performAction())})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){var e;let t=this.targetElements.flatMap(r=>[...r.children]).filter(r=>!!r.id),i=[...(e=this.templateContent)===null||e===void 0?void 0:e.children].filter(r=>!!r.id).map(r=>r.id);return t.filter(r=>i.includes(r.id))}get performAction(){if(this.action){let e=Et[this.action];if(e)return e;this.raise("unknown action")}this.raise("action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;this.raise("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.raise("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")}raise(e){throw new Error(`${this.description}: ${e}`)}get description(){var e,t;return(t=((e=this.outerHTML.match(/<[^>]+>/))!==null&&e!==void 0?e:[])[0])!==null&&t!==void 0?t:"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0})}get targetElementsById(){var e;let t=(e=this.ownerDocument)===null||e===void 0?void 0:e.getElementById(this.target);return t!==null?[t]:[]}get targetElementsByQuery(){var e;let t=(e=this.ownerDocument)===null||e===void 0?void 0:e.querySelectorAll(this.targets);return t.length!==0?Array.prototype.slice.call(t):[]}};g.delegateConstructor=ye;customElements.define("turbo-frame",g);customElements.define("turbo-stream",Re);(()=>{let s=document.currentScript;if(!!s&&!s.hasAttribute("data-turbo-suppress-warning")){for(;s=s.parentElement;)if(s==document.body)return console.warn(ee`
|
17
|
+
`}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,m.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,m.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){let e=document.createElement("style");return e.type="text/css",e.textContent=m.defaultCSS,e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}};m.animationDuration=300;var ne=class extends A{constructor(){super(...arguments);this.detailsByOuterHTML=this.children.filter(e=>!st(e)).map(e=>nt(e)).reduce((e,t)=>{let{outerHTML:i}=t,r=i in e?e[i]:{type:Ze(t),tracked:et(t),elements:[]};return Object.assign(Object.assign({},e),{[i]:Object.assign(Object.assign({},r),{elements:[...r.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(i=>!(i in t.detailsByOuterHTML)).map(i=>this.detailsByOuterHTML[i]).filter(({type:i})=>i==e).map(({elements:[i]})=>i)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:i,tracked:r,elements:n}=this.detailsByOuterHTML[t];return i==null&&!r?[...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,i)=>{let{elements:[r]}=this.detailsByOuterHTML[i];return rt(r,e)?r:t},void 0)}};function Ze(s){if(tt(s))return"script";if(it(s))return"stylesheet"}function et(s){return s.getAttribute("data-turbo-track")=="reload"}function tt(s){return s.tagName.toLowerCase()=="script"}function st(s){return s.tagName.toLowerCase()=="noscript"}function it(s){let e=s.tagName.toLowerCase();return e=="style"||e=="link"&&s.getAttribute("rel")=="stylesheet"}function rt(s,e){return s.tagName.toLowerCase()=="meta"&&s.getAttribute("name")==e}function nt(s){return s.hasAttribute("nonce")&&s.setAttribute("nonce",""),s}var f=class extends A{constructor(e,t){super(e);this.headSnapshot=t}static fromHTMLString(e=""){return this.fromDocument(Z(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({head:e,body:t}){return new this(t,new ne(e))}clone(){return new f(this.element.cloneNode(!0),this.headSnapshot)}get headElement(){return this.headSnapshot.element}get rootLocation(){var e;let t=(e=this.getSetting("root"))!==null&&e!==void 0?e:"/";return c(t)}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},y;(function(s){s.visitStart="visitStart",s.requestStart="requestStart",s.requestEnd="requestEnd",s.visitEnd="visitEnd"})(y||(y={}));var u;(function(s){s.initialized="initialized",s.started="started",s.canceled="canceled",s.failed="failed",s.completed="completed"})(u||(u={}));var ot={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0},E;(function(s){s[s.networkFailure=0]="networkFailure",s[s.timeoutFailure=-1]="timeoutFailure",s[s.contentTypeMismatch=-2]="contentTypeMismatch"})(E||(E={}));var oe=class{constructor(e,t,i,r={}){this.identifier=T(),this.timingMetrics={},this.followedRedirect=!1,this.historyChanged=!1,this.scrolled=!1,this.snapshotCached=!1,this.state=u.initialized,this.delegate=e,this.location=t,this.restorationIdentifier=i||T();let{action:n,historyChanged:o,referrer:d,snapshotHTML:q,response:H,visitCachedSnapshot:B,willRender:z}=Object.assign(Object.assign({},ot),r);this.action=n,this.historyChanged=o,this.referrer=d,this.snapshotHTML=q,this.response=H,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.visitCachedSnapshot=B,this.willRender=z,this.scrolled=!z}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==u.initialized&&(this.recordTimingMetric(y.visitStart),this.state=u.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==u.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=u.canceled)}complete(){this.state==u.started&&(this.recordTimingMetric(y.visitEnd),this.state=u.completed,this.adapter.visitCompleted(this),this.delegate.visitCompleted(this),this.followRedirect())}fail(){this.state==u.started&&(this.state=u.failed,this.adapter.visitFailed(this))}changeHistory(){var e;if(!this.historyChanged){let t=this.location.href===((e=this.referrer)===null||e===void 0?void 0:e.href)?"replace":this.action,i=this.getHistoryMethodForAction(t);this.history.update(i,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new M(this,a.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(y.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;Q(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(y.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,Q(e)&&t!=null?(await this.view.renderPage(f.fromHTMLString(t),!1,this.willRender),this.adapter.visitRendered(this),this.complete()):(await this.view.renderError(f.fromHTMLString(t)),this.adapter.visitRendered(this),this.fail())})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!S(this.location)||e.hasAnchor(S(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return f.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){let e=this.getCachedSnapshot();if(e){let t=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.view.renderPage(e,t,this.willRender),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){var e;this.redirectedToLocation&&!this.followedRedirect&&((e=this.response)===null||e===void 0?void 0:e.redirected)&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.adapter.visitRendered(this)})}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let i=await t.responseHTML,{redirected:r,statusCode:n}=t;i==null?this.recordResponse({statusCode:E.contentTypeMismatch,redirected:r}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:n,responseHTML:i,redirected:r}))}async requestFailedWithResponse(e,t){let i=await t.responseHTML,{redirected:r,statusCode:n}=t;i==null?this.recordResponse({statusCode:E.contentTypeMismatch,redirected:r}):this.recordResponse({statusCode:n,responseHTML:i,redirected:r})}requestErrored(e,t){this.recordResponse({statusCode:E.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){this.scrolled||(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=S(this.location);if(e!=null)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=new Date().getTime()}getTimingMetrics(){return Object.assign({},this.timingMetrics)}getHistoryMethodForAction(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return typeof this.response=="object"}shouldIssueRequest(){return this.isSamePage?!1:this.action=="restore"?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot().then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),await new Promise(t=>{this.frame=requestAnimationFrame(()=>t())}),await e(),delete this.frame,this.performScroll()}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};function Q(s){return s>=200&&s<300}var ae=class{constructor(e){this.progressBar=new m,this.showProgressBar=()=>{this.progressBar.show()},this.session=e}visitProposedToLocation(e,t){this.navigator.startVisit(e,T(),t)}visitStarted(e){e.loadCachedSnapshot(),e.issueRequest(),e.changeHistory(),e.goToSamePageAnchor()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||e.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case E.networkFailure:case E.timeoutFailure:case E.contentTypeMismatch:return this.reload();default:return e.loadResponse()}}visitRequestFinished(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitCompleted(e){}pageInvalidated(){this.reload()}visitFailed(e){}visitRendered(e){}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){this.formProgressBarTimeout==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}reload(){window.location.reload()}get navigator(){return this.session.navigator}},le=class{constructor(){this.started=!1}start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeStaleElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeStaleElements,!1))}removeStaleElements(){let e=[...document.querySelectorAll('[data-turbo-cache="false"]')];for(let t of e)t.remove()}},ce=class{constructor(e){this.started=!1,this.submitCaptured=()=>{removeEventListener("submit",this.submitBubbled,!1),addEventListener("submit",this.submitBubbled,!1)},this.submitBubbled=t=>{if(!t.defaultPrevented){let i=t.target instanceof HTMLFormElement?t.target:void 0,r=t.submitter||void 0;i&&(r?.getAttribute("formmethod")||i.getAttribute("method"))!="dialog"&&this.delegate.willSubmitForm(i,r)&&(t.preventDefault(),this.delegate.formSubmitted(i,r))}},this.delegate=e}start(){this.started||(addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}},he=class{constructor(e){this.element=e,this.linkInterceptor=new _(this,e),this.formInterceptor=new x(this,e)}start(){this.linkInterceptor.start(),this.formInterceptor.start()}stop(){this.linkInterceptor.stop(),this.formInterceptor.stop()}shouldInterceptLinkClick(e,t){return this.shouldRedirect(e)}linkClickIntercepted(e,t){let i=this.findFrameElement(e);i&&i.delegate.linkClickIntercepted(e,t)}shouldInterceptFormSubmission(e,t){return this.shouldSubmit(e,t)}formSubmissionIntercepted(e,t){let i=this.findFrameElement(e,t);i&&(i.removeAttribute("reloadable"),i.delegate.formSubmissionIntercepted(e,t))}shouldSubmit(e,t){var i;let r=V(e,t),n=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),o=c((i=n?.content)!==null&&i!==void 0?i:"/");return this.shouldRedirect(e,t)&&C(r,o)}shouldRedirect(e,t){let i=this.findFrameElement(e,t);return i?i!=e.closest("turbo-frame"):!1}findFrameElement(e,t){let i=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(i&&i!="_top"){let r=this.element.querySelector(`#${i}:not([disabled])`);if(r instanceof g)return r}}},de=class{constructor(e){this.restorationIdentifier=T(),this.restorationData={},this.started=!1,this.pageLoaded=!1,this.onPopState=t=>{if(this.shouldHandlePopState()){let{turbo:i}=t.state||{};if(i){this.location=new URL(window.location.href);let{restorationIdentifier:r}=i;this.restorationIdentifier=r,this.delegate.historyPoppedToLocationWithRestorationIdentifier(this.location,r)}}},this.onPageLoad=async t=>{await xe(),this.pageLoaded=!0},this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,i=T()){let r={turbo:{restorationIdentifier:i}};e.call(history,r,"",t.href),this.location=t,this.restorationIdentifier=i}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){let{restorationIdentifier:t}=this,i=this.restorationData[t];this.restorationData[t]=Object.assign(Object.assign({},i),e)}assumeControlOfScrollRestoration(){var e;this.previousScrollRestoration||(this.previousScrollRestoration=(e=history.scrollRestoration)!==null&&e!==void 0?e:"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},ue=class{constructor(e){this.started=!1,this.clickCaptured=()=>{removeEventListener("click",this.clickBubbled,!1),addEventListener("click",this.clickBubbled,!1)},this.clickBubbled=t=>{if(this.clickEventIsSignificant(t)){let i=t.composedPath&&t.composedPath()[0]||t.target,r=this.findLinkFromClickTarget(i);if(r){let n=this.getLocationForLink(r);this.delegate.willFollowLinkToLocation(r,n)&&(t.preventDefault(),this.delegate.followedLinkToLocation(r,n))}}},this.delegate=e}start(){this.started||(addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}findLinkFromClickTarget(e){if(e instanceof Element)return e.closest("a[href]:not([target^=_]):not([download])")}getLocationForLink(e){return c(e.getAttribute("href")||"")}};function j(s){return s=="advance"||s=="replace"||s=="restore"}var me=class{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&(C(e,this.view.snapshot.rootLocation)?this.delegate.visitProposedToLocation(e,t):window.location.href=e.toString())}startVisit(e,t,i={}){this.stop(),this.currentVisit=new oe(this,c(e),t,Object.assign({referrer:this.location},i)),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new R(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 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 i=await t.responseHTML;if(i){e.method!=a.get&&this.view.clearSnapshotCache();let{statusCode:r,redirected:n}=t,d={action:this.getActionForFormSubmission(e),response:{statusCode:r,responseHTML:i,redirected:n}};this.proposeVisit(t.location,d)}}}async formSubmissionFailedWithResponse(e,t){let i=await t.responseHTML;if(i){let r=f.fromHTMLString(i);t.serverError?await this.view.renderError(r):await this.view.renderPage(r),this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e)}locationWithActionIsSamePage(e,t){let i=S(e),r=S(this.view.lastRenderedLocation),n=t==="restore"&&typeof i>"u";return t!=="replace"&&O(e)===O(this.view.lastRenderedLocation)&&(n||i!=null&&i!==r)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}getActionForFormSubmission(e){let{formElement:t,submitter:i}=e,r=I("data-turbo-action",i,t);return j(r)?r:"advance"}},p;(function(s){s[s.initial=0]="initial",s[s.loading=1]="loading",s[s.interactive=2]="interactive",s[s.complete=3]="complete"})(p||(p={}));var pe=class{constructor(e){this.stage=p.initial,this.started=!1,this.interpretReadyState=()=>{let{readyState:t}=this;t=="interactive"?this.pageIsInteractive():t=="complete"&&this.pageIsComplete()},this.pageWillUnload=()=>{this.delegate.pageWillUnload()},this.delegate=e}start(){this.started||(this.stage==p.initial&&(this.stage=p.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}pageIsInteractive(){this.stage==p.loading&&(this.stage=p.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==p.interactive&&(this.stage=p.complete,this.delegate.pageLoaded())}get readyState(){return document.readyState}},fe=class{constructor(e){this.started=!1,this.onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})},this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}updatePosition(e){this.delegate.scrollPositionChanged(e)}},ge=class{constructor(e){this.sources=new Set,this.started=!1,this.inspectFetchResponse=t=>{let i=at(t);i&<(i)&&(t.preventDefault(),this.receiveMessageResponse(i))},this.receiveMessageEvent=t=>{this.started&&typeof t.data=="string"&&this.receiveMessageHTML(t.data)},this.delegate=e}start(){this.started||(this.started=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}async receiveMessageResponse(e){let t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(new L(e))}};function at(s){var e;let t=(e=s.detail)===null||e===void 0?void 0:e.fetchResponse;if(t instanceof W)return t}function lt(s){var e;return((e=s.contentType)!==null&&e!==void 0?e:"").startsWith(L.contentType)}var ve=class extends F{async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){let{documentElement:e,head:t,body:i}=document;e.replaceChild(this.newHead,t),e.replaceChild(this.newElement,i)}activateScriptElements(){for(let e of this.scriptElements){let t=e.parentNode;if(t){let i=this.createScriptElement(e);t.replaceChild(i,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return[...document.documentElement.querySelectorAll("script")]}},$=class extends F{get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}prepareToRender(){this.mergeHead()}async render(){this.willRender&&this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}mergeHead(){this.copyNewHeadStylesheetElements(),this.copyNewHeadScriptElements(),this.removeCurrentHeadProvisionalElements(),this.copyNewHeadProvisionalElements()}replaceBody(){this.preservingPermanentElements(()=>{this.activateNewBody(),this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}copyNewHeadStylesheetElements(){for(let e of this.newHeadStylesheetElements)document.head.appendChild(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(this.createScriptElement(e))}removeCurrentHeadProvisionalElements(){for(let e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let t=this.createScriptElement(e);e.replaceWith(t)}}assignNewBody(){document.body&&this.newElement instanceof HTMLBodyElement?document.body.replaceWith(this.newElement):document.documentElement.appendChild(this.newElement)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}},be=class{constructor(e){this.keys=[],this.snapshots={},this.size=e}has(e){return P(e)in this.snapshots}get(e){if(this.has(e)){let t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){this.snapshots={}}read(e){return this.snapshots[P(e)]}write(e,t){this.snapshots[P(e)]=t}touch(e){let t=P(e),i=this.keys.indexOf(t);i>-1&&this.keys.splice(i,1),this.keys.unshift(t),this.trim()}trim(){for(let e of this.keys.splice(this.size))delete this.snapshots[e]}},we=class extends U{constructor(){super(...arguments);this.snapshotCache=new be(10),this.lastRenderedLocation=new URL(location.href)}renderPage(e,t=!1,i=!0){let r=new $(this.snapshot,e,t,i);return this.render(r)}renderError(e){let t=new ve(this.snapshot,e,!1);return this.render(t)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(){if(this.shouldCacheSnapshot){this.delegate.viewWillCacheSnapshot();let{snapshot:e,lastRenderedLocation:t}=this;await We();let i=e.clone();return this.snapshotCache.put(t,i),i}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}get snapshot(){return f.fromElement(this.element)}get shouldCacheSnapshot(){return this.snapshot.isCacheable}},Ee=class{constructor(){this.navigator=new me(this),this.history=new de(this),this.view=new we(this,document.documentElement),this.adapter=new ae(this),this.pageObserver=new pe(this),this.cacheObserver=new le,this.linkClickObserver=new ue(this),this.formSubmitObserver=new ce(this),this.scrollObserver=new fe(this),this.streamObserver=new ge(this),this.frameRedirector=new he(document.documentElement),this.drive=!0,this.enabled=!0,this.progressBarDelay=500,this.started=!1}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){this.navigator.proposeVisit(c(e),t)}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){document.documentElement.appendChild(L.wrap(e).fragment)}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){this.progressBarDelay=e}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}historyPoppedToLocationWithRestorationIdentifier(e,t){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0}):this.adapter.pageInvalidated()}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willFollowLinkToLocation(e,t){return this.elementDriveEnabled(e)&&C(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t)}followedLinkToLocation(e,t){let i=this.getActionForLink(e);this.convertLinkWithMethodClickToFormSubmission(e)||this.visit(t.href,{action:i})}convertLinkWithMethodClickToFormSubmission(e){let t=e.getAttribute("data-turbo-method");if(t){let i=document.createElement("form");i.method=t,i.action=e.getAttribute("href")||"undefined",i.hidden=!0,e.hasAttribute("data-turbo-confirm")&&i.setAttribute("data-turbo-confirm",e.getAttribute("data-turbo-confirm"));let r=this.getTargetFrameForLink(e);return r?(i.setAttribute("data-turbo-frame",r),i.addEventListener("turbo:submit-start",()=>i.remove())):i.addEventListener("submit",()=>i.remove()),document.body.appendChild(i),h("submit",{cancelable:!0,target:i})}else return!1}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){X(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){X(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){let i=V(e,t);return this.elementDriveEnabled(e)&&(!t||this.elementDriveEnabled(t))&&C(c(i),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){var e;!((e=this.navigator.currentVisit)===null||e===void 0)&&e.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){return!this.notifyApplicationBeforeRender(e,t).defaultPrevented}viewRenderedSnapshot(e,t){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender()}viewInvalidated(){this.adapter.pageInvalidated()}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t){return!this.notifyApplicationAfterClickingLinkToLocation(e,t).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t){return h("turbo:click",{target:e,detail:{url:t.href},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return h("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return D(document.documentElement),h("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return h("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return h("turbo:before-render",{detail:{newBody:e,resume:t},cancelable:!0})}notifyApplicationAfterRender(){return h("turbo:render")}notifyApplicationAfterPageLoad(e={}){return N(document.documentElement),h("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return h("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return h("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}elementDriveEnabled(e){let t=e?.closest("[data-turbo]");return this.drive?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){let t=e.getAttribute("data-turbo-action");return j(t)?t:"advance"}getTargetFrameForLink(e){let t=e.getAttribute("data-turbo-frame");if(t)return t;{let i=e.closest("turbo-frame");if(i)return i.id}}get snapshot(){return this.view.snapshot}};function X(s){Object.defineProperties(s,ct)}var ct={absoluteURL:{get(){return this.toString()}}},l=new Ee,{navigator:ht}=l;function Se(){l.start()}function dt(s){l.registerAdapter(s)}function ut(s,e){l.visit(s,e)}function mt(s){l.connectStreamSource(s)}function pt(s){l.disconnectStreamSource(s)}function ft(s){l.renderStreamMessage(s)}function gt(){l.clearCache()}function vt(s){l.setProgressBarDelay(s)}function bt(s){R.confirmMethod=s}var wt=Object.freeze({__proto__:null,navigator:ht,session:l,PageRenderer:$,PageSnapshot:f,start:Se,registerAdapter:dt,visit:ut,connectStreamSource:mt,disconnectStreamSource:pt,renderStreamMessage:ft,clearCache:gt,setProgressBarDelay:vt,setConfirmMethod:bt}),ye=class{constructor(e){this.fetchResponseLoaded=t=>{},this.currentFetchRequest=null,this.resolveVisitPromise=()=>{},this.connected=!1,this.hasBeenLoaded=!1,this.settingSourceURL=!1,this.element=e,this.view=new se(this,this.element),this.appearanceObserver=new te(this,this.element),this.linkInterceptor=new _(this,this.element),this.formInterceptor=new x(this,this.element)}connect(){this.connected||(this.connected=!0,this.reloadable=!1,this.loadingStyle==w.lazy&&this.appearanceObserver.start(),this.linkInterceptor.start(),this.formInterceptor.start(),this.sourceURLChanged())}disconnect(){this.connected&&(this.connected=!1,this.appearanceObserver.stop(),this.linkInterceptor.stop(),this.formInterceptor.stop())}disabledChanged(){this.loadingStyle==w.eager&&this.loadSourceURL()}sourceURLChanged(){(this.loadingStyle==w.eager||this.hasBeenLoaded)&&this.loadSourceURL()}loadingStyleChanged(){this.loadingStyle==w.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.loadSourceURL())}async loadSourceURL(){if(!this.settingSourceURL&&this.enabled&&this.isActive&&(this.reloadable||this.sourceURL!=this.currentURL)){let e=this.currentURL;if(this.currentURL=this.sourceURL,this.sourceURL)try{this.element.loaded=this.visit(c(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.hasBeenLoaded=!0}catch(t){throw this.currentURL=e,t}}}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{let t=await e.responseHTML;if(t){let{body:i}=Z(t),r=new A(await this.extractForeignFrameElement(i)),n=new re(this.view.snapshot,r,!1,!1);this.view.renderPromise&&await this.view.renderPromise,await this.view.render(n),l.frameRendered(e,this.element),l.frameLoaded(this.element),this.fetchResponseLoaded(e)}}catch(t){console.error(t),this.view.invalidate()}finally{this.fetchResponseLoaded=()=>{}}}elementAppearedInViewport(e){this.loadSourceURL()}shouldInterceptLinkClick(e,t){return e.hasAttribute("data-turbo-method")?!1:this.shouldInterceptNavigation(e)}linkClickIntercepted(e,t){this.reloadable=!0,this.navigateFrame(e,t)}shouldInterceptFormSubmission(e,t){return this.shouldInterceptNavigation(e,t)}formSubmissionIntercepted(e,t){this.formSubmission&&this.formSubmission.stop(),this.reloadable=!1,this.formSubmission=new R(this,e,t);let{fetchRequest:i}=this.formSubmission;this.prepareHeadersForRequest(i.headers,i),this.formSubmission.start()}prepareHeadersForRequest(e,t){e["Turbo-Frame"]=this.id}requestStarted(e){D(this.element)}requestPreventedHandlingResponse(e,t){this.resolveVisitPromise()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.resolveVisitPromise()}requestFailedWithResponse(e,t){console.error(t),this.resolveVisitPromise()}requestErrored(e,t){console.error(t),this.resolveVisitPromise()}requestFinished(e){N(this.element)}formSubmissionStarted({formElement:e}){D(e,this.findFrameElement(e))}formSubmissionSucceededWithResponse(e,t){let i=this.findFrameElement(e.formElement,e.submitter);this.proposeVisitIfNavigatedWithAction(i,e.formElement,e.submitter),i.delegate.loadResponse(t)}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t)}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){N(e,this.findFrameElement(e))}allowsImmediateRender(e,t){return!0}viewRenderedSnapshot(e,t){}viewInvalidated(){}async visit(e){var t;let i=new M(this,a.get,e,new URLSearchParams,this.element);return(t=this.currentFetchRequest)===null||t===void 0||t.cancel(),this.currentFetchRequest=i,new Promise(r=>{this.resolveVisitPromise=()=>{this.resolveVisitPromise=()=>{},this.currentFetchRequest=null,r()},i.perform()})}navigateFrame(e,t,i){let r=this.findFrameElement(e,i);this.proposeVisitIfNavigatedWithAction(r,e,i),r.setAttribute("reloadable",""),r.src=t}proposeVisitIfNavigatedWithAction(e,t,i){let r=I("data-turbo-action",i,t,e);if(j(r)){let{visitCachedSnapshot:n}=new Le(e);e.delegate.fetchResponseLoaded=o=>{if(e.src){let{statusCode:d,redirected:q}=o,H=e.ownerDocument.documentElement.outerHTML,B={statusCode:d,redirected:q,responseHTML:H};l.visit(e.src,{action:r,response:B,visitCachedSnapshot:n,willRender:!1})}}}}findFrameElement(e,t){var i;let r=I("data-turbo-frame",t,e)||this.element.getAttribute("target");return(i=Y(r))!==null&&i!==void 0?i:this.element}async extractForeignFrameElement(e){let t,i=CSS.escape(this.id);try{if(t=J(e.querySelector(`turbo-frame#${i}`),this.currentURL))return t;if(t=J(e.querySelector(`turbo-frame[src][recurse~=${i}]`),this.currentURL))return await t.loaded,await this.extractForeignFrameElement(t);console.error(`Response has no matching <turbo-frame id="${i}"> element`)}catch(r){console.error(r)}return new g}formActionIsVisitable(e,t){let i=V(e,t);return C(c(i),this.rootLocation)}shouldInterceptNavigation(e,t){let i=I("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.formActionIsVisitable(e,t)||!this.enabled||i=="_top")return!1;if(i){let r=Y(i);if(r)return!r.disabled}return!(!l.elementDriveEnabled(e)||t&&!l.elementDriveEnabled(t))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}get reloadable(){return this.findFrameElement(this.element).hasAttribute("reloadable")}set reloadable(e){let t=this.findFrameElement(this.element);e?t.setAttribute("reloadable",""):t.removeAttribute("reloadable")}set sourceURL(e){this.settingSourceURL=!0,this.element.src=e??null,this.currentURL=this.element.src,this.settingSourceURL=!1}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||this.resolveVisitPromise()!==void 0}get isActive(){return this.element.isActive&&this.connected}get rootLocation(){var e;let t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),i=(e=t?.content)!==null&&e!==void 0?e:"/";return c(i)}},Le=class{constructor(e){this.visitCachedSnapshot=({element:t})=>{var i;let{id:r,clone:n}=this;(i=t.querySelector("#"+r))===null||i===void 0||i.replaceWith(n)},this.clone=e.cloneNode(!0),this.id=e.id}};function Y(s){if(s!=null){let e=document.getElementById(s);if(e instanceof g)return e}}function J(s,e){if(s){let t=s.getAttribute("src");if(t!=null&&e!=null&&Be(t,e))throw new Error(`Matching <turbo-frame id="${s.id}"> element has a source URL which references itself`);if(s.ownerDocument!==document&&(s=document.importNode(s,!0)),s instanceof g)return s.connectedCallback(),s.disconnectedCallback(),s}}var Et={after(){this.targetElements.forEach(s=>{var e;return(e=s.parentElement)===null||e===void 0?void 0:e.insertBefore(this.templateContent,s.nextSibling)})},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(s=>s.append(this.templateContent))},before(){this.targetElements.forEach(s=>{var e;return(e=s.parentElement)===null||e===void 0?void 0:e.insertBefore(this.templateContent,s)})},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(s=>s.prepend(this.templateContent))},remove(){this.targetElements.forEach(s=>s.remove())},replace(){this.targetElements.forEach(s=>s.replaceWith(this.templateContent))},update(){this.targetElements.forEach(s=>{s.innerHTML="",s.append(this.templateContent)})}},Re=class extends HTMLElement{async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){var e;return(e=this.renderPromise)!==null&&e!==void 0?e:this.renderPromise=(async()=>{this.dispatchEvent(this.beforeRenderEvent)&&(await k(),this.performAction())})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){var e;let t=this.targetElements.flatMap(r=>[...r.children]).filter(r=>!!r.id),i=[...(e=this.templateContent)===null||e===void 0?void 0:e.children].filter(r=>!!r.id).map(r=>r.id);return t.filter(r=>i.includes(r.id))}get performAction(){if(this.action){let e=Et[this.action];if(e)return e;this.raise("unknown action")}this.raise("action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;this.raise("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.raise("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")}raise(e){throw new Error(`${this.description}: ${e}`)}get description(){var e,t;return(t=((e=this.outerHTML.match(/<[^>]+>/))!==null&&e!==void 0?e:[])[0])!==null&&t!==void 0?t:"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0})}get targetElementsById(){var e;let t=(e=this.ownerDocument)===null||e===void 0?void 0:e.getElementById(this.target);return t!==null?[t]:[]}get targetElementsByQuery(){var e;let t=(e=this.ownerDocument)===null||e===void 0?void 0:e.querySelectorAll(this.targets);return t.length!==0?Array.prototype.slice.call(t):[]}};g.delegateConstructor=ye;customElements.define("turbo-frame",g);customElements.define("turbo-stream",Re);(()=>{let s=document.currentScript;if(!!s&&!s.hasAttribute("data-turbo-suppress-warning")){for(;s=s.parentElement;)if(s==document.body)return console.warn(ee`
|
18
18
|
You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
|
19
19
|
|
20
20
|
Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
|
@@ -35,4 +35,4 @@
|
|
35
35
|
<span class="arrow">
|
36
36
|
»
|
37
37
|
</span>
|
38
|
-
</a>`),o+="</p>",r.className="progress-bar",r.innerHTML=o,r},yt=s=>{s.forEach((e,t)=>{let i=s[t+1],r=s[t-1],n=t===s.length-1;if(i||r){let o=St(t+1,s.length,r,i);i
|
38
|
+
</a>`),o+="</p>",r.className="progress-bar",r.innerHTML=o,r},yt=s=>{document.querySelectorAll(".progress-bar").length||s.forEach((e,t)=>{let i=s[t+1],r=s[t-1],n=t===s.length-1;if(i||r){let o=St(t+1,s.length,r,i);i&&i.parentNode.insertBefore(o,i)}})},Te=(s,e,t)=>{if(!e)return;t&&window.scrollTo({top:0,behavior:"smooth"});let i=!1;for(let r=0;r<s.length;r++)typeof s[r].style=="object"&&(s[r].tagName==="H2"&&(i=!1),s[r].id===e&&(i=!0),i?s[r].style.display="block":s[r].style.display="none")},Lt=(s,e)=>{window.addEventListener("hashchange",function(){Te(s,Pe(e),!0)},!1)},Ae=s=>e=>{let t="<li>";return s?t+=e.$el.innerText:t+=`<a href="#${e.$el.id}">${e.$el.innerText}</a>`,e.children.length&&(t+=`<ul>${e.children.map(Ae(!0)).join("")}</ul>`),t+="</li>",t},Rt=(s,e)=>{for(;e.level>=s;)e=e.parent;return e},Ct=(s,e)=>{let t={$el:s,children:[],level:0},i=t;e.forEach(r=>{let n=parseInt(r.tagName.replace("H","")),o={$el:r,children:[],level:n,parent:i};n>i.level?(i.children.push(o),i=o):(i=Rt(n,i),i.children.push(o),i=o)}),s.innerHTML=`<ul>${t.children.map(Ae()).join("")}</ul>`},Ce=(s,e)=>t=>{e&&t.preventDefault(),s.style.display==="block"?s.style.display="":s.style.display="block"},Tt=(s,e)=>{e.addEventListener("click",Ce(s,!0)),s.addEventListener("click",Ce(s),!0)},Pe=s=>{let e=s.querySelector("h2");return window.location.hash.replace(/#/g,"")||e&&e.id},At=()=>{if(typeof document.body.dataset.progress>"u")return;let s=document.querySelector("main"),e=[...s.querySelectorAll("h2")];yt(e);let t=document.getElementById("toc-content"),i=[...s.querySelectorAll("h2, h3")];Ct(t,i);let r=[...s.childNodes];Lt(r,s);let n=Pe(s);Te(r,n);let o=document.getElementById("toc-wrapper"),d=document.getElementById("toc-opener");Tt(o,d)};document.addEventListener("turbo:load",At);})();
|
data/together-theme.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: together-theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dallas Read
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|