turbo_boost-commands 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of turbo_boost-commands might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +9 -11
- data/README.md +7 -6
- data/app/assets/builds/@turbo-boost/commands.js +4 -4
- data/app/assets/builds/@turbo-boost/commands.js.map +3 -3
- data/app/helpers/turbo_boost/commands/application_helper.rb +4 -0
- data/bin/standardize +1 -1
- data/lib/turbo_boost/commands/attribute_hydration.rb +95 -0
- data/lib/turbo_boost/commands/attribute_set.rb +33 -5
- data/lib/turbo_boost/commands/command.rb +19 -10
- data/lib/turbo_boost/commands/controller_pack.rb +2 -0
- data/lib/turbo_boost/commands/engine.rb +10 -1
- data/lib/turbo_boost/commands/patches/action_view_helpers_tag_helper_tag_builder_patch.rb +10 -0
- data/lib/turbo_boost/commands/patches.rb +6 -0
- data/lib/turbo_boost/commands/runner.rb +4 -3
- data/lib/turbo_boost/commands/version.rb +1 -1
- data/package.json +15 -4
- data/tags +984 -1620
- data/turbo_boost-commands.gemspec +2 -2
- data/yarn.lock +153 -153
- metadata +21 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 278f5591c9be78cac56fb62a3e3bedecd567b5cf72aebe7dafb69356145b40ab
|
4
|
+
data.tar.gz: c71e80af6f7c3a36f2f2b2dede92ebecd114a81011dec4b77b4041743fbb1362
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ce066b9f04f16039b13550a1f6b764b0fc117c2c8d80470986ffecf7be765be897bef70f58186ecb85e49b40bb42102ead1153e3feb2127c8ce1647b05361bf
|
7
|
+
data.tar.gz: 7add3bce722083f351de933375e558f81718a6081896c865db66bcd00b2762058c5689519df6ed5caa378b93fd2869e52cb1642dd6e3cbf81fd1febdfc9f4cf6
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
turbo_boost-commands (0.0.
|
4
|
+
turbo_boost-commands (0.0.3)
|
5
5
|
rails (>= 6.1)
|
6
6
|
turbo-rails (>= 1.1)
|
7
|
-
turbo_boost-streams (>= 0.0.
|
7
|
+
turbo_boost-streams (>= 0.0.4)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
@@ -126,12 +126,13 @@ GEM
|
|
126
126
|
matrix (0.4.2)
|
127
127
|
method_source (1.0.0)
|
128
128
|
mini_mime (1.1.2)
|
129
|
-
minitest (5.
|
129
|
+
minitest (5.17.0)
|
130
130
|
minitest-reporters (1.5.0)
|
131
131
|
ansi
|
132
132
|
builder
|
133
133
|
minitest (>= 5.0)
|
134
134
|
ruby-progressbar
|
135
|
+
model_probe (1.0.7)
|
135
136
|
net-imap (0.3.4)
|
136
137
|
date
|
137
138
|
net-protocol
|
@@ -161,10 +162,10 @@ GEM
|
|
161
162
|
pry-rails (0.3.9)
|
162
163
|
pry (>= 0.10.4)
|
163
164
|
public_suffix (5.0.1)
|
164
|
-
puma (6.0.
|
165
|
+
puma (6.0.2)
|
165
166
|
nio4r (~> 2.0)
|
166
167
|
racc (1.6.2)
|
167
|
-
rack (2.2.
|
168
|
+
rack (2.2.5)
|
168
169
|
rack-test (2.0.2)
|
169
170
|
rack (>= 1.3)
|
170
171
|
rails (7.0.4)
|
@@ -208,7 +209,7 @@ GEM
|
|
208
209
|
rubocop-ast (>= 1.23.0, < 2.0)
|
209
210
|
ruby-progressbar (~> 1.7)
|
210
211
|
unicode-display_width (>= 1.4.0, < 3.0)
|
211
|
-
rubocop-ast (1.24.
|
212
|
+
rubocop-ast (1.24.1)
|
212
213
|
parser (>= 3.1.1.0)
|
213
214
|
rubocop-performance (1.15.1)
|
214
215
|
rubocop (>= 1.7.0, < 2.0)
|
@@ -244,10 +245,7 @@ GEM
|
|
244
245
|
actionpack (>= 6.0.0)
|
245
246
|
activejob (>= 6.0.0)
|
246
247
|
railties (>= 6.0.0)
|
247
|
-
turbo_boost-streams (0.0.
|
248
|
-
rails (>= 6.1)
|
249
|
-
turbo-rails (>= 1.1)
|
250
|
-
turbo_ready (0.1.4)
|
248
|
+
turbo_boost-streams (0.0.4)
|
251
249
|
rails (>= 6.1)
|
252
250
|
turbo-rails (>= 1.1)
|
253
251
|
tzinfo (2.0.5)
|
@@ -284,6 +282,7 @@ DEPENDENCIES
|
|
284
282
|
importmap-rails
|
285
283
|
magic_frozen_string_literal
|
286
284
|
minitest-reporters
|
285
|
+
model_probe
|
287
286
|
net-smtp
|
288
287
|
pry-byebug
|
289
288
|
pry-doc
|
@@ -297,7 +296,6 @@ DEPENDENCIES
|
|
297
296
|
standardrb
|
298
297
|
tailwindcss-rails
|
299
298
|
turbo_boost-commands!
|
300
|
-
turbo_ready
|
301
299
|
web-console
|
302
300
|
webdrivers
|
303
301
|
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
</h1>
|
9
9
|
<p align="center">
|
10
10
|
<a href="http://blog.codinghorror.com/the-best-code-is-no-code-at-all/">
|
11
|
-
<img alt="Lines of Code" src="https://img.shields.io/badge/loc-
|
11
|
+
<img alt="Lines of Code" src="https://img.shields.io/badge/loc-1401-47d299.svg" />
|
12
12
|
</a>
|
13
13
|
<a href="https://codeclimate.com/github/hopsoft/turbo_boost-commands/maintainability">
|
14
14
|
<img src="https://api.codeclimate.com/v1/badges/fe1162a742fe83a4fdfd/maintainability" />
|
@@ -83,7 +83,7 @@
|
|
83
83
|
|
84
84
|
## Why TurboBoost Commands?
|
85
85
|
|
86
|
-
Commands
|
86
|
+
Commands help you build robust reactive applications with Rails & Hotwire.
|
87
87
|
They allow you to declaratively specify server methods that will execute whenever client side events are triggered by users.
|
88
88
|
|
89
89
|
TurboBoost Commands work with Hotwire's Turbo Frames.
|
@@ -108,7 +108,7 @@ Namely,
|
|
108
108
|
|
109
109
|
*The primary distinction being that __state is wholly managed by the server__.*
|
110
110
|
|
111
|
-
Commands are executed via Rails
|
111
|
+
Commands are executed via a Rails `before_action` which means that reactivity runs over HTTP.
|
112
112
|
_**Web sockets are NOT used for the reactive critical path!** 🎉_
|
113
113
|
This also means that standard Rails mechanics drive their behavior.
|
114
114
|
|
@@ -159,7 +159,7 @@ Commands can be tested in isolation as well as with standard Rails controller, i
|
|
159
159
|
+import '@turbo-boost/commands'
|
160
160
|
```
|
161
161
|
|
162
|
-
2. Add TurboBoost
|
162
|
+
2. Add TurboBoost to your Rails app
|
163
163
|
|
164
164
|
```diff
|
165
165
|
# app/views/layouts/application.html.erb
|
@@ -303,18 +303,19 @@ Commands are simple Ruby classes that inherit from `TurboBoost::Commands::Comman
|
|
303
303
|
They expose the following instance methods and properties.
|
304
304
|
|
305
305
|
```ruby
|
306
|
+
# * controller .................. The Rails controller processing the HTTP request
|
307
|
+
# * css_id_selector ............. Returns a CSS selector for an element `id` i.e. prefixes with `#`
|
306
308
|
# * dom_id ...................... The Rails dom_id helper
|
307
309
|
# * dom_id_selector ............. Returns a CSS selector for a dom_id
|
308
|
-
# * controller .................. The Rails controller processing the HTTP request
|
309
310
|
# * element ..................... A struct that represents the DOM element that triggered the command
|
310
311
|
# * morph ....................... Appends a Turbo Stream to morph a DOM element
|
311
312
|
# * params ...................... Commands specific params (frame_id, element, etc.)
|
312
313
|
# * render ...................... Renders Rails templates, partials, etc. (doesn't halt controller request handling)
|
313
314
|
# * render_response ............. Renders a full controller response
|
314
315
|
# * renderer .................... An ActionController::Renderer
|
316
|
+
# * state ....................... An object that stores ephemeral `state`
|
315
317
|
# * turbo_stream ................ A Turbo Stream TagBuilder
|
316
318
|
# * turbo_streams ............... A list of Turbo Streams to append to the response (also aliased as streams)
|
317
|
-
# * state ....................... An object that stores ephemeral `state`
|
318
319
|
```
|
319
320
|
|
320
321
|
```ruby
|
@@ -1,7 +1,7 @@
|
|
1
|
-
var
|
1
|
+
var Xr=Object.defineProperty,Jr=Object.defineProperties;var Zr=Object.getOwnPropertyDescriptors;var nn=Object.getOwnPropertySymbols;var Yr=Object.prototype.hasOwnProperty,Gr=Object.prototype.propertyIsEnumerable;var rn=(e,t,n)=>t in e?Xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t)=>{for(var n in t||(t={}))Yr.call(t,n)&&rn(e,n,t[n]);if(nn)for(var n of nn(t))Gr.call(t,n)&&rn(e,n,t[n]);return e},B=(e,t)=>Jr(e,Zr(t));var Qr=Object.defineProperty,eo=Object.defineProperties,to=Object.getOwnPropertyDescriptors,on=Object.getOwnPropertySymbols,no=Object.prototype.hasOwnProperty,ro=Object.prototype.propertyIsEnumerable,ft=(e,t,n)=>t in e?Qr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Re=(e,t)=>{for(var n in t||(t={}))no.call(t,n)&&ft(e,n,t[n]);if(on)for(var n of on(t))ro.call(t,n)&&ft(e,n,t[n]);return e},oo=(e,t)=>eo(e,to(t)),an=(e,t,n)=>(ft(e,typeof t!="symbol"?t+"":t,n),n);function io(e,t,n={}){let r=new CustomEvent(t,n);e.forEach(o=>o.dispatchEvent(r))}var ao=io,mt=!1,pt=!1,te=[];function so(e){lo(e)}function lo(e){te.includes(e)||te.push(e),uo()}function pn(e){let t=te.indexOf(e);t!==-1&&te.splice(t,1)}function uo(){!pt&&!mt&&(mt=!0,queueMicrotask(co))}function co(){mt=!1,pt=!0;for(let e=0;e<te.length;e++)te[e]();te.length=0,pt=!1}var me,Ae,qe,hn,ht=!0;function fo(e){ht=!1,e(),ht=!0}function mo(e){me=e.reactive,qe=e.release,Ae=t=>e.effect(t,{scheduler:n=>{ht?so(n):n()}}),hn=e.raw}function sn(e){Ae=e}function po(e){let t=()=>{};return[n=>{let r=Ae(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(r),t=()=>{r!==void 0&&(e._x_effects.delete(r),qe(r))},r},()=>{t()}]}var _n=[],vn=[],gn=[];function ho(e){gn.push(e)}function bn(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,vn.push(t))}function _o(e){_n.push(e)}function vo(e,t,n){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(n)}function xn(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([n,r])=>{(t===void 0||t.includes(n))&&(r.forEach(o=>o()),delete e._x_attributeCleanups[n])})}var Ot=new MutationObserver(Lt),Tt=!1;function yn(){Ot.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Tt=!0}function go(){bo(),Ot.disconnect(),Tt=!1}var ye=[],lt=!1;function bo(){ye=ye.concat(Ot.takeRecords()),ye.length&&!lt&&(lt=!0,queueMicrotask(()=>{xo(),lt=!1}))}function xo(){Lt(ye),ye.length=0}function C(e){if(!Tt)return e();go();let t=e();return yn(),t}var $t=!1,Be=[];function yo(){$t=!0}function wo(){$t=!1,Lt(Be),Be=[]}function Lt(e){if($t){Be=Be.concat(e);return}let t=[],n=[],r=new Map,o=new Map;for(let i=0;i<e.length;i++)if(!e[i].target._x_ignoreMutationObserver&&(e[i].type==="childList"&&(e[i].addedNodes.forEach(a=>a.nodeType===1&&t.push(a)),e[i].removedNodes.forEach(a=>a.nodeType===1&&n.push(a))),e[i].type==="attributes")){let a=e[i].target,s=e[i].attributeName,l=e[i].oldValue,u=()=>{r.has(a)||r.set(a,[]),r.get(a).push({name:s,value:a.getAttribute(s)})},d=()=>{o.has(a)||o.set(a,[]),o.get(a).push(s)};a.hasAttribute(s)&&l===null?u():a.hasAttribute(s)?(d(),u()):d()}o.forEach((i,a)=>{xn(a,i)}),r.forEach((i,a)=>{_n.forEach(s=>s(a,i))});for(let i of n)if(!t.includes(i)&&(vn.forEach(a=>a(i)),i._x_cleanups))for(;i._x_cleanups.length;)i._x_cleanups.pop()();t.forEach(i=>{i._x_ignoreSelf=!0,i._x_ignore=!0});for(let i of t)n.includes(i)||i.isConnected&&(delete i._x_ignoreSelf,delete i._x_ignore,gn.forEach(a=>a(i)),i._x_ignore=!0,i._x_ignoreSelf=!0);t.forEach(i=>{delete i._x_ignoreSelf,delete i._x_ignore}),t=null,n=null,r=null,o=null}function wn(e){return Ce(ce(e))}function Se(e,t,n){return e._x_dataStack=[t,...ce(n||e)],()=>{e._x_dataStack=e._x_dataStack.filter(r=>r!==t)}}function ln(e,t){let n=e._x_dataStack[0];Object.entries(t).forEach(([r,o])=>{n[r]=o})}function ce(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?ce(e.host):e.parentNode?ce(e.parentNode):[]}function Ce(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(n=>Object.keys(n)))),has:(n,r)=>e.some(o=>o.hasOwnProperty(r)),get:(n,r)=>(e.find(o=>{if(o.hasOwnProperty(r)){let i=Object.getOwnPropertyDescriptor(o,r);if(i.get&&i.get._x_alreadyBound||i.set&&i.set._x_alreadyBound)return!0;if((i.get||i.set)&&i.enumerable){let a=i.get,s=i.set,l=i;a=a&&a.bind(t),s=s&&s.bind(t),a&&(a._x_alreadyBound=!0),s&&(s._x_alreadyBound=!0),Object.defineProperty(o,r,oo(Re({},l),{get:a,set:s}))}return!0}return!1})||{})[r],set:(n,r,o)=>{let i=e.find(a=>a.hasOwnProperty(r));return i?i[r]=o:e[e.length-1][r]=o,!0}});return t}function En(e){let t=r=>typeof r=="object"&&!Array.isArray(r)&&r!==null,n=(r,o="")=>{Object.entries(Object.getOwnPropertyDescriptors(r)).forEach(([i,{value:a,enumerable:s}])=>{if(s===!1||a===void 0)return;let l=o===""?i:`${o}.${i}`;typeof a=="object"&&a!==null&&a._x_interceptor?r[i]=a.initialize(e,l,i):t(a)&&a!==r&&!(a instanceof Element)&&n(a,l)})};return n(e)}function kn(e,t=()=>{}){let n={initialValue:void 0,_x_interceptor:!0,initialize(r,o,i){return e(this.initialValue,()=>Eo(r,o),a=>An(r,o,a),o,i)}};return t(n),r=>{if(typeof r=="object"&&r!==null&&r._x_interceptor){let o=n.initialize.bind(n);n.initialize=(i,a,s)=>{let l=r.initialize(i,a,s);return n.initialValue=l,o(i,a,s)}}else n.initialValue=r;return n}}function Eo(e,t){return t.split(".").reduce((n,r)=>n[r],e)}function An(e,t,n){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=n;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),An(e[t[0]],t.slice(1),n)}}var Sn={};function z(e,t){Sn[e]=t}function _t(e,t){return Object.entries(Sn).forEach(([n,r])=>{Object.defineProperty(e,`$${n}`,{get(){let[o,i]=Nn(t);return o=Re({interceptor:kn},o),bn(t,i),r(t,o)},enumerable:!1})}),e}function ko(e,t,n,...r){try{return n(...r)}catch(o){ke(o,e,t)}}function ke(e,t,n=void 0){Object.assign(e,{el:t,expression:n}),console.warn(`Alpine Expression Error: ${e.message}
|
2
2
|
|
3
|
-
${
|
3
|
+
${n?'Expression: "'+n+`"
|
4
4
|
|
5
|
-
`:""}`,t),setTimeout(()=>{throw e},0)}var Pe=!0;function gi(e){let t=Pe;Pe=!1,e(),Pe=t}function ue(e,t,r={}){let n;return k(e,t)(i=>n=i,r),n}function k(...e){return Tr(...e)}var Tr=Cr;function vi(e){Tr=e}function Cr(e,t){let r={};gt(r,e);let n=[r,...le(e)];if(typeof t=="function")return bi(n,t);let i=yi(n,t,e);return _i.bind(null,e,t,i)}function bi(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(Ce([n,...e]),i);Be(r,o)}}var ct={};function xi(e,t){if(ct[e])return ct[e];let r=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)\s/.test(e)?`(() => { ${e} })()`:e,o=(()=>{try{return new r(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`)}catch(a){return Ae(a,t,e),Promise.resolve()}})();return ct[e]=o,o}function yi(e,t,r){let n=xi(t,r);return(i=()=>{},{scope:o={},params:a=[]}={})=>{n.result=void 0,n.finished=!1;let s=Ce([o,...e]);if(typeof n=="function"){let u=n(n,s).catch(l=>Ae(l,r,t));n.finished?(Be(i,n.result,s,a,r),n.result=void 0):u.then(l=>{Be(i,l,s,a,r)}).catch(l=>Ae(l,r,t)).finally(()=>n.result=void 0)}}}function Be(e,t,r,n,i){if(Pe&&typeof t=="function"){let o=t.apply(r,n);o instanceof Promise?o.then(a=>Be(e,a,r,n)).catch(a=>Ae(a,i,t)):e(o)}else e(t)}var Lt="x-";function pe(e=""){return Lt+e}function wi(e){Lt=e}var Or={};function A(e,t){Or[e]=t}function $t(e,t,r){if(t=Array.from(t),e._x_virtualDirectives){let o=Object.entries(e._x_virtualDirectives).map(([s,u])=>({name:s,value:u})),a=Mr(o);o=o.map(s=>a.find(u=>u.name===s.name)?{name:`x-bind:${s.name}`,value:`"${s.value}"`}:s),t=t.concat(o)}let n={};return t.map($r((o,a)=>n[o]=a)).filter(Ir).map(Si(n,r)).sort(Ti).map(o=>Ai(e,o))}function Mr(e){return Array.from(e).map($r()).filter(t=>!Ir(t))}var vt=!1,xe=new Map,kr=Symbol();function Ei(e){vt=!0;let t=Symbol();kr=t,xe.set(t,[]);let r=()=>{for(;xe.get(t).length;)xe.get(t).shift()();xe.delete(t)},n=()=>{vt=!1,r()};e(r),n()}function Nr(e){let t=[],r=s=>t.push(s),[n,i]=ai(e);return t.push(i),[{Alpine:Oe,effect:n,cleanup:r,evaluateLater:k.bind(k,e),evaluate:ue.bind(ue,e)},()=>t.forEach(s=>s())]}function Ai(e,t){let r=()=>{},n=Or[t.type]||r,[i,o]=Nr(e);li(e,t.original,o);let a=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),vt?xe.get(kr).push(n):n())};return a.runCleanups=o,a}var Rr=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),Lr=e=>e;function $r(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=Pr.reduce((o,a)=>a(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var Pr=[];function Pt(e){Pr.push(e)}function Ir({name:e}){return Br().test(e)}var Br=()=>new RegExp(`^${Lt}([^:^.]+)\\b`);function Si(e,t){return({name:r,value:n})=>{let i=r.match(Br()),o=r.match(/:([a-zA-Z0-9\-:]+)/),a=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],s=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:a.map(u=>u.replace(".","")),expression:n,original:s}}}var bt="DEFAULT",Le=["ignore","ref","data","id","radio","tabs","switch","disclosure","menu","listbox","list","item","combobox","bind","init","for","mask","model","modelable","transition","show","if",bt,"teleport"];function Ti(e,t){let r=Le.indexOf(e.type)===-1?bt:e.type,n=Le.indexOf(t.type)===-1?bt:t.type;return Le.indexOf(r)-Le.indexOf(n)}function we(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}var xt=[],It=!1;function Dr(e=()=>{}){return queueMicrotask(()=>{It||setTimeout(()=>{yt()})}),new Promise(t=>{xt.push(()=>{e(),t()})})}function yt(){for(It=!1;xt.length;)xt.shift()()}function Ci(){It=!0}function ie(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>ie(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)ie(n,t,!1),n=n.nextElementSibling}function ce(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function Oi(){document.body||ce("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),we(document,"alpine:init"),we(document,"alpine:initializing"),yr(),si(t=>X(t,ie)),br(t=>ki(t)),ui((t,r)=>{$t(t,r).forEach(n=>n())});let e=t=>!je(t.parentElement,!0);Array.from(document.querySelectorAll(Kr())).filter(e).forEach(t=>{X(t)}),we(document,"alpine:initialized")}var Bt=[],Fr=[];function jr(){return Bt.map(e=>e())}function Kr(){return Bt.concat(Fr).map(e=>e())}function Hr(e){Bt.push(e)}function qr(e){Fr.push(e)}function je(e,t=!1){return Ke(e,r=>{if((t?Kr():jr()).some(i=>r.matches(i)))return!0})}function Ke(e,t){if(e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),!!e.parentElement)return Ke(e.parentElement,t)}}function Mi(e){return jr().some(t=>e.matches(t))}function X(e,t=ie){Ei(()=>{t(e,(r,n)=>{$t(r,r.attributes).forEach(i=>i()),r._x_ignore&&n()})})}function ki(e){ie(e,t=>xr(t))}function Dt(e,t){return Array.isArray(t)?lr(e,t.join(" ")):typeof t=="object"&&t!==null?Ni(e,t):typeof t=="function"?Dt(e,t()):lr(e,t)}function lr(e,t){let r=o=>o.split(" ").filter(Boolean),n=o=>o.split(" ").filter(a=>!e.classList.contains(a)).filter(Boolean),i=o=>(e.classList.add(...o),()=>{e.classList.remove(...o)});return t=t===!0?t="":t||"",i(n(t))}function Ni(e,t){let r=s=>s.split(" ").filter(Boolean),n=Object.entries(t).flatMap(([s,u])=>u?r(s):!1).filter(Boolean),i=Object.entries(t).flatMap(([s,u])=>u?!1:r(s)).filter(Boolean),o=[],a=[];return i.forEach(s=>{e.classList.contains(s)&&(e.classList.remove(s),a.push(s))}),n.forEach(s=>{e.classList.contains(s)||(e.classList.add(s),o.push(s))}),()=>{a.forEach(s=>e.classList.add(s)),o.forEach(s=>e.classList.remove(s))}}function He(e,t){return typeof t=="object"&&t!==null?Ri(e,t):Li(e,t)}function Ri(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{r[n]=e.style[n],n.startsWith("--")||(n=$i(n)),e.style.setProperty(n,i)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{He(e,r)}}function Li(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r||"")}}function $i(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function wt(e,t=()=>{}){let r=!1;return function(){r?t.apply(this,arguments):(r=!0,e.apply(this,arguments))}}A("transition",(e,{value:t,modifiers:r,expression:n},{evaluate:i})=>{typeof n=="function"&&(n=i(n)),n?Pi(e,n,t):Ii(e,r,t)});function Pi(e,t,r){zr(e,Dt,""),{enter:i=>{e._x_transition.enter.during=i},"enter-start":i=>{e._x_transition.enter.start=i},"enter-end":i=>{e._x_transition.enter.end=i},leave:i=>{e._x_transition.leave.during=i},"leave-start":i=>{e._x_transition.leave.start=i},"leave-end":i=>{e._x_transition.leave.end=i}}[r](t)}function Ii(e,t,r){zr(e,He);let n=!t.includes("in")&&!t.includes("out")&&!r,i=n||t.includes("in")||["enter"].includes(r),o=n||t.includes("out")||["leave"].includes(r);t.includes("in")&&!n&&(t=t.filter((v,y)=>y<t.indexOf("out"))),t.includes("out")&&!n&&(t=t.filter((v,y)=>y>t.indexOf("out")));let a=!t.includes("opacity")&&!t.includes("scale"),s=a||t.includes("opacity"),u=a||t.includes("scale"),l=s?0:1,f=u?ve(t,"scale",95)/100:1,m=ve(t,"delay",0),b=ve(t,"origin","center"),I="opacity, transform",E=ve(t,"duration",150)/1e3,se=ve(t,"duration",75)/1e3,d="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(e._x_transition.enter.during={transformOrigin:b,transitionDelay:m,transitionProperty:I,transitionDuration:`${E}s`,transitionTimingFunction:d},e._x_transition.enter.start={opacity:l,transform:`scale(${f})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),o&&(e._x_transition.leave.during={transformOrigin:b,transitionDelay:m,transitionProperty:I,transitionDuration:`${se}s`,transitionTimingFunction:d},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:l,transform:`scale(${f})`})}function zr(e,t,r={}){e._x_transition||(e._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(n=()=>{},i=()=>{}){Et(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){Et(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,n){let i=document.visibilityState==="visible"?requestAnimationFrame:setTimeout,o=()=>i(r);if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(r):o():e._x_transition?e._x_transition.in(r):o();return}e._x_hidePromise=e._x_transition?new Promise((a,s)=>{e._x_transition.out(()=>{},()=>a(n)),e._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let a=Vr(e);a?(a._x_hideChildren||(a._x_hideChildren=[]),a._x_hideChildren.push(e)):i(()=>{let s=u=>{let l=Promise.all([u._x_hidePromise,...(u._x_hideChildren||[]).map(s)]).then(([f])=>f());return delete u._x_hidePromise,delete u._x_hideChildren,l};s(e).catch(u=>{if(!u.isFromCancelledTransition)throw u})})})};function Vr(e){let t=e.parentNode;if(t)return t._x_hidePromise?t:Vr(t)}function Et(e,t,{during:r,start:n,end:i}={},o=()=>{},a=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(r).length===0&&Object.keys(n).length===0&&Object.keys(i).length===0){o(),a();return}let s,u,l;Bi(e,{start(){s=t(e,n)},during(){u=t(e,r)},before:o,end(){s(),l=t(e,i)},after:a,cleanup(){u(),l()}})}function Bi(e,t){let r,n,i,o=wt(()=>{T(()=>{r=!0,n||t.before(),i||(t.end(),yt()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(a){this.beforeCancels.push(a)},cancel:wt(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()}),finish:o},T(()=>{t.start(),t.during()}),Ci(),requestAnimationFrame(()=>{if(r)return;let a=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,s=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;a===0&&(a=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),T(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{r||(T(()=>{t.end()}),yt(),setTimeout(e._x_transitioning.finish,a+s),i=!0)})})}function ve(e,t,r){if(e.indexOf(t)===-1)return r;let n=e[e.indexOf(t)+1];if(!n||t==="scale"&&isNaN(n))return r;if(t==="duration"){let i=n.match(/([0-9]+)ms/);if(i)return i[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[n,e[e.indexOf(t)+2]].join(" "):n}var At=!1;function qe(e,t=()=>{}){return(...r)=>At?t(...r):e(...r)}function Di(e,t){t._x_dataStack||(t._x_dataStack=e._x_dataStack),At=!0,ji(()=>{Fi(t)}),At=!1}function Fi(e){let t=!1;X(e,(n,i)=>{ie(n,(o,a)=>{if(t&&Mi(o))return a();t=!0,i(o,a)})})}function ji(e){let t=Se;sr((r,n)=>{let i=t(r);return Fe(i),()=>{}}),e(),sr(t)}function Wr(e,t,r,n=[]){switch(e._x_bindings||(e._x_bindings=de({})),e._x_bindings[t]=r,t=n.includes("camel")?Ui(t):t,t){case"value":Ki(e,r);break;case"style":qi(e,r);break;case"class":Hi(e,r);break;default:zi(e,t,r);break}}function Ki(e,t){if(e.type==="radio")e.attributes.value===void 0&&(e.value=t),window.fromModel&&(e.checked=cr(e.value,t));else if(e.type==="checkbox")Number.isInteger(t)?e.value=t:!Number.isInteger(t)&&!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(r=>cr(r,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")Wi(e,t);else{if(e.value===t)return;e.value=t}}function Hi(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=Dt(e,t)}function qi(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=He(e,t)}function zi(e,t,r){[null,void 0,!1].includes(r)&&Gi(t)?e.removeAttribute(t):(Ur(t)&&(r=t),Vi(e,t,r))}function Vi(e,t,r){e.getAttribute(t)!=r&&e.setAttribute(t,r)}function Wi(e,t){let r=[].concat(t).map(n=>n+"");Array.from(e.options).forEach(n=>{n.selected=r.includes(n.value)})}function Ui(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function cr(e,t){return e==t}function Ur(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function Gi(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function Yi(e,t,r){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];let n=e.getAttribute(t);return n===null?typeof r=="function"?r():r:n===""?!0:Ur(t)?!![t,"true"].includes(n):n}function Gr(e,t){var r;return function(){var n=this,i=arguments,o=function(){r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(o,t)}}function Yr(e,t){let r;return function(){let n=this,i=arguments;r||(e.apply(n,i),r=!0,setTimeout(()=>r=!1,t))}}function Xi(e){e(Oe)}var ee={},fr=!1;function Ji(e,t){if(fr||(ee=de(ee),fr=!0),t===void 0)return ee[e];ee[e]=t,typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&ee[e].init(),Er(ee[e])}function Zi(){return ee}var Xr={};function Qi(e,t){let r=typeof t!="function"?()=>t:t;e instanceof Element?Jr(e,r()):Xr[e]=r}function eo(e){return Object.entries(Xr).forEach(([t,r])=>{Object.defineProperty(e,t,{get(){return(...n)=>r(...n)}})}),e}function Jr(e,t,r){let n=[];for(;n.length;)n.pop()();let i=Object.entries(t).map(([a,s])=>({name:a,value:s})),o=Mr(i);i=i.map(a=>o.find(s=>s.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),$t(e,i,r).map(a=>{n.push(a.runCleanups),a()})}var Zr={};function to(e,t){Zr[e]=t}function ro(e,t){return Object.entries(Zr).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}var no={get reactive(){return de},get release(){return Fe},get effect(){return Se},get raw(){return hr},version:"3.10.5",flushAndStopDeferringMutations:mi,dontAutoEvaluateFunctions:gi,disableEffectScheduling:ii,setReactivityEngine:oi,closestDataStack:le,skipDuringClone:qe,addRootSelector:Hr,addInitSelector:qr,addScopeToNode:Te,deferMutations:pi,mapAttributes:Pt,evaluateLater:k,setEvaluator:vi,mergeProxies:Ce,findClosest:Ke,closestRoot:je,interceptor:Ar,transition:Et,setStyles:He,mutateDom:T,directive:A,throttle:Yr,debounce:Gr,evaluate:ue,initTree:X,nextTick:Dr,prefixed:pe,prefix:wi,plugin:Xi,magic:K,store:Ji,start:Oi,clone:Di,bound:Yi,$data:wr,data:to,bind:Qi},Oe=no;function Qr(e,t){let r=Object.create(null),n=e.split(",");for(let i=0;i<n.length;i++)r[n[i]]=!0;return t?i=>!!r[i.toLowerCase()]:i=>!!r[i]}var io="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",$a=Qr(io+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected"),oo=Object.freeze({}),Pa=Object.freeze([]),en=Object.assign,ao=Object.prototype.hasOwnProperty,ze=(e,t)=>ao.call(e,t),re=Array.isArray,Ee=e=>tn(e)==="[object Map]",so=e=>typeof e=="string",Ft=e=>typeof e=="symbol",Ve=e=>e!==null&&typeof e=="object",uo=Object.prototype.toString,tn=e=>uo.call(e),rn=e=>tn(e).slice(8,-1),jt=e=>so(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,We=e=>{let t=Object.create(null);return r=>t[r]||(t[r]=e(r))},lo=/-(\w)/g,Ia=We(e=>e.replace(lo,(t,r)=>r?r.toUpperCase():"")),co=/\B([A-Z])/g,Ba=We(e=>e.replace(co,"-$1").toLowerCase()),nn=We(e=>e.charAt(0).toUpperCase()+e.slice(1)),Da=We(e=>e?`on${nn(e)}`:""),on=(e,t)=>e!==t&&(e===e||t===t),St=new WeakMap,be=[],z,ne=Symbol("iterate"),Tt=Symbol("Map key iterate");function fo(e){return e&&e._isEffect===!0}function po(e,t=oo){fo(e)&&(e=e.raw);let r=_o(e,t);return t.lazy||r(),r}function mo(e){e.active&&(an(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var ho=0;function _o(e,t){let r=function(){if(!r.active)return e();if(!be.includes(r)){an(r);try{return vo(),be.push(r),z=r,e()}finally{be.pop(),sn(),z=be[be.length-1]}}};return r.id=ho++,r.allowRecurse=!!t.allowRecurse,r._isEffect=!0,r.active=!0,r.raw=e,r.deps=[],r.options=t,r}function an(e){let{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++)t[r].delete(e);t.length=0}}var fe=!0,Kt=[];function go(){Kt.push(fe),fe=!1}function vo(){Kt.push(fe),fe=!0}function sn(){let e=Kt.pop();fe=e===void 0?!0:e}function j(e,t,r){if(!fe||z===void 0)return;let n=St.get(e);n||St.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=new Set),i.has(z)||(i.add(z),z.deps.push(i),z.options.onTrack&&z.options.onTrack({effect:z,target:e,type:t,key:r}))}function J(e,t,r,n,i,o){let a=St.get(e);if(!a)return;let s=new Set,u=f=>{f&&f.forEach(m=>{(m!==z||m.allowRecurse)&&s.add(m)})};if(t==="clear")a.forEach(u);else if(r==="length"&&re(e))a.forEach((f,m)=>{(m==="length"||m>=n)&&u(f)});else switch(r!==void 0&&u(a.get(r)),t){case"add":re(e)?jt(r)&&u(a.get("length")):(u(a.get(ne)),Ee(e)&&u(a.get(Tt)));break;case"delete":re(e)||(u(a.get(ne)),Ee(e)&&u(a.get(Tt)));break;case"set":Ee(e)&&u(a.get(ne));break}let l=f=>{f.options.onTrigger&&f.options.onTrigger({effect:f,target:e,key:r,type:t,newValue:n,oldValue:i,oldTarget:o}),f.options.scheduler?f.options.scheduler(f):f()};s.forEach(l)}var bo=Qr("__proto__,__v_isRef,__isVue"),un=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(Ft)),xo=Ue(),yo=Ue(!1,!0),wo=Ue(!0),Eo=Ue(!0,!0),De={};["includes","indexOf","lastIndexOf"].forEach(e=>{let t=Array.prototype[e];De[e]=function(...r){let n=x(this);for(let o=0,a=this.length;o<a;o++)j(n,"get",o+"");let i=t.apply(n,r);return i===-1||i===!1?t.apply(n,r.map(x)):i}});["push","pop","shift","unshift","splice"].forEach(e=>{let t=Array.prototype[e];De[e]=function(...r){go();let n=t.apply(this,r);return sn(),n}});function Ue(e=!1,t=!1){return function(n,i,o){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_raw"&&o===(e?t?Lo:wn:t?Ro:yn).get(n))return n;let a=re(n);if(!e&&a&&ze(De,i))return Reflect.get(De,i,o);let s=Reflect.get(n,i,o);return(Ft(i)?un.has(i):bo(i))||(e||j(n,"get",i),t)?s:Ct(s)?!a||!jt(i)?s.value:s:Ve(s)?e?En(s):Vt(s):s}}var Ao=ln(),So=ln(!0);function ln(e=!1){return function(r,n,i,o){let a=r[n];if(!e&&(i=x(i),a=x(a),!re(r)&&Ct(a)&&!Ct(i)))return a.value=i,!0;let s=re(r)&&jt(n)?Number(n)<r.length:ze(r,n),u=Reflect.set(r,n,i,o);return r===x(o)&&(s?on(i,a)&&J(r,"set",n,i,a):J(r,"add",n,i)),u}}function To(e,t){let r=ze(e,t),n=e[t],i=Reflect.deleteProperty(e,t);return i&&r&&J(e,"delete",t,void 0,n),i}function Co(e,t){let r=Reflect.has(e,t);return(!Ft(t)||!un.has(t))&&j(e,"has",t),r}function Oo(e){return j(e,"iterate",re(e)?"length":ne),Reflect.ownKeys(e)}var cn={get:xo,set:Ao,deleteProperty:To,has:Co,ownKeys:Oo},fn={get:wo,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},Fa=en({},cn,{get:yo,set:So}),ja=en({},fn,{get:Eo}),Ht=e=>Ve(e)?Vt(e):e,qt=e=>Ve(e)?En(e):e,zt=e=>e,Ge=e=>Reflect.getPrototypeOf(e);function Ye(e,t,r=!1,n=!1){e=e.__v_raw;let i=x(e),o=x(t);t!==o&&!r&&j(i,"get",t),!r&&j(i,"get",o);let{has:a}=Ge(i),s=n?zt:r?qt:Ht;if(a.call(i,t))return s(e.get(t));if(a.call(i,o))return s(e.get(o));e!==i&&e.get(t)}function Xe(e,t=!1){let r=this.__v_raw,n=x(r),i=x(e);return e!==i&&!t&&j(n,"has",e),!t&&j(n,"has",i),e===i?r.has(e):r.has(e)||r.has(i)}function Je(e,t=!1){return e=e.__v_raw,!t&&j(x(e),"iterate",ne),Reflect.get(e,"size",e)}function dn(e){e=x(e);let t=x(this);return Ge(t).has.call(t,e)||(t.add(e),J(t,"add",e,e)),this}function pn(e,t){t=x(t);let r=x(this),{has:n,get:i}=Ge(r),o=n.call(r,e);o?xn(r,n,e):(e=x(e),o=n.call(r,e));let a=i.call(r,e);return r.set(e,t),o?on(t,a)&&J(r,"set",e,t,a):J(r,"add",e,t),this}function mn(e){let t=x(this),{has:r,get:n}=Ge(t),i=r.call(t,e);i?xn(t,r,e):(e=x(e),i=r.call(t,e));let o=n?n.call(t,e):void 0,a=t.delete(e);return i&&J(t,"delete",e,void 0,o),a}function hn(){let e=x(this),t=e.size!==0,r=Ee(e)?new Map(e):new Set(e),n=e.clear();return t&&J(e,"clear",void 0,void 0,r),n}function Ze(e,t){return function(n,i){let o=this,a=o.__v_raw,s=x(a),u=t?zt:e?qt:Ht;return!e&&j(s,"iterate",ne),a.forEach((l,f)=>n.call(i,u(l),u(f),o))}}function $e(e,t,r){return function(...n){let i=this.__v_raw,o=x(i),a=Ee(o),s=e==="entries"||e===Symbol.iterator&&a,u=e==="keys"&&a,l=i[e](...n),f=r?zt:t?qt:Ht;return!t&&j(o,"iterate",u?Tt:ne),{next(){let{value:m,done:b}=l.next();return b?{value:m,done:b}:{value:s?[f(m[0]),f(m[1])]:f(m),done:b}},[Symbol.iterator](){return this}}}}function Y(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";console.warn(`${nn(e)} operation ${r}failed: target is readonly.`,x(this))}return e==="delete"?!1:this}}var _n={get(e){return Ye(this,e)},get size(){return Je(this)},has:Xe,add:dn,set:pn,delete:mn,clear:hn,forEach:Ze(!1,!1)},gn={get(e){return Ye(this,e,!1,!0)},get size(){return Je(this)},has:Xe,add:dn,set:pn,delete:mn,clear:hn,forEach:Ze(!1,!0)},vn={get(e){return Ye(this,e,!0)},get size(){return Je(this,!0)},has(e){return Xe.call(this,e,!0)},add:Y("add"),set:Y("set"),delete:Y("delete"),clear:Y("clear"),forEach:Ze(!0,!1)},bn={get(e){return Ye(this,e,!0,!0)},get size(){return Je(this,!0)},has(e){return Xe.call(this,e,!0)},add:Y("add"),set:Y("set"),delete:Y("delete"),clear:Y("clear"),forEach:Ze(!0,!0)},Mo=["keys","values","entries",Symbol.iterator];Mo.forEach(e=>{_n[e]=$e(e,!1,!1),vn[e]=$e(e,!0,!1),gn[e]=$e(e,!1,!0),bn[e]=$e(e,!0,!0)});function Qe(e,t){let r=t?e?bn:gn:e?vn:_n;return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(ze(r,i)&&i in n?r:n,i,o)}var ko={get:Qe(!1,!1)},Ka={get:Qe(!1,!0)},No={get:Qe(!0,!1)},Ha={get:Qe(!0,!0)};function xn(e,t,r){let n=x(r);if(n!==r&&t.call(e,n)){let i=rn(e);console.warn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var yn=new WeakMap,Ro=new WeakMap,wn=new WeakMap,Lo=new WeakMap;function $o(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Po(e){return e.__v_skip||!Object.isExtensible(e)?0:$o(rn(e))}function Vt(e){return e&&e.__v_isReadonly?e:An(e,!1,cn,ko,yn)}function En(e){return An(e,!0,fn,No,wn)}function An(e,t,r,n,i){if(!Ve(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let o=i.get(e);if(o)return o;let a=Po(e);if(a===0)return e;let s=new Proxy(e,a===2?n:r);return i.set(e,s),s}function x(e){return e&&x(e.__v_raw)||e}function Ct(e){return Boolean(e&&e.__v_isRef===!0)}K("nextTick",()=>Dr);K("dispatch",e=>we.bind(we,e));K("watch",(e,{evaluateLater:t,effect:r})=>(n,i)=>{let o=t(n),a=!0,s,u=r(()=>o(l=>{JSON.stringify(l),a?s=l:queueMicrotask(()=>{i(l,s),s=l}),a=!1}));e._x_effects.delete(u)});K("store",Zi);K("data",e=>wr(e));K("root",e=>je(e));K("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=Ce(Io(e))),e._x_refs_proxy));function Io(e){let t=[],r=e;for(;r;)r._x_refs&&t.push(r._x_refs),r=r.parentNode;return t}var ft={};function Sn(e){return ft[e]||(ft[e]=0),++ft[e]}function Bo(e,t){return Ke(e,r=>{if(r._x_ids&&r._x_ids[t])return!0})}function Do(e,t){e._x_ids||(e._x_ids={}),e._x_ids[t]||(e._x_ids[t]=Sn(t))}K("id",e=>(t,r=null)=>{let n=Bo(e,t),i=n?n._x_ids[t]:Sn(t);return r?`${t}-${i}-${r}`:`${t}-${i}`});K("el",e=>e);Tn("Focus","focus","focus");Tn("Persist","persist","persist");function Tn(e,t,r){K(t,n=>ce(`You can't use [$${directiveName}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}A("modelable",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t),o=()=>{let l;return i(f=>l=f),l},a=n(`${t} = __placeholder`),s=l=>a(()=>{},{scope:{__placeholder:l}}),u=o();s(u),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let l=e._x_model.get,f=e._x_model.set;r(()=>s(l())),r(()=>f(o()))})});A("teleport",(e,{expression:t},{cleanup:r})=>{e.tagName.toLowerCase()!=="template"&&ce("x-teleport can only be used on a <template> tag",e);let n=document.querySelector(t);n||ce(`Cannot find x-teleport element for selector: "${t}"`);let i=e.content.cloneNode(!0).firstElementChild;e._x_teleport=i,i._x_teleportBack=e,e._x_forwardEvents&&e._x_forwardEvents.forEach(o=>{i.addEventListener(o,a=>{a.stopPropagation(),e.dispatchEvent(new a.constructor(a.type,a))})}),Te(i,{},e),T(()=>{n.appendChild(i),X(i),i._x_ignore=!0}),r(()=>i.remove())});var Cn=()=>{};Cn.inline=(e,{modifiers:t},{cleanup:r})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,r(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};A("ignore",Cn);A("effect",(e,{expression:t},{effect:r})=>r(k(e,t)));function On(e,t,r,n){let i=e,o=u=>n(u),a={},s=(u,l)=>f=>l(u,f);if(r.includes("dot")&&(t=Fo(t)),r.includes("camel")&&(t=jo(t)),r.includes("passive")&&(a.passive=!0),r.includes("capture")&&(a.capture=!0),r.includes("window")&&(i=window),r.includes("document")&&(i=document),r.includes("prevent")&&(o=s(o,(u,l)=>{l.preventDefault(),u(l)})),r.includes("stop")&&(o=s(o,(u,l)=>{l.stopPropagation(),u(l)})),r.includes("self")&&(o=s(o,(u,l)=>{l.target===e&&u(l)})),(r.includes("away")||r.includes("outside"))&&(i=document,o=s(o,(u,l)=>{e.contains(l.target)||l.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&u(l))})),r.includes("once")&&(o=s(o,(u,l)=>{u(l),i.removeEventListener(t,o,a)})),o=s(o,(u,l)=>{Ho(t)&&qo(l,r)||u(l)}),r.includes("debounce")){let u=r[r.indexOf("debounce")+1]||"invalid-wait",l=Ot(u.split("ms")[0])?Number(u.split("ms")[0]):250;o=Gr(o,l)}if(r.includes("throttle")){let u=r[r.indexOf("throttle")+1]||"invalid-wait",l=Ot(u.split("ms")[0])?Number(u.split("ms")[0]):250;o=Yr(o,l)}return i.addEventListener(t,o,a),()=>{i.removeEventListener(t,o,a)}}function Fo(e){return e.replace(/-/g,".")}function jo(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Ot(e){return!Array.isArray(e)&&!isNaN(e)}function Ko(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Ho(e){return["keydown","keyup"].includes(e)}function qo(e,t){let r=t.filter(o=>!["window","document","prevent","stop","once"].includes(o));if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,Ot((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0||r.length===1&&dr(e.key).includes(r[0]))return!1;let i=["ctrl","shift","alt","meta","cmd","super"].filter(o=>r.includes(o));return r=r.filter(o=>!i.includes(o)),!(i.length>0&&i.filter(a=>((a==="cmd"||a==="super")&&(a="meta"),e[`${a}Key`])).length===i.length&&dr(e.key).includes(r[0]))}function dr(e){if(!e)return[];e=Ko(e);let t={ctrl:"control",slash:"/",space:"-",spacebar:"-",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"="};return t[e]=e,Object.keys(t).map(r=>{if(t[r]===e)return r}).filter(r=>r)}A("model",(e,{modifiers:t,expression:r},{effect:n,cleanup:i})=>{let o=k(e,r),a=`${r} = rightSideOfExpression($event, ${r})`,s=k(e,a);var u=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let l=zo(e,t,r),f=On(e,u,t,b=>{s(()=>{},{scope:{$event:b,rightSideOfExpression:l}})});e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=f,i(()=>e._x_removeModelListeners.default());let m=k(e,`${r} = __placeholder`);e._x_model={get(){let b;return o(I=>b=I),b},set(b){m(()=>{},{scope:{__placeholder:b}})}},e._x_forceModelUpdate=()=>{o(b=>{b===void 0&&r.match(/\./)&&(b=""),window.fromModel=!0,T(()=>Wr(e,"value",b)),delete window.fromModel})},n(()=>{t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate()})});function zo(e,t,r){return e.type==="radio"&&T(()=>{e.hasAttribute("name")||e.setAttribute("name",r)}),(n,i)=>T(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail||n.target.value;if(e.type==="checkbox")if(Array.isArray(i)){let o=t.includes("number")?dt(n.target.value):n.target.value;return n.target.checked?i.concat([o]):i.filter(a=>!Vo(a,o))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(o=>{let a=o.value||o.text;return dt(a)}):Array.from(n.target.selectedOptions).map(o=>o.value||o.text);{let o=n.target.value;return t.includes("number")?dt(o):t.includes("trim")?o.trim():o}}})}function dt(e){let t=e?parseFloat(e):null;return Wo(t)?t:e}function Vo(e,t){return e==t}function Wo(e){return!Array.isArray(e)&&!isNaN(e)}A("cloak",e=>queueMicrotask(()=>T(()=>e.removeAttribute(pe("cloak")))));qr(()=>`[${pe("init")}]`);A("init",qe((e,{expression:t},{evaluate:r})=>typeof t=="string"?!!t.trim()&&r(t,{},!1):r(t,{},!1)));A("text",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{T(()=>{e.textContent=o})})})});A("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{T(()=>{e.innerHTML=o,e._x_ignoreSelf=!0,X(e),delete e._x_ignoreSelf})})})});Pt(Rr(":",Lr(pe("bind:"))));A("bind",(e,{value:t,modifiers:r,expression:n,original:i},{effect:o})=>{if(!t){let s={};eo(s),k(e,n)(l=>{Jr(e,l,i)},{scope:s});return}if(t==="key")return Uo(e,n);let a=k(e,n);o(()=>a(s=>{s===void 0&&typeof n=="string"&&n.match(/\./)&&(s=""),T(()=>Wr(e,t,s,r))}))});function Uo(e,t){e._x_keyExpression=t}Hr(()=>`[${pe("data")}]`);A("data",qe((e,{expression:t},{cleanup:r})=>{t=t===""?"{}":t;let n={};gt(n,e);let i={};ro(i,n);let o=ue(e,t,{scope:i});o===void 0&&(o={}),gt(o,e);let a=de(o);Er(a);let s=Te(e,a);a.init&&ue(e,a.init),r(()=>{a.destroy&&ue(e,a.destroy),s()})}));A("show",(e,{modifiers:t,expression:r},{effect:n})=>{let i=k(e,r);e._x_doHide||(e._x_doHide=()=>{T(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})}),e._x_doShow||(e._x_doShow=()=>{T(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display")})});let o=()=>{e._x_doHide(),e._x_isShown=!1},a=()=>{e._x_doShow(),e._x_isShown=!0},s=()=>setTimeout(a),u=wt(m=>m?a():o(),m=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,m,a,o):m?s():o()}),l,f=!0;n(()=>i(m=>{!f&&m===l||(t.includes("immediate")&&(m?s():o()),u(m),l=m,f=!1)}))});A("for",(e,{expression:t},{effect:r,cleanup:n})=>{let i=Yo(t),o=k(e,i.items),a=k(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},r(()=>Go(e,i,o,a)),n(()=>{Object.values(e._x_lookup).forEach(s=>s.remove()),delete e._x_prevKeys,delete e._x_lookup})});function Go(e,t,r,n){let i=a=>typeof a=="object"&&!Array.isArray(a),o=e;r(a=>{Xo(a)&&a>=0&&(a=Array.from(Array(a).keys(),d=>d+1)),a===void 0&&(a=[]);let s=e._x_lookup,u=e._x_prevKeys,l=[],f=[];if(i(a))a=Object.entries(a).map(([d,v])=>{let y=pr(t,v,d,a);n(O=>f.push(O),{scope:g({index:d},y)}),l.push(y)});else for(let d=0;d<a.length;d++){let v=pr(t,a[d],d,a);n(y=>f.push(y),{scope:g({index:d},v)}),l.push(v)}let m=[],b=[],I=[],E=[];for(let d=0;d<u.length;d++){let v=u[d];f.indexOf(v)===-1&&I.push(v)}u=u.filter(d=>!I.includes(d));let se="template";for(let d=0;d<f.length;d++){let v=f[d],y=u.indexOf(v);if(y===-1)u.splice(d,0,v),m.push([se,d]);else if(y!==d){let O=u.splice(d,1)[0],L=u.splice(y-1,1)[0];u.splice(d,0,L),u.splice(y,0,O),b.push([O,L])}else E.push(v);se=v}for(let d=0;d<I.length;d++){let v=I[d];s[v]._x_effects&&s[v]._x_effects.forEach(mr),s[v].remove(),s[v]=null,delete s[v]}for(let d=0;d<b.length;d++){let[v,y]=b[d],O=s[v],L=s[y],G=document.createElement("div");T(()=>{L.after(G),O.after(L),L._x_currentIfEl&&L.after(L._x_currentIfEl),G.before(O),O._x_currentIfEl&&O.after(O._x_currentIfEl),G.remove()}),ur(L,l[f.indexOf(y)])}for(let d=0;d<m.length;d++){let[v,y]=m[d],O=v==="template"?o:s[v];O._x_currentIfEl&&(O=O._x_currentIfEl);let L=l[y],G=f[y],F=document.importNode(o.content,!0).firstElementChild;Te(F,de(L),o),T(()=>{O.after(F),X(F)}),typeof G=="object"&&ce("x-for key cannot be an object, it must be a string or an integer",o),s[G]=F}for(let d=0;d<E.length;d++)ur(s[E[d]],l[f.indexOf(E[d])]);o._x_prevKeys=f})}function Yo(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,i=e.match(n);if(!i)return;let o={};o.items=i[2].trim();let a=i[1].replace(r,"").trim(),s=a.match(t);return s?(o.item=a.replace(t,"").trim(),o.index=s[1].trim(),s[2]&&(o.collection=s[2].trim())):o.item=a,o}function pr(e,t,r,n){let i={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(a=>a.trim()).forEach((a,s)=>{i[a]=t[s]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(a=>a.trim()).forEach(a=>{i[a]=t[a]}):i[e.item]=t,e.index&&(i[e.index]=r),e.collection&&(i[e.collection]=n),i}function Xo(e){return!Array.isArray(e)&&!isNaN(e)}function Mn(){}Mn.inline=(e,{expression:t},{cleanup:r})=>{let n=je(e);n._x_refs||(n._x_refs={}),n._x_refs[t]=e,r(()=>delete n._x_refs[t])};A("ref",Mn);A("if",(e,{expression:t},{effect:r,cleanup:n})=>{let i=k(e,t),o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let s=e.content.cloneNode(!0).firstElementChild;return Te(s,{},e),T(()=>{e.after(s),X(s)}),e._x_currentIfEl=s,e._x_undoIf=()=>{ie(s,u=>{u._x_effects&&u._x_effects.forEach(mr)}),s.remove(),delete e._x_currentIfEl},s},a=()=>{e._x_undoIf&&(e._x_undoIf(),delete e._x_undoIf)};r(()=>i(s=>{s?o():a()})),n(()=>e._x_undoIf&&e._x_undoIf())});A("id",(e,{expression:t},{evaluate:r})=>{r(t).forEach(i=>Do(e,i))});Pt(Rr("@",Lr(pe("on:"))));A("on",qe((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let o=n?k(e,n):()=>{};e.tagName.toLowerCase()==="template"&&(e._x_forwardEvents||(e._x_forwardEvents=[]),e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let a=On(e,t,r,s=>{o(()=>{},{scope:{$event:s},params:[s]})});i(()=>a())}));et("Collapse","collapse","collapse");et("Intersect","intersect","intersect");et("Focus","trap","focus");et("Mask","mask","mask");function et(e,t,r){A(t,n=>ce(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}Oe.setEvaluator(Cr);Oe.setReactivityEngine({reactive:Vt,effect:po,release:mo,raw:x});var Jo=Oe,Wt=Jo;var Zo=class{constructor(e){ut(this,"el");ut(this,"traversals",{first:"firstElementChild",next:"nextElementSibling",parent:"parentElement"});this.el=e}nodes(){return this.traversals={first:"firstChild",next:"nextSibling",parent:"parentNode"},this}first(){return this.teleportTo(this.el[this.traversals.first])}next(){return this.teleportTo(this.teleportBack(this.el[this.traversals.next]))}before(e){return this.el[this.traversals.parent].insertBefore(e,this.el),e}replace(e){return this.el[this.traversals.parent].replaceChild(e,this.el),e}append(e){return this.el.appendChild(e),e}teleportTo(e){return e&&(e._x_teleport?e._x_teleport:e)}teleportBack(e){return e&&(e._x_teleportBack?e._x_teleportBack:e)}};function C(e){return new Zo(e)}function Qo(e){let t=document.createElement("template");return t.innerHTML=e,t.content.firstElementChild}function ea(e){return e.nodeType===3||e.nodeType===8}var kn=()=>{},Nn=()=>{};async function Ut(e,t,r){let n,i,o,a,s,u,l,f,m,b,I;function E(c){if(I)return Nn((c||"").replace(`
|
6
|
-
`,"\\n"),n,i),new Promise(p=>kn=()=>p())}function se(c={}){let p=B=>B.getAttribute("key"),h=()=>{};s=c.updating||h,u=c.updated||h,l=c.removing||h,f=c.removed||h,m=c.adding||h,b=c.added||h,o=c.key||p,a=c.lookahead||!1,I=c.debug||!1}async function d(c,p){if(v(c,p)){let B=y(c,p);return await E("Swap elements"),B}let h=!1;if(!me(s,c,p,()=>h=!0)){if(window.Alpine&&ta(c,p,()=>h=!0),ea(p)){await O(c,p),u(c,p);return}h||await L(c,p),u(c,p),await G(c,p)}}function v(c,p){return c.nodeType!=p.nodeType||c.nodeName!=p.nodeName||F(c)!=F(p)}function y(c,p){if(me(l,c))return;let h=p.cloneNode(!0);me(m,h)||(C(c).replace(h),f(c),b(h))}async function O(c,p){let h=p.nodeValue;c.nodeValue!==h&&(c.nodeValue=h,await E("Change text node to: "+h))}async function L(c,p){if(c._x_isShown&&!p._x_isShown||!c._x_isShown&&p._x_isShown)return;let h=Array.from(c.attributes),B=Array.from(p.attributes);for(let W=h.length-1;W>=0;W--){let H=h[W].name;p.hasAttribute(H)||(c.removeAttribute(H),await E("Remove attribute"))}for(let W=B.length-1;W>=0;W--){let H=B[W].name,w=B[W].value;c.getAttribute(H)!==w&&(c.setAttribute(H,w),await E(`Set [${H}] attribute to: "${w}"`))}}async function G(c,p){let h=c.childNodes,B=p.childNodes,W=nr(B),H=nr(h),w=C(p).nodes().first(),_=C(c).nodes().first(),Q={};for(;w;){let $=F(w),q=F(_);if(!_)if($&&Q[$]){let P=Q[$];C(c).append(P),_=P,await E("Add element (from key)")}else{let P=Wn(w,c)||{};await E("Add element: "+(P.outerHTML||P.nodeValue)),w=C(w).nodes().next();continue}if(a){let P=C(w).next(),ir=!1;for(;!ir&&P;)_.isEqualNode(P)&&(ir=!0,_=ot(w,_),q=F(_),await E("Move element (lookahead)")),P=C(P).next()}if($!==q){if(!$&&q){Q[q]=_,_=ot(w,_),Q[q].remove(),_=C(_).nodes().next(),w=C(w).nodes().next(),await E('No "to" key');continue}if($&&!q&&H[$]&&(_=C(_).replace(H[$]),await E('No "from" key')),$&&q){Q[q]=_;let P=H[$];if(P)_=C(_).replace(P),await E('Move "from" key');else{Q[q]=_,_=ot(w,_),Q[q].remove(),_=C(_).next(),w=C(w).next(),await E("Swap elements with keys");continue}}}let Un=_&&C(_).nodes().next();await d(_,w),w=w&&C(w).nodes().next(),_=Un}let at=[];for(;_;)me(l,_)||at.push(_),_=C(_).nodes().next();for(;at.length;){let $=at.shift();$.remove(),await E("remove el"),f($)}}function F(c){return c&&c.nodeType===1&&o(c)}function nr(c){let p={};return c.forEach(h=>{let B=F(h);B&&(p[B]=h)}),p}function Wn(c,p){if(!me(m,c)){let h=c.cloneNode(!0);return C(p).append(h),b(h),h}return null}function ot(c,p){if(!me(m,c)){let h=c.cloneNode(!0);return C(p).before(h),b(h),h}return p}return se(r),n=e,i=Qo(t),window.Alpine&&window.Alpine.closestDataStack&&!e._x_dataStack&&(i._x_dataStack=window.Alpine.closestDataStack(e),i._x_dataStack&&window.Alpine.clone(e,i)),await E(),await d(e,i),n=void 0,i=void 0,e}Ut.step=()=>kn();Ut.log=e=>{Nn=e};function me(e,...t){let r=!1;return e(...t,()=>r=!0),r}function ta(e,t,r){e.nodeType===1&&e._x_dataStack&&window.Alpine.clone(e,t)}function ra(e){e.morph=Ut}var Rn=ra;Wt.plugin(Rn);var na=/INPUT/i,ia=/date|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/i,oa=/TEXTAREA/i;function aa(e,t,r,n){if(e.nodeType!==Node.ELEMENT_NODE||e!==document.activeElement)return;if(e.tagName.match(oa)||e.tagName.match(na)&&e.getAttribute("type").match(ia))return n()}function sa(e,t){e.forEach(r=>Wt.morph(r,t,{updating:aa}))}var Ln=sa;function ua(e,t,r){if(e.match(/^dispatch(Event)?$/))return ar(r,t[0],t[1]||{});if(e.match(/^morph|mutate$/))return Ln(r,t[0]);if(e.endsWith("="))return r.forEach(n=>n[e.slice(0,-1).trim()]=t[0]);r.forEach(n=>n[e].apply(n,t))}function la(){let e=JSON.parse(this.templateContent.textContent),{id:t,selector:r,receiver:n,method:i,args:o}=e,a=[self];r&&(a=Array.from(document.querySelectorAll(r))),n&&(a=a.map(s=>{let u=s,l=n.split(".");for(;l.length>0;)u=u[l.shift()];return u})),ua(i,o,a)}var Gt=la;if(!self.Turbo)throw new Error("`Turbo` is not defined! Be sure to import `@turbo-boost/streams` after `@hotwired/turbo` or `@hotwired/turbo-rails`.");if(!Turbo.StreamActions)throw new Error("`Turbo.StreamActions` is not defined! Verify that you are running >= `7.2.0` of `@hotwired/turbo`.");Turbo.StreamActions.invoke=Gt;self.TurboBoost=self.TurboBoost||{};self.TurboBoost.Streams={invoke:Gt};console.info("@turbo-boost/streams has initialized and registered new stream actions with Turbo.");var Yt=class{get element(){return document.querySelector('meta[name="turbo-boost"]')}get token(){return this.element.getAttribute("content")}get busy(){return this.element.dataset.busy==="true"}set busy(t){return this.element.dataset.busy=!!t}},S=new Yt;var N={start:"turbo-boost:command:start",success:"turbo-boost:command:success",finish:"turbo-boost:command:finish",abort:"turbo-boost:command:abort",clientError:"turbo-boost:command:client-error",serverError:"turbo-boost:command:server-error"},V={stateLoad:"turbo-boost:state:load",stateChange:"turbo-boost:state:change"},U=g(g({},N),V);function M(e,t,r={}){r=r||{},r.detail=r.detail||{},t=t||document;let n=new CustomEvent(e,R(g({},r),{bubbles:!0}));return t.dispatchEvent(n),n}var Xt;function tt(e,t=null){if(!e||typeof e!="object")return e;let r=new Proxy(e,{deleteProperty(n,i){return delete n[i],M(V.stateChange,S.element,{detail:{state:Xt}}),!0},set(n,i,o,a){return n[i]=tt(o,this),M(V.stateChange,S.element,{detail:{state:Xt}}),!0}});if(Array.isArray(e))e.forEach((n,i)=>e[i]=tt(n,r));else if(typeof e=="object")for(let[n,i]of Object.entries(e))e[n]=tt(i,r);return t||(Xt=r),r}var $n=tt;var Jt,he,Me,Pn;function In(){if(!S.element)return _e();let e=atob(S.element.dataset.state);Me={},he=$n(JSON.parse(e)),Jt=g({},he),delete S.element.dataset.clientStateChange,setTimeout(()=>M(V.stateLoad,S.element,{detail:{state:he}}))}function _e(){clearTimeout(Pn),Pn=setTimeout(In,10)}Jt||In();addEventListener("DOMContentLoaded",_e);addEventListener("load",_e);addEventListener("turbo:load",_e);addEventListener("turbo:frame-load",_e);addEventListener(N.success,_e);addEventListener(V.stateChange,e=>{Me={};for(let[t,r]of Object.entries(he))Jt[t]!==r&&(Me[t]=r);S.element.dataset.clientStateChange=!0,S.element.dataset.state=btoa(JSON.stringify(he))});var oe={events:V,get current(){return he},get delta(){return Me},get payloadChunks(){return btoa(JSON.stringify(Me)).match(/.{1,2000}/g)}};function ca(e){let t="<html",r="</html",n=e.indexOf(t),i=e.lastIndexOf(r);if(n>=0&&i>=0){let o=e.slice(e.indexOf(">",n)+1,i);document.documentElement.innerHTML=o}}function fa(e){document.body.insertAdjacentHTML("beforeend",e)}var ae={append:fa,replaceDocument:ca};var rt={};function da(e){rt[e.id]=e}function pa(e){delete rt[e]}var nt={add:da,remove:pa,get commands(){return[...Object.values(rt)]},get length(){return Object.keys(rt).length}};function Bn(e){e.detail.endedAt=new Date().getTime(),e.detail.milliseconds=e.detail.endedAt-e.detail.startedAt,setTimeout(()=>M(N.finish,e.target,{detail:e.detail}),25)}addEventListener(N.serverError,Bn);addEventListener(N.success,Bn);addEventListener(N.finish,e=>nt.remove(e.detail.id),!0);var ke={events:N};var Zt={};addEventListener("turbo:before-fetch-request",e=>{let t=e.target.closest("turbo-frame"),{fetchOptions:r}=e.detail;if(S.busy){let n=["text/vnd.turbo-boost.html",r.headers.Accept];n=n.filter(i=>i&&i.trim().length>0).join(", "),r.headers.Accept=n,r.headers["TurboBoost-Token"]=S.token}oe.payloadChunks.forEach((n,i)=>{r.headers[`TurboBoost-State-${i.toString().padStart(4,"0")}`]=n})});addEventListener("turbo:before-fetch-response",e=>{let t=e.target.closest("turbo-frame"),{fetchResponse:r}=e.detail;if(t&&(Zt[t.id]=t.src),r.header("TurboBoost")){if(r.statusCode<200||r.statusCode>399){let n=`Server returned a ${r.statusCode} status code! TurboBoost Commands require 2XX-3XX status codes.`;M(ke.events.clientError,document,{detail:R(g({},e.detail),{error:n})},!0)}r.header("TurboBoost")==="Append"&&(e.preventDefault(),r.responseText.then(n=>ae.append(n)))}});addEventListener("turbo:frame-load",e=>{let t=e.target.closest("turbo-frame");t.dataset.turboBoostSrc=Zt[t.id]||t.src||t.dataset.turboBoostSrc,delete Zt[t.id]});var ma={frameAttribute:"data-turbo-frame",methodAttribute:"data-turbo-method",commandAttribute:"data-turbo-command"},D=g({},ma);var it={},Dn;function ha(e,t){it[e]=t,document.addEventListener(e,Dn,!0)}function _a(e){return Object.keys(it).find(t=>!!it[t].find(r=>Array.from(document.querySelectorAll(r)).find(n=>n===e)))}function ga(e,t){return e===_a(t)}var Z={events:it,register:ha,isRegisteredForElement:ga,set handler(e){Dn=e}};function va(e){return e.closest(`[${D.commandAttribute}]`)}function ba(e){return e.closest("turbo-frame")}function xa(e,t={}){if(e.tagName.toLowerCase()!=="select")return t.value=e.value||null;if(!e.multiple)return t.value=e.options[e.selectedIndex].value;t.values=Array.from(e.options).reduce((r,n)=>(n.selected&&r.push(n.value),r),[])}function ya(e){let t=Array.from(e.attributes).reduce((r,n)=>{let i=n.value;return r[n.name]=i,r},{});return t.tag=e.tagName,t.checked=!!e.checked,t.disabled=!!e.disabled,xa(e,t),delete t.class,delete t.action,delete t.href,delete t[D.commandAttribute],delete t[D.frameAttribute],t}var Ne={buildAttributePayload:ya,findClosestCommand:va,findClosestFrame:ba};function wa(e,t={}){t.token=S.token;let r=document.createElement("input");r.type="hidden",r.name="turbo_boost_command",r.value=JSON.stringify(t),e.appendChild(r)}var Fn={invokeCommand:wa};function Ea(e,t={}){let r=document.createElement("a");r.href=e;let n=new URL(r);return n.searchParams.set("turbo_boost_command",JSON.stringify(t)),n}var ge={build:Ea};function Aa(e,t){let r=t.src;t=g({},t),delete t.src,e.src=ge.build(r,t)}var Qt={invokeCommand:Aa};function Sa(e,t={}){let r=t.src;t=g({},t),delete t.src,delete t.href,e.setAttribute("href",ge.build(r,t))}var jn={invokeCommand:Sa};function Ta(e){let t=e.target;M(ke.events.abort,document,{detail:R(g({},e.detail),{xhr:t})})}function er(e){let t=e.target;t.getResponseHeader("TurboBoost")==="Append"?ae.append(t.responseText):ae.replaceDocument(t.responseText);let r=`Server returned a ${t.status} status code! TurboBoost Commands require 2XX-3XX status codes.`;M(ke.events.clientError,document,{detail:R(g({},e.detail),{error:r,xhr:t})},!0)}function Ca(e){let t=e.target;if(t.status<200||t.status>399)return er(e);let r=t.responseText;t.getResponseHeader("TurboBoost")==="Append"?ae.append(t.responseText):ae.replaceDocument(t.responseText)}function Oa(e){let t=e.src;e=g({},e),delete e.src;try{let r=new XMLHttpRequest;r.open("GET",ge.build(t,e),!0),r.setRequestHeader("Accept","text/vnd.turbo-boost.html, text/html, application/xhtml+xml"),r.setRequestHeader("TurboBoost-Token",S.token),oe.payloadChunks.forEach((n,i)=>r.setRequestHeader(`TurboBoost-State-${i.toString().padStart(4,"0")}`,n)),r.addEventListener("abort",Ta),r.addEventListener("error",er),r.addEventListener("load",Ca),r.send()}catch(r){let n=`Unexpected error sending HTTP request! ${r.message}`;er(r,{detail:{message:n}})}}var Kn={invokeCommand:Oa};function tr(e,t){return t=t||{dataset:{}},e.href||t.src||t.dataset.turboBoostSrc||location.href}function Ma(e){let t=Ne.findClosestFrame(e),{turboFrame:r,turboMethod:n}=e.dataset;return e.tagName.toLowerCase()==="form"?{name:"form",reason:"Element is a form.",frame:t,src:e.action,invokeCommand:Fn.invokeCommand}:n&&n.length>0?{name:"method",reason:"Element defines data-turbo-method.",frame:t,src:e.href,invokeCommand:jn.invokeCommand}:r&&r!=="_self"?(t=document.getElementById(r),{name:"frame",reason:"element targets a frame that is not _self",frame:t,src:tr(e,t),invokeCommand:Qt.invokeCommand}):(!r||r==="_self")&&t?{name:"frame",reason:"element does NOT target a frame or targets _self and is contained by a frame",frame:t,src:tr(e,t),invokeCommand:Qt.invokeCommand}:{name:"window",reason:"element matches one or more of the following conditions (targets _top, does NOT target a frame, is NOT contained by a frame)",frame:null,src:tr(e),invokeCommand:Kn.invokeCommand}}var rr={find:Ma};var Re="unknown",Hn={debug:Object.values(U),info:Object.values(U),warn:[U.abort,U.clientError,U.serverError],error:[U.clientError,U.serverError],unknown:[]};Object.values(U).forEach(e=>{addEventListener(e,t=>{Hn[Re].includes(t.type)&&console[Re==="debug"?"log":Re](t.type,{target:t.target,detail:t.detail})})});var qn={get level(){return Re},set level(e){return Object.keys(Hn).includes(e)||(e="unknown"),Re=e}};function ka(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}var zn={v4:ka};function Vn(e,t){return{id:e,name:t.getAttribute(D.commandAttribute),elementId:t.id.length>0?t.id:null,elementAttributes:Ne.buildAttributePayload(t),startedAt:new Date().getTime()}}function Na(e){let t,r={};try{if(t=Ne.findClosestCommand(e.target),!t||!Z.isRegisteredForElement(e.type,t))return;let n=`turbo-command-${zn.v4()}`,i=rr.find(t),o=R(g({},Vn(n,t)),{driver:i.name,frameId:i.frame?i.frame.id:null,src:i.src}),a=M(N.start,t,{cancelable:!0,detail:o});if(a.defaultPrevented)return M(N.abort,t,{detail:{message:`An event handler for '${N.start}' prevented default behavior and blocked command invocation!`,source:a}});switch(i=rr.find(t),o=R(g({},Vn(n,t)),{driver:i.name,frameId:i.frame?i.frame.id:null,src:i.src}),nt.add(o),["frame","window"].includes(i.name)&&e.preventDefault(),S.busy=!0,setTimeout(()=>S.busy=!1,10),i.name){case"method":return i.invokeCommand(t,o);case"form":return i.invokeCommand(t,o);case"frame":return i.invokeCommand(i.frame,o);case"window":return i.invokeCommand(o)}}catch(n){M(N.clientError,t,{detail:R(g({},r),{error:n})})}}Z.handler=Na;Z.register("change",[`input[${D.commandAttribute}]`,`select[${D.commandAttribute}]`,`textarea[${D.commandAttribute}]`]);Z.register("submit",[`form[${D.commandAttribute}]`]);Z.register("click",[`[${D.commandAttribute}]`]);self.TurboBoost=self.TurboBoost||{};self.TurboBoost=R(g({},self.TurboBoost),{stateEvents:V,get state(){return oe.current},get stateDelta(){return oe.delta}});self.TurboBoost.Commands={logger:qn,schema:D,events:N,registerEventDelegate:Z.register,get eventDelegates(){return g({},Z.events)}};var vu=self.TurboBoost.Commands;export{vu as default};
|
5
|
+
`:""}`,t),setTimeout(()=>{throw e},0)}var Me=!0;function Ao(e){let t=Me;Me=!1,e(),Me=t}function ue(e,t,n={}){let r;return $(e,t)(o=>r=o,n),r}function $(...e){return Cn(...e)}var Cn=On;function So(e){Cn=e}function On(e,t){let n={};_t(n,e);let r=[n,...ce(e)];if(typeof t=="function")return Co(r,t);let o=To(r,t,e);return ko.bind(null,e,t,o)}function Co(e,t){return(n=()=>{},{scope:r={},params:o=[]}={})=>{let i=t.apply(Ce([r,...e]),o);De(n,i)}}var ut={};function Oo(e,t){if(ut[e])return ut[e];let n=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)\s/.test(e)?`(() => { ${e} })()`:e,o=(()=>{try{return new n(["__self","scope"],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`)}catch(i){return ke(i,t,e),Promise.resolve()}})();return ut[e]=o,o}function To(e,t,n){let r=Oo(t,n);return(o=()=>{},{scope:i={},params:a=[]}={})=>{r.result=void 0,r.finished=!1;let s=Ce([i,...e]);if(typeof r=="function"){let l=r(r,s).catch(u=>ke(u,n,t));r.finished?(De(o,r.result,s,a,n),r.result=void 0):l.then(u=>{De(o,u,s,a,n)}).catch(u=>ke(u,n,t)).finally(()=>r.result=void 0)}}}function De(e,t,n,r,o){if(Me&&typeof t=="function"){let i=t.apply(n,r);i instanceof Promise?i.then(a=>De(e,a,n,r)).catch(a=>ke(a,o,t)):e(i)}else e(t)}var Nt="x-";function pe(e=""){return Nt+e}function $o(e){Nt=e}var Tn={};function k(e,t){Tn[e]=t}function jt(e,t,n){if(t=Array.from(t),e._x_virtualDirectives){let o=Object.entries(e._x_virtualDirectives).map(([a,s])=>({name:a,value:s})),i=$n(o);o=o.map(a=>i.find(s=>s.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),t=t.concat(o)}let r={};return t.map(Mn((o,i)=>r[o]=i)).filter(Bn).map(jo(r,n)).sort(Po).map(o=>No(e,o))}function $n(e){return Array.from(e).map(Mn()).filter(t=>!Bn(t))}var vt=!1,xe=new Map,Ln=Symbol();function Lo(e){vt=!0;let t=Symbol();Ln=t,xe.set(t,[]);let n=()=>{for(;xe.get(t).length;)xe.get(t).shift()();xe.delete(t)},r=()=>{vt=!1,n()};e(n),r()}function Nn(e){let t=[],n=i=>t.push(i),[r,o]=po(e);return t.push(o),[{Alpine:Oe,effect:r,cleanup:n,evaluateLater:$.bind($,e),evaluate:ue.bind(ue,e)},()=>t.forEach(i=>i())]}function No(e,t){let n=()=>{},r=Tn[t.type]||n,[o,i]=Nn(e);vo(e,t.original,i);let a=()=>{e._x_ignore||e._x_ignoreSelf||(r.inline&&r.inline(e,t,o),r=r.bind(r,e,t,o),vt?xe.get(Ln).push(r):r())};return a.runCleanups=i,a}var jn=(e,t)=>({name:n,value:r})=>(n.startsWith(e)&&(n=n.replace(e,t)),{name:n,value:r}),Pn=e=>e;function Mn(e=()=>{}){return({name:t,value:n})=>{let{name:r,value:o}=Rn.reduce((i,a)=>a(i),{name:t,value:n});return r!==t&&e(r,t),{name:r,value:o}}}var Rn=[];function Pt(e){Rn.push(e)}function Bn({name:e}){return Dn().test(e)}var Dn=()=>new RegExp(`^${Nt}([^:^.]+)\\b`);function jo(e,t){return({name:n,value:r})=>{let o=n.match(Dn()),i=n.match(/:([a-zA-Z0-9\-:]+)/),a=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],s=t||e[n]||n;return{type:o?o[1]:null,value:i?i[1]:null,modifiers:a.map(l=>l.replace(".","")),expression:r,original:s}}}var gt="DEFAULT",je=["ignore","ref","data","id","radio","tabs","switch","disclosure","menu","listbox","list","item","combobox","bind","init","for","mask","model","modelable","transition","show","if",gt,"teleport"];function Po(e,t){let n=je.indexOf(e.type)===-1?gt:e.type,r=je.indexOf(t.type)===-1?gt:t.type;return je.indexOf(n)-je.indexOf(r)}function we(e,t,n={}){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}var bt=[],Mt=!1;function In(e=()=>{}){return queueMicrotask(()=>{Mt||setTimeout(()=>{xt()})}),new Promise(t=>{bt.push(()=>{e(),t()})})}function xt(){for(Mt=!1;bt.length;)bt.shift()()}function Mo(){Mt=!0}function oe(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(o=>oe(o,t));return}let n=!1;if(t(e,()=>n=!0),n)return;let r=e.firstElementChild;for(;r;)oe(r,t,!1),r=r.nextElementSibling}function de(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function Ro(){document.body||de("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),we(document,"alpine:init"),we(document,"alpine:initializing"),yn(),ho(t=>Z(t,oe)),bn(t=>Do(t)),_o((t,n)=>{jt(t,n).forEach(r=>r())});let e=t=>!ze(t.parentElement,!0);Array.from(document.querySelectorAll(Fn())).filter(e).forEach(t=>{Z(t)}),we(document,"alpine:initialized")}var Rt=[],qn=[];function zn(){return Rt.map(e=>e())}function Fn(){return Rt.concat(qn).map(e=>e())}function Hn(e){Rt.push(e)}function Vn(e){qn.push(e)}function ze(e,t=!1){return Fe(e,n=>{if((t?Fn():zn()).some(r=>n.matches(r)))return!0})}function Fe(e,t){if(e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),!!e.parentElement)return Fe(e.parentElement,t)}}function Bo(e){return zn().some(t=>e.matches(t))}function Z(e,t=oe){Lo(()=>{t(e,(n,r)=>{jt(n,n.attributes).forEach(o=>o()),n._x_ignore&&r()})})}function Do(e){oe(e,t=>xn(t))}function Bt(e,t){return Array.isArray(t)?un(e,t.join(" ")):typeof t=="object"&&t!==null?Io(e,t):typeof t=="function"?Bt(e,t()):un(e,t)}function un(e,t){let n=i=>i.split(" ").filter(Boolean),r=i=>i.split(" ").filter(a=>!e.classList.contains(a)).filter(Boolean),o=i=>(e.classList.add(...i),()=>{e.classList.remove(...i)});return t=t===!0?t="":t||"",o(r(t))}function Io(e,t){let n=s=>s.split(" ").filter(Boolean),r=Object.entries(t).flatMap(([s,l])=>l?n(s):!1).filter(Boolean),o=Object.entries(t).flatMap(([s,l])=>l?!1:n(s)).filter(Boolean),i=[],a=[];return o.forEach(s=>{e.classList.contains(s)&&(e.classList.remove(s),a.push(s))}),r.forEach(s=>{e.classList.contains(s)||(e.classList.add(s),i.push(s))}),()=>{a.forEach(s=>e.classList.add(s)),i.forEach(s=>e.classList.remove(s))}}function He(e,t){return typeof t=="object"&&t!==null?qo(e,t):zo(e,t)}function qo(e,t){let n={};return Object.entries(t).forEach(([r,o])=>{n[r]=e.style[r],r.startsWith("--")||(r=Fo(r)),e.style.setProperty(r,o)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{He(e,n)}}function zo(e,t){let n=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",n||"")}}function Fo(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function yt(e,t=()=>{}){let n=!1;return function(){n?t.apply(this,arguments):(n=!0,e.apply(this,arguments))}}k("transition",(e,{value:t,modifiers:n,expression:r},{evaluate:o})=>{typeof r=="function"&&(r=o(r)),r?Ho(e,r,t):Vo(e,n,t)});function Ho(e,t,n){Wn(e,Bt,""),{enter:r=>{e._x_transition.enter.during=r},"enter-start":r=>{e._x_transition.enter.start=r},"enter-end":r=>{e._x_transition.enter.end=r},leave:r=>{e._x_transition.leave.during=r},"leave-start":r=>{e._x_transition.leave.start=r},"leave-end":r=>{e._x_transition.leave.end=r}}[n](t)}function Vo(e,t,n){Wn(e,He);let r=!t.includes("in")&&!t.includes("out")&&!n,o=r||t.includes("in")||["enter"].includes(n),i=r||t.includes("out")||["leave"].includes(n);t.includes("in")&&!r&&(t=t.filter((v,y)=>y<t.indexOf("out"))),t.includes("out")&&!r&&(t=t.filter((v,y)=>y>t.indexOf("out")));let a=!t.includes("opacity")&&!t.includes("scale"),s=a||t.includes("opacity"),l=a||t.includes("scale"),u=s?0:1,d=l?ge(t,"scale",95)/100:1,p=ge(t,"delay",0),g=ge(t,"origin","center"),M="opacity, transform",E=ge(t,"duration",150)/1e3,se=ge(t,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";o&&(e._x_transition.enter.during={transformOrigin:g,transitionDelay:p,transitionProperty:M,transitionDuration:`${E}s`,transitionTimingFunction:f},e._x_transition.enter.start={opacity:u,transform:`scale(${d})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),i&&(e._x_transition.leave.during={transformOrigin:g,transitionDelay:p,transitionProperty:M,transitionDuration:`${se}s`,transitionTimingFunction:f},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:u,transform:`scale(${d})`})}function Wn(e,t,n={}){e._x_transition||(e._x_transition={enter:{during:n,start:n,end:n},leave:{during:n,start:n,end:n},in(r=()=>{},o=()=>{}){wt(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},r,o)},out(r=()=>{},o=()=>{}){wt(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},r,o)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,n,r){let o=document.visibilityState==="visible"?requestAnimationFrame:setTimeout,i=()=>o(n);if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(n):i():e._x_transition?e._x_transition.in(n):i();return}e._x_hidePromise=e._x_transition?new Promise((a,s)=>{e._x_transition.out(()=>{},()=>a(r)),e._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(r),queueMicrotask(()=>{let a=Un(e);a?(a._x_hideChildren||(a._x_hideChildren=[]),a._x_hideChildren.push(e)):o(()=>{let s=l=>{let u=Promise.all([l._x_hidePromise,...(l._x_hideChildren||[]).map(s)]).then(([d])=>d());return delete l._x_hidePromise,delete l._x_hideChildren,u};s(e).catch(l=>{if(!l.isFromCancelledTransition)throw l})})})};function Un(e){let t=e.parentNode;if(t)return t._x_hidePromise?t:Un(t)}function wt(e,t,{during:n,start:r,end:o}={},i=()=>{},a=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(n).length===0&&Object.keys(r).length===0&&Object.keys(o).length===0){i(),a();return}let s,l,u;Wo(e,{start(){s=t(e,r)},during(){l=t(e,n)},before:i,end(){s(),u=t(e,o)},after:a,cleanup(){l(),u()}})}function Wo(e,t){let n,r,o,i=yt(()=>{C(()=>{n=!0,r||t.before(),o||(t.end(),xt()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(a){this.beforeCancels.push(a)},cancel:yt(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();i()}),finish:i},C(()=>{t.start(),t.during()}),Mo(),requestAnimationFrame(()=>{if(n)return;let a=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,s=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;a===0&&(a=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),C(()=>{t.before()}),r=!0,requestAnimationFrame(()=>{n||(C(()=>{t.end()}),xt(),setTimeout(e._x_transitioning.finish,a+s),o=!0)})})}function ge(e,t,n){if(e.indexOf(t)===-1)return n;let r=e[e.indexOf(t)+1];if(!r||t==="scale"&&isNaN(r))return n;if(t==="duration"){let o=r.match(/([0-9]+)ms/);if(o)return o[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[r,e[e.indexOf(t)+2]].join(" "):r}var Et=!1;function Ve(e,t=()=>{}){return(...n)=>Et?t(...n):e(...n)}function Uo(e,t){t._x_dataStack||(t._x_dataStack=e._x_dataStack),Et=!0,Xo(()=>{Ko(t)}),Et=!1}function Ko(e){let t=!1;Z(e,(n,r)=>{oe(n,(o,i)=>{if(t&&Bo(o))return i();t=!0,r(o,i)})})}function Xo(e){let t=Ae;sn((n,r)=>{let o=t(n);return qe(o),()=>{}}),e(),sn(t)}function Kn(e,t,n,r=[]){switch(e._x_bindings||(e._x_bindings=me({})),e._x_bindings[t]=n,t=r.includes("camel")?ti(t):t,t){case"value":Jo(e,n);break;case"style":Yo(e,n);break;case"class":Zo(e,n);break;default:Go(e,t,n);break}}function Jo(e,t){if(e.type==="radio")e.attributes.value===void 0&&(e.value=t),window.fromModel&&(e.checked=cn(e.value,t));else if(e.type==="checkbox")Number.isInteger(t)?e.value=t:!Number.isInteger(t)&&!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(n=>cn(n,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")ei(e,t);else{if(e.value===t)return;e.value=t}}function Zo(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=Bt(e,t)}function Yo(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=He(e,t)}function Go(e,t,n){[null,void 0,!1].includes(n)&&ni(t)?e.removeAttribute(t):(Xn(t)&&(n=t),Qo(e,t,n))}function Qo(e,t,n){e.getAttribute(t)!=n&&e.setAttribute(t,n)}function ei(e,t){let n=[].concat(t).map(r=>r+"");Array.from(e.options).forEach(r=>{r.selected=n.includes(r.value)})}function ti(e){return e.toLowerCase().replace(/-(\w)/g,(t,n)=>n.toUpperCase())}function cn(e,t){return e==t}function Xn(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function ni(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function ri(e,t,n){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];let r=e.getAttribute(t);return r===null?typeof n=="function"?n():n:r===""?!0:Xn(t)?!![t,"true"].includes(r):r}function Jn(e,t){var n;return function(){var r=this,o=arguments,i=function(){n=null,e.apply(r,o)};clearTimeout(n),n=setTimeout(i,t)}}function Zn(e,t){let n;return function(){let r=this,o=arguments;n||(e.apply(r,o),n=!0,setTimeout(()=>n=!1,t))}}function oi(e){e(Oe)}var ee={},dn=!1;function ii(e,t){if(dn||(ee=me(ee),dn=!0),t===void 0)return ee[e];ee[e]=t,typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&ee[e].init(),En(ee[e])}function ai(){return ee}var Yn={};function si(e,t){let n=typeof t!="function"?()=>t:t;e instanceof Element?Gn(e,n()):Yn[e]=n}function li(e){return Object.entries(Yn).forEach(([t,n])=>{Object.defineProperty(e,t,{get(){return(...r)=>n(...r)}})}),e}function Gn(e,t,n){let r=[];for(;r.length;)r.pop()();let o=Object.entries(t).map(([a,s])=>({name:a,value:s})),i=$n(o);o=o.map(a=>i.find(s=>s.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),jt(e,o,n).map(a=>{r.push(a.runCleanups),a()})}var Qn={};function ui(e,t){Qn[e]=t}function ci(e,t){return Object.entries(Qn).forEach(([n,r])=>{Object.defineProperty(e,n,{get(){return(...o)=>r.bind(t)(...o)},enumerable:!1})}),e}var di={get reactive(){return me},get release(){return qe},get effect(){return Ae},get raw(){return hn},version:"3.10.5",flushAndStopDeferringMutations:wo,dontAutoEvaluateFunctions:Ao,disableEffectScheduling:fo,setReactivityEngine:mo,closestDataStack:ce,skipDuringClone:Ve,addRootSelector:Hn,addInitSelector:Vn,addScopeToNode:Se,deferMutations:yo,mapAttributes:Pt,evaluateLater:$,setEvaluator:So,mergeProxies:Ce,findClosest:Fe,closestRoot:ze,interceptor:kn,transition:wt,setStyles:He,mutateDom:C,directive:k,throttle:Zn,debounce:Jn,evaluate:ue,initTree:Z,nextTick:In,prefixed:pe,prefix:$o,plugin:oi,magic:z,store:ii,start:Ro,clone:Uo,bound:ri,$data:wn,data:ui,bind:si},Oe=di;function er(e,t){let n=Object.create(null),r=e.split(",");for(let o=0;o<r.length;o++)n[r[o]]=!0;return t?o=>!!n[o.toLowerCase()]:o=>!!n[o]}var fi="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Fa=er(fi+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected"),mi=Object.freeze({}),Ha=Object.freeze([]),tr=Object.assign,pi=Object.prototype.hasOwnProperty,We=(e,t)=>pi.call(e,t),ne=Array.isArray,Ee=e=>nr(e)==="[object Map]",hi=e=>typeof e=="string",Dt=e=>typeof e=="symbol",Ue=e=>e!==null&&typeof e=="object",_i=Object.prototype.toString,nr=e=>_i.call(e),rr=e=>nr(e).slice(8,-1),It=e=>hi(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ke=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},vi=/-(\w)/g,Va=Ke(e=>e.replace(vi,(t,n)=>n?n.toUpperCase():"")),gi=/\B([A-Z])/g,Wa=Ke(e=>e.replace(gi,"-$1").toLowerCase()),or=Ke(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ua=Ke(e=>e?`on${or(e)}`:""),ir=(e,t)=>e!==t&&(e===e||t===t),kt=new WeakMap,be=[],V,re=Symbol("iterate"),At=Symbol("Map key iterate");function bi(e){return e&&e._isEffect===!0}function xi(e,t=mi){bi(e)&&(e=e.raw);let n=Ei(e,t);return t.lazy||n(),n}function yi(e){e.active&&(ar(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var wi=0;function Ei(e,t){let n=function(){if(!n.active)return e();if(!be.includes(n)){ar(n);try{return Ai(),be.push(n),V=n,e()}finally{be.pop(),sr(),V=be[be.length-1]}}};return n.id=wi++,n.allowRecurse=!!t.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=e,n.deps=[],n.options=t,n}function ar(e){let{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}var fe=!0,qt=[];function ki(){qt.push(fe),fe=!1}function Ai(){qt.push(fe),fe=!0}function sr(){let e=qt.pop();fe=e===void 0?!0:e}function q(e,t,n){if(!fe||V===void 0)return;let r=kt.get(e);r||kt.set(e,r=new Map);let o=r.get(n);o||r.set(n,o=new Set),o.has(V)||(o.add(V),V.deps.push(o),V.options.onTrack&&V.options.onTrack({effect:V,target:e,type:t,key:n}))}function Y(e,t,n,r,o,i){let a=kt.get(e);if(!a)return;let s=new Set,l=d=>{d&&d.forEach(p=>{(p!==V||p.allowRecurse)&&s.add(p)})};if(t==="clear")a.forEach(l);else if(n==="length"&&ne(e))a.forEach((d,p)=>{(p==="length"||p>=r)&&l(d)});else switch(n!==void 0&&l(a.get(n)),t){case"add":ne(e)?It(n)&&l(a.get("length")):(l(a.get(re)),Ee(e)&&l(a.get(At)));break;case"delete":ne(e)||(l(a.get(re)),Ee(e)&&l(a.get(At)));break;case"set":Ee(e)&&l(a.get(re));break}let u=d=>{d.options.onTrigger&&d.options.onTrigger({effect:d,target:e,key:n,type:t,newValue:r,oldValue:o,oldTarget:i}),d.options.scheduler?d.options.scheduler(d):d()};s.forEach(u)}var Si=er("__proto__,__v_isRef,__isVue"),lr=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(Dt)),Ci=Xe(),Oi=Xe(!1,!0),Ti=Xe(!0),$i=Xe(!0,!0),Ie={};["includes","indexOf","lastIndexOf"].forEach(e=>{let t=Array.prototype[e];Ie[e]=function(...n){let r=x(this);for(let i=0,a=this.length;i<a;i++)q(r,"get",i+"");let o=t.apply(r,n);return o===-1||o===!1?t.apply(r,n.map(x)):o}});["push","pop","shift","unshift","splice"].forEach(e=>{let t=Array.prototype[e];Ie[e]=function(...n){ki();let r=t.apply(this,n);return sr(),r}});function Xe(e=!1,t=!1){return function(n,r,o){if(r==="__v_isReactive")return!e;if(r==="__v_isReadonly")return e;if(r==="__v_raw"&&o===(e?t?qi:wr:t?Ii:yr).get(n))return n;let i=ne(n);if(!e&&i&&We(Ie,r))return Reflect.get(Ie,r,o);let a=Reflect.get(n,r,o);return(Dt(r)?lr.has(r):Si(r))||(e||q(n,"get",r),t)?a:St(a)?!i||!It(r)?a.value:a:Ue(a)?e?Er(a):Vt(a):a}}var Li=ur(),Ni=ur(!0);function ur(e=!1){return function(t,n,r,o){let i=t[n];if(!e&&(r=x(r),i=x(i),!ne(t)&&St(i)&&!St(r)))return i.value=r,!0;let a=ne(t)&&It(n)?Number(n)<t.length:We(t,n),s=Reflect.set(t,n,r,o);return t===x(o)&&(a?ir(r,i)&&Y(t,"set",n,r,i):Y(t,"add",n,r)),s}}function ji(e,t){let n=We(e,t),r=e[t],o=Reflect.deleteProperty(e,t);return o&&n&&Y(e,"delete",t,void 0,r),o}function Pi(e,t){let n=Reflect.has(e,t);return(!Dt(t)||!lr.has(t))&&q(e,"has",t),n}function Mi(e){return q(e,"iterate",ne(e)?"length":re),Reflect.ownKeys(e)}var cr={get:Ci,set:Li,deleteProperty:ji,has:Pi,ownKeys:Mi},dr={get:Ti,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},Ka=tr({},cr,{get:Oi,set:Ni}),Xa=tr({},dr,{get:$i}),zt=e=>Ue(e)?Vt(e):e,Ft=e=>Ue(e)?Er(e):e,Ht=e=>e,Je=e=>Reflect.getPrototypeOf(e);function Ze(e,t,n=!1,r=!1){e=e.__v_raw;let o=x(e),i=x(t);t!==i&&!n&&q(o,"get",t),!n&&q(o,"get",i);let{has:a}=Je(o),s=r?Ht:n?Ft:zt;if(a.call(o,t))return s(e.get(t));if(a.call(o,i))return s(e.get(i));e!==o&&e.get(t)}function Ye(e,t=!1){let n=this.__v_raw,r=x(n),o=x(e);return e!==o&&!t&&q(r,"has",e),!t&&q(r,"has",o),e===o?n.has(e):n.has(e)||n.has(o)}function Ge(e,t=!1){return e=e.__v_raw,!t&&q(x(e),"iterate",re),Reflect.get(e,"size",e)}function fr(e){e=x(e);let t=x(this);return Je(t).has.call(t,e)||(t.add(e),Y(t,"add",e,e)),this}function mr(e,t){t=x(t);let n=x(this),{has:r,get:o}=Je(n),i=r.call(n,e);i?xr(n,r,e):(e=x(e),i=r.call(n,e));let a=o.call(n,e);return n.set(e,t),i?ir(t,a)&&Y(n,"set",e,t,a):Y(n,"add",e,t),this}function pr(e){let t=x(this),{has:n,get:r}=Je(t),o=n.call(t,e);o?xr(t,n,e):(e=x(e),o=n.call(t,e));let i=r?r.call(t,e):void 0,a=t.delete(e);return o&&Y(t,"delete",e,void 0,i),a}function hr(){let e=x(this),t=e.size!==0,n=Ee(e)?new Map(e):new Set(e),r=e.clear();return t&&Y(e,"clear",void 0,void 0,n),r}function Qe(e,t){return function(n,r){let o=this,i=o.__v_raw,a=x(i),s=t?Ht:e?Ft:zt;return!e&&q(a,"iterate",re),i.forEach((l,u)=>n.call(r,s(l),s(u),o))}}function Pe(e,t,n){return function(...r){let o=this.__v_raw,i=x(o),a=Ee(i),s=e==="entries"||e===Symbol.iterator&&a,l=e==="keys"&&a,u=o[e](...r),d=n?Ht:t?Ft:zt;return!t&&q(i,"iterate",l?At:re),{next(){let{value:p,done:g}=u.next();return g?{value:p,done:g}:{value:s?[d(p[0]),d(p[1])]:d(p),done:g}},[Symbol.iterator](){return this}}}}function J(e){return function(...t){{let n=t[0]?`on key "${t[0]}" `:"";console.warn(`${or(e)} operation ${n}failed: target is readonly.`,x(this))}return e==="delete"?!1:this}}var _r={get(e){return Ze(this,e)},get size(){return Ge(this)},has:Ye,add:fr,set:mr,delete:pr,clear:hr,forEach:Qe(!1,!1)},vr={get(e){return Ze(this,e,!1,!0)},get size(){return Ge(this)},has:Ye,add:fr,set:mr,delete:pr,clear:hr,forEach:Qe(!1,!0)},gr={get(e){return Ze(this,e,!0)},get size(){return Ge(this,!0)},has(e){return Ye.call(this,e,!0)},add:J("add"),set:J("set"),delete:J("delete"),clear:J("clear"),forEach:Qe(!0,!1)},br={get(e){return Ze(this,e,!0,!0)},get size(){return Ge(this,!0)},has(e){return Ye.call(this,e,!0)},add:J("add"),set:J("set"),delete:J("delete"),clear:J("clear"),forEach:Qe(!0,!0)},Ri=["keys","values","entries",Symbol.iterator];Ri.forEach(e=>{_r[e]=Pe(e,!1,!1),gr[e]=Pe(e,!0,!1),vr[e]=Pe(e,!1,!0),br[e]=Pe(e,!0,!0)});function et(e,t){let n=t?e?br:vr:e?gr:_r;return(r,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(We(n,o)&&o in r?n:r,o,i)}var Bi={get:et(!1,!1)},Ja={get:et(!1,!0)},Di={get:et(!0,!1)},Za={get:et(!0,!0)};function xr(e,t,n){let r=x(n);if(r!==n&&t.call(e,r)){let o=rr(e);console.warn(`Reactive ${o} contains both the raw and reactive versions of the same object${o==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var yr=new WeakMap,Ii=new WeakMap,wr=new WeakMap,qi=new WeakMap;function zi(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Fi(e){return e.__v_skip||!Object.isExtensible(e)?0:zi(rr(e))}function Vt(e){return e&&e.__v_isReadonly?e:kr(e,!1,cr,Bi,yr)}function Er(e){return kr(e,!0,dr,Di,wr)}function kr(e,t,n,r,o){if(!Ue(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let i=o.get(e);if(i)return i;let a=Fi(e);if(a===0)return e;let s=new Proxy(e,a===2?r:n);return o.set(e,s),s}function x(e){return e&&x(e.__v_raw)||e}function St(e){return Boolean(e&&e.__v_isRef===!0)}z("nextTick",()=>In);z("dispatch",e=>we.bind(we,e));z("watch",(e,{evaluateLater:t,effect:n})=>(r,o)=>{let i=t(r),a=!0,s,l=n(()=>i(u=>{JSON.stringify(u),a?s=u:queueMicrotask(()=>{o(u,s),s=u}),a=!1}));e._x_effects.delete(l)});z("store",ai);z("data",e=>wn(e));z("root",e=>ze(e));z("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=Ce(Hi(e))),e._x_refs_proxy));function Hi(e){let t=[],n=e;for(;n;)n._x_refs&&t.push(n._x_refs),n=n.parentNode;return t}var ct={};function Ar(e){return ct[e]||(ct[e]=0),++ct[e]}function Vi(e,t){return Fe(e,n=>{if(n._x_ids&&n._x_ids[t])return!0})}function Wi(e,t){e._x_ids||(e._x_ids={}),e._x_ids[t]||(e._x_ids[t]=Ar(t))}z("id",e=>(t,n=null)=>{let r=Vi(e,t),o=r?r._x_ids[t]:Ar(t);return n?`${t}-${o}-${n}`:`${t}-${o}`});z("el",e=>e);Sr("Focus","focus","focus");Sr("Persist","persist","persist");function Sr(e,t,n){z(t,r=>de(`You can't use [$${directiveName}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,r))}k("modelable",(e,{expression:t},{effect:n,evaluateLater:r})=>{let o=r(t),i=()=>{let u;return o(d=>u=d),u},a=r(`${t} = __placeholder`),s=u=>a(()=>{},{scope:{__placeholder:u}}),l=i();s(l),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let u=e._x_model.get,d=e._x_model.set;n(()=>s(u())),n(()=>d(i()))})});k("teleport",(e,{expression:t},{cleanup:n})=>{e.tagName.toLowerCase()!=="template"&&de("x-teleport can only be used on a <template> tag",e);let r=document.querySelector(t);r||de(`Cannot find x-teleport element for selector: "${t}"`);let o=e.content.cloneNode(!0).firstElementChild;e._x_teleport=o,o._x_teleportBack=e,e._x_forwardEvents&&e._x_forwardEvents.forEach(i=>{o.addEventListener(i,a=>{a.stopPropagation(),e.dispatchEvent(new a.constructor(a.type,a))})}),Se(o,{},e),C(()=>{r.appendChild(o),Z(o),o._x_ignore=!0}),n(()=>o.remove())});var Cr=()=>{};Cr.inline=(e,{modifiers:t},{cleanup:n})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,n(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};k("ignore",Cr);k("effect",(e,{expression:t},{effect:n})=>n($(e,t)));function Or(e,t,n,r){let o=e,i=l=>r(l),a={},s=(l,u)=>d=>u(l,d);if(n.includes("dot")&&(t=Ui(t)),n.includes("camel")&&(t=Ki(t)),n.includes("passive")&&(a.passive=!0),n.includes("capture")&&(a.capture=!0),n.includes("window")&&(o=window),n.includes("document")&&(o=document),n.includes("prevent")&&(i=s(i,(l,u)=>{u.preventDefault(),l(u)})),n.includes("stop")&&(i=s(i,(l,u)=>{u.stopPropagation(),l(u)})),n.includes("self")&&(i=s(i,(l,u)=>{u.target===e&&l(u)})),(n.includes("away")||n.includes("outside"))&&(o=document,i=s(i,(l,u)=>{e.contains(u.target)||u.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&l(u))})),n.includes("once")&&(i=s(i,(l,u)=>{l(u),o.removeEventListener(t,i,a)})),i=s(i,(l,u)=>{Ji(t)&&Zi(u,n)||l(u)}),n.includes("debounce")){let l=n[n.indexOf("debounce")+1]||"invalid-wait",u=Ct(l.split("ms")[0])?Number(l.split("ms")[0]):250;i=Jn(i,u)}if(n.includes("throttle")){let l=n[n.indexOf("throttle")+1]||"invalid-wait",u=Ct(l.split("ms")[0])?Number(l.split("ms")[0]):250;i=Zn(i,u)}return o.addEventListener(t,i,a),()=>{o.removeEventListener(t,i,a)}}function Ui(e){return e.replace(/-/g,".")}function Ki(e){return e.toLowerCase().replace(/-(\w)/g,(t,n)=>n.toUpperCase())}function Ct(e){return!Array.isArray(e)&&!isNaN(e)}function Xi(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Ji(e){return["keydown","keyup"].includes(e)}function Zi(e,t){let n=t.filter(o=>!["window","document","prevent","stop","once"].includes(o));if(n.includes("debounce")){let o=n.indexOf("debounce");n.splice(o,Ct((n[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(n.length===0||n.length===1&&fn(e.key).includes(n[0]))return!1;let r=["ctrl","shift","alt","meta","cmd","super"].filter(o=>n.includes(o));return n=n.filter(o=>!r.includes(o)),!(r.length>0&&r.filter(o=>((o==="cmd"||o==="super")&&(o="meta"),e[`${o}Key`])).length===r.length&&fn(e.key).includes(n[0]))}function fn(e){if(!e)return[];e=Xi(e);let t={ctrl:"control",slash:"/",space:"-",spacebar:"-",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"="};return t[e]=e,Object.keys(t).map(n=>{if(t[n]===e)return n}).filter(n=>n)}k("model",(e,{modifiers:t,expression:n},{effect:r,cleanup:o})=>{let i=$(e,n),a=`${n} = rightSideOfExpression($event, ${n})`,s=$(e,a);var l=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let u=Yi(e,t,n),d=Or(e,l,t,g=>{s(()=>{},{scope:{$event:g,rightSideOfExpression:u}})});e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=d,o(()=>e._x_removeModelListeners.default());let p=$(e,`${n} = __placeholder`);e._x_model={get(){let g;return i(M=>g=M),g},set(g){p(()=>{},{scope:{__placeholder:g}})}},e._x_forceModelUpdate=()=>{i(g=>{g===void 0&&n.match(/\./)&&(g=""),window.fromModel=!0,C(()=>Kn(e,"value",g)),delete window.fromModel})},r(()=>{t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate()})});function Yi(e,t,n){return e.type==="radio"&&C(()=>{e.hasAttribute("name")||e.setAttribute("name",n)}),(r,o)=>C(()=>{if(r instanceof CustomEvent&&r.detail!==void 0)return r.detail||r.target.value;if(e.type==="checkbox")if(Array.isArray(o)){let i=t.includes("number")?dt(r.target.value):r.target.value;return r.target.checked?o.concat([i]):o.filter(a=>!Gi(a,i))}else return r.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(r.target.selectedOptions).map(i=>{let a=i.value||i.text;return dt(a)}):Array.from(r.target.selectedOptions).map(i=>i.value||i.text);{let i=r.target.value;return t.includes("number")?dt(i):t.includes("trim")?i.trim():i}}})}function dt(e){let t=e?parseFloat(e):null;return Qi(t)?t:e}function Gi(e,t){return e==t}function Qi(e){return!Array.isArray(e)&&!isNaN(e)}k("cloak",e=>queueMicrotask(()=>C(()=>e.removeAttribute(pe("cloak")))));Vn(()=>`[${pe("init")}]`);k("init",Ve((e,{expression:t},{evaluate:n})=>typeof t=="string"?!!t.trim()&&n(t,{},!1):n(t,{},!1)));k("text",(e,{expression:t},{effect:n,evaluateLater:r})=>{let o=r(t);n(()=>{o(i=>{C(()=>{e.textContent=i})})})});k("html",(e,{expression:t},{effect:n,evaluateLater:r})=>{let o=r(t);n(()=>{o(i=>{C(()=>{e.innerHTML=i,e._x_ignoreSelf=!0,Z(e),delete e._x_ignoreSelf})})})});Pt(jn(":",Pn(pe("bind:"))));k("bind",(e,{value:t,modifiers:n,expression:r,original:o},{effect:i})=>{if(!t){let s={};li(s),$(e,r)(l=>{Gn(e,l,o)},{scope:s});return}if(t==="key")return ea(e,r);let a=$(e,r);i(()=>a(s=>{s===void 0&&typeof r=="string"&&r.match(/\./)&&(s=""),C(()=>Kn(e,t,s,n))}))});function ea(e,t){e._x_keyExpression=t}Hn(()=>`[${pe("data")}]`);k("data",Ve((e,{expression:t},{cleanup:n})=>{t=t===""?"{}":t;let r={};_t(r,e);let o={};ci(o,r);let i=ue(e,t,{scope:o});i===void 0&&(i={}),_t(i,e);let a=me(i);En(a);let s=Se(e,a);a.init&&ue(e,a.init),n(()=>{a.destroy&&ue(e,a.destroy),s()})}));k("show",(e,{modifiers:t,expression:n},{effect:r})=>{let o=$(e,n);e._x_doHide||(e._x_doHide=()=>{C(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})}),e._x_doShow||(e._x_doShow=()=>{C(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display")})});let i=()=>{e._x_doHide(),e._x_isShown=!1},a=()=>{e._x_doShow(),e._x_isShown=!0},s=()=>setTimeout(a),l=yt(p=>p?a():i(),p=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,p,a,i):p?s():i()}),u,d=!0;r(()=>o(p=>{!d&&p===u||(t.includes("immediate")&&(p?s():i()),l(p),u=p,d=!1)}))});k("for",(e,{expression:t},{effect:n,cleanup:r})=>{let o=na(t),i=$(e,o.items),a=$(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},n(()=>ta(e,o,i,a)),r(()=>{Object.values(e._x_lookup).forEach(s=>s.remove()),delete e._x_prevKeys,delete e._x_lookup})});function ta(e,t,n,r){let o=a=>typeof a=="object"&&!Array.isArray(a),i=e;n(a=>{ra(a)&&a>=0&&(a=Array.from(Array(a).keys(),f=>f+1)),a===void 0&&(a=[]);let s=e._x_lookup,l=e._x_prevKeys,u=[],d=[];if(o(a))a=Object.entries(a).map(([f,v])=>{let y=mn(t,v,f,a);r(O=>d.push(O),{scope:Re({index:f},y)}),u.push(y)});else for(let f=0;f<a.length;f++){let v=mn(t,a[f],f,a);r(y=>d.push(y),{scope:Re({index:f},v)}),u.push(v)}let p=[],g=[],M=[],E=[];for(let f=0;f<l.length;f++){let v=l[f];d.indexOf(v)===-1&&M.push(v)}l=l.filter(f=>!M.includes(f));let se="template";for(let f=0;f<d.length;f++){let v=d[f],y=l.indexOf(v);if(y===-1)l.splice(f,0,v),p.push([se,f]);else if(y!==f){let O=l.splice(f,1)[0],N=l.splice(y-1,1)[0];l.splice(f,0,N),l.splice(y,0,O),g.push([O,N])}else E.push(v);se=v}for(let f=0;f<M.length;f++){let v=M[f];s[v]._x_effects&&s[v]._x_effects.forEach(pn),s[v].remove(),s[v]=null,delete s[v]}for(let f=0;f<g.length;f++){let[v,y]=g[f],O=s[v],N=s[y],X=document.createElement("div");C(()=>{N.after(X),O.after(N),N._x_currentIfEl&&N.after(N._x_currentIfEl),X.before(O),O._x_currentIfEl&&O.after(O._x_currentIfEl),X.remove()}),ln(N,u[d.indexOf(y)])}for(let f=0;f<p.length;f++){let[v,y]=p[f],O=v==="template"?i:s[v];O._x_currentIfEl&&(O=O._x_currentIfEl);let N=u[y],X=d[y],I=document.importNode(i.content,!0).firstElementChild;Se(I,me(N),i),C(()=>{O.after(I),Z(I)}),typeof X=="object"&&de("x-for key cannot be an object, it must be a string or an integer",i),s[X]=I}for(let f=0;f<E.length;f++)ln(s[E[f]],u[d.indexOf(E[f])]);i._x_prevKeys=d})}function na(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,n=/^\s*\(|\)\s*$/g,r=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,o=e.match(r);if(!o)return;let i={};i.items=o[2].trim();let a=o[1].replace(n,"").trim(),s=a.match(t);return s?(i.item=a.replace(t,"").trim(),i.index=s[1].trim(),s[2]&&(i.collection=s[2].trim())):i.item=a,i}function mn(e,t,n,r){let o={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(i=>i.trim()).forEach((i,a)=>{o[i]=t[a]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(i=>i.trim()).forEach(i=>{o[i]=t[i]}):o[e.item]=t,e.index&&(o[e.index]=n),e.collection&&(o[e.collection]=r),o}function ra(e){return!Array.isArray(e)&&!isNaN(e)}function Tr(){}Tr.inline=(e,{expression:t},{cleanup:n})=>{let r=ze(e);r._x_refs||(r._x_refs={}),r._x_refs[t]=e,n(()=>delete r._x_refs[t])};k("ref",Tr);k("if",(e,{expression:t},{effect:n,cleanup:r})=>{let o=$(e,t),i=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let s=e.content.cloneNode(!0).firstElementChild;return Se(s,{},e),C(()=>{e.after(s),Z(s)}),e._x_currentIfEl=s,e._x_undoIf=()=>{oe(s,l=>{l._x_effects&&l._x_effects.forEach(pn)}),s.remove(),delete e._x_currentIfEl},s},a=()=>{e._x_undoIf&&(e._x_undoIf(),delete e._x_undoIf)};n(()=>o(s=>{s?i():a()})),r(()=>e._x_undoIf&&e._x_undoIf())});k("id",(e,{expression:t},{evaluate:n})=>{n(t).forEach(r=>Wi(e,r))});Pt(jn("@",Pn(pe("on:"))));k("on",Ve((e,{value:t,modifiers:n,expression:r},{cleanup:o})=>{let i=r?$(e,r):()=>{};e.tagName.toLowerCase()==="template"&&(e._x_forwardEvents||(e._x_forwardEvents=[]),e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let a=Or(e,t,n,s=>{i(()=>{},{scope:{$event:s},params:[s]})});o(()=>a())}));tt("Collapse","collapse","collapse");tt("Intersect","intersect","intersect");tt("Focus","trap","focus");tt("Mask","mask","mask");function tt(e,t,n){k(t,r=>de(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,r))}Oe.setEvaluator(On);Oe.setReactivityEngine({reactive:Vt,effect:xi,release:yi,raw:x});var oa=Oe,$r=oa,ia=class{constructor(e){an(this,"el"),an(this,"traversals",{first:"firstElementChild",next:"nextElementSibling",parent:"parentElement"}),this.el=e}nodes(){return this.traversals={first:"firstChild",next:"nextSibling",parent:"parentNode"},this}first(){return this.teleportTo(this.el[this.traversals.first])}next(){return this.teleportTo(this.teleportBack(this.el[this.traversals.next]))}before(e){return this.el[this.traversals.parent].insertBefore(e,this.el),e}replace(e){return this.el[this.traversals.parent].replaceChild(e,this.el),e}append(e){return this.el.appendChild(e),e}teleportTo(e){return e&&(e._x_teleport?e._x_teleport:e)}teleportBack(e){return e&&(e._x_teleportBack?e._x_teleportBack:e)}};function S(e){return new ia(e)}function aa(e){let t=document.createElement("template");return t.innerHTML=e,t.content.firstElementChild}function sa(e){return e.nodeType===3||e.nodeType===8}var Lr=()=>{},Nr=()=>{};async function Wt(e,t,n){let r,o,i,a,s,l,u,d,p,g,M;function E(c){if(M)return Nr((c||"").replace(`
|
6
|
+
`,"\\n"),r,o),new Promise(m=>Lr=()=>m())}function se(c={}){let m=R=>R.getAttribute("key"),h=()=>{};s=c.updating||h,l=c.updated||h,u=c.removing||h,d=c.removed||h,p=c.adding||h,g=c.added||h,i=c.key||m,a=c.lookahead||!1,M=c.debug||!1}async function f(c,m){if(v(c,m)){let R=y(c,m);return await E("Swap elements"),R}let h=!1;if(!le(s,c,m,()=>h=!0)){if(window.Alpine&&la(c,m,()=>h=!0),sa(m)){await O(c,m),l(c,m);return}h||await N(c,m),l(c,m),await X(c,m)}}function v(c,m){return c.nodeType!=m.nodeType||c.nodeName!=m.nodeName||I(c)!=I(m)}function y(c,m){if(le(u,c))return;let h=m.cloneNode(!0);le(p,h)||(S(c).replace(h),d(c),g(h))}async function O(c,m){let h=m.nodeValue;c.nodeValue!==h&&(c.nodeValue=h,await E("Change text node to: "+h))}async function N(c,m){if(c._x_isShown&&!m._x_isShown||!c._x_isShown&&m._x_isShown)return;let h=Array.from(c.attributes),R=Array.from(m.attributes);for(let U=h.length-1;U>=0;U--){let F=h[U].name;m.hasAttribute(F)||(c.removeAttribute(F),await E("Remove attribute"))}for(let U=R.length-1;U>=0;U--){let F=R[U].name,w=R[U].value;c.getAttribute(F)!==w&&(c.setAttribute(F,w),await E(`Set [${F}] attribute to: "${w}"`))}}async function X(c,m){let h=c.childNodes,R=m.childNodes,U=en(R),F=en(h),w=S(m).nodes().first(),_=S(c).nodes().first(),Q={};for(;w;){let j=I(w),H=I(_);if(!_)if(j&&Q[j]){let P=Q[j];S(c).append(P),_=P,await E("Add element (from key)")}else{let P=Ur(w,c)||{};await E("Add element: "+(P.outerHTML||P.nodeValue)),w=S(w).nodes().next();continue}if(a){let P=S(w).next(),tn=!1;for(;!tn&&P;)_.isEqualNode(P)&&(tn=!0,_=at(w,_),H=I(_),await E("Move element (lookahead)")),P=S(P).next()}if(j!==H){if(!j&&H){Q[H]=_,_=at(w,_),Q[H].remove(),_=S(_).nodes().next(),w=S(w).nodes().next(),await E('No "to" key');continue}if(j&&!H&&F[j]&&(_=S(_).replace(F[j]),await E('No "from" key')),j&&H){Q[H]=_;let P=F[j];if(P)_=S(_).replace(P),await E('Move "from" key');else{Q[H]=_,_=at(w,_),Q[H].remove(),_=S(_).next(),w=S(w).next(),await E("Swap elements with keys");continue}}}let Kr=_&&S(_).nodes().next();await f(_,w),w=w&&S(w).nodes().next(),_=Kr}let st=[];for(;_;)le(u,_)||st.push(_),_=S(_).nodes().next();for(;st.length;){let j=st.shift();j.remove(),await E("remove el"),d(j)}}function I(c){return c&&c.nodeType===1&&i(c)}function en(c){let m={};return c.forEach(h=>{let R=I(h);R&&(m[R]=h)}),m}function Ur(c,m){if(!le(p,c)){let h=c.cloneNode(!0);return S(m).append(h),g(h),h}return null}function at(c,m){if(!le(p,c)){let h=c.cloneNode(!0);return S(m).before(h),g(h),h}return m}return se(n),r=e,o=aa(t),window.Alpine&&window.Alpine.closestDataStack&&!e._x_dataStack&&(o._x_dataStack=window.Alpine.closestDataStack(e),o._x_dataStack&&window.Alpine.clone(e,o)),await E(),await f(e,o),r=void 0,o=void 0,e}Wt.step=()=>Lr();Wt.log=e=>{Nr=e};function le(e,...t){let n=!1;return e(...t,()=>n=!0),n}function la(e,t,n){e.nodeType===1&&e._x_dataStack&&window.Alpine.clone(e,t)}function ua(e){e.morph=Wt}var ca=ua;$r.plugin(ca);var da=/INPUT/i,fa=/date|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/i,ma=/TEXTAREA/i;function pa(e,t,n,r){if(!(e.nodeType!==Node.ELEMENT_NODE||e!==document.activeElement)&&(e.tagName.match(ma)||e.tagName.match(da)&&e.getAttribute("type").match(fa)))return r()}function ha(e,t){e.forEach(n=>$r.morph(n,t,{updating:pa}))}var _a=ha;function va(e,t,n){if(e.match(/^dispatch(Event)?$/))return ao(n,t[0],t[1]||{});if(e.match(/^morph|mutate$/))return _a(n,t[0]);if(e.endsWith("="))return n.forEach(r=>r[e.slice(0,-1).trim()]=t[0]);n.forEach(r=>r[e].apply(r,t))}function ga(){let e=JSON.parse(this.templateContent.textContent),{id:t,selector:n,receiver:r,method:o,args:i}=e,a=[self];n&&(a=Array.from(document.querySelectorAll(n))),r&&(a=a.map(s=>{let l=s,u=r.split(".");for(;u.length>0;)l=l[u.shift()];return l})),va(o,i,a)}var jr=ga;if(!self.Turbo)throw new Error("`Turbo` is not defined! Be sure to import `@turbo-boost/streams` after `@hotwired/turbo` or `@hotwired/turbo-rails`.");if(!Turbo.StreamActions)throw new Error("`Turbo.StreamActions` is not defined! Verify that you are running >= `7.2.0` of `@hotwired/turbo`.");Turbo.StreamActions.invoke=jr;self.TurboBoost=self.TurboBoost||{};self.TurboBoost.Streams={invoke:jr};console.info("@turbo-boost/streams has initialized and registered new stream actions with Turbo.");var Ut=class{get element(){return document.querySelector('meta[name="turbo-boost"]')}get token(){return this.element.getAttribute("content")}get busy(){return this.element.dataset.busy==="true"}set busy(t){return this.element.dataset.busy=!!t}},A=new Ut;var L={start:"turbo-boost:command:start",success:"turbo-boost:command:success",finish:"turbo-boost:command:finish",abort:"turbo-boost:command:abort",clientError:"turbo-boost:command:client-error",serverError:"turbo-boost:command:server-error"},W={stateLoad:"turbo-boost:state:load",stateChange:"turbo-boost:state:change"},K=b(b({},L),W);function T(e,t,n={}){n=n||{},n.detail=n.detail||{},t=t||document;let r=new CustomEvent(e,B(b({},n),{bubbles:!0}));return t.dispatchEvent(r),r}var Kt;function nt(e,t=null){if(!e||typeof e!="object")return e;let n=new Proxy(e,{deleteProperty(r,o){return delete r[o],T(W.stateChange,A.element,{detail:{state:Kt}}),!0},set(r,o,i,a){return r[o]=nt(i,this),T(W.stateChange,A.element,{detail:{state:Kt}}),!0}});if(Array.isArray(e))e.forEach((r,o)=>e[o]=nt(r,n));else if(typeof e=="object")for(let[r,o]of Object.entries(e))e[r]=nt(o,n);return t||(Kt=n),n}var Pr=nt;var Xt,he,Te,Mr;function Rr(){if(!A.element)return _e();let e=atob(A.element.dataset.state);Te={},he=Pr(JSON.parse(e)),Xt=b({},he),delete A.element.dataset.clientStateChange,setTimeout(()=>T(W.stateLoad,A.element,{detail:{state:he}}))}function _e(){clearTimeout(Mr),Mr=setTimeout(Rr,10)}Xt||Rr();addEventListener("DOMContentLoaded",_e);addEventListener("load",_e);addEventListener("turbo:load",_e);addEventListener("turbo:frame-load",_e);addEventListener(L.success,_e);addEventListener(W.stateChange,e=>{Te={};for(let[t,n]of Object.entries(he))Xt[t]!==n&&(Te[t]=n);A.element.dataset.clientStateChange=!0,A.element.dataset.state=btoa(JSON.stringify(he))});var ie={events:W,get current(){return he},get delta(){return Te},get payloadChunks(){return btoa(JSON.stringify(Te)).match(/.{1,2000}/g)}};function ba(e){let t="<html",n="</html",r=e.indexOf(t),o=e.lastIndexOf(n);if(r>=0&&o>=0){let i=e.slice(e.indexOf(">",r)+1,o);document.documentElement.innerHTML=i}}function xa(e){document.body.insertAdjacentHTML("beforeend",e)}var ae={append:xa,replaceDocument:ba};var rt={};function ya(e){rt[e.id]=e}function wa(e){delete rt[e]}var ot={add:ya,remove:wa,get commands(){return[...Object.values(rt)]},get length(){return Object.keys(rt).length}};function Br(e){e.detail.endedAt=new Date().getTime(),e.detail.milliseconds=e.detail.endedAt-e.detail.startedAt,setTimeout(()=>T(L.finish,e.target,{detail:e.detail}),25)}addEventListener(L.serverError,Br);addEventListener(L.success,Br);addEventListener(L.finish,e=>ot.remove(e.detail.id),!0);var $e={events:L};var Jt={};addEventListener("turbo:before-fetch-request",e=>{let t=e.target.closest("turbo-frame"),{fetchOptions:n}=e.detail;if(A.busy){let r=["text/vnd.turbo-boost.html",n.headers.Accept];r=r.filter(o=>o&&o.trim().length>0).join(", "),n.headers.Accept=r,n.headers["TurboBoost-Token"]=A.token}ie.payloadChunks.forEach((r,o)=>{n.headers[`TurboBoost-State-${o.toString().padStart(4,"0")}`]=r})});addEventListener("turbo:before-fetch-response",e=>{let t=e.target.closest("turbo-frame"),{fetchResponse:n}=e.detail;if(t&&(Jt[t.id]=t.src),n.header("TurboBoost")){if(n.statusCode<200||n.statusCode>399){let r=`Server returned a ${n.statusCode} status code! TurboBoost Commands require 2XX-3XX status codes.`;T($e.events.clientError,document,{detail:B(b({},e.detail),{error:r})},!0)}n.header("TurboBoost")==="Append"&&(e.preventDefault(),n.responseText.then(r=>ae.append(r)))}});addEventListener("turbo:frame-load",e=>{let t=e.target.closest("turbo-frame");t.dataset.turboBoostSrc=Jt[t.id]||t.src||t.dataset.turboBoostSrc,delete Jt[t.id]});var Ea={frameAttribute:"data-turbo-frame",methodAttribute:"data-turbo-method",commandAttribute:"data-turbo-command"},D=b({},Ea);var it={},Dr;function ka(e,t){it[e]=t,document.addEventListener(e,Dr,!0)}function Aa(e){return Object.keys(it).find(t=>!!it[t].find(n=>Array.from(document.querySelectorAll(n)).find(r=>r===e)))}function Sa(e,t){return e===Aa(t)}var G={events:it,register:ka,isRegisteredForElement:Sa,set handler(e){Dr=e}};function Ca(e){return e.closest(`[${D.commandAttribute}]`)}function Oa(e){return e.closest("turbo-frame")}function Ta(e,t={}){if(e.tagName.toLowerCase()!=="select")return t.value=e.value||null;if(!e.multiple)return t.value=e.options[e.selectedIndex].value;t.values=Array.from(e.options).reduce((n,r)=>(r.selected&&n.push(r.value),n),[])}function $a(e){let t=Array.from(e.attributes).reduce((n,r)=>{let o=r.value;return n[r.name]=o,n},{});return t.tag=e.tagName,t.checked=!!e.checked,t.disabled=!!e.disabled,Ta(e,t),delete t.class,delete t.action,delete t.href,delete t[D.commandAttribute],delete t[D.frameAttribute],t}var Le={buildAttributePayload:$a,findClosestCommand:Ca,findClosestFrame:Oa};function La(e,t={}){t.token=A.token;let n=document.createElement("input");n.type="hidden",n.name="turbo_boost_command",n.value=JSON.stringify(t),e.appendChild(n)}var Ir={invokeCommand:La};function Na(e,t={}){let n=document.createElement("a");n.href=e;let r=new URL(n);return r.searchParams.set("turbo_boost_command",JSON.stringify(t)),r}var ve={build:Na};function ja(e,t){let n=t.src;t=b({},t),delete t.src,e.src=ve.build(n,t)}var Zt={invokeCommand:ja};function Pa(e,t={}){let n=t.src;t=b({},t),delete t.src,delete t.href,e.setAttribute("href",ve.build(n,t))}var qr={invokeCommand:Pa};function Ma(e){let t=e.target;T($e.events.abort,document,{detail:B(b({},e.detail),{xhr:t})})}function Yt(e){let t=e.target;t.getResponseHeader("TurboBoost")==="Append"?ae.append(t.responseText):ae.replaceDocument(t.responseText);let n=`Server returned a ${t.status} status code! TurboBoost Commands require 2XX-3XX status codes.`;T($e.events.clientError,document,{detail:B(b({},e.detail),{error:n,xhr:t})},!0)}function Ra(e){let t=e.target;if(t.status<200||t.status>399)return Yt(e);let n=t.responseText;t.getResponseHeader("TurboBoost")==="Append"?ae.append(t.responseText):ae.replaceDocument(t.responseText)}function Ba(e){let t=e.src;e=b({},e),delete e.src;try{let n=new XMLHttpRequest;n.open("GET",ve.build(t,e),!0),n.setRequestHeader("Accept","text/vnd.turbo-boost.html, text/html, application/xhtml+xml"),n.setRequestHeader("TurboBoost-Token",A.token),ie.payloadChunks.forEach((r,o)=>n.setRequestHeader(`TurboBoost-State-${o.toString().padStart(4,"0")}`,r)),n.addEventListener("abort",Ma),n.addEventListener("error",Yt),n.addEventListener("load",Ra),n.send()}catch(n){let r=`Unexpected error sending HTTP request! ${n.message}`;Yt(n,{detail:{message:r}})}}var zr={invokeCommand:Ba};function Gt(e,t){return t=t||{dataset:{}},e.href||t.src||t.dataset.turboBoostSrc||location.href}function Da(e){let t=Le.findClosestFrame(e),{turboFrame:n,turboMethod:r}=e.dataset;return e.tagName.toLowerCase()==="form"?{name:"form",reason:"Element is a form.",frame:t,src:e.action,invokeCommand:Ir.invokeCommand}:r&&r.length>0?{name:"method",reason:"Element defines data-turbo-method.",frame:t,src:e.href,invokeCommand:qr.invokeCommand}:n&&n!=="_self"?(t=document.getElementById(n),{name:"frame",reason:"element targets a frame that is not _self",frame:t,src:Gt(e,t),invokeCommand:Zt.invokeCommand}):(!n||n==="_self")&&t?{name:"frame",reason:"element does NOT target a frame or targets _self and is contained by a frame",frame:t,src:Gt(e,t),invokeCommand:Zt.invokeCommand}:{name:"window",reason:"element matches one or more of the following conditions (targets _top, does NOT target a frame, is NOT contained by a frame)",frame:null,src:Gt(e),invokeCommand:zr.invokeCommand}}var Qt={find:Da};var Ne="unknown",Fr={debug:Object.values(K),info:Object.values(K),warn:[K.abort,K.clientError,K.serverError],error:[K.clientError,K.serverError],unknown:[]};Object.values(K).forEach(e=>{addEventListener(e,t=>{Fr[Ne].includes(t.type)&&console[Ne==="debug"?"log":Ne](t.type,{target:t.target,detail:t.detail})})});var Hr={get level(){return Ne},set level(e){return Object.keys(Fr).includes(e)||(e="unknown"),Ne=e}};function Ia(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}var Vr={v4:Ia};function Wr(e,t){return{id:e,name:t.getAttribute(D.commandAttribute),elementId:t.id.length>0?t.id:null,elementAttributes:Le.buildAttributePayload(t),startedAt:new Date().getTime()}}function qa(e){let t,n={};try{if(t=Le.findClosestCommand(e.target),!t||!G.isRegisteredForElement(e.type,t))return;let r=`turbo-command-${Vr.v4()}`,o=Qt.find(t),i=B(b({},Wr(r,t)),{driver:o.name,frameId:o.frame?o.frame.id:null,src:o.src}),a=T(L.start,t,{cancelable:!0,detail:i});if(a.defaultPrevented)return T(L.abort,t,{detail:{message:`An event handler for '${L.start}' prevented default behavior and blocked command invocation!`,source:a}});switch(o=Qt.find(t),i=B(b({},Wr(r,t)),{driver:o.name,frameId:o.frame?o.frame.id:null,src:o.src}),ot.add(i),["frame","window"].includes(o.name)&&e.preventDefault(),A.busy=!0,setTimeout(()=>A.busy=!1,10),o.name){case"method":return o.invokeCommand(t,i);case"form":return o.invokeCommand(t,i);case"frame":return o.invokeCommand(o.frame,i);case"window":return o.invokeCommand(i)}}catch(r){T(L.clientError,t,{detail:B(b({},n),{error:r})})}}G.handler=qa;G.register("change",[`input[${D.commandAttribute}]`,`select[${D.commandAttribute}]`,`textarea[${D.commandAttribute}]`]);G.register("submit",[`form[${D.commandAttribute}]`]);G.register("click",[`[${D.commandAttribute}]`]);self.TurboBoost=self.TurboBoost||{};self.TurboBoost=B(b({},self.TurboBoost),{stateEvents:W,get state(){return ie.current},get stateDelta(){return ie.delta}});self.TurboBoost.Commands={logger:Hr,schema:D,events:L,registerEventDelegate:G.register,get eventDelegates(){return b({},G.events)}};var hl=self.TurboBoost.Commands;export{hl as default};
|
7
7
|
//# sourceMappingURL=commands.js.map
|