1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00
laravel-tips/public/js/app.js
2021-04-07 20:16:47 +02:00

24 lines
No EOL
78 KiB
JavaScript
Vendored
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(()=>{var e,t={52:()=>{class e{init(){document.body.querySelectorAll("[x-cloak]").forEach((e=>{e.setAttribute("data-alpine-was-cloaked",e.getAttribute("x-cloak")??"")})),this.configureEventHandlers()}setMutationObserverState(e){if(!window.Alpine.version||!function(e,t){const i=e.split("."),s=t.split(".");for(let e=0;e<i.length;e++)if(!s[e]||s[e]<i[e])return!1;return!0}("2.4.0",window.Alpine.version))throw new Error("Invalid Alpine version. Please use Alpine 2.4.0 or above");window.Alpine.pauseMutationObserver=e}configureEventHandlers(){const e=()=>{window.Alpine.discoverUninitializedComponents((e=>{window.Alpine.initializeComponent(e)})),requestAnimationFrame((()=>{this.setMutationObserverState(!1)}))},t=e=>{(e.data?e.data.newBody:e.detail.newBody).querySelectorAll("[data-alpine-generated-me],[x-cloak]").forEach((e=>{e.hasAttribute("x-cloak")&&e.setAttribute("data-alpine-was-cloaked",e.getAttribute("x-cloak")??""),e.hasAttribute("data-alpine-generated-me")&&(e.removeAttribute("data-alpine-generated-me"),void 0===e.__x_for_key&&void 0===e.__x_inserted_me&&e.remove())}))},i=()=>{this.setMutationObserverState(!0),document.body.querySelectorAll("[x-for],[x-if],[data-alpine-was-cloaked]").forEach((e=>{if(e.hasAttribute("data-alpine-was-cloaked")&&(e.setAttribute("x-cloak",e.getAttribute("data-alpine-was-cloaked")??""),e.removeAttribute("data-alpine-was-cloaked")),e.hasAttribute("x-for")){let t=e.nextElementSibling;for(;t&&void 0!==t.__x_for_key;){const e=t;t=t.nextElementSibling,e.setAttribute("data-alpine-generated-me",!0)}}else if(e.hasAttribute("x-if")){const t=e.nextElementSibling;t&&void 0!==t.__x_inserted_me&&t.setAttribute("data-alpine-generated-me",!0)}}))};document.addEventListener("turbo:load",e),document.addEventListener("turbolinks:load",e),document.addEventListener("turbo:before-render",t),document.addEventListener("turbolinks:before-render",t),document.addEventListener("turbo:before-cache",i),document.addEventListener("turbolinks:before-cache",i)}}var t;window.Alpine&&console.error("Alpine-turbo-drive-adapter must be included before AlpineJs"),Object.getOwnPropertyDescriptor(NodeList.prototype,"forEach")||Object.defineProperty(NodeList.prototype,"forEach",Object.getOwnPropertyDescriptor(Array.prototype,"forEach")),t=()=>{(new e).init()},"loading"===document.readyState?document.addEventListener("readystatechange",(()=>{"interactive"===document.readyState&&t()})):t()},443:function(e){e.exports=function(){"use strict";function e(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function t(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}function i(i){for(var s=1;s<arguments.length;s++){var n=null!=arguments[s]?arguments[s]:{};s%2?t(Object(n),!0).forEach((function(t){e(i,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))}))}return i}function s(){return new Promise((e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",e):e()}))}function n(e){return Array.from(new Set(e))}function r(){return navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")}function o(e,t){return e==t}function a(e,t){"template"!==e.tagName.toLowerCase()?console.warn(`Alpine: [${t}] directive should only be added to <template> tags. See https://github.com/alpinejs/alpine#${t}`):1!==e.content.childElementCount&&console.warn(`Alpine: <template> tag with [${t}] encountered with an unexpected number of root elements. Make sure <template> has a single root element. `)}function l(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function c(e){return e.toLowerCase().replace(/-(\w)/g,((e,t)=>t.toUpperCase()))}function h(e,t){if(!1===t(e))return;let i=e.firstElementChild;for(;i;)h(i,t),i=i.nextElementSibling}function d(e,t){var i;return function(){var s=this,n=arguments,r=function(){i=null,e.apply(s,n)};clearTimeout(i),i=setTimeout(r,t)}}const u=(e,t,i)=>{if(console.warn(`Alpine Error: "${i}"\n\nExpression: "${t}"\nElement:`,e),!r())throw Object.assign(i,{el:e,expression:t}),i};function m(e,{el:t,expression:i}){try{const s=e();return s instanceof Promise?s.catch((e=>u(t,i,e))):s}catch(e){u(t,i,e)}}function p(e,t,i,s={}){return m((()=>"function"==typeof t?t.call(i):new Function(["$data",...Object.keys(s)],`var __alpine_result; with($data) { __alpine_result = ${t} }; return __alpine_result`)(i,...Object.values(s))),{el:e,expression:t})}function f(e,t,i,s={}){return m((()=>{if("function"==typeof t)return Promise.resolve(t.call(i,s.$event));let e=Function;if(e=Object.getPrototypeOf((async function(){})).constructor,Object.keys(i).includes(t)){let e=new Function(["dataContext",...Object.keys(s)],`with(dataContext) { return ${t} }`)(i,...Object.values(s));return"function"==typeof e?Promise.resolve(e.call(i,s.$event)):Promise.resolve()}return Promise.resolve(new e(["dataContext",...Object.keys(s)],`with(dataContext) { ${t} }`)(i,...Object.values(s)))}),{el:e,expression:t})}const g=/^x-(on|bind|data|text|html|model|if|for|show|cloak|transition|ref|spread)\b/;function v(e){const t=S(e.name);return g.test(t)}function b(e,t,i){let s=Array.from(e.attributes).filter(v).map(w),n=s.filter((e=>"spread"===e.type))[0];if(n){let i=p(e,n.expression,t.$data);s=s.concat(Object.entries(i).map((([e,t])=>w({name:e,value:t}))))}return i?s.filter((e=>e.type===i)):y(s)}function y(e){let t=["bind","model","show","catch-all"];return e.sort(((e,i)=>{let s=-1===t.indexOf(e.type)?"catch-all":e.type,n=-1===t.indexOf(i.type)?"catch-all":i.type;return t.indexOf(s)-t.indexOf(n)}))}function w({name:e,value:t}){const i=S(e),s=i.match(g),n=i.match(/:([a-zA-Z0-9\-:]+)/),r=i.match(/\.[^.\]]+(?=[^\]]*$)/g)||[];return{type:s?s[1]:null,value:n?n[1]:null,modifiers:r.map((e=>e.replace(".",""))),expression:t}}function E(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function S(e){return e.startsWith("@")?e.replace("@","x-on:"):e.startsWith(":")?e.replace(":","x-bind:"):e}function x(e,t=Boolean){return e.split(" ").filter(t)}const k="in",L="out",A="cancelled";function C(e,t,i,s,n=!1){if(n)return t();if(e.__x_transition&&e.__x_transition.type===k)return;const r=b(e,s,"transition"),o=b(e,s,"show")[0];if(o&&o.modifiers.includes("transition")){let s=o.modifiers;if(s.includes("out")&&!s.includes("in"))return t();const n=s.includes("in")&&s.includes("out");s=n?s.filter(((e,t)=>t<s.indexOf("out"))):s,_(e,s,t,i)}else r.some((e=>["enter","enter-start","enter-end"].includes(e.value)))?F(e,s,r,t,i):t()}function R(e,t,i,s,n=!1){if(n)return t();if(e.__x_transition&&e.__x_transition.type===L)return;const r=b(e,s,"transition"),o=b(e,s,"show")[0];if(o&&o.modifiers.includes("transition")){let s=o.modifiers;if(s.includes("in")&&!s.includes("out"))return t();const n=s.includes("in")&&s.includes("out");s=n?s.filter(((e,t)=>t>s.indexOf("out"))):s,O(e,s,n,t,i)}else r.some((e=>["leave","leave-start","leave-end"].includes(e.value)))?M(e,s,r,t,i):t()}function _(e,t,i,s){P(e,t,i,(()=>{}),s,{duration:T(t,"duration",150),origin:T(t,"origin","center"),first:{opacity:0,scale:T(t,"scale",95)},second:{opacity:1,scale:100}},k)}function O(e,t,i,s,n){P(e,t,(()=>{}),s,n,{duration:i?T(t,"duration",150):T(t,"duration",150)/2,origin:T(t,"origin","center"),first:{opacity:1,scale:100},second:{opacity:0,scale:T(t,"scale",95)}},L)}function T(e,t,i){if(-1===e.indexOf(t))return i;const s=e[e.indexOf(t)+1];if(!s)return i;if("scale"===t&&!D(s))return i;if("duration"===t){let e=s.match(/([0-9]+)ms/);if(e)return e[1]}return"origin"===t&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[s,e[e.indexOf(t)+2]].join(" "):s}function P(e,t,i,s,n,r,o){e.__x_transition&&e.__x_transition.cancel&&e.__x_transition.cancel();const a=e.style.opacity,l=e.style.transform,c=e.style.transformOrigin,h=!t.includes("opacity")&&!t.includes("scale"),d=h||t.includes("opacity"),u=h||t.includes("scale"),m={start(){d&&(e.style.opacity=r.first.opacity),u&&(e.style.transform=`scale(${r.first.scale/100})`)},during(){u&&(e.style.transformOrigin=r.origin),e.style.transitionProperty=[d?"opacity":"",u?"transform":""].join(" ").trim(),e.style.transitionDuration=r.duration/1e3+"s",e.style.transitionTimingFunction="cubic-bezier(0.4, 0.0, 0.2, 1)"},show(){i()},end(){d&&(e.style.opacity=r.second.opacity),u&&(e.style.transform=`scale(${r.second.scale/100})`)},hide(){s()},cleanup(){d&&(e.style.opacity=a),u&&(e.style.transform=l),u&&(e.style.transformOrigin=c),e.style.transitionProperty=null,e.style.transitionDuration=null,e.style.transitionTimingFunction=null}};q(e,m,o,n)}const I=(e,t,i)=>"function"==typeof e?i.evaluateReturnExpression(t,e):e;function F(e,t,i,s,n){H(e,x(I((i.find((e=>"enter"===e.value))||{expression:""}).expression,e,t)),x(I((i.find((e=>"enter-start"===e.value))||{expression:""}).expression,e,t)),x(I((i.find((e=>"enter-end"===e.value))||{expression:""}).expression,e,t)),s,(()=>{}),k,n)}function M(e,t,i,s,n){H(e,x(I((i.find((e=>"leave"===e.value))||{expression:""}).expression,e,t)),x(I((i.find((e=>"leave-start"===e.value))||{expression:""}).expression,e,t)),x(I((i.find((e=>"leave-end"===e.value))||{expression:""}).expression,e,t)),(()=>{}),s,L,n)}function H(e,t,i,s,n,r,o,a){e.__x_transition&&e.__x_transition.cancel&&e.__x_transition.cancel();const l=e.__x_original_classes||[],c={start(){e.classList.add(...i)},during(){e.classList.add(...t)},show(){n()},end(){e.classList.remove(...i.filter((e=>!l.includes(e)))),e.classList.add(...s)},hide(){r()},cleanup(){e.classList.remove(...t.filter((e=>!l.includes(e)))),e.classList.remove(...s.filter((e=>!l.includes(e))))}};q(e,c,o,a)}function q(e,t,i,s){const n=B((()=>{t.hide(),e.isConnected&&t.cleanup(),delete e.__x_transition}));e.__x_transition={type:i,cancel:B((()=>{s(A),n()})),finish:n,nextFrame:null},t.start(),t.during(),e.__x_transition.nextFrame=requestAnimationFrame((()=>{let i=1e3*Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""));0===i&&(i=1e3*Number(getComputedStyle(e).animationDuration.replace("s",""))),t.show(),e.__x_transition.nextFrame=requestAnimationFrame((()=>{t.end(),setTimeout(e.__x_transition.finish,i)}))}))}function D(e){return!Array.isArray(e)&&!isNaN(e)}function B(e){let t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}function $(e,t,i,s,n){a(t,"x-for");let r=N("function"==typeof i?e.evaluateReturnExpression(t,i):i),o=z(e,t,r,n),l=t;o.forEach(((i,a)=>{let c=j(r,i,a,o,n()),h=V(e,t,a,c),d=U(l.nextElementSibling,h);d?(delete d.__x_for_key,d.__x_for=c,e.updateElements(d,(()=>d.__x_for))):(d=W(t,l),C(d,(()=>{}),(()=>{}),e,s),d.__x_for=c,e.initializeElements(d,(()=>d.__x_for))),l=d,l.__x_for_key=h})),K(l,e)}function N(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,i=/^\(|\)$/g,s=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,n=String(e).match(s);if(!n)return;let r={};r.items=n[2].trim();let o=n[1].trim().replace(i,""),a=o.match(t);return a?(r.item=o.replace(t,"").trim(),r.index=a[1].trim(),a[2]&&(r.collection=a[2].trim())):r.item=o,r}function j(e,t,s,n,r){let o=r?i({},r):{};return o[e.item]=t,e.index&&(o[e.index]=s),e.collection&&(o[e.collection]=n),o}function V(e,t,i,s){let n=b(t,e,"bind").filter((e=>"key"===e.value))[0];return n?e.evaluateReturnExpression(t,n.expression,(()=>s)):i}function z(e,t,i,s){let n=b(t,e,"if")[0];if(n&&!e.evaluateReturnExpression(t,n.expression))return[];let r=e.evaluateReturnExpression(t,i.items,s);return D(r)&&r>=0&&(r=Array.from(Array(r).keys(),(e=>e+1))),r}function W(e,t){let i=document.importNode(e.content,!0);return t.parentElement.insertBefore(i,t.nextElementSibling),t.nextElementSibling}function U(e,t){if(!e)return;if(void 0===e.__x_for_key)return;if(e.__x_for_key===t)return e;let i=e;for(;i;){if(i.__x_for_key===t)return i.parentElement.insertBefore(i,e);i=!(!i.nextElementSibling||void 0===i.nextElementSibling.__x_for_key)&&i.nextElementSibling}}function K(e,t){for(var i=!(!e.nextElementSibling||void 0===e.nextElementSibling.__x_for_key)&&e.nextElementSibling;i;){let e=i,s=i.nextElementSibling;R(i,(()=>{e.remove()}),(()=>{}),t),i=!(!s||void 0===s.__x_for_key)&&s}}function G(e,t,i,s,r,a,l){var h=e.evaluateReturnExpression(t,s,r);if("value"===i){if(Ue.ignoreFocusedForValueBinding&&document.activeElement.isSameNode(t))return;if(void 0===h&&String(s).match(/\./)&&(h=""),"radio"===t.type)void 0===t.attributes.value&&"bind"===a?t.value=h:"bind"!==a&&(t.checked=o(t.value,h));else if("checkbox"===t.type)"boolean"==typeof h||[null,void 0].includes(h)||"bind"!==a?"bind"!==a&&(Array.isArray(h)?t.checked=h.some((e=>o(e,t.value))):t.checked=!!h):t.value=String(h);else if("SELECT"===t.tagName)X(t,h);else{if(t.value===h)return;t.value=h}}else if("class"===i)if(Array.isArray(h)){const e=t.__x_original_classes||[];t.setAttribute("class",n(e.concat(h)).join(" "))}else if("object"==typeof h)Object.keys(h).sort(((e,t)=>h[e]-h[t])).forEach((e=>{h[e]?x(e).forEach((e=>t.classList.add(e))):x(e).forEach((e=>t.classList.remove(e)))}));else{const e=t.__x_original_classes||[],i=h?x(h):[];t.setAttribute("class",n(e.concat(i)).join(" "))}else i=l.includes("camel")?c(i):i,[null,void 0,!1].includes(h)?t.removeAttribute(i):E(i)?J(t,i,i):J(t,i,h)}function J(e,t,i){e.getAttribute(t)!=i&&e.setAttribute(t,i)}function X(e,t){const i=[].concat(t).map((e=>e+""));Array.from(e.options).forEach((e=>{e.selected=i.includes(e.value||e.text)}))}function Y(e,t,i){void 0===t&&String(i).match(/\./)&&(t=""),e.textContent=t}function Z(e,t,i,s){t.innerHTML=e.evaluateReturnExpression(t,i,s)}function Q(e,t,i,s,n=!1){const r=()=>{t.style.display="none",t.__x_is_shown=!1},o=()=>{1===t.style.length&&"none"===t.style.display?t.removeAttribute("style"):t.style.removeProperty("display"),t.__x_is_shown=!0};if(!0===n)return void(i?o():r());const a=(s,n)=>{i?(("none"===t.style.display||t.__x_transition)&&C(t,(()=>{o()}),n,e),s((()=>{}))):"none"!==t.style.display?R(t,(()=>{s((()=>{r()}))}),n,e):s((()=>{}))};s.includes("immediate")?a((e=>e()),(()=>{})):(e.showDirectiveLastElement&&!e.showDirectiveLastElement.contains(t)&&e.executeAndClearRemainingShowDirectiveStack(),e.showDirectiveStack.push(a),e.showDirectiveLastElement=t)}function ee(e,t,i,s,n){a(t,"x-if");const r=t.nextElementSibling&&!0===t.nextElementSibling.__x_inserted_me;if(!i||r&&!t.__x_transition)!i&&r&&R(t.nextElementSibling,(()=>{t.nextElementSibling.remove()}),(()=>{}),e,s);else{const i=document.importNode(t.content,!0);t.parentElement.insertBefore(i,t.nextElementSibling),C(t.nextElementSibling,(()=>{}),(()=>{}),e,s),e.initializeElements(t.nextElementSibling,n),t.nextElementSibling.__x_inserted_me=!0}}function te(e,t,i,s,n,r={}){const o={passive:s.includes("passive")};let a,l;if(s.includes("camel")&&(i=c(i)),s.includes("away")?(l=document,a=l=>{t.contains(l.target)||t.offsetWidth<1&&t.offsetHeight<1||(ie(e,n,l,r),s.includes("once")&&document.removeEventListener(i,a,o))}):(l=s.includes("window")?window:s.includes("document")?document:t,a=c=>{l!==window&&l!==document||document.body.contains(t)?se(i)&&ne(c,s)||(s.includes("prevent")&&c.preventDefault(),s.includes("stop")&&c.stopPropagation(),s.includes("self")&&c.target!==t)||ie(e,n,c,r).then((e=>{!1===e?c.preventDefault():s.includes("once")&&l.removeEventListener(i,a,o)})):l.removeEventListener(i,a,o)}),s.includes("debounce")){let e=s[s.indexOf("debounce")+1]||"invalid-wait",t=D(e.split("ms")[0])?Number(e.split("ms")[0]):250;a=d(a,t)}l.addEventListener(i,a,o)}function ie(e,t,s,n){return e.evaluateCommandExpression(s.target,t,(()=>i(i({},n()),{},{$event:s})))}function se(e){return["keydown","keyup"].includes(e)}function ne(e,t){let i=t.filter((e=>!["window","document","prevent","stop"].includes(e)));if(i.includes("debounce")){let e=i.indexOf("debounce");i.splice(e,D((i[e+1]||"invalid-wait").split("ms")[0])?2:1)}if(0===i.length)return!1;if(1===i.length&&i[0]===re(e.key))return!1;const s=["ctrl","shift","alt","meta","cmd","super"].filter((e=>i.includes(e)));return i=i.filter((e=>!s.includes(e))),!(s.length>0&&s.filter((t=>("cmd"!==t&&"super"!==t||(t="meta"),e[`${t}Key`]))).length===s.length&&i[0]===re(e.key))}function re(e){switch(e){case"/":return"slash";case" ":case"Spacebar":return"space";default:return e&&l(e)}}function oe(e,t,s,n,r){var o="select"===t.tagName.toLowerCase()||["checkbox","radio"].includes(t.type)||s.includes("lazy")?"change":"input";te(e,t,o,s,`${n} = rightSideOfExpression($event, ${n})`,(()=>i(i({},r()),{},{rightSideOfExpression:ae(t,s,n)})))}function ae(e,t,i){return"radio"===e.type&&(e.hasAttribute("name")||e.setAttribute("name",i)),(i,s)=>{if(i instanceof CustomEvent&&i.detail)return i.detail;if("checkbox"===e.type){if(Array.isArray(s)){const e=t.includes("number")?le(i.target.value):i.target.value;return i.target.checked?s.concat([e]):s.filter((t=>!o(t,e)))}return i.target.checked}if("select"===e.tagName.toLowerCase()&&e.multiple)return t.includes("number")?Array.from(i.target.selectedOptions).map((e=>le(e.value||e.text))):Array.from(i.target.selectedOptions).map((e=>e.value||e.text));{const e=i.target.value;return t.includes("number")?le(e):t.includes("trim")?e.trim():e}}}function le(e){const t=e?parseFloat(e):null;return D(t)?t:e}const{isArray:ce}=Array,{getPrototypeOf:he,create:de,defineProperty:ue,defineProperties:me,isExtensible:pe,getOwnPropertyDescriptor:fe,getOwnPropertyNames:ge,getOwnPropertySymbols:ve,preventExtensions:be,hasOwnProperty:ye}=Object,{push:we,concat:Ee,map:Se}=Array.prototype;function xe(e){return void 0===e}function ke(e){return"function"==typeof e}function Le(e){return"object"==typeof e}const Ae=new WeakMap;function Ce(e,t){Ae.set(e,t)}const Re=e=>Ae.get(e)||e;function _e(e,t){return e.valueIsObservable(t)?e.getProxy(t):t}function Oe(e){return ye.call(e,"value")&&(e.value=Re(e.value)),e}function Te(e,t,i){Ee.call(ge(i),ve(i)).forEach((s=>{let n=fe(i,s);n.configurable||(n=Ne(e,n,_e)),ue(t,s,n)})),be(t)}class Pe{constructor(e,t){this.originalTarget=t,this.membrane=e}get(e,t){const{originalTarget:i,membrane:s}=this,n=i[t],{valueObserved:r}=s;return r(i,t),s.getProxy(n)}set(e,t,i){const{originalTarget:s,membrane:{valueMutated:n}}=this;return s[t]!==i?(s[t]=i,n(s,t)):"length"===t&&ce(s)&&n(s,t),!0}deleteProperty(e,t){const{originalTarget:i,membrane:{valueMutated:s}}=this;return delete i[t],s(i,t),!0}apply(e,t,i){}construct(e,t,i){}has(e,t){const{originalTarget:i,membrane:{valueObserved:s}}=this;return s(i,t),t in i}ownKeys(e){const{originalTarget:t}=this;return Ee.call(ge(t),ve(t))}isExtensible(e){const t=pe(e);if(!t)return t;const{originalTarget:i,membrane:s}=this,n=pe(i);return n||Te(s,e,i),n}setPrototypeOf(e,t){}getPrototypeOf(e){const{originalTarget:t}=this;return he(t)}getOwnPropertyDescriptor(e,t){const{originalTarget:i,membrane:s}=this,{valueObserved:n}=this.membrane;n(i,t);let r=fe(i,t);if(xe(r))return r;const o=fe(e,t);return xe(o)?(r=Ne(s,r,_e),r.configurable||ue(e,t,r),r):o}preventExtensions(e){const{originalTarget:t,membrane:i}=this;return Te(i,e,t),be(t),!0}defineProperty(e,t,i){const{originalTarget:s,membrane:n}=this,{valueMutated:r}=n,{configurable:o}=i;if(ye.call(i,"writable")&&!ye.call(i,"value")){const e=fe(s,t);i.value=e.value}return ue(s,t,Oe(i)),!1===o&&ue(e,t,Ne(n,i,_e)),r(s,t),!0}}function Ie(e,t){return e.valueIsObservable(t)?e.getReadOnlyProxy(t):t}class Fe{constructor(e,t){this.originalTarget=t,this.membrane=e}get(e,t){const{membrane:i,originalTarget:s}=this,n=s[t],{valueObserved:r}=i;return r(s,t),i.getReadOnlyProxy(n)}set(e,t,i){return!1}deleteProperty(e,t){return!1}apply(e,t,i){}construct(e,t,i){}has(e,t){const{originalTarget:i,membrane:{valueObserved:s}}=this;return s(i,t),t in i}ownKeys(e){const{originalTarget:t}=this;return Ee.call(ge(t),ve(t))}setPrototypeOf(e,t){}getOwnPropertyDescriptor(e,t){const{originalTarget:i,membrane:s}=this,{valueObserved:n}=s;n(i,t);let r=fe(i,t);if(xe(r))return r;const o=fe(e,t);return xe(o)?(r=Ne(s,r,Ie),ye.call(r,"set")&&(r.set=void 0),r.configurable||ue(e,t,r),r):o}preventExtensions(e){return!1}defineProperty(e,t,i){return!1}}function Me(e){let t;return ce(e)?t=[]:Le(e)&&(t={}),t}const He=Object.prototype;function qe(e){if(null===e)return!1;if("object"!=typeof e)return!1;if(ce(e))return!0;const t=he(e);return t===He||null===t||null===he(t)}const De=(e,t)=>{},Be=(e,t)=>{},$e=e=>e;function Ne(e,t,i){const{set:s,get:n}=t;return ye.call(t,"value")?t.value=i(e,t.value):(xe(n)||(t.get=function(){return i(e,n.call(Re(this)))}),xe(s)||(t.set=function(t){s.call(Re(this),e.unwrapProxy(t))})),t}class je{constructor(e){if(this.valueDistortion=$e,this.valueMutated=Be,this.valueObserved=De,this.valueIsObservable=qe,this.objectGraph=new WeakMap,!xe(e)){const{valueDistortion:t,valueMutated:i,valueObserved:s,valueIsObservable:n}=e;this.valueDistortion=ke(t)?t:$e,this.valueMutated=ke(i)?i:Be,this.valueObserved=ke(s)?s:De,this.valueIsObservable=ke(n)?n:qe}}getProxy(e){const t=Re(e),i=this.valueDistortion(t);if(this.valueIsObservable(i)){const s=this.getReactiveState(t,i);return s.readOnly===e?e:s.reactive}return i}getReadOnlyProxy(e){e=Re(e);const t=this.valueDistortion(e);return this.valueIsObservable(t)?this.getReactiveState(e,t).readOnly:t}unwrapProxy(e){return Re(e)}getReactiveState(e,t){const{objectGraph:i}=this;let s=i.get(t);if(s)return s;const n=this;return s={get reactive(){const i=new Pe(n,t),s=new Proxy(Me(t),i);return Ce(s,e),ue(this,"reactive",{value:s}),s},get readOnly(){const i=new Fe(n,t),s=new Proxy(Me(t),i);return Ce(s,e),ue(this,"readOnly",{value:s}),s}},i.set(t,s),s}}function Ve(e,t){let i=new je({valueMutated(e,i){t(e,i)}});return{data:i.getProxy(e),membrane:i}}function ze(e,t){let i=e.unwrapProxy(t),s={};return Object.keys(i).forEach((e=>{["$el","$refs","$nextTick","$watch"].includes(e)||(s[e]=i[e])})),s}class We{constructor(e,t=null){this.$el=e;const i=this.$el.getAttribute("x-data"),s=""===i?"{}":i,n=this.$el.getAttribute("x-init");let r={$el:this.$el},o=t?t.$el:this.$el;Object.entries(Ue.magicProperties).forEach((([e,t])=>{Object.defineProperty(r,`$${e}`,{get:function(){return t(o)}})})),this.unobservedData=t?t.getUnobservedData():p(e,s,r);let{membrane:a,data:l}=this.wrapDataInObservable(this.unobservedData);var c;this.$data=l,this.membrane=a,this.unobservedData.$el=this.$el,this.unobservedData.$refs=this.getRefsProxy(),this.nextTickStack=[],this.unobservedData.$nextTick=e=>{this.nextTickStack.push(e)},this.watchers={},this.unobservedData.$watch=(e,t)=>{this.watchers[e]||(this.watchers[e]=[]),this.watchers[e].push(t)},Object.entries(Ue.magicProperties).forEach((([e,t])=>{Object.defineProperty(this.unobservedData,`$${e}`,{get:function(){return t(o,this.$el)}})})),this.showDirectiveStack=[],this.showDirectiveLastElement,t||Ue.onBeforeComponentInitializeds.forEach((e=>e(this))),n&&!t&&(this.pauseReactivity=!0,c=this.evaluateReturnExpression(this.$el,n),this.pauseReactivity=!1),this.initializeElements(this.$el,(()=>{}),t),this.listenForNewElementsToInitialize(),"function"==typeof c&&c.call(this.$data),t||setTimeout((()=>{Ue.onComponentInitializeds.forEach((e=>e(this)))}),0)}getUnobservedData(){return ze(this.membrane,this.$data)}wrapDataInObservable(e){var t=this;let i=d((function(){t.updateElements(t.$el)}),0);return Ve(e,((e,s)=>{t.watchers[s]?t.watchers[s].forEach((t=>t(e[s]))):Array.isArray(e)?Object.keys(t.watchers).forEach((i=>{let n=i.split(".");"length"!==s&&n.reduce(((s,n)=>(Object.is(e,s[n])&&t.watchers[i].forEach((t=>t(e))),s[n])),t.unobservedData)})):Object.keys(t.watchers).filter((e=>e.includes("."))).forEach((i=>{let n=i.split(".");s===n[n.length-1]&&n.reduce(((n,r)=>(Object.is(e,n)&&t.watchers[i].forEach((t=>t(e[s]))),n[r])),t.unobservedData)})),t.pauseReactivity||i()}))}walkAndSkipNestedComponents(e,t,i=(()=>{})){h(e,(e=>e.hasAttribute("x-data")&&!e.isSameNode(this.$el)?(e.__x||i(e),!1):t(e)))}initializeElements(e,t=(()=>{}),i=!1){this.walkAndSkipNestedComponents(e,(e=>void 0===e.__x_for_key&&void 0===e.__x_inserted_me&&void this.initializeElement(e,t,!i)),(e=>{i||(e.__x=new We(e))})),this.executeAndClearRemainingShowDirectiveStack(),this.executeAndClearNextTickStack(e)}initializeElement(e,t,i=!0){e.hasAttribute("class")&&b(e,this).length>0&&(e.__x_original_classes=x(e.getAttribute("class"))),i&&this.registerListeners(e,t),this.resolveBoundAttributes(e,!0,t)}updateElements(e,t=(()=>{})){this.walkAndSkipNestedComponents(e,(e=>{if(void 0!==e.__x_for_key&&!e.isSameNode(this.$el))return!1;this.updateElement(e,t)}),(e=>{e.__x=new We(e)})),this.executeAndClearRemainingShowDirectiveStack(),this.executeAndClearNextTickStack(e)}executeAndClearNextTickStack(e){e===this.$el&&this.nextTickStack.length>0&&requestAnimationFrame((()=>{for(;this.nextTickStack.length>0;)this.nextTickStack.shift()()}))}executeAndClearRemainingShowDirectiveStack(){this.showDirectiveStack.reverse().map((e=>new Promise(((t,i)=>{e(t,i)})))).reduce(((e,t)=>e.then((()=>t.then((e=>{e()}))))),Promise.resolve((()=>{}))).catch((e=>{if(e!==A)throw e})),this.showDirectiveStack=[],this.showDirectiveLastElement=void 0}updateElement(e,t){this.resolveBoundAttributes(e,!1,t)}registerListeners(e,t){b(e,this).forEach((({type:i,value:s,modifiers:n,expression:r})=>{switch(i){case"on":te(this,e,s,n,r,t);break;case"model":oe(this,e,n,r,t)}}))}resolveBoundAttributes(e,t=!1,i){let s=b(e,this);s.forEach((({type:n,value:r,modifiers:o,expression:a})=>{switch(n){case"model":G(this,e,"value",a,i,n,o);break;case"bind":if("template"===e.tagName.toLowerCase()&&"key"===r)return;G(this,e,r,a,i,n,o);break;case"text":var l=this.evaluateReturnExpression(e,a,i);Y(e,l,a);break;case"html":Z(this,e,a,i);break;case"show":l=this.evaluateReturnExpression(e,a,i),Q(this,e,l,o,t);break;case"if":if(s.some((e=>"for"===e.type)))return;l=this.evaluateReturnExpression(e,a,i),ee(this,e,l,t,i);break;case"for":$(this,e,a,t,i);break;case"cloak":e.removeAttribute("x-cloak")}}))}evaluateReturnExpression(e,t,s=(()=>{})){return p(e,t,this.$data,i(i({},s()),{},{$dispatch:this.getDispatchFunction(e)}))}evaluateCommandExpression(e,t,s=(()=>{})){return f(e,t,this.$data,i(i({},s()),{},{$dispatch:this.getDispatchFunction(e)}))}getDispatchFunction(e){return(t,i={})=>{e.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0}))}}listenForNewElementsToInitialize(){const e=this.$el,t={childList:!0,attributes:!0,subtree:!0};new MutationObserver((e=>{for(let t=0;t<e.length;t++){const i=e[t].target.closest("[x-data]");if(i&&i.isSameNode(this.$el)){if("attributes"===e[t].type&&"x-data"===e[t].attributeName){const i=e[t].target.getAttribute("x-data")||"{}",s=p(this.$el,i,{$el:this.$el});Object.keys(s).forEach((e=>{this.$data[e]!==s[e]&&(this.$data[e]=s[e])}))}e[t].addedNodes.length>0&&e[t].addedNodes.forEach((e=>{1!==e.nodeType||e.__x_inserted_me||(!e.matches("[x-data]")||e.__x?this.initializeElements(e):e.__x=new We(e))}))}}})).observe(e,t)}getRefsProxy(){var e=this;return new Proxy({},{get(t,i){return"$isAlpineProxy"===i||(e.walkAndSkipNestedComponents(e.$el,(e=>{e.hasAttribute("x-ref")&&e.getAttribute("x-ref")===i&&(s=e)})),s);var s}})}}const Ue={version:"2.8.2",pauseMutationObserver:!1,magicProperties:{},onComponentInitializeds:[],onBeforeComponentInitializeds:[],ignoreFocusedForValueBinding:!1,start:async function(){r()||await s(),this.discoverComponents((e=>{this.initializeComponent(e)})),document.addEventListener("turbolinks:load",(()=>{this.discoverUninitializedComponents((e=>{this.initializeComponent(e)}))})),this.listenForNewUninitializedComponentsAtRunTime()},discoverComponents:function(e){document.querySelectorAll("[x-data]").forEach((t=>{e(t)}))},discoverUninitializedComponents:function(e,t=null){const i=(t||document).querySelectorAll("[x-data]");Array.from(i).filter((e=>void 0===e.__x)).forEach((t=>{e(t)}))},listenForNewUninitializedComponentsAtRunTime:function(){const e=document.querySelector("body"),t={childList:!0,attributes:!0,subtree:!0};new MutationObserver((e=>{if(!this.pauseMutationObserver)for(let t=0;t<e.length;t++)e[t].addedNodes.length>0&&e[t].addedNodes.forEach((e=>{1===e.nodeType&&(e.parentElement&&e.parentElement.closest("[x-data]")||this.discoverUninitializedComponents((e=>{this.initializeComponent(e)}),e.parentElement))}))})).observe(e,t)},initializeComponent:function(e){if(!e.__x)try{e.__x=new We(e)}catch(e){setTimeout((()=>{throw e}),0)}},clone:function(e,t){t.__x||(t.__x=new We(t,e))},addMagicProperty:function(e,t){this.magicProperties[e]=t},onComponentInitialized:function(e){this.onComponentInitializeds.push(e)},onBeforeComponentInitialized:function(e){this.onBeforeComponentInitializeds.push(e)}};return r()||(window.Alpine=Ue,window.deferLoadingAlpine?window.deferLoadingAlpine((function(){window.Alpine.start()})):window.Alpine.start()),Ue}()},249:(e,t,i)=>{"use strict";!function(){if(void 0===window.Reflect||void 0===window.customElements||window.customElements.polyfillWrapFlushCallback)return;const e=HTMLElement,t=function(){return Reflect.construct(e,[],this.constructor)};window.HTMLElement=t,HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}();const s=new WeakMap;function n(e){const t=function(e){const t=e instanceof Element?e:e instanceof Node?e.parentElement:null,i=t?t.closest("input, button"):null;return"submit"==(null==i?void 0:i.type)?i:null}(e.target);t&&t.form&&s.set(t.form,t)}var r,o,a,l;"SubmitEvent"in window||(addEventListener("click",n,!0),Object.defineProperty(Event.prototype,"submitter",{get(){if("submit"==this.type&&this.target instanceof HTMLFormElement)return s.get(this.target)}})),function(e){e.eager="eager",e.lazy="lazy"}(r||(r={}));class c extends HTMLElement{constructor(){super(),this.loaded=Promise.resolve(),this.delegate=new c.delegateConstructor(this)}static get observedAttributes(){return["loading","src"]}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}attributeChangedCallback(e){"loading"==e?this.delegate.loadingStyleChanged():"src"==e&&this.delegate.sourceURLChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get loading(){return function(e){switch(e.toLowerCase()){case"lazy":return r.lazy;default:return r.eager}}(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 null===(t=null===(e=this.ownerDocument)||void 0===e?void 0:e.documentElement)||void 0===t?void 0:t.hasAttribute("data-turbo-preview")}}function h(e){const t=document.createElement("a");return t.href=e.toString(),new URL(t.href)}function d(e){let t;return e.hash?e.hash.slice(1):(t=e.href.match(/#(.*)$/))?t[1]:""}function u(e){return(function(e){return function(e){return e.pathname.split("/").slice(1)}(e).slice(-1)[0]}(e).match(/\.[^.]*$/)||[])[0]||""}function m(e,t){const i=function(e){return t=e.origin+e.pathname,t.endsWith("/")?t:t+"/";var t}(t);return e.href===h(i).href||e.href.startsWith(i)}function p(e){const t=e.hash.length;return t<2?e.href:e.href.slice(0,-t)}class f{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 h(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.text()}get responseHTML(){return this.isHTML?this.response.text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}}function g(e,{target:t,cancelable:i,detail:s}={}){const n=new CustomEvent(e,{cancelable:i,bubbles:!0,detail:s});return(t||document.documentElement).dispatchEvent(n),n}function v(){return new Promise((e=>requestAnimationFrame((()=>e()))))}function b(e=""){return(new DOMParser).parseFromString(e,"text/html")}function y(e,...t){const i=function(e,t){return e.reduce(((e,i,s)=>e+i+(null==t[s]?"":t[s])),"")}(e,t).replace(/^\n/,"").split("\n"),s=i[0].match(/^\s+/),n=s?s[0].length:0;return i.map((e=>e.slice(n))).join("\n")}function w(){return Array.apply(null,{length:36}).map(((e,t)=>8==t||13==t||18==t||23==t?"-":14==t?"4":19==t?(Math.floor(4*Math.random())+8).toString(16):Math.floor(15*Math.random()).toString(16))).join("")}!function(e){e[e.get=0]="get",e[e.post=1]="post",e[e.put=2]="put",e[e.patch=3]="patch",e[e.delete=4]="delete"}(o||(o={}));class E{constructor(e,t,i,s=new URLSearchParams){this.abortController=new AbortController,this.delegate=e,this.method=t,this.isIdempotent?this.url=function(e,t){const i=new URLSearchParams(e.search);for(const[s,n]of t)n instanceof File||(i.has(s)?(i.delete(s),e.searchParams.set(s,n)):e.searchParams.append(s,n));return e}(i,[...s.entries()]):(this.body=s,this.url=i)}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){const{fetchOptions:e}=this;g("turbo:before-fetch-request",{detail:{fetchOptions:e}});try{this.delegate.requestStarted(this);const t=await fetch(this.url.href,e);return await this.receive(t)}catch(e){throw this.delegate.requestErrored(this,e),e}finally{this.delegate.requestFinished(this)}}async receive(e){const t=new f(e);return g("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t}}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get fetchOptions(){return{method:o[this.method].toUpperCase(),credentials:"same-origin",headers:this.headers,redirect:"follow",body:this.body,signal:this.abortSignal}}get isIdempotent(){return this.method==o.get}get headers(){const e=Object.assign({},this.defaultHeaders);return"function"==typeof this.delegate.prepareHeadersForRequest&&this.delegate.prepareHeadersForRequest(e,this),e}get abortSignal(){return this.abortController.signal}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}}class S{constructor(e,t){this.started=!1,this.intersect=e=>{const t=e.slice(-1)[0];(null==t?void 0:t.isIntersecting)&&this.delegate.elementAppearedInViewport(this.element)},this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}}class x{constructor(e){this.templateElement=document.createElement("template"),this.templateElement.innerHTML=e}static wrap(e){return"string"==typeof e?new this(e):e}get fragment(){const e=document.createDocumentFragment();for(const t of this.foreignElements)e.appendChild(document.importNode(t,!0));return e}get foreignElements(){return this.templateChildren.reduce(((e,t)=>"turbo-stream"==t.tagName.toLowerCase()?[...e,t]:e),[])}get templateChildren(){return Array.from(this.templateElement.content.children)}}x.contentType="text/vnd.turbo-stream.html",function(e){e[e.initialized=0]="initialized",e[e.requesting=1]="requesting",e[e.waiting=2]="waiting",e[e.receiving=3]="receiving",e[e.stopping=4]="stopping",e[e.stopped=5]="stopped"}(a||(a={})),function(e){e.urlEncoded="application/x-www-form-urlencoded",e.multipart="multipart/form-data",e.plain="text/plain"}(l||(l={}));class k{constructor(e,t,i,s=!1){this.state=a.initialized,this.delegate=e,this.formElement=t,this.submitter=i,this.formData=function(e,t){const i=new FormData(e),s=null==t?void 0:t.getAttribute("name"),n=null==t?void 0:t.getAttribute("value");s&&i.get(s)!=n&&i.append(s,n||"");return i}(t,i),this.fetchRequest=new E(this,this.method,this.location,this.body),this.mustRedirect=s}get method(){var e;return function(e){switch(e.toLowerCase()){case"get":return o.get;case"post":return o.post;case"put":return o.put;case"patch":return o.patch;case"delete":return o.delete}}(((null===(e=this.submitter)||void 0===e?void 0:e.getAttribute("formmethod"))||this.formElement.getAttribute("method")||"").toLowerCase())||o.get}get action(){var e;return(null===(e=this.submitter)||void 0===e?void 0:e.getAttribute("formaction"))||this.formElement.action}get location(){return h(this.action)}get body(){return this.enctype==l.urlEncoded||this.method==o.get?new URLSearchParams(this.stringFormData):this.formData}get enctype(){var e;return function(e){switch(e.toLowerCase()){case l.multipart:return l.multipart;case l.plain:return l.plain;default:return l.urlEncoded}}((null===(e=this.submitter)||void 0===e?void 0:e.getAttribute("formenctype"))||this.formElement.enctype)}get stringFormData(){return[...this.formData].reduce(((e,[t,i])=>e.concat("string"==typeof i?[[t,i]]:[])),[])}async start(){const{initialized:e,requesting:t}=a;if(this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){const{stopping:e,stopped:t}=a;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareHeadersForRequest(e,t){if(!t.isIdempotent){const t=function(e){if(null!=e){const t=(document.cookie?document.cookie.split("; "):[]).find((t=>t.startsWith(e)));if(t){const e=t.split("=").slice(1).join("=");return e?decodeURIComponent(e):void 0}}}(L("csrf-param"))||L("csrf-token");t&&(e["X-CSRF-Token"]=t),e.Accept=[x.contentType,e.Accept].join(", ")}}requestStarted(e){this.state=a.waiting,g("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)&&function(e){return 200==e.statusCode&&!e.redirected}(t)){const e=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,e)}else this.state=a.receiving,this.result={success:!0,fetchResponse:t},this.delegate.formSubmissionSucceededWithResponse(this,t)}requestFailedWithResponse(e,t){this.result={success:!1,fetchResponse:t},this.delegate.formSubmissionFailedWithResponse(this,t)}requestErrored(e,t){this.result={success:!1,error:t},this.delegate.formSubmissionErrored(this,t)}requestFinished(e){this.state=a.stopped,g("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 L(e){const t=document.querySelector(`meta[name="${e}"]`);return t&&t.content}class A{constructor(e){this.element=e}get children(){return[...this.element.children]}hasAnchor(e){return null!=this.getElementForAnchor(e)}getElementForAnchor(e){try{return this.element.querySelector(`[id='${e}'], a[name='${e}']`)}catch(e){return null}}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]`)}getPermanentElementsPresentInSnapshot(e){return this.permanentElements.filter((({id:t})=>e.getPermanentElementById(t)))}}class C{constructor(e,t){this.submitBubbled=e=>{if(e.target instanceof HTMLFormElement){const t=e.target,i=e.submitter||void 0;this.delegate.shouldInterceptFormSubmission(t,i)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmissionIntercepted(t,i))}},this.delegate=e,this.element=t}start(){this.element.addEventListener("submit",this.submitBubbled)}stop(){this.element.removeEventListener("submit",this.submitBubbled)}}class R{constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){const t=this.snapshot.getElementForAnchor(e);t?this.scrollToElement(t):this.scrollToPosition({x:0,y:0})}scrollToElement(e){e.scrollIntoView()}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}get scrollRoot(){return window}async render(e){if(this.renderer)throw new Error("rendering is already in progress");const{isPreview:t,shouldRender:i,newSnapshot:s}=e;if(i)try{this.renderer=e,this.prepareToRenderSnapshot(e),this.delegate.viewWillRenderSnapshot(s,t),await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(s,t),this.finishRenderingSnapshot(e)}finally{delete this.renderer}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()}}class _ extends R{invalidate(){this.element.innerHTML=""}get snapshot(){return new A(this.element)}}class O{constructor(e,t){this.clickBubbled=e=>{this.respondsToEventTarget(e.target)?this.clickEvent=e:delete this.clickEvent},this.linkClicked=e=>{this.clickEvent&&this.respondsToEventTarget(e.target)&&e.target instanceof Element&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.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){const t=e instanceof Element?e:e instanceof Node?e.parentElement:null;return t&&t.closest("turbo-frame, html")==this.element}}class T{constructor(e,t,i){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=i,this.promise=new Promise(((e,t)=>this.resolvingFunctions={resolve:e,reject:t}))}get shouldRender(){return!0}prepareToRender(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}createScriptElement(e){if("false"==e.getAttribute("data-turbo-eval"))return e;{const t=document.createElement("script");return t.textContent=e.textContent,t.async=!1,function(e,t){for(const{name:i,value:s}of[...t.attributes])e.setAttribute(i,s)}(t,e),t}}preservingPermanentElements(e){const t=(i=this.currentSnapshot,s=this.newSnapshot,i.getPermanentElementsPresentInSnapshot(s).reduce(((e,t)=>{const i=s.getPermanentElementById(t.id);if(i){const s=function(e){const t=document.createElement("meta");return t.setAttribute("name","turbo-permanent-placeholder"),t.setAttribute("content",e.id),{element:t,permanentElement:e}}(t);return P(t,s.element),P(i,t),[...e,s]}return e}),[]));var i,s;e(),function(e){for(const{element:t,permanentElement:i}of e){P(t,i.cloneNode(!0))}}(t)}focusFirstAutofocusableElement(){const e=this.newSnapshot.firstAutofocusableElement;(function(e){return e&&"function"==typeof e.focus})(e)&&e.focus()}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}}function P(e,t){const i=e.parentElement;if(i)return i.replaceChild(t,e)}class I extends T{get shouldRender(){return!0}async render(){await v(),this.preservingPermanentElements((()=>{this.loadFrameElement()})),this.scrollFrameIntoView(),await v(),this.focusFirstAutofocusableElement()}loadFrameElement(){var e;const t=document.createRange();t.selectNodeContents(this.currentElement),t.deleteContents();const i=this.newElement,s=null===(e=i.ownerDocument)||void 0===e?void 0:e.createRange();s&&(s.selectNodeContents(i),this.currentElement.appendChild(s.extractContents()))}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){const i=this.currentElement.firstElementChild,s=(e=this.currentElement.getAttribute("data-autoscroll-block"),t="end","end"==e||"start"==e||"center"==e||"nearest"==e?e:t);if(i)return i.scrollIntoView({block:s}),!0}var e,t;return!1}}function F(e){if(null!=e){const t=document.getElementById(e);if(t instanceof c)return t}}function M(e){if(e&&e.ownerDocument!==document&&(e=document.importNode(e,!0)),e instanceof c)return e}const H={append(){var e;null===(e=this.targetElement)||void 0===e||e.append(this.templateContent)},prepend(){var e;null===(e=this.targetElement)||void 0===e||e.prepend(this.templateContent)},remove(){var e;null===(e=this.targetElement)||void 0===e||e.remove()},replace(){var e;null===(e=this.targetElement)||void 0===e||e.replaceWith(this.templateContent)},update(){this.targetElement&&(this.targetElement.innerHTML="",this.targetElement.append(this.templateContent))}};class q extends HTMLElement{async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){var e;return null!==(e=this.renderPromise)&&void 0!==e?e:this.renderPromise=(async()=>{this.dispatchEvent(this.beforeRenderEvent)&&(await v(),this.performAction())})()}disconnect(){try{this.remove()}catch(e){}}get performAction(){if(this.action){const e=H[this.action];if(e)return e;this.raise("unknown action")}this.raise("action attribute is missing")}get targetElement(){var e;if(this.target)return null===(e=this.ownerDocument)||void 0===e?void 0:e.getElementById(this.target);this.raise("target attribute is missing")}get templateContent(){return this.templateElement.content}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")}raise(e){throw new Error(`${this.description}: ${e}`)}get description(){var e,t;return null!==(t=(null!==(e=this.outerHTML.match(/<[^>]+>/))&&void 0!==e?e:[])[0])&&void 0!==t?t:"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0})}}c.delegateConstructor=class{constructor(e){this.resolveVisitPromise=()=>{},this.element=e,this.view=new _(this,this.element),this.appearanceObserver=new S(this,this.element),this.linkInterceptor=new O(this,this.element),this.formInterceptor=new C(this,this.element)}connect(){this.loadingStyle==r.lazy&&this.appearanceObserver.start(),this.linkInterceptor.start(),this.formInterceptor.start()}disconnect(){this.appearanceObserver.stop(),this.linkInterceptor.stop(),this.formInterceptor.stop()}sourceURLChanged(){this.loadingStyle==r.eager&&this.loadSourceURL()}loadingStyleChanged(){this.loadingStyle==r.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.loadSourceURL())}async loadSourceURL(){if(this.isActive&&this.sourceURL&&this.sourceURL!=this.loadingURL)try{this.loadingURL=this.sourceURL,this.element.loaded=this.visit(this.sourceURL),this.appearanceObserver.stop(),await this.element.loaded}finally{delete this.loadingURL}}async loadResponse(e){try{const t=await e.responseHTML;if(t){const{body:e}=b(t),i=new A(await this.extractForeignFrameElement(e)),s=new I(this.view.snapshot,i,!1);await this.view.render(s)}}catch(e){console.error(e),this.view.invalidate()}}elementAppearedInViewport(e){this.loadSourceURL()}shouldInterceptLinkClick(e,t){return this.shouldInterceptNavigation(e)}linkClickIntercepted(e,t){this.navigateFrame(e,t)}shouldInterceptFormSubmission(e){return this.shouldInterceptNavigation(e)}formSubmissionIntercepted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new k(this,e,t),this.formSubmission.fetchRequest.isIdempotent?this.navigateFrame(e,this.formSubmission.fetchRequest.url.href):this.formSubmission.start()}prepareHeadersForRequest(e,t){e["Turbo-Frame"]=this.id}requestStarted(e){this.element.setAttribute("busy","")}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){this.element.removeAttribute("busy")}formSubmissionStarted(e){}formSubmissionSucceededWithResponse(e,t){this.findFrameElement(e.formElement).delegate.loadResponse(t)}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t)}formSubmissionErrored(e,t){}formSubmissionFinished(e){}viewWillRenderSnapshot(e,t){}viewRenderedSnapshot(e,t){}viewInvalidated(){}async visit(e){const t=new E(this,o.get,h(e));return new Promise((e=>{this.resolveVisitPromise=()=>{this.resolveVisitPromise=()=>{},e()},t.perform()}))}navigateFrame(e,t){this.findFrameElement(e).src=t}findFrameElement(e){var t;return null!==(t=F(e.getAttribute("data-turbo-frame")||this.element.getAttribute("target")))&&void 0!==t?t:this.element}async extractForeignFrameElement(e){let t;const i=CSS.escape(this.id);return(t=M(e.querySelector(`turbo-frame#${i}`)))?t:(t=M(e.querySelector(`turbo-frame[src][recurse~=${i}]`)))?(await t.loaded,await this.extractForeignFrameElement(t)):(console.error(`Response has no matching <turbo-frame id="${i}"> element`),new c)}shouldInterceptNavigation(e){const t=e.getAttribute("data-turbo-frame")||this.element.getAttribute("target");if(!this.enabled||"_top"==t)return!1;if(t){const e=F(t);if(e)return!e.disabled}return!0}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){return this.element.src}get loadingStyle(){return this.element.loading}get isLoading(){return void 0!==this.formSubmission||void 0!==this.loadingURL}get isActive(){return this.element.isActive}},customElements.define("turbo-frame",c),customElements.define("turbo-stream",q),(()=>{let e=document.currentScript;if(e&&!e.hasAttribute("data-turbo-suppress-warning"))for(;e=e.parentElement;)if(e==document.body)return console.warn(y`
You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
Load your applications JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
For more information, see: https://turbo.hotwire.dev/handbook/building#working-with-script-elements
——
Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
`,e.outerHTML)})();class D{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 y`
.turbo-progress-bar {
position: fixed;
display: block;
top: 0;
left: 0;
height: 3px;
background: #0076ff;
z-index: 9999;
transition:
width ${D.animationDuration}ms ease-out,
opacity ${D.animationDuration/2}ms ${D.animationDuration/2}ms ease-in;
transform: translate3d(0, 0, 0);
}
`}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement((()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1})))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,1.5*D.animationDuration)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,D.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}refresh(){requestAnimationFrame((()=>{this.progressElement.style.width=10+90*this.value+"%"}))}createStylesheetElement(){const e=document.createElement("style");return e.type="text/css",e.textContent=D.defaultCSS,e}createProgressElement(){const e=document.createElement("div");return e.className="turbo-progress-bar",e}}D.animationDuration=300;class B extends A{constructor(){super(...arguments),this.detailsByOuterHTML=this.children.reduce(((e,t)=>{const{outerHTML:i}=t,s=i in e?e[i]:{type:$(t),tracked:N(t),elements:[]};return Object.assign(Object.assign({},e),{[i]:Object.assign(Object.assign({},s),{elements:[...s.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((e=>!(e in t.detailsByOuterHTML))).map((e=>this.detailsByOuterHTML[e])).filter((({type:t})=>t==e)).map((({elements:[e]})=>e))}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce(((e,t)=>{const{type:i,tracked:s,elements:n}=this.detailsByOuterHTML[t];return null!=i||s?n.length>1?[...e,...n.slice(1)]:e:[...e,...n]}),[])}getMetaValue(e){const t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce(((t,i)=>{const{elements:[s]}=this.detailsByOuterHTML[i];return function(e,t){return"meta"==e.tagName.toLowerCase()&&e.getAttribute("name")==t}(s,e)?s:t}),void 0)}}function $(e){return function(e){return"script"==e.tagName.toLowerCase()}(e)?"script":function(e){const t=e.tagName.toLowerCase();return"style"==t||"link"==t&&"stylesheet"==e.getAttribute("rel")}(e)?"stylesheet":void 0}function N(e){return"reload"==e.getAttribute("data-turbo-track")}class j extends A{constructor(e,t){super(e),this.headSnapshot=t}static fromHTMLString(e=""){return this.fromDocument(b(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({head:e,body:t}){return new this(t,new B(e))}clone(){return new j(this.element.cloneNode(!0),this.headSnapshot)}get headElement(){return this.headSnapshot.element}get rootLocation(){var e;return h(null!==(e=this.getSetting("root"))&&void 0!==e?e:"/")}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return"no-preview"!=this.cacheControlValue}get isCacheable(){return"no-cache"!=this.cacheControlValue}get isVisitable(){return"reload"!=this.getSetting("visit-control")}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}}var V,z;!function(e){e.visitStart="visitStart",e.requestStart="requestStart",e.requestEnd="requestEnd",e.visitEnd="visitEnd"}(V||(V={})),function(e){e.initialized="initialized",e.started="started",e.canceled="canceled",e.failed="failed",e.completed="completed"}(z||(z={}));const W={action:"advance",historyChanged:!1};var U,K;!function(e){e[e.networkFailure=0]="networkFailure",e[e.timeoutFailure=-1]="timeoutFailure",e[e.contentTypeMismatch=-2]="contentTypeMismatch"}(U||(U={}));class G{constructor(e,t,i,s={}){this.identifier=w(),this.timingMetrics={},this.followedRedirect=!1,this.historyChanged=!1,this.scrolled=!1,this.snapshotCached=!1,this.state=z.initialized,this.delegate=e,this.location=t,this.restorationIdentifier=i||w();const{action:n,historyChanged:r,referrer:o,snapshotHTML:a,response:l}=Object.assign(Object.assign({},W),s);this.action=n,this.historyChanged=r,this.referrer=o,this.snapshotHTML=a,this.response=l}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}start(){this.state==z.initialized&&(this.recordTimingMetric(V.visitStart),this.state=z.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==z.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=z.canceled)}complete(){this.state==z.started&&(this.recordTimingMetric(V.visitEnd),this.state=z.completed,this.adapter.visitCompleted(this),this.delegate.visitCompleted(this))}fail(){this.state==z.started&&(this.state=z.failed,this.adapter.visitFailed(this))}changeHistory(){var e;if(!this.historyChanged){const t=this.location.href===(null===(e=this.referrer)||void 0===e?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 E(this,o.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(V.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){const{statusCode:t}=e;J(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(V.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){const{statusCode:e,responseHTML:t}=this.response;this.render((async()=>{this.cacheSnapshot(),J(e)&&null!=t?(await this.view.renderPage(j.fromHTMLString(t)),this.adapter.visitRendered(this),this.complete()):(await this.view.renderError(j.fromHTMLString(t)),this.adapter.visitRendered(this),this.fail())}))}}getCachedSnapshot(){const e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!d(this.location)||e.hasAnchor(d(this.location)))&&("restore"==this.action||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return j.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return null!=this.getCachedSnapshot()}loadCachedSnapshot(){const e=this.getCachedSnapshot();if(e){const t=this.shouldIssueRequest();this.render((async()=>{this.cacheSnapshot(),await this.view.renderPage(e),this.adapter.visitRendered(this),t||this.complete()}))}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&(this.location=this.redirectedToLocation,this.history.replace(this.redirectedToLocation,this.restorationIdentifier),this.followedRedirect=!0)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){const i=await t.responseHTML;null==i?this.recordResponse({statusCode:U.contentTypeMismatch}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:t.statusCode,responseHTML:i}))}async requestFailedWithResponse(e,t){const i=await t.responseHTML;null==i?this.recordResponse({statusCode:U.contentTypeMismatch}):this.recordResponse({statusCode:t.statusCode,responseHTML:i})}requestErrored(e,t){this.recordResponse({statusCode:U.networkFailure})}requestFinished(){this.finishRequest()}performScroll(){this.scrolled||("restore"==this.action?this.scrollToRestoredPosition()||this.scrollToTop():this.scrollToAnchor()||this.scrollToTop(),this.scrolled=!0)}scrollToRestoredPosition(){const{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){if(null!=d(this.location))return this.view.scrollToAnchor(d(this.location)),!0}scrollToTop(){this.view.scrollToPosition({x:0,y: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"object"==typeof this.response}shouldIssueRequest(){return"restore"!=this.action||!this.hasCachedSnapshot()}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(),this.snapshotCached=!0)}async render(e){this.cancelRender(),await new Promise((e=>{this.frame=requestAnimationFrame((()=>e()))})),e(),delete this.frame,this.performScroll()}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}}function J(e){return e>=200&&e<300}class X{constructor(e){this.progressBar=new D,this.showProgressBar=()=>{this.progressBar.show()},this.session=e}visitProposedToLocation(e,t){this.navigator.startVisit(e,w(),t)}visitStarted(e){e.issueRequest(),e.changeHistory(),e.loadCachedSnapshot()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||"restore"!=e.action?this.showProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case U.networkFailure:case U.timeoutFailure:case U.contentTypeMismatch:return this.reload();default:return e.loadResponse()}}visitRequestFinished(e){this.progressBar.setValue(1),this.hideProgressBar()}visitCompleted(e){e.followRedirect()}pageInvalidated(){this.reload()}visitFailed(e){}visitRendered(e){}showProgressBarAfterDelay(){this.progressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideProgressBar(){this.progressBar.hide(),null!=this.progressBarTimeout&&(window.clearTimeout(this.progressBarTimeout),delete this.progressBarTimeout)}reload(){window.location.reload()}get navigator(){return this.session.navigator}}class Y{constructor(e){this.started=!1,this.submitCaptured=()=>{removeEventListener("submit",this.submitBubbled,!1),addEventListener("submit",this.submitBubbled,!1)},this.submitBubbled=e=>{if(!e.defaultPrevented){const t=e.target instanceof HTMLFormElement?e.target:void 0,i=e.submitter||void 0;if(t){"dialog"!=((null==i?void 0:i.getAttribute("formmethod"))||t.method)&&this.delegate.willSubmitForm(t,i)&&(e.preventDefault(),this.delegate.formSubmitted(t,i))}}},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)}}class Z{constructor(e){this.element=e,this.linkInterceptor=new O(this,e),this.formInterceptor=new C(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){const i=this.findFrameElement(e);i&&(i.src=t)}shouldInterceptFormSubmission(e,t){return this.shouldRedirect(e,t)}formSubmissionIntercepted(e,t){const i=this.findFrameElement(e);i&&i.delegate.formSubmissionIntercepted(e,t)}shouldRedirect(e,t){const i=this.findFrameElement(e);return!!i&&i!=e.closest("turbo-frame")}findFrameElement(e){const t=e.getAttribute("data-turbo-frame");if(t&&"_top"!=t){const e=this.element.querySelector(`#${t}:not([disabled])`);if(e instanceof c)return e}}}class Q{constructor(e){this.restorationIdentifier=w(),this.restorationData={},this.started=!1,this.pageLoaded=!1,this.onPopState=e=>{if(this.shouldHandlePopState()){const{turbo:t}=e.state||{};if(t){this.location=new URL(window.location.href);const{restorationIdentifier:e}=t;this.restorationIdentifier=e,this.delegate.historyPoppedToLocationWithRestorationIdentifier(this.location,e)}}},this.onPageLoad=async e=>{await Promise.resolve(),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=w()){const s={turbo:{restorationIdentifier:i}};e.call(history,s,"",t.href),this.location=t,this.restorationIdentifier=i}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){const{restorationIdentifier:t}=this,i=this.restorationData[t];this.restorationData[t]=Object.assign(Object.assign({},i),e)}assumeControlOfScrollRestoration(){var e;this.previousScrollRestoration||(this.previousScrollRestoration=null!==(e=history.scrollRestoration)&&void 0!==e?e:"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||"complete"==document.readyState}}class ee{constructor(e){this.started=!1,this.clickCaptured=()=>{removeEventListener("click",this.clickBubbled,!1),addEventListener("click",this.clickBubbled,!1)},this.clickBubbled=e=>{if(this.clickEventIsSignificant(e)){const t=this.findLinkFromClickTarget(e.target);if(t){const i=this.getLocationForLink(t);this.delegate.willFollowLinkToLocation(t,i)&&(e.preventDefault(),this.delegate.followedLinkToLocation(t,i))}}},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 h(e.getAttribute("href")||"")}}class te{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocation(e)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,i={}){this.stop(),this.currentVisit=new G(this,h(e),t,Object.assign({referrer:this.location},i)),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new k(this,e,t,!0),this.formSubmission.fetchRequest.isIdempotent?this.proposeVisit(this.formSubmission.fetchRequest.url):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){}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){const i=await t.responseHTML;if(i){e.method!=o.get&&this.view.clearSnapshotCache();const{statusCode:s}=t,n={response:{statusCode:s,responseHTML:i}};this.proposeVisit(t.location,n)}}}async formSubmissionFailedWithResponse(e,t){const i=await t.responseHTML;if(i){const e=j.fromHTMLString(i);await this.view.renderPage(e),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){}formSubmissionFinished(e){}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}}!function(e){e[e.initial=0]="initial",e[e.loading=1]="loading",e[e.interactive=2]="interactive",e[e.complete=3]="complete"}(K||(K={}));class ie{constructor(e){this.stage=K.initial,this.started=!1,this.interpretReadyState=()=>{const{readyState:e}=this;"interactive"==e?this.pageIsInteractive():"complete"==e&&this.pageIsComplete()},this.pageWillUnload=()=>{this.delegate.pageWillUnload()},this.delegate=e}start(){this.started||(this.stage==K.initial&&(this.stage=K.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}pageIsInteractive(){this.stage==K.loading&&(this.stage=K.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==K.interactive&&(this.stage=K.complete,this.delegate.pageLoaded())}get readyState(){return document.readyState}}class se{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)}}class ne{constructor(e){this.sources=new Set,this.started=!1,this.inspectFetchResponse=e=>{const t=function(e){var t;const i=null===(t=e.detail)||void 0===t?void 0:t.fetchResponse;if(i instanceof f)return i}(e);t&&function(e){var t;return(null!==(t=e.contentType)&&void 0!==t?t:"").startsWith(x.contentType)}(t)&&(e.preventDefault(),this.receiveMessageResponse(t))},this.receiveMessageEvent=e=>{this.started&&"string"==typeof e.data&&this.receiveMessageHTML(e.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){const t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(new x(e))}}class re extends T{async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){const{documentElement:e,head:t,body:i}=document;e.replaceChild(this.newHead,t),e.replaceChild(this.newElement,i)}activateScriptElements(){for(const e of this.scriptElements){const t=e.parentNode;if(t){const i=this.createScriptElement(e);t.replaceChild(i,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return[...document.documentElement.querySelectorAll("script")]}}class oe extends T{get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}prepareToRender(){this.mergeHead()}async render(){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(const e of this.newHeadStylesheetElements)document.head.appendChild(e)}copyNewHeadScriptElements(){for(const e of this.newHeadScriptElements)document.head.appendChild(this.createScriptElement(e))}removeCurrentHeadProvisionalElements(){for(const e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(const e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(const e of this.newBodyScriptElements){P(e,this.createScriptElement(e))}}assignNewBody(){document.body&&this.newElement instanceof HTMLBodyElement?P(document.body,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")]}}class ae{constructor(e){this.keys=[],this.snapshots={},this.size=e}has(e){return p(e)in this.snapshots}get(e){if(this.has(e)){const t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){this.snapshots={}}read(e){return this.snapshots[p(e)]}write(e,t){this.snapshots[p(e)]=t}touch(e){const t=p(e),i=this.keys.indexOf(t);i>-1&&this.keys.splice(i,1),this.keys.unshift(t),this.trim()}trim(){for(const e of this.keys.splice(this.size))delete this.snapshots[e]}}class le extends R{constructor(){super(...arguments),this.snapshotCache=new ae(10),this.lastRenderedLocation=new URL(location.href)}renderPage(e,t=!1){const i=new oe(this.snapshot,e,t);return this.render(i)}renderError(e){const t=new re(this.snapshot,e,!1);this.render(t)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(){if(this.shouldCacheSnapshot){this.delegate.viewWillCacheSnapshot();const{snapshot:e,lastRenderedLocation:t}=this;await new Promise((e=>setTimeout((()=>e()),0))),this.snapshotCache.put(t,e.clone())}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}get snapshot(){return j.fromElement(this.element)}get shouldCacheSnapshot(){return this.snapshot.isCacheable}}function ce(e){Object.defineProperties(e,he)}const he={absoluteURL:{get(){return this.toString()}}},de=new class{constructor(){this.navigator=new te(this),this.history=new Q(this),this.view=new le(this,document.documentElement),this.adapter=new X(this),this.pageObserver=new ie(this),this.linkClickObserver=new ee(this),this.formSubmitObserver=new Y(this),this.scrollObserver=new se(this),this.streamObserver=new ne(this),this.frameRedirector=new Z(document.documentElement),this.enabled=!0,this.progressBarDelay=500,this.started=!1}start(){this.started||(this.pageObserver.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.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(h(e),t)}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){document.documentElement.appendChild(x.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){this.enabled?this.navigator.proposeVisit(e,{action:"restore",historyChanged:!0}):this.adapter.pageInvalidated()}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willFollowLinkToLocation(e,t){return this.elementIsNavigable(e)&&this.locationIsVisitable(t)&&this.applicationAllowsFollowingLinkToLocation(e,t)}followedLinkToLocation(e,t){const i=this.getActionForLink(e);this.visit(t.href,{action:i})}allowsVisitingLocation(e){return this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){ce(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){ce(e.location),this.notifyApplicationAfterVisitingLocation(e.location)}visitCompleted(e){this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}willSubmitForm(e,t){return this.elementIsNavigable(e)&&this.elementIsNavigable(t)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){this.notifyApplicationBeforeCachingSnapshot()}viewWillRenderSnapshot({element:e},t){this.notifyApplicationBeforeRender(e)}viewRenderedSnapshot(e,t){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender()}viewInvalidated(){this.adapter.pageInvalidated()}applicationAllowsFollowingLinkToLocation(e,t){return!this.notifyApplicationAfterClickingLinkToLocation(e,t).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t){return g("turbo:click",{target:e,detail:{url:t.href},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return g("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e){return g("turbo:visit",{detail:{url:e.href}})}notifyApplicationBeforeCachingSnapshot(){return g("turbo:before-cache")}notifyApplicationBeforeRender(e){return g("turbo:before-render",{detail:{newBody:e}})}notifyApplicationAfterRender(){return g("turbo:render")}notifyApplicationAfterPageLoad(e={}){return g("turbo:load",{detail:{url:this.location.href,timing:e}})}getActionForLink(e){const t=e.getAttribute("data-turbo-action");return function(e){return"advance"==e||"replace"==e||"restore"==e}(t)?t:"advance"}elementIsNavigable(e){const t=null==e?void 0:e.closest("[data-turbo]");return!t||"false"!=t.getAttribute("data-turbo")}locationIsVisitable(e){return m(e,this.snapshot.rootLocation)&&!!u(e).match(/^(?:|\.(?:htm|html|xhtml))$/)}get snapshot(){return this.view.snapshot}},{navigator:ue}=de;de.start();i(52),i(443)},662:()=>{}},i={};function s(e){var n=i[e];if(void 0!==n)return n.exports;var r=i[e]={exports:{}};return t[e].call(r.exports,r,r.exports,s),r.exports}s.m=t,e=[],s.O=(t,i,n,r)=>{if(!i){var o=1/0;for(c=0;c<e.length;c++){for(var[i,n,r]=e[c],a=!0,l=0;l<i.length;l++)(!1&r||o>=r)&&Object.keys(s.O).every((e=>s.O[e](i[l])))?i.splice(l--,1):(a=!1,r<o&&(o=r));a&&(e.splice(c--,1),t=n())}return t}r=r||0;for(var c=e.length;c>0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[i,n,r]},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={773:0,170:0};s.O.j=t=>0===e[t];var t=(t,i)=>{var n,r,[o,a,l]=i,c=0;for(n in a)s.o(a,n)&&(s.m[n]=a[n]);for(l&&l(s),t&&t(i);c<o.length;c++)r=o[c],s.o(e,r)&&e[r]&&e[r][0](),e[o[c]]=0;s.O()},i=self.webpackChunk=self.webpackChunk||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})(),s.O(void 0,[170],(()=>s(249)));var n=s.O(void 0,[170],(()=>s(662)));n=s.O(n)})();