disco-jekyll-theme 0.0.7 → 0.0.10

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.
@@ -1,49 +0,0 @@
1
- (()=>{var Fi=Object.create;var Br=Object.defineProperty;var Pi=Object.getOwnPropertyDescriptor;var Ni=Object.getOwnPropertyNames;var Bi=Object.getPrototypeOf,xi=Object.prototype.hasOwnProperty;var G=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Ii=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ni(e))!xi.call(r,i)&&i!==t&&Br(r,i,{get:()=>e[i],enumerable:!(s=Pi(e,i))||s.enumerable});return r};var xr=(r,e,t)=>(t=r!=null?Fi(Bi(r)):{},Ii(e||!r||!r.__esModule?Br(t,"default",{value:r,enumerable:!0}):t,r));var Gr=G((bt,Xr)=>{(function(r,e){"use strict";typeof define=="function"&&define.amd?define("stackframe",[],e):typeof bt=="object"?Xr.exports=e():r.StackFrame=e()})(bt,function(){"use strict";function r(w){return!isNaN(parseFloat(w))&&isFinite(w)}function e(w){return w.charAt(0).toUpperCase()+w.substring(1)}function t(w){return function(){return this[w]}}var s=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],n=["fileName","functionName","source"],o=["args"],c=["evalOrigin"],u=s.concat(i,n,o,c);function p(w){if(w)for(var S=0;S<u.length;S++)w[u[S]]!==void 0&&this["set"+e(u[S])](w[u[S]])}p.prototype={getArgs:function(){return this.args},setArgs:function(w){if(Object.prototype.toString.call(w)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=w},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(w){if(w instanceof p)this.evalOrigin=w;else if(w instanceof Object)this.evalOrigin=new p(w);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var w=this.getFileName()||"",S=this.getLineNumber()||"",O=this.getColumnNumber()||"",T=this.getFunctionName()||"";return this.getIsEval()?w?"[eval] ("+w+":"+S+":"+O+")":"[eval]:"+S+":"+O:T?T+" ("+w+":"+S+":"+O+")":w+":"+S+":"+O}},p.fromString=function(S){var O=S.indexOf("("),T=S.lastIndexOf(")"),A=S.substring(0,O),f=S.substring(O+1,T).split(","),m=S.substring(T+1);if(m.indexOf("@")===0)var h=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(m,""),l=h[1],_=h[2],b=h[3];return new p({functionName:A,args:f||void 0,fileName:l,lineNumber:_||void 0,columnNumber:b||void 0})};for(var y=0;y<s.length;y++)p.prototype["get"+e(s[y])]=t(s[y]),p.prototype["set"+e(s[y])]=function(w){return function(S){this[w]=!!S}}(s[y]);for(var E=0;E<i.length;E++)p.prototype["get"+e(i[E])]=t(i[E]),p.prototype["set"+e(i[E])]=function(w){return function(S){if(!r(S))throw new TypeError(w+" must be a Number");this[w]=Number(S)}}(i[E]);for(var g=0;g<n.length;g++)p.prototype["get"+e(n[g])]=t(n[g]),p.prototype["set"+e(n[g])]=function(w){return function(S){this[w]=String(S)}}(n[g]);return p})});var Yr=G((wt,Qr)=>{(function(r,e){"use strict";typeof define=="function"&&define.amd?define("error-stack-parser",["stackframe"],e):typeof wt=="object"?Qr.exports=e(Gr()):r.ErrorStackParser=e(r.StackFrame)})(wt,function(e){"use strict";var t=/(^|@)\S+:\d+/,s=/^\s*at .*(\S+:\d+|\(native\))/m,i=/^(eval@)?(\[native code])?$/;return{parse:function(o){if(typeof o.stacktrace<"u"||typeof o["opera#sourceloc"]<"u")return this.parseOpera(o);if(o.stack&&o.stack.match(s))return this.parseV8OrIE(o);if(o.stack)return this.parseFFOrSafari(o);throw new Error("Cannot parse given Error object")},extractLocation:function(o){if(o.indexOf(":")===-1)return[o];var c=/(.+?)(?::(\d+))?(?::(\d+))?$/,u=c.exec(o.replace(/[()]/g,""));return[u[1],u[2]||void 0,u[3]||void 0]},parseV8OrIE:function(o){var c=o.stack.split(`
2
- `).filter(function(u){return!!u.match(s)},this);return c.map(function(u){u.indexOf("(eval ")>-1&&(u=u.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var p=u.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),y=p.match(/ (\(.+\)$)/);p=y?p.replace(y[0],""):p;var E=this.extractLocation(y?y[1]:p),g=y&&p||void 0,w=["eval","<anonymous>"].indexOf(E[0])>-1?void 0:E[0];return new e({functionName:g,fileName:w,lineNumber:E[1],columnNumber:E[2],source:u})},this)},parseFFOrSafari:function(o){var c=o.stack.split(`
3
- `).filter(function(u){return!u.match(i)},this);return c.map(function(u){if(u.indexOf(" > eval")>-1&&(u=u.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),u.indexOf("@")===-1&&u.indexOf(":")===-1)return new e({functionName:u});var p=/((.*".+"[^@]*)?[^@]*)(?:@)/,y=u.match(p),E=y&&y[1]?y[1]:void 0,g=this.extractLocation(u.replace(p,""));return new e({functionName:E,fileName:g[0],lineNumber:g[1],columnNumber:g[2],source:u})},this)},parseOpera:function(o){return!o.stacktrace||o.message.indexOf(`
4
- `)>-1&&o.message.split(`
5
- `).length>o.stacktrace.split(`
6
- `).length?this.parseOpera9(o):o.stack?this.parseOpera11(o):this.parseOpera10(o)},parseOpera9:function(o){for(var c=/Line (\d+).*script (?:in )?(\S+)/i,u=o.message.split(`
7
- `),p=[],y=2,E=u.length;y<E;y+=2){var g=c.exec(u[y]);g&&p.push(new e({fileName:g[2],lineNumber:g[1],source:u[y]}))}return p},parseOpera10:function(o){for(var c=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,u=o.stacktrace.split(`
8
- `),p=[],y=0,E=u.length;y<E;y+=2){var g=c.exec(u[y]);g&&p.push(new e({functionName:g[3]||void 0,fileName:g[2],lineNumber:g[1],source:u[y]}))}return p},parseOpera11:function(o){var c=o.stack.split(`
9
- `).filter(function(u){return!!u.match(t)&&!u.match(/^Error created at/)},this);return c.map(function(u){var p=u.split("@"),y=this.extractLocation(p.pop()),E=p.shift()||"",g=E.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,w;E.match(/\(([^)]*)\)/)&&(w=E.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var S=w===void 0||w==="[arguments not available]"?void 0:w.split(",");return new e({functionName:g,args:S,fileName:y[0],lineNumber:y[1],columnNumber:y[2],source:u})},this)}}})});var as=G((Q,os)=>{var qe=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,He=function(){function r(){this.fetch=!1,this.DOMException=qe.DOMException}return r.prototype=qe,new r}();(function(r){var e=function(t){var s=typeof r<"u"&&r||typeof self<"u"&&self||typeof global<"u"&&global||{},i={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function n(a){return a&&DataView.prototype.isPrototypeOf(a)}if(i.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(a){return a&&o.indexOf(Object.prototype.toString.call(a))>-1};function u(a){if(typeof a!="string"&&(a=String(a)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(a)||a==="")throw new TypeError('Invalid character in header field name: "'+a+'"');return a.toLowerCase()}function p(a){return typeof a!="string"&&(a=String(a)),a}function y(a){var d={next:function(){var L=a.shift();return{done:L===void 0,value:L}}};return i.iterable&&(d[Symbol.iterator]=function(){return d}),d}function E(a){this.map={},a instanceof E?a.forEach(function(d,L){this.append(L,d)},this):Array.isArray(a)?a.forEach(function(d){if(d.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+d.length);this.append(d[0],d[1])},this):a&&Object.getOwnPropertyNames(a).forEach(function(d){this.append(d,a[d])},this)}E.prototype.append=function(a,d){a=u(a),d=p(d);var L=this.map[a];this.map[a]=L?L+", "+d:d},E.prototype.delete=function(a){delete this.map[u(a)]},E.prototype.get=function(a){return a=u(a),this.has(a)?this.map[a]:null},E.prototype.has=function(a){return this.map.hasOwnProperty(u(a))},E.prototype.set=function(a,d){this.map[u(a)]=p(d)},E.prototype.forEach=function(a,d){for(var L in this.map)this.map.hasOwnProperty(L)&&a.call(d,this.map[L],L,this)},E.prototype.keys=function(){var a=[];return this.forEach(function(d,L){a.push(L)}),y(a)},E.prototype.values=function(){var a=[];return this.forEach(function(d){a.push(d)}),y(a)},E.prototype.entries=function(){var a=[];return this.forEach(function(d,L){a.push([L,d])}),y(a)},i.iterable&&(E.prototype[Symbol.iterator]=E.prototype.entries);function g(a){if(!a._noBody){if(a.bodyUsed)return Promise.reject(new TypeError("Already read"));a.bodyUsed=!0}}function w(a){return new Promise(function(d,L){a.onload=function(){d(a.result)},a.onerror=function(){L(a.error)}})}function S(a){var d=new FileReader,L=w(d);return d.readAsArrayBuffer(a),L}function O(a){var d=new FileReader,L=w(d),M=/charset=([A-Za-z0-9_-]+)/.exec(a.type),P=M?M[1]:"utf-8";return d.readAsText(a,P),L}function T(a){for(var d=new Uint8Array(a),L=new Array(d.length),M=0;M<d.length;M++)L[M]=String.fromCharCode(d[M]);return L.join("")}function A(a){if(a.slice)return a.slice(0);var d=new Uint8Array(a.byteLength);return d.set(new Uint8Array(a)),d.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(a){this.bodyUsed=this.bodyUsed,this._bodyInit=a,a?typeof a=="string"?this._bodyText=a:i.blob&&Blob.prototype.isPrototypeOf(a)?this._bodyBlob=a:i.formData&&FormData.prototype.isPrototypeOf(a)?this._bodyFormData=a:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(a)?this._bodyText=a.toString():i.arrayBuffer&&i.blob&&n(a)?(this._bodyArrayBuffer=A(a.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(a)||c(a))?this._bodyArrayBuffer=A(a):this._bodyText=a=Object.prototype.toString.call(a):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof a=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(a)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var a=g(this);if(a)return a;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var a=g(this);return a||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(i.blob)return this.blob().then(S);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var a=g(this);if(a)return a;if(this._bodyBlob)return O(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(T(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}var m=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function h(a){var d=a.toUpperCase();return m.indexOf(d)>-1?d:a}function l(a,d){if(!(this instanceof l))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');d=d||{};var L=d.body;if(a instanceof l){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,d.headers||(this.headers=new E(a.headers)),this.method=a.method,this.mode=a.mode,this.signal=a.signal,!L&&a._bodyInit!=null&&(L=a._bodyInit,a.bodyUsed=!0)}else this.url=String(a);if(this.credentials=d.credentials||this.credentials||"same-origin",(d.headers||!this.headers)&&(this.headers=new E(d.headers)),this.method=h(d.method||this.method||"GET"),this.mode=d.mode||this.mode||null,this.signal=d.signal||this.signal||function(){if("AbortController"in s){var k=new AbortController;return k.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&L)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(L),(this.method==="GET"||this.method==="HEAD")&&(d.cache==="no-store"||d.cache==="no-cache")){var M=/([?&])_=[^&]*/;if(M.test(this.url))this.url=this.url.replace(M,"$1_="+new Date().getTime());else{var P=/\?/;this.url+=(P.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}l.prototype.clone=function(){return new l(this,{body:this._bodyInit})};function _(a){var d=new FormData;return a.trim().split("&").forEach(function(L){if(L){var M=L.split("="),P=M.shift().replace(/\+/g," "),k=M.join("=").replace(/\+/g," ");d.append(decodeURIComponent(P),decodeURIComponent(k))}}),d}function b(a){var d=new E,L=a.replace(/\r?\n[\t ]+/g," ");return L.split("\r").map(function(M){return M.indexOf(`
10
- `)===0?M.substr(1,M.length):M}).forEach(function(M){var P=M.split(":"),k=P.shift().trim();if(k){var xe=P.join(":").trim();try{d.append(k,xe)}catch(mt){console.warn("Response "+mt.message)}}}),d}f.call(l.prototype);function v(a,d){if(!(this instanceof v))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(d||(d={}),this.type="default",this.status=d.status===void 0?200:d.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=d.statusText===void 0?"":""+d.statusText,this.headers=new E(d.headers),this.url=d.url||"",this._initBody(a)}f.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new E(this.headers),url:this.url})},v.error=function(){var a=new v(null,{status:200,statusText:""});return a.ok=!1,a.status=0,a.type="error",a};var R=[301,302,303,307,308];v.redirect=function(a,d){if(R.indexOf(d)===-1)throw new RangeError("Invalid status code");return new v(null,{status:d,headers:{location:a}})},t.DOMException=s.DOMException;try{new t.DOMException}catch{t.DOMException=function(d,L){this.message=d,this.name=L;var M=Error(d);this.stack=M.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function C(a,d){return new Promise(function(L,M){var P=new l(a,d);if(P.signal&&P.signal.aborted)return M(new t.DOMException("Aborted","AbortError"));var k=new XMLHttpRequest;function xe(){k.abort()}k.onload=function(){var q={statusText:k.statusText,headers:b(k.getAllResponseHeaders()||"")};P.url.indexOf("file://")===0&&(k.status<200||k.status>599)?q.status=200:q.status=k.status,q.url="responseURL"in k?k.responseURL:q.headers.get("X-Request-URL");var ie="response"in k?k.response:k.responseText;setTimeout(function(){L(new v(ie,q))},0)},k.onerror=function(){setTimeout(function(){M(new TypeError("Network request failed"))},0)},k.ontimeout=function(){setTimeout(function(){M(new TypeError("Network request timed out"))},0)},k.onabort=function(){setTimeout(function(){M(new t.DOMException("Aborted","AbortError"))},0)};function mt(q){try{return q===""&&s.location.href?s.location.href:q}catch{return q}}if(k.open(P.method,mt(P.url),!0),P.credentials==="include"?k.withCredentials=!0:P.credentials==="omit"&&(k.withCredentials=!1),"responseType"in k&&(i.blob?k.responseType="blob":i.arrayBuffer&&(k.responseType="arraybuffer")),d&&typeof d.headers=="object"&&!(d.headers instanceof E||s.Headers&&d.headers instanceof s.Headers)){var Nr=[];Object.getOwnPropertyNames(d.headers).forEach(function(q){Nr.push(u(q)),k.setRequestHeader(q,p(d.headers[q]))}),P.headers.forEach(function(q,ie){Nr.indexOf(ie)===-1&&k.setRequestHeader(ie,q)})}else P.headers.forEach(function(q,ie){k.setRequestHeader(ie,q)});P.signal&&(P.signal.addEventListener("abort",xe),k.onreadystatechange=function(){k.readyState===4&&P.signal.removeEventListener("abort",xe)}),k.send(typeof P._bodyInit>"u"?null:P._bodyInit)})}return C.polyfill=!0,s.fetch||(s.fetch=C,s.Headers=E,s.Request=l,s.Response=v),t.Headers=E,t.Request=l,t.Response=v,t.fetch=C,Object.defineProperty(t,"__esModule",{value:!0}),t}({})})(He);He.fetch.ponyfill=!0;delete He.fetch.polyfill;var le=qe.fetch?qe:He;Q=le.fetch;Q.default=le.fetch;Q.fetch=le.fetch;Q.Headers=le.Headers;Q.Request=le.Request;Q.Response=le.Response;os.exports=Q});var Et=G((oc,fs)=>{function V(){}V.prototype.clear=function(){this._root=null,this.size=0};V.prototype.find=function(r){for(var e=this._root;e!==null;){var t=this._comparator(r,e.data);if(t===0)return e.data;e=e.get_child(t>0)}return null};V.prototype.findIter=function(r){for(var e=this._root,t=this.iterator();e!==null;){var s=this._comparator(r,e.data);if(s===0)return t._cursor=e,t;t._ancestors.push(e),e=e.get_child(s>0)}return null};V.prototype.lowerBound=function(r){for(var e=this._root,t=this.iterator(),s=this._comparator;e!==null;){var i=s(r,e.data);if(i===0)return t._cursor=e,t;t._ancestors.push(e),e=e.get_child(i>0)}for(var n=t._ancestors.length-1;n>=0;--n)if(e=t._ancestors[n],s(r,e.data)<0)return t._cursor=e,t._ancestors.length=n,t;return t._ancestors.length=0,t};V.prototype.upperBound=function(r){for(var e=this.lowerBound(r),t=this._comparator;e.data()!==null&&t(e.data(),r)===0;)e.next();return e};V.prototype.min=function(){var r=this._root;if(r===null)return null;for(;r.left!==null;)r=r.left;return r.data};V.prototype.max=function(){var r=this._root;if(r===null)return null;for(;r.right!==null;)r=r.right;return r.data};V.prototype.iterator=function(){return new de(this)};V.prototype.each=function(r){for(var e=this.iterator(),t;(t=e.next())!==null;)if(r(t)===!1)return};V.prototype.reach=function(r){for(var e=this.iterator(),t;(t=e.prev())!==null;)if(r(t)===!1)return};function de(r){this._tree=r,this._ancestors=[],this._cursor=null}de.prototype.data=function(){return this._cursor!==null?this._cursor.data:null};de.prototype.next=function(){if(this._cursor===null){var r=this._tree._root;r!==null&&this._minNode(r)}else if(this._cursor.right===null){var e;do if(e=this._cursor,this._ancestors.length)this._cursor=this._ancestors.pop();else{this._cursor=null;break}while(this._cursor.right===e)}else this._ancestors.push(this._cursor),this._minNode(this._cursor.right);return this._cursor!==null?this._cursor.data:null};de.prototype.prev=function(){if(this._cursor===null){var r=this._tree._root;r!==null&&this._maxNode(r)}else if(this._cursor.left===null){var e;do if(e=this._cursor,this._ancestors.length)this._cursor=this._ancestors.pop();else{this._cursor=null;break}while(this._cursor.left===e)}else this._ancestors.push(this._cursor),this._maxNode(this._cursor.left);return this._cursor!==null?this._cursor.data:null};de.prototype._minNode=function(r){for(;r.left!==null;)this._ancestors.push(r),r=r.left;this._cursor=r};de.prototype._maxNode=function(r){for(;r.right!==null;)this._ancestors.push(r),r=r.right;this._cursor=r};fs.exports=V});var gs=G((ac,ms)=>{var tn=Et();function fe(r){this.data=r,this.left=null,this.right=null,this.red=!0}fe.prototype.get_child=function(r){return r?this.right:this.left};fe.prototype.set_child=function(r,e){r?this.right=e:this.left=e};function je(r){this._root=null,this._comparator=r,this.size=0}je.prototype=new tn;je.prototype.insert=function(r){var e=!1;if(this._root===null)this._root=new fe(r),e=!0,this.size++;else{var t=new fe(void 0),s=0,i=0,n=null,o=t,c=null,u=this._root;for(o.right=this._root;;){if(u===null?(u=new fe(r),c.set_child(s,u),e=!0,this.size++):H(u.left)&&H(u.right)&&(u.red=!0,u.left.red=!1,u.right.red=!1),H(u)&&H(c)){var p=o.right===n;u===c.get_child(i)?o.set_child(p,_e(n,!i)):o.set_child(p,ps(n,!i))}var y=this._comparator(u.data,r);if(y===0)break;i=s,s=y<0,n!==null&&(o=n),n=c,c=u,u=u.get_child(s)}this._root=t.right}return this._root.red=!1,e};je.prototype.remove=function(r){if(this._root===null)return!1;var e=new fe(void 0),t=e;t.right=this._root;for(var s=null,i=null,n=null,o=1;t.get_child(o)!==null;){var c=o;i=s,s=t,t=t.get_child(o);var u=this._comparator(r,t.data);if(o=u>0,u===0&&(n=t),!H(t)&&!H(t.get_child(o))){if(H(t.get_child(!o))){var p=_e(t,o);s.set_child(c,p),s=p}else if(!H(t.get_child(!o))){var y=s.get_child(!c);if(y!==null)if(!H(y.get_child(!c))&&!H(y.get_child(c)))s.red=!1,y.red=!0,t.red=!0;else{var E=i.right===s;H(y.get_child(c))?i.set_child(E,ps(s,c)):H(y.get_child(!c))&&i.set_child(E,_e(s,c));var g=i.get_child(E);g.red=!0,t.red=!0,g.left.red=!1,g.right.red=!1}}}}return n!==null&&(n.data=t.data,s.set_child(s.right===t,t.get_child(t.left===null)),this.size--),this._root=e.right,this._root!==null&&(this._root.red=!1),n!==null};function H(r){return r!==null&&r.red}function _e(r,e){var t=r.get_child(!e);return r.set_child(!e,t.get_child(e)),t.set_child(e,r),r.red=!0,t.red=!1,t}function ps(r,e){return r.set_child(!e,_e(r.get_child(!e),!e)),_e(r,e)}ms.exports=je});var ys=G((cc,vs)=>{var rn=Et();function Ae(r){this.data=r,this.left=null,this.right=null}Ae.prototype.get_child=function(r){return r?this.right:this.left};Ae.prototype.set_child=function(r,e){r?this.right=e:this.left=e};function Ve(r){this._root=null,this._comparator=r,this.size=0}Ve.prototype=new rn;Ve.prototype.insert=function(r){if(this._root===null)return this._root=new Ae(r),this.size++,!0;for(var e=0,t=null,s=this._root;;){if(s===null)return s=new Ae(r),t.set_child(e,s),ret=!0,this.size++,!0;if(this._comparator(s.data,r)===0)return!1;e=this._comparator(s.data,r)<0,t=s,s=s.get_child(e)}};Ve.prototype.remove=function(r){if(this._root===null)return!1;var e=new Ae(void 0),t=e;t.right=this._root;for(var s=null,i=null,n=1;t.get_child(n)!==null;){s=t,t=t.get_child(n);var o=this._comparator(r,t.data);n=o>0,o===0&&(i=t)}return i!==null?(i.data=t.data,s.set_child(s.right===t,t.get_child(t.left===null)),this._root=e.right,this.size--,!0):!1};vs.exports=Ve});var ws=G((uc,bs)=>{bs.exports={RBTree:gs(),BinTree:ys()}});var _s=G((hc,Ss)=>{var sn=ws().RBTree;function F(r,e,t){this.discrete=r===!1,this.delta=r||.01,this.K=e===void 0?25:e,this.CX=t===void 0?1.1:t,this.centroids=new sn(Es),this.nreset=0,this.reset()}F.prototype.reset=function(){this.centroids.clear(),this.n=0,this.nreset+=1,this.last_cumulate=0};F.prototype.size=function(){return this.centroids.size};F.prototype.toArray=function(r){var e=[];return r?(this._cumulate(!0),this.centroids.each(function(t){e.push(t)})):this.centroids.each(function(t){e.push({mean:t.mean,n:t.n})}),e};F.prototype.summary=function(){var r=this.discrete?"exact ":"approximating ",e=[r+this.n+" samples using "+this.size()+" centroids","min = "+this.percentile(0),"Q1 = "+this.percentile(.25),"Q2 = "+this.percentile(.5),"Q3 = "+this.percentile(.75),"max = "+this.percentile(1)];return e.join(`
11
- `)};function Es(r,e){return r.mean>e.mean?1:r.mean<e.mean?-1:0}function nn(r,e){return r.mean_cumn-e.mean_cumn}F.prototype.push=function(r,e){e=e||1,r=Array.isArray(r)?r:[r];for(var t=0;t<r.length;t++)this._digest(r[t],e)};F.prototype.push_centroid=function(r){r=Array.isArray(r)?r:[r];for(var e=0;e<r.length;e++)this._digest(r[e].mean,r[e].n)};F.prototype._cumulate=function(r){if(!(this.n===this.last_cumulate||!r&&this.CX&&this.CX>this.n/this.last_cumulate)){var e=0;this.centroids.each(function(t){t.mean_cumn=e+t.n/2,e=t.cumn=e+t.n}),this.n=this.last_cumulate=e}};F.prototype.find_nearest=function(r){if(this.size()===0)return null;var e=this.centroids.lowerBound({mean:r}),t=e.data()===null?e.prev():e.data();if(t.mean===r||this.discrete)return t;var s=e.prev();return s&&Math.abs(s.mean-r)<Math.abs(t.mean-r)?s:t};F.prototype._new_centroid=function(r,e,t){var s={mean:r,n:e,cumn:t};return this.centroids.insert(s),this.n+=e,s};F.prototype._addweight=function(r,e,t){e!==r.mean&&(r.mean+=t*(e-r.mean)/(r.n+t)),r.cumn+=t,r.mean_cumn+=t/2,r.n+=t,this.n+=t};F.prototype._digest=function(r,e){var t=this.centroids.min(),s=this.centroids.max(),i=this.find_nearest(r);if(i&&i.mean===r)this._addweight(i,r,e);else if(i===t)this._new_centroid(r,e,0);else if(i===s)this._new_centroid(r,e,this.n);else if(this.discrete)this._new_centroid(r,e,i.cumn);else{var n=i.mean_cumn/this.n,o=Math.floor(4*this.n*this.delta*n*(1-n));o-i.n>=e?this._addweight(i,r,e):this._new_centroid(r,e,i.cumn)}this._cumulate(!1),!this.discrete&&this.K&&this.size()>this.K/this.delta&&this.compress()};F.prototype.bound_mean=function(r){var e=this.centroids.upperBound({mean:r}),t=e.prev(),s=t.mean===r?t:e.next();return[t,s]};F.prototype.p_rank=function(r){var e=Array.isArray(r)?r:[r],t=e.map(this._p_rank,this);return Array.isArray(r)?t:t[0]};F.prototype._p_rank=function(r){if(this.size()!==0){{if(r<this.centroids.min().mean)return 0;if(r>this.centroids.max().mean)return 1}this._cumulate(!0);var e=this.bound_mean(r),t=e[0],s=e[1];if(this.discrete)return t.cumn/this.n;var i=t.mean_cumn;return t!==s&&(i+=(r-t.mean)*(s.mean_cumn-t.mean_cumn)/(s.mean-t.mean)),i/this.n}};F.prototype.bound_mean_cumn=function(r){this.centroids._comparator=nn;var e=this.centroids.upperBound({mean_cumn:r});this.centroids._comparator=Es;var t=e.prev(),s=t&&t.mean_cumn===r?t:e.next();return[t,s]};F.prototype.percentile=function(r){var e=Array.isArray(r)?r:[r],t=e.map(this._percentile,this);return Array.isArray(r)?t:t[0]};F.prototype._percentile=function(r){if(this.size()!==0){this._cumulate(!0);var e=this.n*r,t=this.bound_mean_cumn(e),s=t[0],i=t[1];return i===s||s===null||i===null?(s||i).mean:this.discrete?e<=s.cumn?s.mean:i.mean:s.mean+(e-s.mean_cumn)*(i.mean-s.mean)/(i.mean_cumn-s.mean_cumn)}};function on(r){var e=Math.floor(Math.random()*r.length);return r.splice(e,1)[0]}F.prototype.compress=function(){if(!this.compressing){var r=this.toArray();for(this.reset(),this.compressing=!0;r.length>0;)this.push_centroid(on(r));this._cumulate(!0),this.compressing=!1}};function Y(r){this.config=r||{},this.mode=this.config.mode||"auto",F.call(this,this.mode==="cont"?r.delta:!1),this.digest_ratio=this.config.ratio||.9,this.digest_thresh=this.config.thresh||1e3,this.n_unique=0}Y.prototype=Object.create(F.prototype);Y.prototype.constructor=Y;Y.prototype.push=function(r){F.prototype.push.call(this,r),this.check_continuous()};Y.prototype._new_centroid=function(r,e,t){this.n_unique+=1,F.prototype._new_centroid.call(this,r,e,t)};Y.prototype._addweight=function(r,e,t){r.n===1&&(this.n_unique-=1),F.prototype._addweight.call(this,r,e,t)};Y.prototype.check_continuous=function(){return this.mode!=="auto"||this.size()<this.digest_thresh?!1:this.n_unique/this.size()>this.digest_ratio?(this.mode="cont",this.discrete=!1,this.delta=this.config.delta||.01,this.compress(),!0):!1};Ss.exports={TDigest:F,Digest:Y}});function Di(r){var e=this.constructor;return this.then(function(t){return e.resolve(r()).then(function(){return t})},function(t){return e.resolve(r()).then(function(){return e.reject(t)})})}var Ir=Di;function qi(r){var e=this;return new e(function(t,s){if(!(r&&typeof r.length<"u"))return s(new TypeError(typeof r+" "+r+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var i=Array.prototype.slice.call(r);if(i.length===0)return t([]);var n=i.length;function o(u,p){if(p&&(typeof p=="object"||typeof p=="function")){var y=p.then;if(typeof y=="function"){y.call(p,function(E){o(u,E)},function(E){i[u]={status:"rejected",reason:E},--n===0&&t(i)});return}}i[u]={status:"fulfilled",value:p},--n===0&&t(i)}for(var c=0;c<i.length;c++)o(c,i[c])})}var Dr=qi;function qr(r,e){this.name="AggregateError",this.errors=r,this.message=e||""}qr.prototype=Error.prototype;function Hi(r){var e=this;return new e(function(t,s){if(!(r&&typeof r.length<"u"))return s(new TypeError("Promise.any accepts an array"));var i=Array.prototype.slice.call(r);if(i.length===0)return s();for(var n=[],o=0;o<i.length;o++)try{e.resolve(i[o]).then(t).catch(function(c){n.push(c),n.length===i.length&&s(new qr(n,"All promises were rejected"))})}catch(c){s(c)}})}var Hr=Hi;var ji=setTimeout;function jr(r){return!!(r&&typeof r.length<"u")}function Vi(){}function $i(r,e){return function(){r.apply(e,arguments)}}function N(r){if(!(this instanceof N))throw new TypeError("Promises must be constructed via new");if(typeof r!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],$r(r,this)}function Vr(r,e){for(;r._state===3;)r=r._value;if(r._state===0){r._deferreds.push(e);return}r._handled=!0,N._immediateFn(function(){var t=r._state===1?e.onFulfilled:e.onRejected;if(t===null){(r._state===1?gt:Se)(e.promise,r._value);return}var s;try{s=t(r._value)}catch(i){Se(e.promise,i);return}gt(e.promise,s)})}function gt(r,e){try{if(e===r)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof N){r._state=3,r._value=e,vt(r);return}else if(typeof t=="function"){$r($i(t,e),r);return}}r._state=1,r._value=e,vt(r)}catch(s){Se(r,s)}}function Se(r,e){r._state=2,r._value=e,vt(r)}function vt(r){r._state===2&&r._deferreds.length===0&&N._immediateFn(function(){r._handled||N._unhandledRejectionFn(r._value)});for(var e=0,t=r._deferreds.length;e<t;e++)Vr(r,r._deferreds[e]);r._deferreds=null}function Ui(r,e,t){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function $r(r,e){var t=!1;try{r(function(s){t||(t=!0,gt(e,s))},function(s){t||(t=!0,Se(e,s))})}catch(s){if(t)return;t=!0,Se(e,s)}}N.prototype.catch=function(r){return this.then(null,r)};N.prototype.then=function(r,e){var t=new this.constructor(Vi);return Vr(this,new Ui(r,e,t)),t};N.prototype.finally=Ir;N.all=function(r){return new N(function(e,t){if(!jr(r))return t(new TypeError("Promise.all accepts an array"));var s=Array.prototype.slice.call(r);if(s.length===0)return e([]);var i=s.length;function n(c,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var p=u.then;if(typeof p=="function"){p.call(u,function(y){n(c,y)},t);return}}s[c]=u,--i===0&&e(s)}catch(y){t(y)}}for(var o=0;o<s.length;o++)n(o,s[o])})};N.any=Hr;N.allSettled=Dr;N.resolve=function(r){return r&&typeof r=="object"&&r.constructor===N?r:new N(function(e){e(r)})};N.reject=function(r){return new N(function(e,t){t(r)})};N.race=function(r){return new N(function(e,t){if(!jr(r))return t(new TypeError("Promise.race accepts an array"));for(var s=0,i=r.length;s<i;s++)N.resolve(r[s]).then(e,t)})};N._immediateFn=typeof setImmediate=="function"&&function(r){setImmediate(r)}||function(r){ji(r,0)};N._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var W=N;var Wi="[Filtered]",Ur=128;function Kr(r,e){var t=e===void 0?{}:e,s=t.maxLength,i=s===void 0?64e3:s,n=t.keysBlocklist,o=n===void 0?[]:n;if(r.errors)for(var c=0;c<r.errors.length;c++){var u=new zr({keysBlocklist:o});r.errors[c]=u.truncate(r.errors[c])}for(var p="",y=["context","params","environment","session"],E=0;E<8;E++){for(var g={level:E,keysBlocklist:o},w=0,S=y;w<S.length;w++){var O=S[w],T=r[O];T&&(r[O]=Ki(T,g))}if(p=JSON.stringify(r),p.length<i)return p}var A={json:p.slice(0,Math.floor(i/2))+"..."};y.push("errors");for(var f=0,m=y;f<m.length;f++){var O=m[f],T=r[O];T&&(p=JSON.stringify(T),A[O]=p.length)}var h=new Error("airbrake: notice exceeds max length and can't be truncated");throw h.params=A,h}function Ie(r,e){return r>>e||1}var zr=function(){function r(e){this.maxStringLength=1024,this.maxObjectLength=Ur,this.maxArrayLength=Ur,this.maxDepth=8,this.keys=[],this.keysBlocklist=[],this.seen=[];var t=e.level||0;this.keysBlocklist=e.keysBlocklist||[],this.maxStringLength=Ie(this.maxStringLength,t),this.maxObjectLength=Ie(this.maxObjectLength,t),this.maxArrayLength=Ie(this.maxArrayLength,t),this.maxDepth=Ie(this.maxDepth,t)}return r.prototype.truncate=function(e,t,s){if(t===void 0&&(t=""),s===void 0&&(s=0),e==null)return e;switch(typeof e){case"boolean":case"number":case"function":return e;case"string":return this.truncateString(e);case"object":break;default:return this.truncateString(String(e))}if(e instanceof String)return this.truncateString(e.toString());if(e instanceof Boolean||e instanceof Number||e instanceof Date||e instanceof RegExp)return e;if(e instanceof Error)return this.truncateString(e.toString());if(this.seen.indexOf(e)>=0)return"[Circular "+this.getPath(e)+"]";var i=zi(e);if(s++,s>this.maxDepth)return"[Truncated "+i+"]";switch(this.keys.push(t),this.seen.push(e),i){case"Array":return this.truncateArray(e,s);case"Object":return this.truncateObject(e,s);default:var n=this.maxDepth;this.maxDepth=0;var o=this.truncateObject(e,s);return o.__type=i,this.maxDepth=n,o}},r.prototype.getPath=function(e){for(var t=this.seen.indexOf(e),s=[this.keys[t]],i=t;i>=0;i--){var n=this.seen[i];n&&Wr(n,s[0])===e&&(e=n,s.unshift(this.keys[i]))}return"~"+s.join(".")},r.prototype.truncateString=function(e){return e.length>this.maxStringLength?e.slice(0,this.maxStringLength)+"...":e},r.prototype.truncateArray=function(e,t){t===void 0&&(t=0);for(var s=0,i=[],n=0;n<e.length;n++){var o=e[n];if(i.push(this.truncate(o,n.toString(),t)),s++,s>=this.maxArrayLength)break}return i},r.prototype.truncateObject=function(e,t){t===void 0&&(t=0);var s=0,i={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(Ji(n,this.keysBlocklist)){i[n]=Wi;continue}var o=Wr(e,n);if(!(o===void 0||typeof o=="function")&&(i[n]=this.truncate(o,n,t),s++,s>=this.maxObjectLength))break}return i},r}();function Ki(r,e){e===void 0&&(e={});var t=new zr(e);return t.truncate(r)}function Wr(r,e){try{return r[e]}catch{return}}function zi(r){var e=Object.prototype.toString.apply(r);return e.slice(8,-1)}function Ji(r,e){for(var t=0,s=e;t<s.length;t++){var i=s[t];if(i===r||i instanceof RegExp&&r.match(i))return!0}return!1}var Xi=function(){function r(e,t,s){this._dur=0,this._level=0,this._metric=e,this.name=t,this.startTime=s||new Date}return r.prototype.end=function(e){this.endTime=e||new Date,this._dur+=this.endTime.getTime()-this.startTime.getTime(),this._metric._incGroup(this.name,this._dur),this._metric=null},r.prototype._pause=function(){if(!this._paused()){var e=new Date;this._dur+=e.getTime()-this.startTime.getTime(),this.startTime=null}},r.prototype._resume=function(){this._paused()&&(this.startTime=new Date)},r.prototype._paused=function(){return this.startTime==null},r}();var De=function(){function r(){this._spans={},this._groups={},this.startTime=new Date}return r.prototype.end=function(e){this.endTime||(this.endTime=e||new Date)},r.prototype.isRecording=function(){return!0},r.prototype.startSpan=function(e,t){var s=this._spans[e];s?s._level++:(s=new Xi(this,e,t),this._spans[e]=s)},r.prototype.endSpan=function(e,t){var s=this._spans[e];if(!s){console.error("airbrake: span=%s does not exist",e);return}s._level>0?s._level--:(s.end(t),delete this._spans[s.name])},r.prototype._incGroup=function(e,t){this._groups[e]=(this._groups[e]||0)+t},r.prototype._duration=function(){return this.endTime||(this.endTime=new Date),this.endTime.getTime()-this.startTime.getTime()},r}();var Jr=function(){function r(){}return r.prototype.isRecording=function(){return!1},r.prototype.startSpan=function(e,t){},r.prototype.endSpan=function(e,t){},r.prototype._incGroup=function(e,t){},r}();var he=function(){return he=Object.assign||function(r){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},he.apply(this,arguments)},yt=function(){function r(){this._noopMetric=new Jr,this._context={},this._historyMaxLen=20,this._history=[]}return r.prototype.clone=function(){var e=new r;return e._context=he({},this._context),e._history=this._history.slice(),e},r.prototype.setContext=function(e){this._context=he(he({},this._context),e)},r.prototype.context=function(){var e=he({},this._context);return this._history.length>0&&(e.history=this._history.slice()),e},r.prototype.pushHistory=function(e){if(this._isDupState(e)){this._lastRecord.num?this._lastRecord.num++:this._lastRecord.num=2;return}e.date||(e.date=new Date),this._history.push(e),this._lastRecord=e,this._history.length>this._historyMaxLen&&(this._history=this._history.slice(-this._historyMaxLen))},r.prototype._isDupState=function(e){if(!this._lastRecord)return!1;for(var t in e)if(!(!e.hasOwnProperty(t)||t==="date")&&e[t]!==this._lastRecord[t])return!1;return!0},r.prototype.routeMetric=function(){return this._routeMetric||this._noopMetric},r.prototype.setRouteMetric=function(e){this._routeMetric=e},r.prototype.queueMetric=function(){return this._queueMetric||this._noopMetric},r.prototype.setQueueMetric=function(e){this._queueMetric=e},r}();var es=xr(Yr()),Gi=typeof console=="object"&&console.warn;function Zr(r){try{return es.default.parse(r)}catch(e){Gi&&r.stack&&console.warn("ErrorStackParser:",e.toString(),r.stack)}return r.fileName?[r]:[]}function ts(r){var e=[];if(r.noStack)e.push({function:r.functionName||"",file:r.fileName||"",line:r.lineNumber||0,column:r.columnNumber||0});else{var t=Zr(r);if(t.length===0)try{throw new Error("fake")}catch(u){t=Zr(u),t.shift(),t.shift()}for(var s=0,i=t;s<i.length;s++){var n=i[s];e.push({function:n.functionName||"",file:n.fileName||"",line:n.lineNumber||0,column:n.columnNumber||0})}}var o=r.name?r.name:"",c=r.message?String(r.message):String(r);return{type:o,message:c,backtrace:e}}var Qi=new RegExp(["^","\\[(\\$.+)\\]","\\s","([\\s\\S]+)","$"].join(""));function rs(r){var e=r.errors[0];if(e.type!==""&&e.type!=="Error")return r;var t=e.message.match(Qi);return t!==null&&(e.type=t[1],e.message=t[2]),r}function ss(){var r,e;return function(t){var s=JSON.stringify(t.errors);return s===r?null:(e&&clearTimeout(e),r=s,e=setTimeout(function(){r=""},1e3),t)}}var Yi=["Script error","Script error.","InvalidAccessError"];function is(r){var e=r.errors[0];if(e.type===""&&Yi.indexOf(e.message)!==-1)return null;if(e.backtrace&&e.backtrace.length>0){var t=e.backtrace[0];if(t.file==="<anonymous>")return null}return r}var Zi=new RegExp(["^","Uncaught\\s","(.+?)",":\\s","(.+)","$"].join(""));function ns(r){var e=r.errors[0];if(e.type!==""&&e.type!=="Error")return r;var t=e.message.match(Zi);return t!==null&&(e.type=t[1],e.message=t[2]),r}var us=xr(as());var K={unauthorized:new Error("airbrake: unauthorized: project id or key are wrong"),ipRateLimited:new Error("airbrake: IP is rate limited")};var cs=0;function hs(r){var e=Date.now()/1e3;if(e<cs)return W.reject(K.ipRateLimited);var t={method:r.method,body:r.body};return(0,us.default)(r.url,t).then(function(s){if(s.status===401)throw K.unauthorized;if(s.status===429){var i=s.headers.get("X-RateLimit-Delay");if(!i)throw K.ipRateLimited;var n=parseInt(i,10);throw n>0&&(cs=Date.now()/1e3+n),K.ipRateLimited}if(s.status===204)return{json:null};if(s.status===404)throw new Error("404 Not Found");return s.status>=200&&s.status<300?s.json().then(function(o){return{json:o}}):s.status>=400&&s.status<500?s.json().then(function(o){var c=new Error(o.message);throw c}):s.text().then(function(o){var c=new Error("airbrake: fetch: unexpected response: code="+s.status+" body='"+o+"'");throw c})})}function ds(r){return function(e){return en(e,r)}}var ls=0;function en(r,e){var t=Date.now()/1e3;return t<ls?W.reject(K.ipRateLimited):new W(function(s,i){e({url:r.url,method:r.method,body:r.body,headers:{"content-type":"application/json"},timeout:r.timeout},function(n,o,c){if(n){i(n);return}if(!o.statusCode){n=new Error("airbrake: request: response statusCode is "+o.statusCode),i(n);return}if(o.statusCode===401){i(K.unauthorized);return}if(o.statusCode===429){i(K.ipRateLimited);var u=o.headers["x-ratelimit-delay"];if(!u)return;var p=void 0;if(typeof u=="string")p=u;else if(u instanceof Array)p=u[0];else return;var y=parseInt(p,10);y>0&&(ls=Date.now()/1e3+y);return}if(o.statusCode===204){s({json:null});return}if(o.statusCode>=200&&o.statusCode<300){var E=void 0;try{E=JSON.parse(c)}catch(g){i(g);return}s(E);return}if(o.statusCode>=400&&o.statusCode<500){var E=void 0;try{E=JSON.parse(c)}catch(w){i(w);return}n=new Error(E.message),i(n);return}c=c.trim(),n=new Error("airbrake: node: unexpected response: code="+o.statusCode+" body='"+c+"'"),i(n)})})}function z(r){return r.request?ds(r.request):hs}var an=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(s[n]=i[n])},r(e,t)};return function(e,t){r(e,t);function s(){this.constructor=e}e.prototype=t===null?Object.create(t):(s.prototype=t.prototype,new s)}}(),As,Z=!1;try{As=_s(),Z=!0}catch{}var pe=function(){function r(){this.count=0,this.sum=0,this.sumsq=0,this._td=new As.Digest}return r.prototype.add=function(e){e===0&&(e=1e-5),this.count+=1,this.sum+=e,this.sumsq+=e*e,this._td&&this._td.push(e)},r.prototype.toJSON=function(){return{count:this.count,sum:this.sum,sumsq:this.sumsq,tdigestCentroids:Ts(this._td)}},r}();var $e=function(r){an(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.groups={},t}return e.prototype.addGroups=function(t,s){this.add(t);for(var i in s)s.hasOwnProperty(i)&&this.addGroup(i,s[i])},e.prototype.addGroup=function(t,s){var i=this.groups[t];i||(i=new pe,this.groups[t]=i),i.add(s)},e.prototype.toJSON=function(){return{count:this.count,sum:this.sum,sumsq:this.sumsq,tdigestCentroids:Ts(this._td),groups:this.groups}},e}(pe);function Ts(r){var e=[],t=[];return r.centroids.each(function(s){e.push(s.mean),t.push(s.n)}),{mean:e,count:t}}var Ue=function(){return Ue=Object.assign||function(r){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Ue.apply(this,arguments)},cn=15e3,Os=function(){function r(e){e===void 0&&(e=""),this.method="",this.route="",this.query="",this.func="",this.file="",this.line=0,this.startTime=new Date,this.query=e}return r.prototype._duration=function(){return this.endTime||(this.endTime=new Date),this.endTime.getTime()-this.startTime.getTime()},r}();var Ls=function(){function r(e){this._m={},this._opt=e,this._url=e.host+"/api/v5/projects/"+e.projectId+"/queries-stats?key="+e.projectKey,this._requester=z(e)}return r.prototype.start=function(e){return e===void 0&&(e=""),new Os(e)},r.prototype.notify=function(e){var t=this;if(Z){var s=e._duration(),i=60*1e3,n=new Date(Math.floor(e.startTime.getTime()/i)*i),o={method:e.method,route:e.route,query:e.query,func:e.func,file:e.file,line:e.line,time:n},c=JSON.stringify(o),u=this._m[c];u||(u=new pe,this._m[c]=u),u.add(s),!this._timer&&(this._timer=setTimeout(function(){t._flush()},cn))}},r.prototype._flush=function(){var e=[];for(var t in this._m)if(this._m.hasOwnProperty(t)){var s=JSON.parse(t),i=Ue(Ue({},s),this._m[t].toJSON());e.push(i)}this._m={},this._timer=null;var n=JSON.stringify({environment:this._opt.environment,queries:e}),o={method:"POST",url:this._url,body:n};this._requester(o).then(function(c){}).catch(function(c){console.error&&console.error("can not report queries stats",c)})},r}();var un=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(s[n]=i[n])},r(e,t)};return function(e,t){r(e,t);function s(){this.constructor=e}e.prototype=t===null?Object.create(t):(s.prototype=t.prototype,new s)}}(),We=function(){return We=Object.assign||function(r){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},We.apply(this,arguments)},hn=15e3,Rs=function(r){un(e,r);function e(t){var s=r.call(this)||this;return s.queue=t,s.startTime=new Date,s}return e}(De);var Ms=function(){function r(e){this._m={},this._opt=e,this._url=e.host+"/api/v5/projects/"+e.projectId+"/queues-stats?key="+e.projectKey,this._requester=z(e)}return r.prototype.notify=function(e){var t=this;if(Z){var s=e._duration();s===0&&(s=1e-5);var i=60*1e3,n=new Date(Math.floor(e.startTime.getTime()/i)*i),o={queue:e.queue,time:n},c=JSON.stringify(o),u=this._m[c];u||(u=new $e,this._m[c]=u),u.addGroups(s,e._groups),!this._timer&&(this._timer=setTimeout(function(){t._flush()},hn))}},r.prototype._flush=function(){var e=[];for(var t in this._m)if(this._m.hasOwnProperty(t)){var s=JSON.parse(t),i=We(We({},s),this._m[t].toJSON());e.push(i)}this._m={},this._timer=null;var n=JSON.stringify({environment:this._opt.environment,queues:e}),o={method:"POST",url:this._url,body:n};this._requester(o).then(function(c){}).catch(function(c){console.error&&console.error("can not report queues breakdowns",c)})},r}();var ln=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(s[n]=i[n])},r(e,t)};return function(e,t){r(e,t);function s(){this.constructor=e}e.prototype=t===null?Object.create(t):(s.prototype=t.prototype,new s)}}(),me=function(){return me=Object.assign||function(r){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},me.apply(this,arguments)},ks=15e3,Cs=function(r){ln(e,r);function e(t,s,i,n){t===void 0&&(t=""),s===void 0&&(s=""),i===void 0&&(i=0),n===void 0&&(n="");var o=r.call(this)||this;return o.method=t,o.route=s,o.statusCode=i,o.contentType=n,o.startTime=new Date,o}return e}(De);var Fs=function(){function r(e){this._m={},this._opt=e,this._url=e.host+"/api/v5/projects/"+e.projectId+"/routes-stats?key="+e.projectKey,this._requester=z(e)}return r.prototype.notify=function(e){var t=this;if(Z){var s=e._duration(),i=60*1e3,n=new Date(Math.floor(e.startTime.getTime()/i)*i),o={method:e.method,route:e.route,statusCode:e.statusCode,time:n},c=JSON.stringify(o),u=this._m[c];u||(u=new pe,this._m[c]=u),u.add(s),!this._timer&&(this._timer=setTimeout(function(){t._flush()},ks))}},r.prototype._flush=function(){var e=[];for(var t in this._m)if(this._m.hasOwnProperty(t)){var s=JSON.parse(t),i=me(me({},s),this._m[t].toJSON());e.push(i)}this._m={},this._timer=null;var n=JSON.stringify({environment:this._opt.environment,routes:e}),o={method:"POST",url:this._url,body:n};this._requester(o).then(function(c){}).catch(function(c){console.error&&console.error("can not report routes stats",c)})},r}();var Ps=function(){function r(e){this._m={},this._opt=e,this._url=e.host+"/api/v5/projects/"+e.projectId+"/routes-breakdowns?key="+e.projectKey,this._requester=z(e)}return r.prototype.notify=function(e){var t=this;if(Z&&!(e.statusCode<200||e.statusCode>=300&&e.statusCode<400||e.statusCode===404||Object.keys(e._groups).length===0)){var s=e._duration();s===0&&(s=1e-5);var i=60*1e3,n=new Date(Math.floor(e.startTime.getTime()/i)*i),o={method:e.method,route:e.route,responseType:this._responseType(e),time:n},c=JSON.stringify(o),u=this._m[c];u||(u=new $e,this._m[c]=u),u.addGroups(s,e._groups),!this._timer&&(this._timer=setTimeout(function(){t._flush()},ks))}},r.prototype._flush=function(){var e=[];for(var t in this._m)if(this._m.hasOwnProperty(t)){var s=JSON.parse(t),i=me(me({},s),this._m[t].toJSON());e.push(i)}this._m={},this._timer=null;var n=JSON.stringify({environment:this._opt.environment,routes:e}),o={method:"POST",url:this._url,body:n};this._requester(o).then(function(c){}).catch(function(c){console.error&&console.error("can not report routes breakdowns",c)})},r.prototype._responseType=function(e){return e.statusCode>=500?"5xx":e.statusCode>=400?"4xx":e.contentType?e.contentType.split(";")[0].split("/")[-1]:""},r}();var Ns="airbrake-js/browser",Bs="1.4.2",xs="https://github.com/airbrake/airbrake-js/tree/master/packages/browser";var Ke=function(){return Ke=Object.assign||function(r){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Ke.apply(this,arguments)},St=function(){function r(e){var t=this;if(this._filters=[],this._performanceFilters=[],this._scope=new yt,this._onClose=[],!e.projectId||!e.projectKey)throw new Error("airbrake: projectId and projectKey are required");this._opt=e,this._opt.host=this._opt.host||"https://api.airbrake.io",this._opt.timeout=this._opt.timeout||1e4,this._opt.keysBlocklist=this._opt.keysBlocklist||this._opt.keysBlacklist||[/password/,/secret/],this._url=this._opt.host+"/api/v3/projects/"+this._opt.projectId+"/notices?key="+this._opt.projectKey,this._processor=this._opt.processor||ts,this._requester=z(this._opt),this.addFilter(is),this.addFilter(ss()),this.addFilter(ns),this.addFilter(rs),this.addFilter(function(s){return s.context.notifier={name:Ns,version:Bs,url:xs},t._opt.environment&&(s.context.environment=t._opt.environment),s}),this.routes=new dn(this),this.queues=new fn(this),this.queries=new Ls(this._opt)}return r.prototype.close=function(){for(var e=0,t=this._onClose;e<t.length;e++){var s=t[e];s()}},r.prototype.scope=function(){return this._scope},r.prototype.setActiveScope=function(e){this._scope=e},r.prototype.addFilter=function(e){this._filters.push(e)},r.prototype.addPerformanceFilter=function(e){this._performanceFilters.push(e)},r.prototype.notify=function(e){var t={errors:[],context:Ke(Ke({severity:"error"},this.scope().context()),e.context),params:e.params||{},environment:e.environment||{},session:e.session||{}};if((typeof e!="object"||e.error===void 0)&&(e={error:e}),!e.error)return t.error=new Error("airbrake: got err="+JSON.stringify(e.error)+", wanted an Error"),W.resolve(t);var s=this._processor(e.error);t.errors.push(s);for(var i=0,n=this._filters;i<n.length;i++){var o=n[i],c=o(t);if(c===null)return t.error=new Error("airbrake: error is filtered"),W.resolve(t);t=c}return t.context||(t.context={}),t.context.language="JavaScript",this._sendNotice(t)},r.prototype._sendNotice=function(e){var t=Kr(e,{keysBlocklist:this._opt.keysBlocklist});if(this._opt.reporter){if(typeof this._opt.reporter=="function")return this._opt.reporter(e);console.warn("airbrake: options.reporter must be a function")}var s={method:"POST",url:this._url,body:t};return this._requester(s).then(function(i){return e.id=i.json.id,e.url=i.json.url,e}).catch(function(i){return e.error=i,e})},r.prototype.wrap=function(e,t){if(t===void 0&&(t=[]),e._airbrake)return e;var s=this,i=function(){var u=Array.prototype.slice.call(arguments),p=s._wrapArguments(u);try{return e.apply(this,p)}catch(y){throw s.notify({error:y,params:{arguments:u}}),this._ignoreNextWindowError(),y}};for(var n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);for(var o=0,c=t;o<c.length;o++){var n=c[o];e.hasOwnProperty(n)&&(i[n]=e[n])}return i._airbrake=!0,i.inner=e,i},r.prototype._wrapArguments=function(e){for(var t=0;t<e.length;t++){var s=e[t];typeof s=="function"&&(e[t]=this.wrap(s))}return e},r.prototype._ignoreNextWindowError=function(){},r.prototype.call=function(e){for(var t=[],s=1;s<arguments.length;s++)t[s-1]=arguments[s];var i=this.wrap(e);return i.apply(this,Array.prototype.slice.call(arguments,1))},r}();var dn=function(){function r(e){this._notifier=e,this._routes=new Fs(e._opt),this._breakdowns=new Ps(e._opt)}return r.prototype.start=function(e,t,s,i){e===void 0&&(e=""),t===void 0&&(t=""),s===void 0&&(s=0),i===void 0&&(i="");var n=new Cs(e,t,s,i),o=this._notifier.scope().clone();return o.setContext({httpMethod:e,route:t}),o.setRouteMetric(n),this._notifier.setActiveScope(o),n},r.prototype.notify=function(e){e.end();for(var t=0,s=this._notifier._performanceFilters;t<s.length;t++){var i=s[t];if(i(e)===null)return}this._routes.notify(e),this._breakdowns.notify(e)},r}(),fn=function(){function r(e){this._notifier=e,this._queues=new Ms(e._opt)}return r.prototype.start=function(e){var t=new Rs(e),s=this._notifier.scope().clone();return s.setContext({queue:e}),s.setQueueMetric(t),this._notifier.setActiveScope(s),t},r.prototype.notify=function(e){e.end(),this._queues.notify(e)},r}();function Is(r){return window.navigator&&window.navigator.userAgent&&(r.context.userAgent=window.navigator.userAgent),window.location&&(r.context.url=String(window.location),r.context.rootDirectory=window.location.protocol+"//"+window.location.host),r}var pn=["debug","log","info","warn","error"];function Ds(r){for(var e=function(n){if(!(n in console))return"continue";var o=console[n],c=function(){for(var u=[],p=0;p<arguments.length;p++)u[p]=arguments[p];o.apply(console,u),r.scope().pushHistory({type:"log",severity:n,arguments:u})};c.inner=o,console[n]=c},t=0,s=pn;t<s.length;t++){var i=s[t];e(i)}}var mn=["type","name","src"];function qs(r){var e=gn(r);window.addEventListener&&(window.addEventListener("load",e),window.addEventListener("error",function(t){Hs(t,"error")||e(t)},!0)),typeof document=="object"&&document.addEventListener&&(document.addEventListener("DOMContentLoaded",e),document.addEventListener("click",e),document.addEventListener("keypress",e))}function gn(r){return function(e){var t=Hs(e,"target");if(t){var s={type:e.type};try{s.target=bn(t)}catch(i){s.target="<"+String(i)+">"}r.scope().pushHistory(s)}}}function vn(r){if(!r)return"";var e=[];if(r.tagName&&e.push(r.tagName.toLowerCase()),r.id&&(e.push("#"),e.push(r.id)),r.classList&&Array.from)e.push("."),e.push(Array.from(r.classList).join("."));else if(r.className){var t=yn(r.className);t!==""&&(e.push("."),e.push(t))}if(r.getAttribute)for(var s=0,i=mn;s<i.length;s++){var n=i[s],o=r.getAttribute(n);o&&e.push("["+n+'="'+o+'"]')}return e.join("")}function yn(r){return r.split?r.split(" ").join("."):r.baseVal&&r.baseVal.split?r.baseVal.split(" ").join("."):(console.error("unsupported HTMLElement.className type",typeof r),"")}function bn(r){for(var e=10,t=[],s=r;s;){var i=vn(s);if(i!==""&&(t.push(i),t.length>e))break;s=s.parentNode}return t.length===0?String(r):t.reverse().join(" > ")}function Hs(r,e){try{return r[e]}catch{return null}}function js(r){var e=window.fetch;window.fetch=function(t,s){var i={type:"xhr",date:new Date};return i.method=s&&s.method?s.method:"GET",typeof t=="string"?i.url=t:(i.method=t.method,i.url=t.url),r._ignoreNextXHR++,setTimeout(function(){return r._ignoreNextXHR--}),e.apply(this,arguments).then(function(n){return i.statusCode=n.status,i.duration=new Date().getTime()-i.date.getTime(),r.scope().pushHistory(i),n}).catch(function(n){throw i.error=n,i.duration=new Date().getTime()-i.date.getTime(),r.scope().pushHistory(i),n})}}var _t="";function Vs(){return document.location&&document.location.pathname}function Us(r){_t=Vs();var e=window.onpopstate;window.onpopstate=function(i){var n=Vs();if(n&&$s(r,n),e)return e.apply(this,arguments)};var t=history.pushState;history.pushState=function(i,n,o){o&&$s(r,o.toString()),t.apply(this,arguments)}}function $s(r,e){var t=e.indexOf("://");t>=0?(e=e.slice(t+3),t=e.indexOf("/"),e=t>=0?e.slice(t):"/"):e.charAt(0)!=="/"&&(e="/"+e),r.scope().pushHistory({type:"location",from:_t,to:e}),_t=e}function Ws(r){function e(i){var n=i.__state;n.statusCode=i.status,n.duration=new Date().getTime()-n.date.getTime(),r.scope().pushHistory(n)}var t=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(n,o,c,u,p){r._ignoreNextXHR===0&&(this.__state={type:"xhr",method:n,url:o}),t.apply(this,arguments)};var s=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(n){var o=this.onreadystatechange;return this.onreadystatechange=function(c){if(this.readyState===4&&this.__state&&e(this),o)return o.apply(this,arguments)},this.__state&&(this.__state.date=new Date),s.apply(this,arguments)}}var wn=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(s[n]=i[n])},r(e,t)};return function(e,t){r(e,t);function s(){this.constructor=e}e.prototype=t===null?Object.create(t):(s.prototype=t.prototype,new s)}}(),ze=function(){return ze=Object.assign||function(r){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},ze.apply(this,arguments)},At=function(r){wn(e,r);function e(t){var s=r.call(this,t)||this;return s.offline=!1,s.todo=[],s._ignoreWindowError=0,s._ignoreNextXHR=0,typeof window>"u"||(s.addFilter(Is),window.addEventListener&&(s.onOnline=s.onOnline.bind(s),window.addEventListener("online",s.onOnline),s.onOffline=s.onOffline.bind(s),window.addEventListener("offline",s.onOffline),s.onUnhandledrejection=s.onUnhandledrejection.bind(s),window.addEventListener("unhandledrejection",s.onUnhandledrejection),s._onClose.push(function(){window.removeEventListener("online",s.onOnline),window.removeEventListener("offline",s.onOffline),window.removeEventListener("unhandledrejection",s.onUnhandledrejection)})),s._opt.ignoreWindowError&&(t.instrumentation.onerror=!1),s._instrument(t.instrumentation)),s}return e.prototype._instrument=function(t){if(t===void 0&&(t={}),t.console===void 0&&(t.console=!En(this._opt.environment)),Te(t.onerror)){var s=this,i=window.onerror;window.onerror=function(){i&&i.apply(this,arguments),s.onerror.apply(s,arguments)}}qs(this),Te(t.fetch)&&typeof fetch=="function"&&js(this),Te(t.history)&&typeof history=="object"&&Us(this),Te(t.console)&&typeof console=="object"&&Ds(this),Te(t.xhr)&&typeof XMLHttpRequest<"u"&&Ws(this)},e.prototype.notify=function(t){var s=this;return this.offline?new W(function(i,n){for(s.todo.push({err:t,resolve:i,reject:n});s.todo.length>100;){var o=s.todo.shift();if(o===void 0)break;o.resolve({error:new Error("airbrake: offline queue is too large")})}}):r.prototype.notify.call(this,t)},e.prototype.onOnline=function(){this.offline=!1;for(var t=function(c){s.notify(c.err).then(function(u){c.resolve(u)})},s=this,i=0,n=this.todo;i<n.length;i++){var o=n[i];t(o)}this.todo=[]},e.prototype.onOffline=function(){this.offline=!0},e.prototype.onUnhandledrejection=function(t){var s=t.reason||t.detail&&t.detail.reason;if(s){var i=s.message||String(s);if(!(i.indexOf&&i.indexOf("airbrake: ")===0)){if(typeof s!="object"||s.error===void 0){this.notify({error:s,context:{unhandledRejection:!0}});return}this.notify(ze(ze({},s),{context:{unhandledRejection:!0}}))}}},e.prototype.onerror=function(t,s,i,n,o){if(!(this._ignoreWindowError>0)){if(o){this.notify({error:o,context:{windowError:!0}});return}!s||!i||this.notify({error:{message:t,fileName:s,lineNumber:i,columnNumber:n,noStack:!0},context:{windowError:!0}})}},e.prototype._ignoreNextWindowError=function(){var t=this;this._ignoreWindowError++,setTimeout(function(){return t._ignoreWindowError--})},e}(St);function En(r){return r&&r.startsWith&&r.startsWith("dev")}function Te(r){return r===void 0||r===!0}(function(r){if(typeof r.requestSubmit=="function")return;r.requestSubmit=function(s){s?(e(s,this),s.click()):(s=document.createElement("input"),s.type="submit",s.hidden=!0,this.appendChild(s),s.click(),this.removeChild(s))};function e(s,i){s instanceof HTMLElement||t(TypeError,"parameter 1 is not of type 'HTMLElement'"),s.type=="submit"||t(TypeError,"The specified element is not a submit button"),s.form==i||t(DOMException,"The specified element is not owned by this form element","NotFoundError")}function t(s,i,n){throw new s("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+i+".",n)}})(HTMLFormElement.prototype);var Zs=new WeakMap;function Sn(r){let e=r instanceof Element?r:r instanceof Node?r.parentElement:null,t=e?e.closest("input, button"):null;return t?.type=="submit"?t:null}function _n(r){let e=Sn(r.target);e&&e.form&&Zs.set(e.form,e)}(function(){if("submitter"in Event.prototype)return;let r=window.Event.prototype;if("SubmitEvent"in window){let e=window.SubmitEvent.prototype;if(/Apple Computer/.test(navigator.vendor)&&!("submitter"in e))r=e;else return}addEventListener("click",_n,!0),Object.defineProperty(r,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return Zs.get(this.target)}})})();var ve={eager:"eager",lazy:"lazy"},U=class r extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new r.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(e){e=="loading"?this.delegate.loadingStyleChanged():e=="src"?this.delegate.sourceURLChanged():e=="disabled"&&this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(e){e?this.setAttribute("refresh",e):this.removeAttribute("refresh")}get shouldReloadWithMorph(){return this.src&&this.refresh==="morph"}get loading(){return An(this.getAttribute("loading")||"")}set loading(e){e?this.setAttribute("loading",e):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(e){e?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){return this.ownerDocument?.documentElement?.hasAttribute("data-turbo-preview")}};function An(r){switch(r.toLowerCase()){case"lazy":return ve.lazy;default:return ve.eager}}var Tn={enabled:!0,progressBarDelay:500,unvisitableExtensions:new Set([".7z",".aac",".apk",".avi",".bmp",".bz2",".css",".csv",".deb",".dmg",".doc",".docx",".exe",".gif",".gz",".heic",".heif",".ico",".iso",".jpeg",".jpg",".js",".json",".m4a",".mkv",".mov",".mp3",".mp4",".mpeg",".mpg",".msi",".ogg",".ogv",".pdf",".pkg",".png",".ppt",".pptx",".rar",".rtf",".svg",".tar",".tif",".tiff",".txt",".wav",".webm",".webp",".wma",".wmv",".xls",".xlsx",".xml",".zip"])};function Le(r){if(r.getAttribute("data-turbo-eval")=="false")return r;{let e=document.createElement("script"),t=ni();return t&&(e.nonce=t),e.textContent=r.textContent,e.async=!1,On(e,r),e}}function On(r,e){for(let{name:t,value:s}of e.attributes)r.setAttribute(t,s)}function Ln(r){let e=document.createElement("template");return e.innerHTML=r,e.content}function B(r,{target:e,cancelable:t,detail:s}={}){let i=new CustomEvent(r,{cancelable:t,bubbles:!0,composed:!0,detail:s});return e&&e.isConnected?e.dispatchEvent(i):document.documentElement.dispatchEvent(i),i}function Ks(r){r.preventDefault(),r.stopImmediatePropagation()}function Oe(){return document.visibilityState==="hidden"?ti():ei()}function ei(){return new Promise(r=>requestAnimationFrame(()=>r()))}function ti(){return new Promise(r=>setTimeout(()=>r(),0))}function Rn(){return Promise.resolve()}function ri(r=""){return new DOMParser().parseFromString(r,"text/html")}function si(r,...e){let t=Mn(r,e).replace(/^\n/,"").split(`
12
- `),s=t[0].match(/^\s+/),i=s?s[0].length:0;return t.map(n=>n.slice(i)).join(`
13
- `)}function Mn(r,e){return r.reduce((t,s,i)=>{let n=e[i]==null?"":e[i];return t+s+n},"")}function te(){return Array.from({length:36}).map((r,e)=>e==8||e==13||e==18||e==23?"-":e==14?"4":e==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}function Ge(r,...e){for(let t of e.map(s=>s?.getAttribute(r)))if(typeof t=="string")return t;return null}function kn(r,...e){return e.some(t=>t&&t.hasAttribute(r))}function Qe(...r){for(let e of r)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function Ye(...r){for(let e of r)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function Cn(r,e=2e3){return new Promise(t=>{let s=()=>{r.removeEventListener("error",s),r.removeEventListener("load",s),t()};r.addEventListener("load",s,{once:!0}),r.addEventListener("error",s,{once:!0}),setTimeout(t,e)})}function ii(r){switch(r){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function Fn(r){return r=="advance"||r=="replace"||r=="restore"}function ae(...r){let e=Ge("data-turbo-action",...r);return Fn(e)?e:null}function ir(r){return document.querySelector(`meta[name="${r}"]`)}function Ze(r){let e=ir(r);return e&&e.content}function ni(){let r=ir("csp-nonce");if(r){let{nonce:e,content:t}=r;return e==""?t:e}}function Pn(r,e){let t=ir(r);return t||(t=document.createElement("meta"),t.setAttribute("name",r),document.head.appendChild(t)),t.setAttribute("content",e),t}function be(r,e){if(r instanceof Element)return r.closest(e)||be(r.assignedSlot||r.getRootNode()?.host,e)}function nr(r){return!!r&&r.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof r.focus=="function"}function oi(r){return Array.from(r.querySelectorAll("[autofocus]")).find(nr)}async function Nn(r,e){let t=e();r(),await ei();let s=e();return[t,s]}function ai(r){if(r==="_blank")return!1;if(r){for(let e of document.getElementsByName(r))if(e instanceof HTMLIFrameElement)return!1;return!0}else return!0}function ci(r){return be(r,"a[href]:not([target^=_]):not([download])")}function ui(r){return D(r.getAttribute("href")||"")}function Bn(r,e){let t=null;return(...s)=>{let i=()=>r.apply(this,s);clearTimeout(t),t=setTimeout(i,e)}}var xn={"aria-disabled":{beforeSubmit:r=>{r.setAttribute("aria-disabled","true"),r.addEventListener("click",Ks)},afterSubmit:r=>{r.removeAttribute("aria-disabled"),r.removeEventListener("click",Ks)}},disabled:{beforeSubmit:r=>r.disabled=!0,afterSubmit:r=>r.disabled=!1}},Tt=class{#e=null;constructor(e){Object.assign(this,e)}get submitter(){return this.#e}set submitter(e){this.#e=xn[e]||e}},In=new Tt({mode:"on",submitter:"disabled"}),I={drive:Tn,forms:In};function D(r){return new URL(r.toString(),document.baseURI)}function ce(r){let e;if(r.hash)return r.hash.slice(1);if(e=r.href.match(/#(.*)$/))return e[1]}function or(r,e){let t=e?.getAttribute("formaction")||r.getAttribute("action")||r.action;return D(t)}function Dn(r){return(Vn(r).match(/\.[^.]*$/)||[])[0]||""}function qn(r,e){let t=$n(e);return r.href===D(t).href||r.href.startsWith(t)}function ee(r,e){return qn(r,e)&&!I.drive.unvisitableExtensions.has(Dn(r))}function Ot(r){let e=ce(r);return e!=null?r.href.slice(0,-(e.length+1)):r.href}function Je(r){return Ot(r)}function Hn(r,e){return D(r).href==D(e).href}function jn(r){return r.pathname.split("/").slice(1)}function Vn(r){return jn(r).slice(-1)[0]}function $n(r){return Un(r.origin+r.pathname)}function Un(r){return r.endsWith("/")?r:r+"/"}var Re=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 D(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}},Lt=class extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){let s=this.values().next().value;this.delete(s)}super.add(e)}},hi=new Lt(20),Wn=window.fetch;function li(r,e={}){let t=new Headers(e.headers||{}),s=te();return hi.add(s),t.append("X-Turbo-Request-Id",s),Wn(r,{...e,headers:t})}function ar(r){switch(r.toLowerCase()){case"get":return j.get;case"post":return j.post;case"put":return j.put;case"patch":return j.patch;case"delete":return j.delete}}var j={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function Kn(r){switch(r.toLowerCase()){case oe.multipart:return oe.multipart;case oe.plain:return oe.plain;default:return oe.urlEncoded}}var oe={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"},ue=class{abortController=new AbortController;#e=e=>{};constructor(e,t,s,i=new URLSearchParams,n=null,o=oe.urlEncoded){let[c,u]=zs(D(s),t,i,o);this.delegate=e,this.url=c,this.target=n,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t.toUpperCase(),headers:{...this.defaultHeaders},body:u,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=o}get method(){return this.fetchOptions.method}set method(e){let t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,s=ar(e)||j.get;this.url.search="";let[i,n]=zs(this.url,s,t,this.enctype);this.url=i,this.fetchOptions.body=n,this.fetchOptions.method=s.toUpperCase()}get headers(){return this.fetchOptions.headers}set headers(e){this.fetchOptions.headers=e}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(e){this.fetchOptions.body=e}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){let{fetchOptions:e}=this;this.delegate.prepareRequest(this);let t=await this.#t(e);try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=li(this.url.href,e);let s=await this.response;return await this.receive(s)}catch(s){if(s.name!=="AbortError")throw this.#r(s)&&this.delegate.requestErrored(this,s),s}finally{this.delegate.requestFinished(this)}}async receive(e){let t=new Re(e);return B("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return cr(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#t(e){let t=new Promise(i=>this.#e=i),s=B("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#e},target:this.target});return this.url=s.detail.url,s.defaultPrevented&&await t,s}#r(e){return!B("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}};function cr(r){return ar(r)==j.get}function zs(r,e,t,s){let i=Array.from(t).length>0?new URLSearchParams(di(t)):r.searchParams;return cr(e)?[zn(r,i),null]:s==oe.urlEncoded?[r,i]:[r,t]}function di(r){let e=[];for(let[t,s]of r)s instanceof File||e.push([t,s]);return e}function zn(r,e){let t=new URLSearchParams(di(e));return r.search=t.toString(),r}var Rt=class{started=!1;constructor(e,t){this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}intersect=e=>{e.slice(-1)[0]?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)}},re=class{static contentType="text/vnd.turbo-stream.html";static wrap(e){return typeof e=="string"?new this(Ln(e)):e}constructor(e){this.fragment=Jn(e)}};function Jn(r){for(let e of r.querySelectorAll("turbo-stream")){let t=document.importNode(e,!0);for(let s of t.templateElement.content.querySelectorAll("script"))s.replaceWith(Le(s));e.replaceWith(t)}return r}var Xn=100,Mt=class{#e=null;#t=null;get(e){if(this.#t&&this.#t.url===e&&this.#t.expire>Date.now())return this.#t.request}setLater(e,t,s){this.clear(),this.#e=setTimeout(()=>{t.perform(),this.set(e,t,s),this.#e=null},Xn)}set(e,t,s){this.#t={url:e,request:t,expire:new Date(new Date().getTime()+s)}}clear(){this.#e&&clearTimeout(this.#e),this.#t=null}},Gn=10*1e3,ye=new Mt,ge={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"},et=class r{state=ge.initialized;static confirmMethod(e){return Promise.resolve(confirm(e))}constructor(e,t,s,i=!1){let n=ro(t,s),o=to(eo(t,s),n),c=Qn(t,s),u=so(t,s);this.delegate=e,this.formElement=t,this.submitter=s,this.fetchRequest=new ue(this,n,o,c,t,u),this.mustRedirect=i}get method(){return this.fetchRequest.method}set method(e){this.fetchRequest.method=e}get action(){return this.fetchRequest.url.toString()}set action(e){this.fetchRequest.url=D(e)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){let{initialized:e,requesting:t}=ge,s=Ge("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof s=="string"&&!await(typeof I.forms.confirm=="function"?I.forms.confirm:r.confirmMethod)(s,this.formElement,this.submitter))&&this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:t}=ge;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){let t=Yn(Ze("csrf-param"))||Ze("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(re.contentType)}requestStarted(e){this.state=ge.waiting,this.submitter&&I.forms.submitter.beforeSubmit(this.submitter),this.setSubmitsWith(),Qe(this.formElement),B("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){ye.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(ye.clear(),this.requestMustRedirect(e)&&Zn(t)){let s=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,s)}else this.state=ge.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=ge.stopped,this.submitter&&I.forms.submitter.afterSubmit(this.submitter),this.resetSubmitterText(),Ye(this.formElement),B("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(!(!this.submitter||!this.submitsWith)){if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){let e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}}resetSubmitterText(){if(!(!this.submitter||!this.originalSubmitText)){if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){let e=this.submitter;e.value=this.originalSubmitText}}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||kn("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}};function Qn(r,e){let t=new FormData(r),s=e?.getAttribute("name"),i=e?.getAttribute("value");return s&&t.append(s,i||""),t}function Yn(r){if(r!=null){let t=(document.cookie?document.cookie.split("; "):[]).find(s=>s.startsWith(r));if(t){let s=t.split("=").slice(1).join("=");return s?decodeURIComponent(s):void 0}}}function Zn(r){return r.statusCode==200&&!r.redirected}function eo(r,e){let t=typeof r.action=="string"?r.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":r.getAttribute("action")||t||""}function to(r,e){let t=D(r);return cr(e)&&(t.search=""),t}function ro(r,e){let t=e?.getAttribute("formmethod")||r.getAttribute("method")||"";return ar(t.toLowerCase())||j.get}function so(r,e){return Kn(e?.getAttribute("formenctype")||r.enctype)}var Ee=class{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return this.getElementForAnchor(e)!=null}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return oi(this.element)}get permanentElements(){return pi(this.element)}getPermanentElementById(e){return fi(this.element,e)}getPermanentElementMapForSnapshot(e){let t={};for(let s of this.permanentElements){let{id:i}=s,n=e.getPermanentElementById(i);n&&(t[i]=[s,n])}return t}};function fi(r,e){return r.querySelector(`#${e}[data-turbo-permanent]`)}function pi(r){return r.querySelectorAll("[id][data-turbo-permanent]")}var Me=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)};submitBubbled=e=>{if(!e.defaultPrevented){let t=e.target instanceof HTMLFormElement?e.target:void 0,s=e.submitter||void 0;t&&io(t,s)&&no(t,s)&&this.delegate.willSubmitForm(t,s)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,s))}}};function io(r,e){return(e?.getAttribute("formmethod")||r.getAttribute("method"))!="dialog"}function no(r,e){let t=e?.getAttribute("formtarget")||r.getAttribute("target");return ai(t)}var tt=class{#e=e=>{};#t=e=>{};constructor(e,t){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(ce(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:s,willRender:i,newSnapshot:n}=e,o=i;if(s)try{this.renderPromise=new Promise(y=>this.#e=y),this.renderer=e,await this.prepareToRenderSnapshot(e);let c=new Promise(y=>this.#t=y),u={resume:this.#t,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(n,u)||await c,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(n,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#e(void 0),delete this.renderPromise}else o&&this.invalidate(e.reloadReason)}invalidate(e){this.delegate.viewInvalidated(e)}async prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),await e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}markVisitDirection(e){this.element.setAttribute("data-turbo-visit-direction",e)}unmarkVisitDirection(){this.element.removeAttribute("data-turbo-visit-direction")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}},kt=class extends tt{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new Ee(this.element)}},rt=class{constructor(e,t){this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}clickBubbled=e=>{this.clickEventIsSignificant(e)?this.clickEvent=e:delete this.clickEvent};linkClicked=e=>{this.clickEvent&&this.clickEventIsSignificant(e)&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url,e.detail.originalEvent)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.detail.url,e.detail.originalEvent)),delete this.clickEvent};willVisit=e=>{delete this.clickEvent};clickEventIsSignificant(e){let t=e.composed?e.target?.parentElement:e.target,s=ci(t)||t;return s instanceof Element&&s.closest("turbo-frame, html")==this.element}},st=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)};clickBubbled=e=>{if(e instanceof MouseEvent&&this.clickEventIsSignificant(e)){let t=e.composedPath&&e.composedPath()[0]||e.target,s=ci(t);if(s&&ai(s.target)){let i=ui(s);this.delegate.willFollowLinkToLocation(s,i,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(s,i))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}},it=class{constructor(e,t){this.delegate=e,this.linkInterceptor=new st(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,s){return this.delegate.willSubmitFormLinkToLocation(e,t,s)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,t){let s=document.createElement("form"),i="hidden";for(let[E,g]of t.searchParams)s.append(Object.assign(document.createElement("input"),{type:i,name:E,value:g}));let n=Object.assign(t,{search:""});s.setAttribute("data-turbo","true"),s.setAttribute("action",n.href),s.setAttribute("hidden","");let o=e.getAttribute("data-turbo-method");o&&s.setAttribute("method",o);let c=e.getAttribute("data-turbo-frame");c&&s.setAttribute("data-turbo-frame",c);let u=ae(e);u&&s.setAttribute("data-turbo-action",u);let p=e.getAttribute("data-turbo-confirm");p&&s.setAttribute("data-turbo-confirm",p),e.hasAttribute("data-turbo-stream")&&s.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,s),document.body.appendChild(s),s.addEventListener("turbo:submit-end",()=>s.remove(),{once:!0}),requestAnimationFrame(()=>s.requestSubmit())}},nt=class{static async preservingPermanentElements(e,t,s){let i=new this(e,t);i.enter(),await s(),i.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(let e in this.permanentElementMap){let[t,s]=this.permanentElementMap[e];this.delegate.enteringBardo(t,s),this.replaceNewPermanentElementWithPlaceholder(s)}}leave(){for(let e in this.permanentElementMap){let[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){let t=oo(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){let t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){this.getPlaceholderById(e.id)?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}};function oo(r){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",r.id),e}var ke=class{#e=null;static renderElement(e,t){}constructor(e,t,s,i=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=s,this.willRender=i,this.renderElement=this.constructor.renderElement,this.promise=new Promise((n,o)=>this.resolvingFunctions={resolve:n,reject:o})}get shouldRender(){return!0}get shouldAutofocus(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await nt.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){if(this.shouldAutofocus){let e=this.connectedSnapshot.firstAutofocusableElement;e&&e.focus()}}enteringBardo(e){this.#e||e.contains(this.currentSnapshot.activeElement)&&(this.#e=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.#e)&&this.#e instanceof HTMLElement&&(this.#e.focus(),this.#e=null)}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get renderMethod(){return"replace"}},Ce=class extends ke{static renderElement(e,t){let s=document.createRange();s.selectNodeContents(e),s.deleteContents();let i=t,n=i.ownerDocument?.createRange();n&&(n.selectNodeContents(i),e.appendChild(n.extractContents()))}constructor(e,t,s,i,n,o=!0){super(t,s,i,n,o),this.delegate=e}get shouldRender(){return!0}async render(){await Oe(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await Oe(),this.focusFirstAutofocusableElement(),await Oe(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){let e=this.currentElement.firstElementChild,t=ao(this.currentElement.getAttribute("data-autoscroll-block"),"end"),s=co(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:t,behavior:s}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let t=Le(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function ao(r,e){return r=="end"||r=="start"||r=="center"||r=="nearest"?r:e}function co(r,e){return r=="auto"||r=="smooth"?r:e}var uo=function(){let r=()=>{},e={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:r,afterNodeAdded:r,beforeNodeMorphed:r,afterNodeMorphed:r,beforeNodeRemoved:r,afterNodeRemoved:r,beforeAttributeUpdated:r},head:{style:"merge",shouldPreserve:g=>g.getAttribute("im-preserve")==="true",shouldReAppend:g=>g.getAttribute("im-re-append")==="true",shouldRemove:r,afterHeadMorphed:r},restoreFocus:!0};function t(g,w,S={}){g=y(g);let O=E(w),T=p(g,O,S),A=i(T,()=>c(T,g,O,f=>f.morphStyle==="innerHTML"?(n(f,g,O),Array.from(g.childNodes)):s(f,g,O)));return T.pantry.remove(),A}function s(g,w,S){let O=E(w),T=Array.from(O.childNodes),A=T.indexOf(w),f=T.length-(A+1);return n(g,O,S,w,w.nextSibling),T=Array.from(O.childNodes),T.slice(A,T.length-f)}function i(g,w){if(!g.config.restoreFocus)return w();let S=document.activeElement;if(!(S instanceof HTMLInputElement||S instanceof HTMLTextAreaElement))return w();let{id:O,selectionStart:T,selectionEnd:A}=S,f=w();return O&&O!==document.activeElement?.id&&(S=g.target.querySelector(`#${O}`),S?.focus()),S&&!S.selectionEnd&&A&&S.setSelectionRange(T,A),f}let n=function(){function g(h,l,_,b=null,v=null){l instanceof HTMLTemplateElement&&_ instanceof HTMLTemplateElement&&(l=l.content,_=_.content),b||=l.firstChild;for(let R of _.childNodes){if(b&&b!=v){let a=S(h,R,b,v);if(a){a!==b&&T(h,b,a),o(a,R,h),b=a.nextSibling;continue}}if(R instanceof Element&&h.persistentIds.has(R.id)){let a=A(l,R.id,b,h);o(a,R,h),b=a.nextSibling;continue}let C=w(l,R,b,h);C&&(b=C.nextSibling)}for(;b&&b!=v;){let R=b;b=b.nextSibling,O(h,R)}}function w(h,l,_,b){if(b.callbacks.beforeNodeAdded(l)===!1)return null;if(b.idMap.has(l)){let v=document.createElement(l.tagName);return h.insertBefore(v,_),o(v,l,b),b.callbacks.afterNodeAdded(v),v}else{let v=document.importNode(l,!0);return h.insertBefore(v,_),b.callbacks.afterNodeAdded(v),v}}let S=function(){function h(b,v,R,C){let a=null,d=v.nextSibling,L=0,M=R;for(;M&&M!=C;){if(_(M,v)){if(l(b,M,v))return M;a===null&&(b.idMap.has(M)||(a=M))}if(a===null&&d&&_(M,d)&&(L++,d=d.nextSibling,L>=2&&(a=void 0)),M.contains(document.activeElement))break;M=M.nextSibling}return a||null}function l(b,v,R){let C=b.idMap.get(v),a=b.idMap.get(R);if(!a||!C)return!1;for(let d of C)if(a.has(d))return!0;return!1}function _(b,v){let R=b,C=v;return R.nodeType===C.nodeType&&R.tagName===C.tagName&&(!R.id||R.id===C.id)}return h}();function O(h,l){if(h.idMap.has(l))m(h.pantry,l,null);else{if(h.callbacks.beforeNodeRemoved(l)===!1)return;l.parentNode?.removeChild(l),h.callbacks.afterNodeRemoved(l)}}function T(h,l,_){let b=l;for(;b&&b!==_;){let v=b;b=b.nextSibling,O(h,v)}return b}function A(h,l,_,b){let v=b.target.querySelector(`#${l}`)||b.pantry.querySelector(`#${l}`);return f(v,b),m(h,v,_),v}function f(h,l){let _=h.id;for(;h=h.parentNode;){let b=l.idMap.get(h);b&&(b.delete(_),b.size||l.idMap.delete(h))}}function m(h,l,_){if(h.moveBefore)try{h.moveBefore(l,_)}catch{h.insertBefore(l,_)}else h.insertBefore(l,_)}return g}(),o=function(){function g(f,m,h){return h.ignoreActive&&f===document.activeElement?null:(h.callbacks.beforeNodeMorphed(f,m)===!1||(f instanceof HTMLHeadElement&&h.head.ignore||(f instanceof HTMLHeadElement&&h.head.style!=="morph"?u(f,m,h):(w(f,m,h),A(f,h)||n(h,f,m))),h.callbacks.afterNodeMorphed(f,m)),f)}function w(f,m,h){let l=m.nodeType;if(l===1){let _=f,b=m,v=_.attributes,R=b.attributes;for(let C of R)T(C.name,_,"update",h)||_.getAttribute(C.name)!==C.value&&_.setAttribute(C.name,C.value);for(let C=v.length-1;0<=C;C--){let a=v[C];if(a&&!b.hasAttribute(a.name)){if(T(a.name,_,"remove",h))continue;_.removeAttribute(a.name)}}A(_,h)||S(_,b,h)}(l===8||l===3)&&f.nodeValue!==m.nodeValue&&(f.nodeValue=m.nodeValue)}function S(f,m,h){if(f instanceof HTMLInputElement&&m instanceof HTMLInputElement&&m.type!=="file"){let l=m.value,_=f.value;O(f,m,"checked",h),O(f,m,"disabled",h),m.hasAttribute("value")?_!==l&&(T("value",f,"update",h)||(f.setAttribute("value",l),f.value=l)):T("value",f,"remove",h)||(f.value="",f.removeAttribute("value"))}else if(f instanceof HTMLOptionElement&&m instanceof HTMLOptionElement)O(f,m,"selected",h);else if(f instanceof HTMLTextAreaElement&&m instanceof HTMLTextAreaElement){let l=m.value,_=f.value;if(T("value",f,"update",h))return;l!==_&&(f.value=l),f.firstChild&&f.firstChild.nodeValue!==l&&(f.firstChild.nodeValue=l)}}function O(f,m,h,l){let _=m[h],b=f[h];if(_!==b){let v=T(h,f,"update",l);v||(f[h]=m[h]),_?v||f.setAttribute(h,""):T(h,f,"remove",l)||f.removeAttribute(h)}}function T(f,m,h,l){return f==="value"&&l.ignoreActiveValue&&m===document.activeElement?!0:l.callbacks.beforeAttributeUpdated(f,m,h)===!1}function A(f,m){return!!m.ignoreActiveValue&&f===document.activeElement&&f!==document.body}return g}();function c(g,w,S,O){if(g.head.block){let T=w.querySelector("head"),A=S.querySelector("head");if(T&&A){let f=u(T,A,g);return Promise.all(f).then(()=>{let m=Object.assign(g,{head:{block:!1,ignore:!0}});return O(m)})}}return O(g)}function u(g,w,S){let O=[],T=[],A=[],f=[],m=new Map;for(let l of w.children)m.set(l.outerHTML,l);for(let l of g.children){let _=m.has(l.outerHTML),b=S.head.shouldReAppend(l),v=S.head.shouldPreserve(l);_||v?b?T.push(l):(m.delete(l.outerHTML),A.push(l)):S.head.style==="append"?b&&(T.push(l),f.push(l)):S.head.shouldRemove(l)!==!1&&T.push(l)}f.push(...m.values());let h=[];for(let l of f){let _=document.createRange().createContextualFragment(l.outerHTML).firstChild;if(S.callbacks.beforeNodeAdded(_)!==!1){if("href"in _&&_.href||"src"in _&&_.src){let b,v=new Promise(function(R){b=R});_.addEventListener("load",function(){b()}),h.push(v)}g.appendChild(_),S.callbacks.afterNodeAdded(_),O.push(_)}}for(let l of T)S.callbacks.beforeNodeRemoved(l)!==!1&&(g.removeChild(l),S.callbacks.afterNodeRemoved(l));return S.head.afterHeadMorphed(g,{added:O,kept:A,removed:T}),h}let p=function(){function g(m,h,l){let{persistentIds:_,idMap:b}=A(m,h),v=w(l),R=v.morphStyle||"outerHTML";if(!["innerHTML","outerHTML"].includes(R))throw`Do not understand how to morph style ${R}`;return{target:m,newContent:h,config:v,morphStyle:R,ignoreActive:v.ignoreActive,ignoreActiveValue:v.ignoreActiveValue,restoreFocus:v.restoreFocus,idMap:b,persistentIds:_,pantry:S(),callbacks:v.callbacks,head:v.head}}function w(m){let h=Object.assign({},e);return Object.assign(h,m),h.callbacks=Object.assign({},e.callbacks,m.callbacks),h.head=Object.assign({},e.head,m.head),h}function S(){let m=document.createElement("div");return m.hidden=!0,document.body.insertAdjacentElement("afterend",m),m}function O(m){let h=Array.from(m.querySelectorAll("[id]"));return m.id&&h.push(m),h}function T(m,h,l,_){for(let b of _)if(h.has(b.id)){let v=b;for(;v;){let R=m.get(v);if(R==null&&(R=new Set,m.set(v,R)),R.add(b.id),v===l)break;v=v.parentElement}}}function A(m,h){let l=O(m),_=O(h),b=f(l,_),v=new Map;T(v,b,m,l);let R=h.__idiomorphRoot||h;return T(v,b,R,_),{persistentIds:b,idMap:v}}function f(m,h){let l=new Set,_=new Map;for(let{id:v,tagName:R}of m)_.has(v)?l.add(v):_.set(v,R);let b=new Set;for(let{id:v,tagName:R}of h)b.has(v)?l.add(v):_.get(v)===R&&b.add(v);for(let v of l)b.delete(v);return b}return g}(),{normalizeElement:y,normalizeParent:E}=function(){let g=new WeakSet;function w(A){return A instanceof Document?A.documentElement:A}function S(A){if(A==null)return document.createElement("div");if(typeof A=="string")return S(T(A));if(g.has(A))return A;if(A instanceof Node){if(A.parentNode)return O(A);{let f=document.createElement("div");return f.append(A),f}}else{let f=document.createElement("div");for(let m of[...A])f.append(m);return f}}function O(A){return{childNodes:[A],querySelectorAll:f=>{let m=A.querySelectorAll(f);return A.matches(f)?[A,...m]:m},insertBefore:(f,m)=>A.parentNode.insertBefore(f,m),moveBefore:(f,m)=>A.parentNode.moveBefore(f,m),get __idiomorphRoot(){return A}}}function T(A){let f=new DOMParser,m=A.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(m.match(/<\/html>/)||m.match(/<\/head>/)||m.match(/<\/body>/)){let h=f.parseFromString(A,"text/html");if(m.match(/<\/html>/))return g.add(h),h;{let l=h.firstChild;return l&&g.add(l),l}}else{let l=f.parseFromString("<body><template>"+A+"</template></body>","text/html").body.querySelector("template").content;return g.add(l),l}}return{normalizeElement:w,normalizeParent:S}}();return{morph:t,defaults:e}}();function ur(r,e,{callbacks:t,...s}={}){uo.morph(r,e,{...s,callbacks:new Ct(t)})}function mi(r,e){ur(r,e.childNodes,{morphStyle:"innerHTML"})}var Ct=class{#e;constructor({beforeNodeMorphed:e}={}){this.#e=e||(()=>!0)}beforeNodeAdded=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));beforeNodeMorphed=(e,t)=>{if(e instanceof Element)return!e.hasAttribute("data-turbo-permanent")&&this.#e(e,t)?!B("turbo:before-morph-element",{cancelable:!0,target:e,detail:{currentElement:e,newElement:t}}).defaultPrevented:!1};beforeAttributeUpdated=(e,t,s)=>!B("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:s}}).defaultPrevented;beforeNodeRemoved=e=>this.beforeNodeMorphed(e);afterNodeMorphed=(e,t)=>{e instanceof Element&&B("turbo:morph-element",{target:e,detail:{currentElement:e,newElement:t}})}},Ft=class extends Ce{static renderElement(e,t){B("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),mi(e,t)}async preservingPermanentElements(e){return await e()}},Pt=class r{static animationDuration=300;static get defaultCSS(){return si`
14
- .turbo-progress-bar {
15
- position: fixed;
16
- display: block;
17
- top: 0;
18
- left: 0;
19
- height: 3px;
20
- background: #0076ff;
21
- z-index: 2147483647;
22
- transition:
23
- width ${r.animationDuration}ms ease-out,
24
- opacity ${r.animationDuration/2}ms ${r.animationDuration/2}ms ease-in;
25
- transform: translate3d(0, 0, 0);
26
- }
27
- `}hiding=!1;value=0;visible=!1;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,r.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,r.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}trickle=()=>{this.setValue(this.value+Math.random()/100)};refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){let e=document.createElement("style");e.type="text/css",e.textContent=r.defaultCSS;let t=ni();return t&&(e.nonce=t),e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}},Nt=class extends Ee{detailsByOuterHTML=this.children.filter(e=>!po(e)).map(e=>vo(e)).reduce((e,t)=>{let{outerHTML:s}=t,i=s in e?e[s]:{type:ho(t),tracked:lo(t),elements:[]};return{...e,[s]:{...i,elements:[...i.elements,t]}}},{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter(s=>!(s in t.detailsByOuterHTML)).map(s=>this.detailsByOuterHTML[s]).filter(({type:s})=>s==e).map(({elements:[s]})=>s)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:s,tracked:i,elements:n}=this.detailsByOuterHTML[t];return s==null&&!i?[...e,...n]:n.length>1?[...e,...n.slice(1)]:e},[])}getMetaValue(e){let t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,s)=>{let{elements:[i]}=this.detailsByOuterHTML[s];return go(i,e)?i:t},void 0|void 0)}};function ho(r){if(fo(r))return"script";if(mo(r))return"stylesheet"}function lo(r){return r.getAttribute("data-turbo-track")=="reload"}function fo(r){return r.localName=="script"}function po(r){return r.localName=="noscript"}function mo(r){let e=r.localName;return e=="style"||e=="link"&&r.getAttribute("rel")=="stylesheet"}function go(r,e){return r.localName=="meta"&&r.getAttribute("name")==e}function vo(r){return r.hasAttribute("nonce")&&r.setAttribute("nonce",""),r}var $=class r extends Ee{static fromHTMLString(e=""){return this.fromDocument(ri(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:s}){return new this(e,t,new Nt(s))}constructor(e,t,s){super(t),this.documentElement=e,this.headSnapshot=s}clone(){let e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),s=e.querySelectorAll("select");for(let[i,n]of t.entries()){let o=s[i];for(let c of o.selectedOptions)c.selected=!1;for(let c of n.selectedOptions)o.options[c.index].selected=!0}for(let i of e.querySelectorAll('input[type="password"]'))i.value="";return new r(this.documentElement,e,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get headElement(){return this.headSnapshot.element}get rootLocation(){let e=this.getSetting("root")??"/";return D(e)}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}get prefersViewTransitions(){return this.headSnapshot.getMetaValue("view-transition")==="same-origin"}get shouldMorphPage(){return this.getSetting("refresh-method")==="morph"}get shouldPreserveScrollPosition(){return this.getSetting("refresh-scroll")==="preserve"}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},Bt=class{#e=!1;#t=Promise.resolve();renderChange(e,t){return e&&this.viewTransitionsAvailable&&!this.#e?(this.#e=!0,this.#t=this.#t.then(async()=>{await document.startViewTransition(t).finished})):this.#t=this.#t.then(t),this.#t}get viewTransitionsAvailable(){return document.startViewTransition}},yo={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},Xe={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},J={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},we={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},bo={advance:"forward",restore:"back",replace:"none"},xt=class{identifier=te();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=J.initialized;viewTransitioner=new Bt;constructor(e,t,s,i={}){this.delegate=e,this.location=t,this.restorationIdentifier=s||te();let{action:n,historyChanged:o,referrer:c,snapshot:u,snapshotHTML:p,response:y,visitCachedSnapshot:E,willRender:g,updateHistory:w,shouldCacheSnapshot:S,acceptsStreamResponse:O,direction:T}={...yo,...i};this.action=n,this.historyChanged=o,this.referrer=c,this.snapshot=u,this.snapshotHTML=p,this.response=y,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=E,this.willRender=g,this.updateHistory=w,this.scrolled=!g,this.shouldCacheSnapshot=S,this.acceptsStreamResponse=O,this.direction=T||bo[n]}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==J.initialized&&(this.recordTimingMetric(Xe.visitStart),this.state=J.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==J.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=J.canceled)}complete(){this.state==J.started&&(this.recordTimingMetric(Xe.visitEnd),this.adapter.visitCompleted(this),this.state=J.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==J.started&&(this.state=J.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){let e=this.location.href===this.referrer?.href?"replace":this.action,t=ii(e);this.history.update(t,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new ue(this,j.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(Xe.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;Js(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(Xe.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,Js(e)&&t!=null){let s=$.fromHTMLString(t);await this.renderPageSnapshot(s,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError($.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!ce(this.location)||e.hasAnchor(ce(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return $.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.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(e,t),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&this.response?.redirected&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)})}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(re.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let s=await t.responseHTML,{redirected:i,statusCode:n}=t;s==null?this.recordResponse({statusCode:we.contentTypeMismatch,redirected:i}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:n,responseHTML:s,redirected:i}))}async requestFailedWithResponse(e,t){let s=await t.responseHTML,{redirected:i,statusCode:n}=t;s==null?this.recordResponse({statusCode:we.contentTypeMismatch,redirected:i}):this.recordResponse({statusCode:n,responseHTML:s,redirected:i})}requestErrored(e,t){this.recordResponse({statusCode:we.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){!this.scrolled&&!this.view.forceReloaded&&!this.view.shouldPreserveScrollPosition(this)&&(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=ce(this.location);if(e!=null)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=new Date().getTime()}getTimingMetrics(){return{...this.timingMetrics}}hasPreloadedResponse(){return typeof this.response=="object"}shouldIssueRequest(){return this.isSamePage?!1:this.action=="restore"?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),await new Promise(t=>{this.frame=document.visibilityState==="hidden"?setTimeout(()=>t(),0):requestAnimationFrame(()=>t())}),await e(),delete this.frame}async renderPageSnapshot(e,t){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(e),async()=>{await this.view.renderPage(e,t,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};function Js(r){return r>=200&&r<300}var It=class{progressBar=new Pt;constructor(e){this.session=e}visitProposedToLocation(e,t){ee(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||te(),t):window.location.href=e.toString()}visitStarted(e){this.location=e.location,e.loadCachedSnapshot(),e.issueRequest(),e.goToSamePageAnchor()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||e.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case we.networkFailure:case we.timeoutFailure:case we.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:t}});default:return e.loadResponse()}}visitRequestFinished(e){}visitCompleted(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(e){this.reload(e)}visitFailed(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(e){}linkPrefetchingIsEnabledForLocation(e){return!0}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)}showProgressBar=()=>{this.progressBar.show()};reload(e){B("turbo:reload",{detail:e}),window.location.href=this.location?.toString()||window.location.href}get navigator(){return this.session.navigator}},Dt=class{selector="[data-turbo-temporary]";deprecatedSelector="[data-turbo-cache=false]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=e=>{for(let t of this.temporaryElements)t.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){let e=document.querySelectorAll(this.deprecatedSelector);return e.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...e]}},qt=class{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new rt(this,t),this.formSubmitObserver=new Me(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,s){return this.#t(e)}linkClickIntercepted(e,t,s){let i=this.#r(e);i&&i.delegate.linkClickIntercepted(e,t,s)}willSubmitForm(e,t){return e.closest("turbo-frame")==null&&this.#e(e,t)&&this.#t(e,t)}formSubmitted(e,t){let s=this.#r(e,t);s&&s.delegate.formSubmitted(e,t)}#e(e,t){let s=or(e,t),i=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),n=D(i?.content??"/");return this.#t(e,t)&&ee(s,n)}#t(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){let i=this.#r(e,t);return i?i!=e.closest("turbo-frame"):!1}else return!1}#r(e,t){let s=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(s&&s!="_top"){let i=this.element.querySelector(`#${s}:not([disabled])`);if(i instanceof U)return i}}},Ht=class{location;restorationIdentifier=te();restorationData={};started=!1;pageLoaded=!1;currentIndex=0;constructor(e){this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,s=te()){e===history.pushState&&++this.currentIndex;let i={turbo:{restorationIdentifier:s,restorationIndex:this.currentIndex}};e.call(history,i,"",t.href),this.location=t,this.restorationIdentifier=s}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){let{restorationIdentifier:t}=this,s=this.restorationData[t];this.restorationData[t]={...s,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=e=>{if(this.shouldHandlePopState()){let{turbo:t}=e.state||{};if(t){this.location=new URL(window.location.href);let{restorationIdentifier:s,restorationIndex:i}=t;this.restorationIdentifier=s;let n=i>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,s,n),this.currentIndex=i}}};onPageLoad=async e=>{await Rn(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},jt=class{started=!1;#e=null;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.readyState==="loading"?this.eventTarget.addEventListener("DOMContentLoaded",this.#t,{once:!0}):this.#t())}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",this.#r,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#i,!0),this.started=!1)}#t=()=>{this.eventTarget.addEventListener("mouseenter",this.#r,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#i,!0),this.started=!0};#r=e=>{if(Ze("turbo-prefetch")==="false")return;let t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&this.#c(t)){let i=t,n=ui(i);if(this.delegate.canPrefetchRequestToLocation(i,n)){this.#e=i;let o=new ue(this,j.get,n,new URLSearchParams,t);ye.setLater(n.toString(),o,this.#s)}}};#n=e=>{e.target===this.#e&&this.#o()};#o=()=>{ye.clear(),this.#e=null};#i=e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="GET"){let t=ye.get(e.detail.url.toString());t&&(e.detail.fetchRequest=t),ye.clear()}};prepareRequest(e){let t=e.target;e.headers["X-Sec-Purpose"]="prefetch";let s=t.closest("turbo-frame"),i=t.getAttribute("data-turbo-frame")||s?.getAttribute("target")||s?.id;i&&i!=="_top"&&(e.headers["Turbo-Frame"]=i)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#s(){return Number(Ze("turbo-prefetch-cache-time"))||Gn}#c(e){return!(!e.getAttribute("href")||wo(e)||Eo(e)||So(e)||_o(e)||To(e))}},wo=r=>r.origin!==document.location.origin||!["http:","https:"].includes(r.protocol)||r.hasAttribute("target"),Eo=r=>r.pathname+r.search===document.location.pathname+document.location.search||r.href.startsWith("#"),So=r=>{if(r.getAttribute("data-turbo-prefetch")==="false"||r.getAttribute("data-turbo")==="false")return!0;let e=be(r,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},_o=r=>{let e=r.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||Ao(r)||r.hasAttribute("data-turbo-confirm")||r.hasAttribute("data-turbo-stream"))},Ao=r=>r.hasAttribute("data-remote")||r.hasAttribute("data-behavior")||r.hasAttribute("data-confirm")||r.hasAttribute("data-method"),To=r=>B("turbo:before-prefetch",{target:r,cancelable:!0}).defaultPrevented,Vt=class{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,s={}){this.stop(),this.currentVisit=new xt(this,D(e),t,{referrer:this.location,...s}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new et(this,e,t,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(e){typeof this.adapter.formSubmissionStarted=="function"&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){let s=await t.responseHTML;if(s){let i=e.isSafe;i||this.view.clearSnapshotCache();let{statusCode:n,redirected:o}=t,u={action:this.#e(e,t),shouldCacheSnapshot:i,response:{statusCode:n,responseHTML:s,redirected:o}};this.proposeVisit(t.location,u)}}}async formSubmissionFailedWithResponse(e,t){let s=await t.responseHTML;if(s){let i=$.fromHTMLString(s);t.serverError?await this.view.renderError(i,this.currentVisit):await this.view.renderPage(i,!1,!0,this.currentVisit),i.shouldPreserveScrollPosition||this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(e)}linkPrefetchingIsEnabledForLocation(e){return typeof this.adapter.linkPrefetchingIsEnabledForLocation=="function"?this.adapter.linkPrefetchingIsEnabledForLocation(e):!0}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e),delete this.currentVisit}locationWithActionIsSamePage(e,t){let s=ce(e),i=ce(this.view.lastRenderedLocation),n=t==="restore"&&typeof s>"u";return t!=="replace"&&Ot(e)===Ot(this.view.lastRenderedLocation)&&(n||s!=null&&s!==i)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#e(e,t){let{submitter:s,formElement:i}=e;return ae(s,i)||this.#t(t)}#t(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}},ne={initial:0,loading:1,interactive:2,complete:3},$t=class{stage=ne.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==ne.initial&&(this.stage=ne.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=>{let{readyState:e}=this;e=="interactive"?this.pageIsInteractive():e=="complete"&&this.pageIsComplete()};pageIsInteractive(){this.stage==ne.loading&&(this.stage=ne.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==ne.interactive&&(this.stage=ne.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}},Ut=class{started=!1;constructor(e){this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}},Wt=class{render({fragment:e}){nt.preservingPermanentElements(this,Oo(e),()=>{Lo(e,()=>{Ro(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}};function Oo(r){let e=pi(document.documentElement),t={};for(let s of e){let{id:i}=s;for(let n of r.querySelectorAll("turbo-stream")){let o=fi(n.templateElement.content,i);o&&(t[i]=[s,o])}}return t}async function Lo(r,e){let t=`turbo-stream-autofocus-${te()}`,s=r.querySelectorAll("turbo-stream"),i=Mo(s),n=null;if(i&&(i.id?n=i.id:n=t,i.id=n),e(),await Oe(),(document.activeElement==null||document.activeElement==document.body)&&n){let c=document.getElementById(n);nr(c)&&c.focus(),c&&c.id==t&&c.removeAttribute("id")}}async function Ro(r){let[e,t]=await Nn(r,()=>document.activeElement),s=e&&e.id;if(s){let i=document.getElementById(s);nr(i)&&i!=t&&i.focus()}}function Mo(r){for(let e of r){let t=oi(e.templateElement.content);if(t)return t}return null}var Kt=class{sources=new Set;#e=!1;constructor(e){this.delegate=e}start(){this.#e||(this.#e=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.#e&&(this.#e=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}inspectFetchResponse=e=>{let t=ko(e);t&&Co(t)&&(e.preventDefault(),this.receiveMessageResponse(t))};receiveMessageEvent=e=>{this.#e&&typeof e.data=="string"&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){let t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(re.wrap(e))}};function ko(r){let e=r.detail?.fetchResponse;if(e instanceof Re)return e}function Co(r){return(r.contentType??"").startsWith(re.contentType)}var zt=class extends ke{static renderElement(e,t){let{documentElement:s,body:i}=document;s.replaceChild(t,i)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){let{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(let e of this.scriptElements){let t=e.parentNode;if(t){let s=Le(e);t.replaceChild(s,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}},Fe=class extends ke{static renderElement(e,t){document.body&&t instanceof HTMLBodyElement?document.body.replaceWith(t):document.documentElement.appendChild(t)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){if(!this.newSnapshot.isVisitable)return{reason:"turbo_visit_control_is_reload"};if(!this.trackedElementsAreIdentical)return{reason:"tracked_element_mismatch"}}async prepareToRender(){this.#e(),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#e(){let{documentElement:e}=this.currentSnapshot,{lang:t}=this.newSnapshot;t?e.setAttribute("lang",t):e.removeAttribute("lang")}async mergeHead(){let e=this.mergeProvisionalElements(),t=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await e,await t,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){let e=[];for(let t of this.newHeadStylesheetElements)e.push(Cn(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(Le(e))}removeUnusedDynamicStylesheetElements(){for(let e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){let e=[...this.newHeadProvisionalElements];for(let t of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(t,e)||document.head.removeChild(t);for(let t of e)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(let[s,i]of t.entries()){if(e.tagName=="TITLE"){if(i.tagName!="TITLE")continue;if(e.innerHTML==i.innerHTML)return t.splice(s,1),!0}if(i.isEqualNode(e))return t.splice(s,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(let e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let t=Le(e);e.replaceWith(t)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(e=>e.getAttribute("data-turbo-track")==="dynamic")}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}},Jt=class extends Fe{static renderElement(e,t){ur(e,t,{callbacks:{beforeNodeMorphed:s=>!Xs(s)}});for(let s of e.querySelectorAll("turbo-frame"))Xs(s)&&s.reload();B("turbo:morph",{detail:{currentElement:e,newElement:t}})}async preservingPermanentElements(e){return await e()}get renderMethod(){return"morph"}get shouldAutofocus(){return!1}};function Xs(r){return r instanceof U&&r.src&&r.refresh==="morph"&&!r.closest("[data-turbo-permanent]")}var Xt=class{keys=[];snapshots={};constructor(e){this.size=e}has(e){return Je(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[Je(e)]}write(e,t){this.snapshots[Je(e)]=t}touch(e){let t=Je(e),s=this.keys.indexOf(t);s>-1&&this.keys.splice(s,1),this.keys.unshift(t),this.trim()}trim(){for(let e of this.keys.splice(this.size))delete this.snapshots[e]}},Gt=class extends tt{snapshotCache=new Xt(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,s=!0,i){let o=this.isPageRefresh(i)&&this.snapshot.shouldMorphPage?Jt:Fe,c=new o(this.snapshot,e,t,s);return c.shouldRender?i?.changeHistory():this.forceReloaded=!0,this.render(c)}renderError(e,t){t?.changeHistory();let s=new zt(this.snapshot,e,!1);return this.render(s)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();let{lastRenderedLocation:t}=this;await ti();let s=e.clone();return this.snapshotCache.put(t,s),s}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}isPageRefresh(e){return!e||this.lastRenderedLocation.pathname===e.location.pathname&&e.action==="replace"}shouldPreserveScrollPosition(e){return this.isPageRefresh(e)&&this.snapshot.shouldPreserveScrollPosition}get snapshot(){return $.fromElement(this.element)}},Qt=class{selector="a[data-turbo-preload]";constructor(e,t){this.delegate=e,this.snapshotCache=t}start(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.#e):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",this.#e)}preloadOnLoadLinksForView(e){for(let t of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(t)&&this.preloadURL(t)}async preloadURL(e){let t=new URL(e.href);if(this.snapshotCache.has(t))return;await new ue(this,j.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{let s=await t.responseHTML,i=$.fromHTMLString(s);this.snapshotCache.put(e.url,i)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#e=()=>{this.preloadOnLoadLinksForView(document.body)}},Yt=class{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.#e("")}exemptPageFromCache(){this.#e("no-cache")}exemptPageFromPreview(){this.#e("no-preview")}#e(e){Pn("turbo-cache-control",e)}},Zt=class{navigator=new Vt(this);history=new Ht(this);view=new Gt(this,document.documentElement);adapter=new It(this);pageObserver=new $t(this);cacheObserver=new Dt;linkPrefetchObserver=new jt(this,document);linkClickObserver=new st(this,window);formSubmitObserver=new Me(this,document);scrollObserver=new Ut(this);streamObserver=new Kt(this);formLinkClickObserver=new it(this,document.documentElement);frameRedirector=new qt(this,document.documentElement);streamMessageRenderer=new Wt;cache=new Yt(this);enabled=!0;started=!1;#e=150;constructor(e){this.recentRequests=e,this.preloader=new Qt(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){let s=t.frame?document.getElementById(t.frame):null;if(s instanceof U){let i=t.action||ae(s);s.delegate.proposeVisitIfNavigatedWithAction(s,i),s.src=e.toString()}else this.navigator.proposeVisit(D(e),t)}refresh(e,t){let s=t&&this.recentRequests.has(t),i=e===document.baseURI;!s&&!this.navigator.currentVisit&&i&&this.visit(e,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(re.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){console.warn("Please replace `session.setProgressBarDelay(delay)` with `session.progressBarDelay = delay`. The function is deprecated and will be removed in a future version of Turbo.`"),this.progressBarDelay=e}set progressBarDelay(e){I.drive.progressBarDelay=e}get progressBarDelay(){return I.drive.progressBarDelay}set drive(e){I.drive.enabled=e}get drive(){return I.drive.enabled}set formMode(e){I.forms.mode=e}get formMode(){return I.forms.mode}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#e}set pageRefreshDebouncePeriod(e){this.refresh=Bn(this.debouncedRefresh.bind(this),e),this.#e=e}shouldPreloadLink(e){let t=e.hasAttribute("data-turbo-method"),s=e.hasAttribute("data-turbo-stream"),i=e.getAttribute("data-turbo-frame"),n=i=="_top"?null:document.getElementById(i)||be(e,"turbo-frame:not([disabled])");if(t||s||n instanceof U)return!1;{let o=new URL(e.href);return this.elementIsNavigatable(e)&&ee(o,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,t,s){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0,direction:s}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&ee(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&ee(t,this.snapshot.rootLocation)&&this.navigator.linkPrefetchingIsEnabledForLocation(t)}willFollowLinkToLocation(e,t,s){return this.elementIsNavigatable(e)&&ee(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,s)}followedLinkToLocation(e,t){let s=this.getActionForLink(e),i=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:s,acceptsStreamResponse:i})}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){Gs(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(Qe(document.documentElement),this.view.markVisitDirection(e.direction)),Gs(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),Ye(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){let s=or(e,t);return this.submissionIsNavigatable(e,t)&&ee(D(s),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){this.navigator.currentVisit?.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){let s=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:i,detail:{render:n}}=s;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!i}viewRenderedSnapshot(e,t,s){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(s)}preloadOnLoadLinksForView(e){this.preloader.preloadOnLoadLinksForView(e)}viewInvalidated(e){this.adapter.pageInvalidated(e)}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t,s){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,s).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,s){return B("turbo:click",{target:e,detail:{url:t.href,originalEvent:s},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return B("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return B("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return B("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return B("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return B("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return B("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 B("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return B("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if(I.forms.mode=="off")return!1;{let s=t?this.elementIsNavigatable(t):!0;return I.forms.mode=="optin"?s&&e.closest('[data-turbo="true"]')!=null:s&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){let t=be(e,"[data-turbo]"),s=be(e,"turbo-frame");return I.drive.enabled||s?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return ae(e)||"advance"}get snapshot(){return this.view.snapshot}};function Gs(r){Object.defineProperties(r,Fo)}var Fo={absoluteURL:{get(){return this.toString()}}},x=new Zt(hi),{cache:Po,navigator:No}=x;function ot(){x.start()}function Bo(r){x.registerAdapter(r)}function xo(r,e){x.visit(r,e)}function gi(r){x.connectStreamSource(r)}function vi(r){x.disconnectStreamSource(r)}function Io(r){x.renderStreamMessage(r)}function Do(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),x.clearCache()}function qo(r){console.warn("Please replace `Turbo.setProgressBarDelay(delay)` with `Turbo.config.drive.progressBarDelay = delay`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),I.drive.progressBarDelay=r}function Ho(r){console.warn("Please replace `Turbo.setConfirmMethod(confirmMethod)` with `Turbo.config.forms.confirm = confirmMethod`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),I.forms.confirm=r}function jo(r){console.warn("Please replace `Turbo.setFormMode(mode)` with `Turbo.config.forms.mode = mode`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),I.forms.mode=r}var Vo=Object.freeze({__proto__:null,navigator:No,session:x,cache:Po,PageRenderer:Fe,PageSnapshot:$,FrameRenderer:Ce,fetch:li,config:I,start:ot,registerAdapter:Bo,visit:xo,connectStreamSource:gi,disconnectStreamSource:vi,renderStreamMessage:Io,clearCache:Do,setProgressBarDelay:qo,setConfirmMethod:Ho,setFormMode:jo}),er=class extends Error{},tr=class{fetchResponseLoaded=e=>Promise.resolve();#e=null;#t=()=>{};#r=!1;#n=!1;#o=new Set;#i=!1;action=null;constructor(e){this.element=e,this.view=new kt(this,this.element),this.appearanceObserver=new Rt(this,this.element),this.formLinkClickObserver=new it(this,this.element),this.linkInterceptor=new rt(this,this.element),this.restorationIdentifier=te(),this.formSubmitObserver=new Me(this,this.element)}connect(){this.#r||(this.#r=!0,this.loadingStyle==ve.lazy?this.appearanceObserver.start():this.#s(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#r&&(this.#r=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==ve.eager&&this.#s()}sourceURLChanged(){this.#y("src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==ve.eager||this.#n)&&this.#s())}sourceURLReloaded(){let{refresh:e,src:t}=this.element;return this.#i=t&&e==="morph",this.element.removeAttribute("complete"),this.element.src=null,this.element.src=t,this.element.loaded}loadingStyleChanged(){this.loadingStyle==ve.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#s())}async#s(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#l(D(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#n=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{let t=await e.responseHTML;if(t){let s=ri(t);$.fromDocument(s).isVisitable?await this.#c(e,s):await this.#f(e)}}finally{this.#i=!1,this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,ae(e)),this.#s()}willSubmitFormLinkToLocation(e){return this.#u(e)}submittedFormLinkToLocation(e,t,s){let i=this.#a(e);i&&s.setAttribute("data-turbo-frame",i.id)}shouldInterceptLinkClick(e,t,s){return this.#u(e)}linkClickIntercepted(e,t){this.#d(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.#u(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new et(this,e,t);let{fetchRequest:s}=this.formSubmission;this.prepareRequest(s),this.formSubmission.start()}prepareRequest(e){e.headers["Turbo-Frame"]=this.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&&e.acceptResponseType(re.contentType)}requestStarted(e){Qe(this.element)}requestPreventedHandlingResponse(e,t){this.#t()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.#t()}async requestFailedWithResponse(e,t){await this.loadResponse(t),this.#t()}requestErrored(e,t){console.error(t),this.#t()}requestFinished(e){Ye(this.element)}formSubmissionStarted({formElement:e}){Qe(e,this.#a(e))}formSubmissionSucceededWithResponse(e,t){let s=this.#a(e.formElement,e.submitter);s.delegate.proposeVisitIfNavigatedWithAction(s,ae(e.submitter,e.formElement,s)),s.delegate.loadResponse(t),e.isSafe||x.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),x.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){Ye(e,this.#a(e))}allowsImmediateRender({element:e},t){let s=B("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0}),{defaultPrevented:i,detail:{render:n}}=s;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!i}viewRenderedSnapshot(e,t,s){}preloadOnLoadLinksForView(e){x.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>{let t=e.querySelector("#"+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#c(e,t){let s=await this.extractForeignFrameElement(t.body),i=this.#i?Ft:Ce;if(s){let n=new Ee(s),o=new i(this,this.view.snapshot,n,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(o),this.complete=!0,x.frameRendered(e,this.element),x.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#p(e)&&this.#m(e)}async#l(e){let t=new ue(this,j.get,e,new URLSearchParams,this.element);return this.#e?.cancel(),this.#e=t,new Promise(s=>{this.#t=()=>{this.#t=()=>{},this.#e=null,s()},t.perform()})}#d(e,t,s){let i=this.#a(e,s);i.delegate.proposeVisitIfNavigatedWithAction(i,ae(s,e,i)),this.#w(e,()=>{i.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){let s=$.fromElement(e).clone(),{visitCachedSnapshot:i}=e.delegate;e.delegate.fetchResponseLoaded=async n=>{if(e.src){let{statusCode:o,redirected:c}=n,u=await n.responseHTML,y={response:{statusCode:o,redirected:c,responseHTML:u},visitCachedSnapshot:i,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:s};this.action&&(y.action=this.action),x.visit(e.src,y)}}}}changeHistory(){if(this.action){let e=ii(this.action);x.history.update(e,D(this.element.src||""),this.restorationIdentifier)}}async#f(e){console.warn(`The response (${e.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await this.#h(e.response)}#p(e){this.element.setAttribute("complete","");let t=e.response,s=async(n,o)=>{n instanceof Response?this.#h(n):x.visit(n,o)};return!B("turbo:frame-missing",{target:this.element,detail:{response:t,visit:s},cancelable:!0}).defaultPrevented}#m(e){this.view.missing(),this.#g(e)}#g(e){let t=`The response (${e.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new er(t)}async#h(e){let t=new Re(e),s=await t.responseHTML,{location:i,redirected:n,statusCode:o}=t;return x.visit(i,{response:{redirected:n,statusCode:o,responseHTML:s}})}#a(e,t){let s=Ge("data-turbo-frame",t,e)||this.element.getAttribute("target");return Qs(s)??this.element}async extractForeignFrameElement(e){let t,s=CSS.escape(this.id);try{if(t=Ys(e.querySelector(`turbo-frame#${s}`),this.sourceURL),t)return t;if(t=Ys(e.querySelector(`turbo-frame[src][recurse~=${s}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(i){return console.error(i),new U}return null}#v(e,t){let s=or(e,t);return ee(D(s),this.rootLocation)}#u(e,t){let s=Ge("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#v(e,t)||!this.enabled||s=="_top")return!1;if(s){let i=Qs(s);if(i)return!i.disabled}return!(!x.elementIsNavigatable(e)||t&&!x.elementIsNavigatable(t))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(e){this.#b("src",()=>{this.element.src=e??null})}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||this.#t()!==void 0}get complete(){return this.element.hasAttribute("complete")}set complete(e){e?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&this.#r}get rootLocation(){let t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]')?.content??"/";return D(t)}#y(e){return this.#o.has(e)}#b(e,t){this.#o.add(e),t(),this.#o.delete(e)}#w(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}};function Qs(r){if(r!=null){let e=document.getElementById(r);if(e instanceof U)return e}}function Ys(r,e){if(r){let t=r.getAttribute("src");if(t!=null&&e!=null&&Hn(t,e))throw new Error(`Matching <turbo-frame id="${r.id}"> element has a source URL which references itself`);if(r.ownerDocument!==document&&(r=document.importNode(r,!0)),r instanceof U)return r.connectedCallback(),r.disconnectedCallback(),r}}var yi={after(){this.targetElements.forEach(r=>r.parentElement?.insertBefore(this.templateContent,r.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(r=>r.append(this.templateContent))},before(){this.targetElements.forEach(r=>r.parentElement?.insertBefore(this.templateContent,r))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(r=>r.prepend(this.templateContent))},remove(){this.targetElements.forEach(r=>r.remove())},replace(){let r=this.getAttribute("method");this.targetElements.forEach(e=>{r==="morph"?ur(e,this.templateContent):e.replaceWith(this.templateContent)})},update(){let r=this.getAttribute("method");this.targetElements.forEach(e=>{r==="morph"?mi(e,this.templateContent):(e.innerHTML="",e.append(this.templateContent))})},refresh(){x.refresh(this.baseURI,this.requestId)}},rr=class r extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=>{let e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await Oe(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){let e=this.targetElements.flatMap(s=>[...s.children]).filter(s=>!!s.getAttribute("id")),t=[...this.templateContent?.children||[]].filter(s=>!!s.getAttribute("id")).map(s=>s.getAttribute("id"));return e.filter(s=>t.includes(s.getAttribute("id")))}get performAction(){if(this.action){let e=yi[this.action];if(e)return e;this.#e("unknown action")}this.#e("action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;this.#e("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild===null){let e=this.ownerDocument.createElement("template");return this.appendChild(e),e}else if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.#e("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}#e(e){throw new Error(`${this.description}: ${e}`)}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:r.renderElement}})}get targetElementsById(){let e=this.ownerDocument?.getElementById(this.target);return e!==null?[e]:[]}get targetElementsByQuery(){let e=this.ownerDocument?.querySelectorAll(this.targets);return e.length!==0?Array.prototype.slice.call(e):[]}},sr=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),gi(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),vi(this.streamSource))}get src(){return this.getAttribute("src")||""}};U.delegateConstructor=tr;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",U);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",rr);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",sr);(()=>{let r=document.currentScript;if(r&&!r.hasAttribute("data-turbo-suppress-warning"))for(r=r.parentElement;r;){if(r==document.body)return console.warn(si`
28
- You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
29
-
30
- Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
31
-
32
- For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements
33
-
34
- ——
35
- Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
36
- `,r.outerHTML);r=r.parentElement}})();window.Turbo={...Vo,StreamActions:yi};ot();var hr=class{constructor(e,t,s){this.eventTarget=e,this.eventName=t,this.eventOptions=s,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){let t=Uo(e);for(let s of this.bindings){if(t.immediatePropagationStopped)break;s.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{let s=e.index,i=t.index;return s<i?-1:s>i?1:0})}};function Uo(r){if("immediatePropagationStopped"in r)return r;{let{stopImmediatePropagation:e}=r;return Object.assign(r,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,e.call(this)}})}}var lr=class{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(e=>e.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(e=>e.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((e,t)=>e.concat(Array.from(t.values())),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,s={}){this.application.handleError(e,`Error ${t}`,s)}clearEventListenersForBinding(e){let t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){let{eventTarget:t,eventName:s,eventOptions:i}=e,n=this.fetchEventListenerMapForEventTarget(t),o=this.cacheKey(s,i);n.delete(o),n.size==0&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){let{eventTarget:t,eventName:s,eventOptions:i}=e;return this.fetchEventListener(t,s,i)}fetchEventListener(e,t,s){let i=this.fetchEventListenerMapForEventTarget(e),n=this.cacheKey(t,s),o=i.get(n);return o||(o=this.createEventListener(e,t,s),i.set(n,o)),o}createEventListener(e,t,s){let i=new hr(e,t,s);return this.started&&i.connect(),i}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){let s=[e];return Object.keys(t).sort().forEach(i=>{s.push(`${t[i]?"":"!"}${i}`)}),s.join(":")}},Wo={stop({event:r,value:e}){return e&&r.stopPropagation(),!0},prevent({event:r,value:e}){return e&&r.preventDefault(),!0},self({event:r,value:e,element:t}){return e?t===r.target:!0}},Ko=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function zo(r){let t=r.trim().match(Ko)||[],s=t[2],i=t[3];return i&&!["keydown","keyup","keypress"].includes(s)&&(s+=`.${i}`,i=""),{eventTarget:Jo(t[4]),eventName:s,eventOptions:t[7]?Xo(t[7]):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||i}}function Jo(r){if(r=="window")return window;if(r=="document")return document}function Xo(r){return r.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})}function Go(r){if(r==window)return"window";if(r==document)return"document"}function Pr(r){return r.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function dr(r){return Pr(r.replace(/--/g,"-").replace(/__/g,"_"))}function Ne(r){return r.charAt(0).toUpperCase()+r.slice(1)}function Ri(r){return r.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function Qo(r){return r.match(/[^\s]+/g)||[]}function bi(r){return r!=null}function fr(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var wi=["meta","ctrl","alt","shift"],pr=class{constructor(e,t,s,i){this.element=e,this.index=t,this.eventTarget=s.eventTarget||e,this.eventName=s.eventName||Yo(e)||at("missing event name"),this.eventOptions=s.eventOptions||{},this.identifier=s.identifier||at("missing identifier"),this.methodName=s.methodName||at("missing method name"),this.keyFilter=s.keyFilter||"",this.schema=i}static forToken(e,t){return new this(e.element,e.index,zo(e.content),t)}toString(){let e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;let t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;let s=t.filter(i=>!wi.includes(i))[0];return s?(fr(this.keyMappings,s)||at(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[s].toLowerCase()!==e.key.toLowerCase()):!1}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;let t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){let e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(let{name:s,value:i}of Array.from(this.element.attributes)){let n=s.match(t),o=n&&n[1];o&&(e[Pr(o)]=Zo(i))}return e}get eventTargetName(){return Go(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){let[s,i,n,o]=wi.map(c=>t.includes(c));return e.metaKey!==s||e.ctrlKey!==i||e.altKey!==n||e.shiftKey!==o}},Ei={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:r=>r.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function Yo(r){let e=r.tagName.toLowerCase();if(e in Ei)return Ei[e](r)}function at(r){throw new Error(r)}function Zo(r){try{return JSON.parse(r)}catch{return r}}var mr=class{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){let t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){let e=this.controller[this.methodName];if(typeof e=="function")return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){let{element:t}=this.action,{actionDescriptorFilters:s}=this.context.application,{controller:i}=this.context,n=!0;for(let[o,c]of Object.entries(this.eventOptions))if(o in s){let u=s[o];n=n&&u({name:o,value:c,event:e,element:t,controller:i})}else continue;return n}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){let{target:t,currentTarget:s}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:s,action:this.methodName})}catch(i){let{identifier:n,controller:o,element:c,index:u}=this,p={identifier:n,controller:o,element:c,index:u,event:e};this.context.handleError(i,`invoking action "${this.action}"`,p)}}willBeInvokedByEvent(e){let t=e.target;return e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e)||e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e)?!1:this.element===t?!0:t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element)}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}},ct=class{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(s=>this.processMutations(s))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){let e=new Set(this.matchElementsInTree());for(let t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(let t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(let t of Array.from(e)){let s=this.elementFromNode(t);s&&this.processTree(s,this.removeElement)}}processAddedNodes(e){for(let t of Array.from(e)){let s=this.elementFromNode(t);s&&this.elementIsActive(s)&&this.processTree(s,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(let s of this.matchElementsInTree(e))t.call(this,s)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected!=this.element.isConnected?!1:this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}},ut=class{constructor(e,t,s){this.attributeName=t,this.delegate=s,this.elementObserver=new ct(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){let t=this.matchElement(e)?[e]:[],s=Array.from(e.querySelectorAll(this.selector));return t.concat(s)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}};function ea(r,e,t){Mi(r,e).add(t)}function ta(r,e,t){Mi(r,e).delete(t),ra(r,e)}function Mi(r,e){let t=r.get(e);return t||(t=new Set,r.set(e,t)),t}function ra(r,e){let t=r.get(e);t!=null&&t.size==0&&r.delete(e)}var X=class{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((t,s)=>t.concat(Array.from(s)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((t,s)=>t+s.size,0)}add(e,t){ea(this.valuesByKey,e,t)}delete(e,t){ta(this.valuesByKey,e,t)}has(e,t){let s=this.valuesByKey.get(e);return s!=null&&s.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(s=>s.has(e))}getValuesForKey(e){let t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,s])=>s.has(e)).map(([t,s])=>t)}};var gr=class{constructor(e,t,s,i){this._selector=t,this.details=i,this.elementObserver=new ct(e,this),this.delegate=s,this.matchesByElement=new X}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){let{selector:t}=this;if(t){let s=e.matches(t);return this.delegate.selectorMatchElement?s&&this.delegate.selectorMatchElement(e,this.details):s}else return!1}matchElementsInTree(e){let{selector:t}=this;if(t){let s=this.matchElement(e)?[e]:[],i=Array.from(e.querySelectorAll(t)).filter(n=>this.matchElement(n));return s.concat(i)}else return[]}elementMatched(e){let{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){let t=this.matchesByElement.getKeysForValue(e);for(let s of t)this.selectorUnmatched(e,s)}elementAttributeChanged(e,t){let{selector:s}=this;if(s){let i=this.matchElement(e),n=this.matchesByElement.has(s,e);i&&!n?this.selectorMatched(e,s):!i&&n&&this.selectorUnmatched(e,s)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}},vr=class{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(s=>this.processMutations(s))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(let e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){let t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){let s=this.delegate.getStringMapKeyForAttribute(e);if(s!=null){this.stringMap.has(e)||this.stringMapKeyAdded(s,e);let i=this.element.getAttribute(e);if(this.stringMap.get(e)!=i&&this.stringMapValueChanged(i,s,t),i==null){let n=this.stringMap.get(e);this.stringMap.delete(e),n&&this.stringMapKeyRemoved(s,e,n)}else this.stringMap.set(e,i)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,s){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,s)}stringMapKeyRemoved(e,t,s){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,s)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(e=>e.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}},ht=class{constructor(e,t,s){this.attributeObserver=new ut(e,t,this),this.delegate=s,this.tokensByElement=new X}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){let[t,s]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(s)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(t=>this.tokenMatched(t))}tokensUnmatched(e){e.forEach(t=>this.tokenUnmatched(t))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){let t=this.tokensByElement.getValuesForKey(e),s=this.readTokensForElement(e),i=ia(t,s).findIndex(([n,o])=>!na(n,o));return i==-1?[[],[]]:[t.slice(i),s.slice(i)]}readTokensForElement(e){let t=this.attributeName,s=e.getAttribute(t)||"";return sa(s,e,t)}};function sa(r,e,t){return r.trim().split(/\s+/).filter(s=>s.length).map((s,i)=>({element:e,attributeName:t,content:s,index:i}))}function ia(r,e){let t=Math.max(r.length,e.length);return Array.from({length:t},(s,i)=>[r[i],e[i]])}function na(r,e){return r&&e&&r.index==e.index&&r.content==e.content}var lt=class{constructor(e,t,s){this.tokenListObserver=new ht(e,t,this),this.delegate=s,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){let{element:t}=e,{value:s}=this.fetchParseResultForToken(e);s&&(this.fetchValuesByTokenForElement(t).set(e,s),this.delegate.elementMatchedValue(t,s))}tokenUnmatched(e){let{element:t}=e,{value:s}=this.fetchParseResultForToken(e);s&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,s))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(t){return{error:t}}}},yr=class{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new lt(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){let t=new mr(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){let t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach(e=>this.delegate.bindingDisconnected(e,!0)),this.bindingsByAction.clear()}parseValueForToken(e){let t=pr.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},br=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new vr(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){let s=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,s.writer(this.receiver[e]),s.writer(s.defaultValue))}stringMapValueChanged(e,t,s){let i=this.valueDescriptorNameMap[t];e!==null&&(s===null&&(s=i.writer(i.defaultValue)),this.invokeChangedCallback(t,e,s))}stringMapKeyRemoved(e,t,s){let i=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,i.writer(this.receiver[e]),s):this.invokeChangedCallback(e,i.writer(i.defaultValue),s)}invokeChangedCallbacksForDefaultValues(){for(let{key:e,name:t,defaultValue:s,writer:i}of this.valueDescriptors)s!=null&&!this.controller.data.has(e)&&this.invokeChangedCallback(t,i(s),void 0)}invokeChangedCallback(e,t,s){let i=`${e}Changed`,n=this.receiver[i];if(typeof n=="function"){let o=this.valueDescriptorNameMap[e];try{let c=o.reader(t),u=s;s&&(u=o.reader(s)),n.call(this.receiver,c,u)}catch(c){throw c instanceof TypeError&&(c.message=`Stimulus Value "${this.context.identifier}.${o.name}" - ${c.message}`),c}}}get valueDescriptors(){let{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){let e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{let s=this.valueDescriptorMap[t];e[s.name]=s}),e}hasValue(e){let t=this.valueDescriptorNameMap[e],s=`has${Ne(t.name)}`;return this.receiver[s]}},wr=class{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new X}start(){this.tokenListObserver||(this.tokenListObserver=new ht(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var s;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var s;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(let e of this.targetsByName.keys)for(let t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}};function Be(r,e){let t=ki(r);return Array.from(t.reduce((s,i)=>(aa(i,e).forEach(n=>s.add(n)),s),new Set))}function oa(r,e){return ki(r).reduce((s,i)=>(s.push(...ca(i,e)),s),[])}function ki(r){let e=[];for(;r;)e.push(r),r=Object.getPrototypeOf(r);return e.reverse()}function aa(r,e){let t=r[e];return Array.isArray(t)?t:[]}function ca(r,e){let t=r[e];return t?Object.keys(t).map(s=>[s,t[s]]):[]}var Er=class{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new X,this.outletElementsByName=new X,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)}),this.started=!0,this.dependentContexts.forEach(e=>e.refresh()))}refresh(){this.selectorObserverMap.forEach(e=>e.refresh()),this.attributeObserverMap.forEach(e=>e.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(e=>e.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(e=>e.stop()),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:s}){let i=this.getOutlet(e,s);i&&this.connectOutlet(i,e,s)}selectorUnmatched(e,t,{outletName:s}){let i=this.getOutletFromMap(e,s);i&&this.disconnectOutlet(i,e,s)}selectorMatchElement(e,{outletName:t}){let s=this.selector(t),i=this.hasOutlet(e,t),n=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return s?i&&n&&e.matches(s):!1}elementMatchedAttribute(e,t){let s=this.getOutletNameFromOutletAttributeName(t);s&&this.updateSelectorObserverForOutlet(s)}elementAttributeValueChanged(e,t){let s=this.getOutletNameFromOutletAttributeName(t);s&&this.updateSelectorObserverForOutlet(s)}elementUnmatchedAttribute(e,t){let s=this.getOutletNameFromOutletAttributeName(t);s&&this.updateSelectorObserverForOutlet(s)}connectOutlet(e,t,s){var i;this.outletElementsByName.has(s,t)||(this.outletsByName.add(s,e),this.outletElementsByName.add(s,t),(i=this.selectorObserverMap.get(s))===null||i===void 0||i.pause(()=>this.delegate.outletConnected(e,t,s)))}disconnectOutlet(e,t,s){var i;this.outletElementsByName.has(s,t)&&(this.outletsByName.delete(s,e),this.outletElementsByName.delete(s,t),(i=this.selectorObserverMap.get(s))===null||i===void 0||i.pause(()=>this.delegate.outletDisconnected(e,t,s)))}disconnectAllOutlets(){for(let e of this.outletElementsByName.keys)for(let t of this.outletElementsByName.getValuesForKey(e))for(let s of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(s,t,e)}updateSelectorObserverForOutlet(e){let t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){let t=this.selector(e),s=new gr(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,s),s.start()}setupAttributeObserverForOutlet(e){let t=this.attributeNameForOutletName(e),s=new ut(this.scope.element,t,this);this.attributeObserverMap.set(e,s),s.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find(t=>this.attributeNameForOutletName(t)===e)}get outletDependencies(){let e=new X;return this.router.modules.forEach(t=>{let s=t.definition.controllerConstructor;Be(s,"outlets").forEach(n=>e.add(n,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){let e=this.dependentControllerIdentifiers;return this.router.contexts.filter(t=>e.includes(t.identifier))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find(s=>s.element===e)}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}},Sr=class{constructor(e,t){this.logDebugActivity=(s,i={})=>{let{identifier:n,controller:o,element:c}=this;i=Object.assign({identifier:n,controller:o,element:c},i),this.application.logDebugActivity(this.identifier,s,i)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new yr(this,this.dispatcher),this.valueObserver=new br(this,this.controller),this.targetObserver=new wr(this,this),this.outletObserver=new Er(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(s){this.handleError(s,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,s={}){let{identifier:i,controller:n,element:o}=this;s=Object.assign({identifier:i,controller:n,element:o},s),this.application.handleError(e,`Error ${t}`,s)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,s){this.invokeControllerMethod(`${dr(s)}OutletConnected`,e,t)}outletDisconnected(e,t,s){this.invokeControllerMethod(`${dr(s)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){let s=this.controller;typeof s[e]=="function"&&s[e](...t)}};function ua(r){return ha(r,la(r))}function ha(r,e){let t=ma(r),s=da(r.prototype,e);return Object.defineProperties(t.prototype,s),t}function la(r){return Be(r,"blessings").reduce((t,s)=>{let i=s(r);for(let n in i){let o=t[n]||{};t[n]=Object.assign(o,i[n])}return t},{})}function da(r,e){return pa(e).reduce((t,s)=>{let i=fa(r,e,s);return i&&Object.assign(t,{[s]:i}),t},{})}function fa(r,e,t){let s=Object.getOwnPropertyDescriptor(r,t);if(!(s&&"value"in s)){let n=Object.getOwnPropertyDescriptor(e,t).value;return s&&(n.get=s.get||n.get,n.set=s.set||n.set),n}}var pa=typeof Object.getOwnPropertySymbols=="function"?r=>[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)]:Object.getOwnPropertyNames,ma=(()=>{function r(t){function s(){return Reflect.construct(t,arguments,new.target)}return s.prototype=Object.create(t.prototype,{constructor:{value:s}}),Reflect.setPrototypeOf(s,t),s}function e(){let s=r(function(){this.a.call(this)});return s.prototype.a=function(){},new s}try{return e(),r}catch{return s=>class extends s{}}})();function ga(r){return{identifier:r.identifier,controllerConstructor:ua(r.controllerConstructor)}}var _r=class{constructor(e,t){this.application=e,this.definition=ga(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){let t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){let t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new Sr(this,e),this.contextsByScope.set(e,t)),t}},Ar=class{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){let t=this.data.get(this.getDataKey(e))||"";return Qo(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},Tr=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){let t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){let s=this.getAttributeNameForKey(e);return this.element.setAttribute(s,t),this.get(e)}has(e){let t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){let t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}else return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${Ri(e)}`}},Or=class{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,s){let i=this.warnedKeysByObject.get(e);i||(i=new Set,this.warnedKeysByObject.set(e,i)),i.has(t)||(i.add(t),this.logger.warn(s,e))}};function Lr(r,e){return`[${r}~="${e}"]`}var Rr=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((t,s)=>t||this.findTarget(s)||this.findLegacyTarget(s),void 0)}findAll(...e){return e.reduce((t,s)=>[...t,...this.findAllTargets(s),...this.findAllLegacyTargets(s)],[])}findTarget(e){let t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){let t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){let t=this.schema.targetAttributeForScope(this.identifier);return Lr(t,e)}findLegacyTarget(e){let t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){let t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(s=>this.deprecate(s,e))}getLegacySelectorForTargetName(e){let t=`${this.identifier}.${e}`;return Lr(this.schema.targetAttribute,t)}deprecate(e,t){if(e){let{identifier:s}=this,i=this.schema.targetAttribute,n=this.schema.targetAttributeForScope(s);this.guide.warn(e,`target:${t}`,`Please replace ${i}="${s}.${t}" with ${n}="${t}". The ${i} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}},Mr=class{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((t,s)=>t||this.findOutlet(s),void 0)}findAll(...e){return e.reduce((t,s)=>[...t,...this.findAllOutlets(s)],[])}getSelectorForOutletName(e){let t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){let t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){let t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter(i=>this.matchesElement(i,e,t))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter(i=>this.matchesElement(i,e,t))}matchesElement(e,t,s){let i=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&i.split(" ").includes(s)}},kr=class r{constructor(e,t,s,i){this.targets=new Rr(this),this.classes=new Ar(this),this.data=new Tr(this),this.containsElement=n=>n.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=s,this.guide=new Or(i),this.outlets=new Mr(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return Lr(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new r(this.schema,document.documentElement,this.identifier,this.guide.logger)}},Cr=class{constructor(e,t,s){this.element=e,this.schema=t,this.delegate=s,this.valueListObserver=new lt(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){let{element:t,content:s}=e;return this.parseValueForElementAndIdentifier(t,s)}parseValueForElementAndIdentifier(e,t){let s=this.fetchScopesByIdentifierForElement(e),i=s.get(t);return i||(i=this.delegate.createScopeForElementAndIdentifier(e,t),s.set(t,i)),i}elementMatchedValue(e,t){let s=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,s),s==1&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){let s=this.scopeReferenceCounts.get(t);s&&(this.scopeReferenceCounts.set(t,s-1),s==1&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}},Fr=class{constructor(e){this.application=e,this.scopeObserver=new Cr(this.element,this.schema,this),this.scopesByIdentifier=new X,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((e,t)=>e.concat(t.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);let t=new _r(this.application,e);this.connectModule(t);let s=e.controllerConstructor.afterLoad;s&&s.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){let t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){let s=this.modulesByIdentifier.get(t);if(s)return s.contexts.find(i=>i.element==e)}proposeToConnectScopeForElementAndIdentifier(e,t){let s=this.scopeObserver.parseValueForElementAndIdentifier(e,t);s?this.scopeObserver.elementMatchedValue(s.element,s):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,s){this.application.handleError(e,t,s)}createScopeForElementAndIdentifier(e,t){return new kr(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(s=>e.connectContextForScope(s))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(s=>e.disconnectContextForScope(s))}},va={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:r=>`data-${r}-target`,outletAttributeForScope:(r,e)=>`data-${r}-${e}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},Si("abcdefghijklmnopqrstuvwxyz".split("").map(r=>[r,r]))),Si("0123456789".split("").map(r=>[r,r])))};function Si(r){return r.reduce((e,[t,s])=>Object.assign(Object.assign({},e),{[t]:s}),{})}var dt=class{constructor(e=document.documentElement,t=va){this.logger=console,this.debug=!1,this.logDebugActivity=(s,i,n={})=>{this.debug&&this.logFormattedMessage(s,i,n)},this.element=e,this.schema=t,this.dispatcher=new lr(this),this.router=new Fr(this),this.actionDescriptorFilters=Object.assign({},Wo)}static start(e,t){let s=new this(e,t);return s.start(),s}async start(){await ya(),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(i=>{i.controllerConstructor.shouldLoad&&this.router.loadDefinition(i)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(i=>this.router.unloadIdentifier(i))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){let s=this.router.getContextForElementAndIdentifier(e,t);return s?s.controller:null}handleError(e,t,s){var i;this.logger.error(`%s
37
-
38
- %o
39
-
40
- %o`,t,e,s),(i=window.onerror)===null||i===void 0||i.call(window,t,"",0,0,e)}logFormattedMessage(e,t,s={}){s=Object.assign({application:this},s),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},s)),this.logger.groupEnd()}};function ya(){return new Promise(r=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>r()):r()})}function ba(r){return Be(r,"classes").reduce((t,s)=>Object.assign(t,wa(s)),{})}function wa(r){return{[`${r}Class`]:{get(){let{classes:e}=this;if(e.has(r))return e.get(r);{let t=e.getAttributeName(r);throw new Error(`Missing attribute "${t}"`)}}},[`${r}Classes`]:{get(){return this.classes.getAll(r)}},[`has${Ne(r)}Class`]:{get(){return this.classes.has(r)}}}}function Ea(r){return Be(r,"outlets").reduce((t,s)=>Object.assign(t,Sa(s)),{})}function _i(r,e,t){return r.application.getControllerForElementAndIdentifier(e,t)}function Ai(r,e,t){let s=_i(r,e,t);if(s||(r.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),s=_i(r,e,t),s))return s}function Sa(r){let e=dr(r);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(r),s=this.outlets.getSelectorForOutletName(r);if(t){let i=Ai(this,t,r);if(i)return i;throw new Error(`The provided outlet element is missing an outlet controller "${r}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${r}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${e}Outlets`]:{get(){let t=this.outlets.findAll(r);return t.length>0?t.map(s=>{let i=Ai(this,s,r);if(i)return i;console.warn(`The provided outlet element is missing an outlet controller "${r}" instance for host controller "${this.identifier}"`,s)}).filter(s=>s):[]}},[`${e}OutletElement`]:{get(){let t=this.outlets.find(r),s=this.outlets.getSelectorForOutletName(r);if(t)return t;throw new Error(`Missing outlet element "${r}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(r)}},[`has${Ne(e)}Outlet`]:{get(){return this.outlets.has(r)}}}}function _a(r){return Be(r,"targets").reduce((t,s)=>Object.assign(t,Aa(s)),{})}function Aa(r){return{[`${r}Target`]:{get(){let e=this.targets.find(r);if(e)return e;throw new Error(`Missing target element "${r}" for "${this.identifier}" controller`)}},[`${r}Targets`]:{get(){return this.targets.findAll(r)}},[`has${Ne(r)}Target`]:{get(){return this.targets.has(r)}}}}function Ta(r){let e=oa(r,"values"),t={valueDescriptorMap:{get(){return e.reduce((s,i)=>{let n=Ci(i,this.identifier),o=this.data.getAttributeNameForKey(n.key);return Object.assign(s,{[o]:n})},{})}}};return e.reduce((s,i)=>Object.assign(s,Oa(i)),t)}function Oa(r,e){let t=Ci(r,e),{key:s,name:i,reader:n,writer:o}=t;return{[i]:{get(){let c=this.data.get(s);return c!==null?n(c):t.defaultValue},set(c){c===void 0?this.data.delete(s):this.data.set(s,o(c))}},[`has${Ne(i)}`]:{get(){return this.data.has(s)||t.hasCustomDefaultValue}}}}function Ci([r,e],t){return ka({controller:t,token:r,typeDefinition:e})}function ft(r){switch(r){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function Pe(r){switch(typeof r){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(r))return"array";if(Object.prototype.toString.call(r)==="[object Object]")return"object"}function La(r){let{controller:e,token:t,typeObject:s}=r,i=bi(s.type),n=bi(s.default),o=i&&n,c=i&&!n,u=!i&&n,p=ft(s.type),y=Pe(r.typeObject.default);if(c)return p;if(u)return y;if(p!==y){let E=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${E}" must match the defined type "${p}". The provided default value of "${s.default}" is of type "${y}".`)}if(o)return p}function Ra(r){let{controller:e,token:t,typeDefinition:s}=r,n=La({controller:e,token:t,typeObject:s}),o=Pe(s),c=ft(s),u=n||o||c;if(u)return u;let p=e?`${e}.${s}`:t;throw new Error(`Unknown value type "${p}" for "${t}" value`)}function Ma(r){let e=ft(r);if(e)return Ti[e];let t=fr(r,"default"),s=fr(r,"type"),i=r;if(t)return i.default;if(s){let{type:n}=i,o=ft(n);if(o)return Ti[o]}return r}function ka(r){let{token:e,typeDefinition:t}=r,s=`${Ri(e)}-value`,i=Ra(r);return{type:i,key:s,name:Pr(s),get defaultValue(){return Ma(t)},get hasCustomDefaultValue(){return Pe(t)!==void 0},reader:Ca[i],writer:Oi[i]||Oi.default}}var Ti={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},Ca={array(r){let e=JSON.parse(r);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${r}" of type "${Pe(e)}"`);return e},boolean(r){return!(r=="0"||String(r).toLowerCase()=="false")},number(r){return Number(r.replace(/_/g,""))},object(r){let e=JSON.parse(r);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${r}" of type "${Pe(e)}"`);return e},string(r){return r}},Oi={default:Fa,array:Li,object:Li};function Li(r){return JSON.stringify(r)}function Fa(r){return`${r}`}var se=class{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:s={},prefix:i=this.identifier,bubbles:n=!0,cancelable:o=!0}={}){let c=i?`${i}:${e}`:e,u=new CustomEvent(c,{detail:s,bubbles:n,cancelable:o});return t.dispatchEvent(u),u}};se.blessings=[ba,_a,Ta,Ea];se.targets=[];se.outlets=[];se.values={};var pt=class extends se{static targets=["toggler"];connect(){this.togglerTarget.checked=this.isBrowserDarkModeEnabled,this.togglerTarget.checked=this.storedDarkMode}toggle(){window.localStorage.setItem("dark-mode",this.isDarkModeEnabled)}get isBrowserDarkModeEnabled(){return window.matchMedia("(prefers-color-scheme: dark)").matches}get isDarkModeEnabled(){return this.togglerTarget.checked}get storedDarkMode(){return window.localStorage.getItem("dark-mode")==="true"}};if(window.env.JEKYLL_ENV==="production")try{window.airbrake=new At({projectId:window.env.AIRBRAKE_PROJECT_ID,projectKey:window.env.AIRBRAKE_PROJECT_KEY,host:"https://panel.sutty.nl"}),console.originalError=console.error,console.error=(...r)=>(window.airbrake.notify(r.join(" ")),console.originalError(...r))}catch(r){console.error(r)}ot();window.Stimulus=dt.start();window.abortController=void 0;Stimulus.debug=window.env.JEKYLL_ENV!=="production";Stimulus.register("dark-mode",pt);document.addEventListener("turbo:load",r=>{window.abortController=new AbortController});document.addEventListener("turbo:visit",r=>{window.abortController.abort()});})();
41
- /*! Bundled license information:
42
-
43
- @hotwired/turbo/dist/turbo.es2017-esm.js:
44
- (*!
45
- Turbo 8.0.13
46
- Copyright © 2025 37signals LLC
47
- *)
48
- */
49
- //# sourceMappingURL=pack.4CCOOFTO.js.map