turbo_reflex 0.0.28 → 0.0.30

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25442bd8a57365579c0030a868468374a7f9522e7813c1e6b1e541d5f35279c1
4
- data.tar.gz: 5080c1f88b495431c4344345ce5ae9098be448f66f0fcfe74ded4b25e84fcf8a
3
+ metadata.gz: 50a67115edf83c3f6a6c88d9af0d606b1e113775df6c13e7b004d271bfa7861d
4
+ data.tar.gz: c28cb824bbe80b60ffb9b4b02595681459b1535be51c54de4c1cb08df558f082
5
5
  SHA512:
6
- metadata.gz: 3f78288b423b55fdea5a9f5856b16cee4450ba8bf798fdf1dd513602339de742f7fd58eba7fe5b9d0321dfd826e4e9ed551b27ec83e403aa067b2b6f7a7c9afb
7
- data.tar.gz: 05e4f7103687b69fd0e742d3636f4f952e670b228dfc81df4a76ffb4ee5ee8aad27d13d302553b8e8b5f57a8fc2e284423ea50435f3444148e27e2b341995c95
6
+ metadata.gz: 45e47fd21667e00d8bedd67c894a7696d09e8a0455dbf8543d8974effbd9b6e6c3f3b6061943021975f1903b459f99a699ee1b4d08a4bf5ccaba6f82920550ab
7
+ data.tar.gz: 662bc2ee9e3bfcf68ef7fa572394456a5699178848beb9e879a2624b315313231c5f3a3b1c22c4ff7ea809653bc82447f0905ae865f60312d57eeb1c3e16ea62
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- turbo_reflex (0.0.28)
4
+ turbo_reflex (0.0.30)
5
5
  rails (>= 6.1)
6
6
  turbo-rails (>= 1.1)
7
- turbo_ready (>= 0.1)
7
+ turbo_ready (>= 0.1.4)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
@@ -90,13 +90,13 @@ GEM
90
90
  rack-test (>= 0.6.3)
91
91
  regexp_parser (>= 1.5, < 3.0)
92
92
  xpath (~> 3.2)
93
- childprocess (4.1.0)
94
93
  coderay (1.1.3)
95
94
  concurrent-ruby (1.1.10)
96
95
  crass (1.0.6)
97
96
  cuprite (0.14.3)
98
97
  capybara (~> 3.0)
99
98
  ferrum (~> 0.13.0)
99
+ date (3.3.1)
100
100
  erubi (1.11.0)
101
101
  ferrum (0.13)
102
102
  addressable (~> 2.5)
@@ -111,13 +111,17 @@ GEM
111
111
  importmap-rails (1.1.5)
112
112
  actionpack (>= 6.0.0)
113
113
  railties (>= 6.0.0)
114
- json (2.6.2)
114
+ json (2.6.3)
115
+ language_server-protocol (3.17.0.2)
115
116
  loofah (2.19.0)
116
117
  crass (~> 1.0.2)
117
118
  nokogiri (>= 1.5.9)
118
119
  magic_frozen_string_literal (1.2.0)
119
- mail (2.7.1)
120
+ mail (2.8.0)
120
121
  mini_mime (>= 0.1.1)
122
+ net-imap
123
+ net-pop
124
+ net-smtp
121
125
  marcel (1.0.2)
122
126
  matrix (0.4.2)
123
127
  method_source (1.0.0)
@@ -128,21 +132,22 @@ GEM
128
132
  builder
129
133
  minitest (>= 5.0)
130
134
  ruby-progressbar
131
- net-imap (0.3.1)
135
+ net-imap (0.3.2)
136
+ date
132
137
  net-protocol
133
138
  net-pop (0.1.2)
134
139
  net-protocol
135
- net-protocol (0.1.3)
140
+ net-protocol (0.2.1)
136
141
  timeout
137
142
  net-smtp (0.3.3)
138
143
  net-protocol
139
144
  nio4r (2.5.8)
140
- nokogiri (1.13.9-aarch64-linux)
145
+ nokogiri (1.13.10-aarch64-linux)
141
146
  racc (~> 1.4)
142
- nokogiri (1.13.9-arm64-darwin)
147
+ nokogiri (1.13.10-arm64-darwin)
143
148
  racc (~> 1.4)
144
149
  parallel (1.22.1)
145
- parser (3.1.2.1)
150
+ parser (3.1.3.0)
146
151
  ast (~> 2.4.1)
147
152
  pry (0.14.1)
148
153
  coderay (~> 1.1)
@@ -155,10 +160,10 @@ GEM
155
160
  yard (~> 0.9.11)
156
161
  pry-rails (0.3.9)
157
162
  pry (>= 0.10.4)
158
- public_suffix (5.0.0)
163
+ public_suffix (5.0.1)
159
164
  puma (6.0.0)
160
165
  nio4r (~> 2.0)
161
- racc (1.6.0)
166
+ racc (1.6.1)
162
167
  rack (2.2.4)
163
168
  rack-test (2.0.2)
164
169
  rack (>= 1.3)
@@ -203,15 +208,14 @@ GEM
203
208
  rubocop-ast (>= 1.23.0, < 2.0)
204
209
  ruby-progressbar (~> 1.7)
205
210
  unicode-display_width (>= 1.4.0, < 3.0)
206
- rubocop-ast (1.23.0)
211
+ rubocop-ast (1.24.0)
207
212
  parser (>= 3.1.1.0)
208
213
  rubocop-performance (1.15.1)
209
214
  rubocop (>= 1.7.0, < 2.0)
210
215
  rubocop-ast (>= 0.4.0)
211
216
  ruby-progressbar (1.11.0)
212
217
  rubyzip (2.3.2)
213
- selenium-webdriver (4.6.1)
214
- childprocess (>= 0.5, < 5.0)
218
+ selenium-webdriver (4.7.1)
215
219
  rexml (~> 3.2, >= 3.2.5)
216
220
  rubyzip (>= 1.2.2, < 3.0)
217
221
  websocket (~> 1.0)
@@ -223,7 +227,8 @@ GEM
223
227
  activesupport (>= 5.2)
224
228
  sprockets (>= 3.0.0)
225
229
  sqlite3 (1.5.4-arm64-darwin)
226
- standard (1.18.1)
230
+ standard (1.19.1)
231
+ language_server-protocol (~> 3.17.0.2)
227
232
  rubocop (= 1.39.0)
228
233
  rubocop-performance (= 1.15.1)
229
234
  standardrb (1.0.1)
@@ -233,12 +238,12 @@ GEM
233
238
  tailwindcss-rails (2.0.21-arm64-darwin)
234
239
  railties (>= 6.0.0)
235
240
  thor (1.2.1)
236
- timeout (0.3.0)
241
+ timeout (0.3.1)
237
242
  turbo-rails (1.3.2)
238
243
  actionpack (>= 6.0.0)
239
244
  activejob (>= 6.0.0)
240
245
  railties (>= 6.0.0)
241
- turbo_ready (0.1.2)
246
+ turbo_ready (0.1.4)
242
247
  rails (>= 6.1)
243
248
  turbo-rails (>= 1.1)
244
249
  tzinfo (2.0.5)
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-1240-47d299.svg" />
11
+ <img alt="Lines of Code" src="https://img.shields.io/badge/loc-1244-47d299.svg" />
12
12
  </a>
13
13
  <a href="https://codeclimate.com/github/hopsoft/turbo_reflex/maintainability">
14
14
  <img src="https://api.codeclimate.com/v1/badges/fe1162a742fe83a4fdfd/maintainability" />
@@ -120,14 +120,15 @@ TurboReflex is a lightweight Turbo Frame extension... which means that reactivit
120
120
 
121
121
  ```diff
122
122
  # Gemfile
123
- +gem "turbo_reflex", "~> 0.0.3"
123
+ gem "turbo-rails", ">= 1.1", "< 2"
124
+ +gem "turbo_reflex", "~> VERSION"
124
125
  ```
125
126
 
126
127
  ```diff
127
128
  # package.json
128
129
  "dependencies": {
129
- "@hotwired/turbo-rails": ">=7.1",
130
- + "turbo_reflex": "^0.0.3"
130
+ "@hotwired/turbo-rails": ">=7.2",
131
+ + "turbo_reflex": "^VERSION"
131
132
  ```
132
133
 
133
134
  *Be sure to install the __same version__ of the Ruby and JavaScript libraries.*
@@ -136,6 +137,7 @@ TurboReflex is a lightweight Turbo Frame extension... which means that reactivit
136
137
 
137
138
  ```diff
138
139
  # app/javascript/application.js
140
+ import '@hotwired/turbo-rails'
139
141
  +import 'turbo_reflex'
140
142
  ```
141
143
 
@@ -1,2 +1,7 @@
1
- var L=class{get element(){return document.querySelector('meta[name="turbo-reflex"]')}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 L;var u={start:"turbo-reflex:start",success:"turbo-reflex:success",finish:"turbo-reflex:finish",abort:"turbo-reflex:abort",clientError:"turbo-reflex:client-error",serverError:"turbo-reflex:server-error"},f={stateLoad:"turbo-reflex:state-load",stateChange:"turbo-reflex:state-change"},i={...u,...f};function a(e,t=document,r={},n=!1){try{t=t||document;let o=new CustomEvent(e,{detail:r,cancelable:!1,bubbles:!0});t.dispatchEvent(o)}catch(o){if(n)throw o;a(u.clientError,t,{error:o,...r},!0)}}var S;function E(e,t=null){if(!e||typeof e!="object")return e;let r=new Proxy(e,{deleteProperty(n,o){return delete n[o],a(f.stateChange,s.element,{state:S}),!0},set(n,o,A,me){return n[o]=E(A,this),a(f.stateChange,s.element,{state:S}),!0}});if(Array.isArray(e))e.forEach((n,o)=>e[o]=E(n,r));else if(typeof e=="object")for(let[n,o]of Object.entries(e))e[n]=E(o,r);return t||(S=r),r}var N=E;var w,m,R,q;function H(){if(!s.element)return b();let e=atob(s.element.dataset.state);R={},m=N(JSON.parse(e)),w={...m},delete s.element.dataset.clientStateChange,setTimeout(()=>a(f.stateLoad,s.element,{state:m}))}function b(){clearTimeout(q),q=setTimeout(H,10)}w||H();addEventListener("DOMContentLoaded",b);addEventListener("load",b);addEventListener("turbo:load",b);addEventListener("turbo:frame-load",b);addEventListener("turbo-reflex:success",b);addEventListener(f.stateChange,e=>{R={};for(let[t,r]of Object.entries(m))w[t]!==r&&(R[t]=r);s.element.dataset.clientStateChange=!0,s.element.dataset.state=btoa(JSON.stringify(m))});var p={events:f,get current(){return m},get delta(){return R},get payloadChunks(){return btoa(JSON.stringify(m)).match(/.{1,2000}/g)}};function V(e){let t="<html",r="</html",n=e.indexOf(t),o=e.lastIndexOf(r);if(n>=0&&o>=0){let A=e.slice(e.indexOf(">",n)+1,o);document.documentElement.innerHTML=A}}function B(e){document.body.insertAdjacentHTML("beforeend",e)}var x={append:B,replaceDocument:V};var k={};function G(e){k[e.id]=e}function z(e){delete k[e]}var y={add:G,remove:z,get reflexes(){return[...Object.values(k)]},get length(){return Object.keys(k).length}};function X(e){e.detail.endedAt=new Date().getTime(),e.detail.milliseconds=e.detail.endedAt-e.detail.startedAt,setTimeout(()=>a(u.finish,e.target,e.detail),20)}addEventListener(u.serverError,X);addEventListener(u.success,X);addEventListener(u.finish,e=>y.remove(e.detail.id),!0);var d={events:u};var O={};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-reflex.html",r.headers.Accept];n=n.filter(o=>o&&o.trim().length>0).join(", "),r.headers.Accept=n,r.headers["TurboReflex-Token"]=s.token}p.payloadChunks.forEach((n,o)=>{r.headers[`TurboReflex-State-${o.toString().padStart(4,"0")}`]=n})});addEventListener("turbo:before-fetch-response",e=>{let t=e.target.closest("turbo-frame"),{fetchResponse:r}=e.detail;if(t&&(O[t.id]=t.src),r.header("TurboReflex")){if(r.statusCode<200||r.statusCode>399){let n=`Server returned a ${r.statusCode} status code! TurboReflex requires 2XX-3XX status codes.`;a(d.events.clientError,document,{...e.detail,error:n},!0)}r.header("TurboReflex")==="Append"&&(e.preventDefault(),r.responseText.then(n=>x.append(n)))}});addEventListener("turbo:frame-load",e=>{let t=e.target.closest("turbo-frame");t.dataset.turboReflexSrc=O[t.id]||t.src||t.dataset.turboReflexSrc,delete O[t.id]});var K={frameAttribute:"data-turbo-frame",methodAttribute:"data-turbo-method",reflexAttribute:"data-turbo-reflex"},l={...K};var T={},I;function Q(e,t){T[e]=t,document.addEventListener(e,I,!0)}function W(e){return Object.keys(T).find(t=>!!T[t].find(r=>Array.from(document.querySelectorAll(r)).find(n=>n===e)))}function Y(e,t){return e===W(t)}var c={events:T,register:Q,isRegisteredForElement:Y,set handler(e){I=e}};function Z(e){return e.closest(`[${l.reflexAttribute}]`)}function ee(e){return e.closest("turbo-frame")}function te(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 re(e){let t=Array.from(e.attributes).reduce((r,n)=>{let o=n.value;return r[n.name]=o,r},{});return t.tag=e.tagName,t.checked=!!e.checked,t.disabled=!!e.disabled,te(e,t),delete t.class,delete t.action,delete t.href,delete t[l.reflexAttribute],delete t[l.frameAttribute],t}var v={buildAttributePayload:re,findClosestReflex:Z,findClosestFrame:ee};function ne(e,t={}){t.token=s.token;let r=document.createElement("input");r.type="hidden",r.name="turbo_reflex",r.value=JSON.stringify(t),e.appendChild(r)}var P={invokeReflex:ne};function oe(e,t={}){let r=document.createElement("a");r.href=e;let n=new URL(r);return n.searchParams.set("turbo_reflex",JSON.stringify(t)),n}var h={build:oe};function se(e,t){let r=t.src;t={...t},delete t.src,e.src=h.build(r,t)}var C={invokeReflex:se};function ae(e,t={}){let r=t.src;t={...t},delete t.src,delete t.href,e.setAttribute("href",h.build(r,t))}var _={invokeReflex:ae};function ie(e){let t=e.target;a(d.events.abort,document,{xhr:t,...e.detail})}function D(e){let t=e.target;t.getResponseHeader("TurboReflex")==="Append"?x.append(t.responseText):x.replaceDocument(t.responseText);let r=`Server returned a ${t.status} status code! TurboReflex requires 2XX-3XX status codes.`;a(d.events.clientError,document,{xhr:t,...e.detail,error:r},!0)}function le(e){let t=e.target;if(t.status<200||t.status>399)return D(e);let r=t.responseText;t.getResponseHeader("TurboReflex")==="Append"?x.append(t.responseText):x.replaceDocument(t.responseText)}function ue(e){let t=e.src;e={...e},delete e.src;try{let r=new XMLHttpRequest;r.open("GET",h.build(t,e),!0),r.setRequestHeader("Accept","text/vnd.turbo-reflex.html, text/html, application/xhtml+xml"),r.setRequestHeader("TurboReflex-Token",s.token),p.payloadChunks.forEach((n,o)=>r.setRequestHeader(`TurboReflex-State-${o.toString().padStart(4,"0")}`,n)),r.addEventListener("abort",ie),r.addEventListener("error",D),r.addEventListener("load",le),r.send()}catch(r){let n=`Unexpected error sending HTTP request! ${r.message}`;D(r,{detail:{message:n}})}}var F={invokeReflex:ue};function $(e,t){return t=t||{dataset:{}},e.href||t.src||t.dataset.turboReflexSrc||location.href}function fe(e){let t=v.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,invokeReflex:P.invokeReflex}:n&&n.length>0?{name:"method",reason:"Element defines data-turbo-method.",frame:t,src:e.href,invokeReflex:_.invokeReflex}:r&&r!=="_self"?(t=document.getElementById(r),{name:"frame",reason:"element targets a frame that is not _self",frame:t,src:$(e,t),invokeReflex:C.invokeReflex}):(!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:$(e,t),invokeReflex:C.invokeReflex}:{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:$(e),invokeReflex:F.invokeReflex}}var j={find:fe};var g="unknown",J={debug:Object.values(i),info:Object.values(i),warn:[i.abort,i.clientError,i.serverError],error:[i.clientError,i.serverError],unknown:[]};Object.values(i).forEach(e=>{addEventListener(e,t=>{J[g].includes(t.type)&&console[g==="debug"?"log":g](t.type,{target:t.target,detail:t.detail})})});var M={get level(){return g},set level(e){return Object.keys(J).includes(e)||(e="unknown"),g=e}};function de(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}var U={v4:de};function ce(e){let t,r={};try{if(t=v.findClosestReflex(e.target),!t||!c.isRegisteredForElement(e.type,t))return;let n=j.find(t);switch(r={id:`reflex-${U.v4()}`,name:t.dataset.turboReflex,driver:n.name,src:n.src,frameId:n.frame?n.frame.id:null,elementId:t.id.length>0?t.id:null,elementAttributes:v.buildAttributePayload(t),startedAt:new Date().getTime()},y.add(r),a(d.events.start,t,r),["frame","window"].includes(n.name)&&e.preventDefault(),s.busy=!0,setTimeout(()=>s.busy=!1,10),n.name){case"method":return n.invokeReflex(t,r);case"form":return n.invokeReflex(t,r);case"frame":return n.invokeReflex(n.frame,r);case"window":return n.invokeReflex(r)}}catch(n){a(d.events.clientError,t,{error:n,...r})}}c.handler=ce;c.register("change",[`input[${l.reflexAttribute}]`,`select[${l.reflexAttribute}]`,`textarea[${l.reflexAttribute}]`]);c.register("submit",[`form[${l.reflexAttribute}]`]);c.register("click",[`[${l.reflexAttribute}]`]);var kt=self.TurboReflex={logger:M,schema:l,registerEventDelegate:c.register,get eventDelegates(){return{...c.events}},get events(){return{...i}},get state(){return p.current},get stateDelta(){return p.delta}};export{kt as default};
1
+ var Un=Object.defineProperty,Gn=Object.defineProperties;var Yn=Object.getOwnPropertyDescriptors;var ir=Object.getOwnPropertySymbols;var Xn=Object.prototype.hasOwnProperty,Jn=Object.prototype.propertyIsEnumerable;var st=(e,t,r)=>t in e?Un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t)=>{for(var r in t||(t={}))Xn.call(t,r)&&st(e,r,t[r]);if(ir)for(var r of ir(t))Jn.call(t,r)&&st(e,r,t[r]);return e},ue=(e,t)=>Gn(e,Yn(t));var lt=(e,t,r)=>(st(e,typeof t!="symbol"?t+"":t,r),r);function Zn(e,t,r={}){let n=new CustomEvent(t,r);e.forEach(i=>i.dispatchEvent(n))}var or=Zn;var pt=!1,ht=!1,te=[];function Qn(e){ei(e)}function ei(e){te.includes(e)||te.push(e),ti()}function pr(e){let t=te.indexOf(e);t!==-1&&te.splice(t,1)}function ti(){!ht&&!pt&&(pt=!0,queueMicrotask(ri))}function ri(){pt=!1,ht=!0;for(let e=0;e<te.length;e++)te[e]();te.length=0,ht=!1}var he,Te,Fe,hr,_t=!0;function ni(e){_t=!1,e(),_t=!0}function ii(e){he=e.reactive,Fe=e.release,Te=t=>e.effect(t,{scheduler:r=>{_t?Qn(r):r()}}),hr=e.raw}function ar(e){Te=e}function oi(e){let t=()=>{};return[n=>{let i=Te(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),Fe(i))},i},()=>{t()}]}var _r=[],mr=[],gr=[];function ai(e){gr.push(e)}function vr(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,mr.push(t))}function si(e){_r.push(e)}function li(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function xr(e,t){!e._x_attributeCleanups||Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}var Rt=new MutationObserver(Nt),Mt=!1;function br(){Rt.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Mt=!0}function ui(){ci(),Rt.disconnect(),Mt=!1}var we=[],ut=!1;function ci(){we=we.concat(Rt.takeRecords()),we.length&&!ut&&(ut=!0,queueMicrotask(()=>{fi(),ut=!1}))}function fi(){Nt(we),we.length=0}function T(e){if(!Mt)return e();ui();let t=e();return br(),t}var kt=!1,Pe=[];function di(){kt=!0}function pi(){kt=!1,Nt(Pe),Pe=[]}function Nt(e){if(kt){Pe=Pe.concat(e);return}let t=[],r=[],n=new Map,i=new Map;for(let o=0;o<e.length;o++)if(!e[o].target._x_ignoreMutationObserver&&(e[o].type==="childList"&&(e[o].addedNodes.forEach(a=>a.nodeType===1&&t.push(a)),e[o].removedNodes.forEach(a=>a.nodeType===1&&r.push(a))),e[o].type==="attributes")){let a=e[o].target,s=e[o].attributeName,l=e[o].oldValue,u=()=>{n.has(a)||n.set(a,[]),n.get(a).push({name:s,value:a.getAttribute(s)})},f=()=>{i.has(a)||i.set(a,[]),i.get(a).push(s)};a.hasAttribute(s)&&l===null?u():a.hasAttribute(s)?(f(),u()):f()}i.forEach((o,a)=>{xr(a,o)}),n.forEach((o,a)=>{_r.forEach(s=>s(a,o))});for(let o of r)if(!t.includes(o)&&(mr.forEach(a=>a(o)),o._x_cleanups))for(;o._x_cleanups.length;)o._x_cleanups.pop()();t.forEach(o=>{o._x_ignoreSelf=!0,o._x_ignore=!0});for(let o of t)r.includes(o)||!o.isConnected||(delete o._x_ignoreSelf,delete o._x_ignore,gr.forEach(a=>a(o)),o._x_ignore=!0,o._x_ignoreSelf=!0);t.forEach(o=>{delete o._x_ignoreSelf,delete o._x_ignore}),t=null,r=null,n=null,i=null}function yr(e){return Ce(fe(e))}function Oe(e,t,r){return e._x_dataStack=[t,...fe(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function sr(e,t){let r=e._x_dataStack[0];Object.entries(t).forEach(([n,i])=>{r[n]=i})}function fe(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?fe(e.host):e.parentNode?fe(e.parentNode):[]}function Ce(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(r=>Object.keys(r)))),has:(r,n)=>e.some(i=>i.hasOwnProperty(n)),get:(r,n)=>(e.find(i=>{if(i.hasOwnProperty(n)){let o=Object.getOwnPropertyDescriptor(i,n);if(o.get&&o.get._x_alreadyBound||o.set&&o.set._x_alreadyBound)return!0;if((o.get||o.set)&&o.enumerable){let a=o.get,s=o.set,l=o;a=a&&a.bind(t),s=s&&s.bind(t),a&&(a._x_alreadyBound=!0),s&&(s._x_alreadyBound=!0),Object.defineProperty(i,n,ue(v({},l),{get:a,set:s}))}return!0}return!1})||{})[n],set:(r,n,i)=>{let o=e.find(a=>a.hasOwnProperty(n));return o?o[n]=i:e[e.length-1][n]=i,!0}});return t}function wr(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:a,enumerable:s}])=>{if(s===!1||a===void 0)return;let l=i===""?o:`${i}.${o}`;typeof a=="object"&&a!==null&&a._x_interceptor?n[o]=a.initialize(e,l,o):t(a)&&a!==n&&!(a instanceof Element)&&r(a,l)})};return r(e)}function Er(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>hi(n,i),a=>mt(n,i,a),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,a,s)=>{let l=n.initialize(o,a,s);return r.initialValue=l,i(o,a,s)}}else r.initialValue=n;return r}}function hi(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function mt(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),mt(e[t[0]],t.slice(1),r)}}var Ar={};function F(e,t){Ar[e]=t}function gt(e,t){return Object.entries(Ar).forEach(([r,n])=>{Object.defineProperty(e,`$${r}`,{get(){let[i,o]=Mr(t);return i=v({interceptor:Er},i),vr(t,o),n(t,i)},enumerable:!1})}),e}function _i(e,t,r,...n){try{return r(...n)}catch(i){Se(i,e,t)}}function Se(e,t,r=void 0){Object.assign(e,{el:t,expression:r}),console.warn(`Alpine Expression Error: ${e.message}
2
+
3
+ ${r?'Expression: "'+r+`"
4
+
5
+ `:""}`,t),setTimeout(()=>{throw e},0)}var $e=!0;function mi(e){let t=$e;$e=!1,e(),$e=t}function ce(e,t,r={}){let n;return M(e,t)(i=>n=i,r),n}function M(...e){return Sr(...e)}var Sr=Tr;function gi(e){Sr=e}function Tr(e,t){let r={};gt(r,e);let n=[r,...fe(e)];if(typeof t=="function")return vi(n,t);let i=bi(n,t,e);return _i.bind(null,e,t,i)}function vi(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(Ce([n,...e]),i);Ie(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 Se(a,t,e),Promise.resolve()}})();return ct[e]=o,o}function bi(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 l=n(n,s).catch(u=>Se(u,r,t));n.finished?(Ie(i,n.result,s,a,r),n.result=void 0):l.then(u=>{Ie(i,u,s,a,r)}).catch(u=>Se(u,r,t)).finally(()=>n.result=void 0)}}}function Ie(e,t,r,n,i){if($e&&typeof t=="function"){let o=t.apply(r,n);o instanceof Promise?o.then(a=>Ie(e,a,r,n)).catch(a=>Se(a,i,t)):e(o)}else e(t)}var Lt="x-";function _e(e=""){return Lt+e}function yi(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,l])=>({name:s,value:l})),a=Cr(o);o=o.map(s=>a.find(l=>l.name===s.name)?{name:`x-bind:${s.name}`,value:`"${s.value}"`}:s),t=t.concat(o)}let n={};return t.map(Lr((o,a)=>n[o]=a)).filter(Pr).map(Ai(n,r)).sort(Si).map(o=>Ei(e,o))}function Cr(e){return Array.from(e).map(Lr()).filter(t=>!Pr(t))}var vt=!1,ye=new Map,Rr=Symbol();function wi(e){vt=!0;let t=Symbol();Rr=t,ye.set(t,[]);let r=()=>{for(;ye.get(t).length;)ye.get(t).shift()();ye.delete(t)},n=()=>{vt=!1,r()};e(r),n()}function Mr(e){let t=[],r=s=>t.push(s),[n,i]=oi(e);return t.push(i),[{Alpine:Re,effect:n,cleanup:r,evaluateLater:M.bind(M,e),evaluate:ce.bind(ce,e)},()=>t.forEach(s=>s())]}function Ei(e,t){let r=()=>{},n=Or[t.type]||r,[i,o]=Mr(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?ye.get(Rr).push(n):n())};return a.runCleanups=o,a}var kr=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),Nr=e=>e;function Lr(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=$r.reduce((o,a)=>a(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var $r=[];function Pt(e){$r.push(e)}function Pr({name:e}){return Ir().test(e)}var Ir=()=>new RegExp(`^${Lt}([^:^.]+)\\b`);function Ai(e,t){return({name:r,value:n})=>{let i=r.match(Ir()),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(l=>l.replace(".","")),expression:n,original:s}}}var xt="DEFAULT",Ne=["ignore","ref","data","id","radio","tabs","switch","disclosure","menu","listbox","list","item","combobox","bind","init","for","mask","model","modelable","transition","show","if",xt,"teleport"];function Si(e,t){let r=Ne.indexOf(e.type)===-1?xt:e.type,n=Ne.indexOf(t.type)===-1?xt:t.type;return Ne.indexOf(r)-Ne.indexOf(n)}function Ee(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}var bt=[],It=!1;function Dr(e=()=>{}){return queueMicrotask(()=>{It||setTimeout(()=>{yt()})}),new Promise(t=>{bt.push(()=>{e(),t()})})}function yt(){for(It=!1;bt.length;)bt.shift()()}function Ti(){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 de(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function Oi(){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?"),Ee(document,"alpine:init"),Ee(document,"alpine:initializing"),br(),ai(t=>U(t,ie)),vr(t=>Ri(t)),si((t,r)=>{$t(t,r).forEach(n=>n())});let e=t=>!je(t.parentElement,!0);Array.from(document.querySelectorAll(Kr())).filter(e).forEach(t=>{U(t)}),Ee(document,"alpine:initialized")}var Dt=[],Fr=[];function jr(){return Dt.map(e=>e())}function Kr(){return Dt.concat(Fr).map(e=>e())}function Hr(e){Dt.push(e)}function Br(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 Ci(e){return jr().some(t=>e.matches(t))}function U(e,t=ie){wi(()=>{t(e,(r,n)=>{$t(r,r.attributes).forEach(i=>i()),r._x_ignore&&n()})})}function Ri(e){ie(e,t=>xr(t))}function Ft(e,t){return Array.isArray(t)?lr(e,t.join(" ")):typeof t=="object"&&t!==null?Mi(e,t):typeof t=="function"?Ft(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 Mi(e,t){let r=s=>s.split(" ").filter(Boolean),n=Object.entries(t).flatMap(([s,l])=>l?r(s):!1).filter(Boolean),i=Object.entries(t).flatMap(([s,l])=>l?!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?ki(e,t):Ni(e,t)}function ki(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{r[n]=e.style[n],n.startsWith("--")||(n=Li(n)),e.style.setProperty(n,i)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{He(e,r)}}function Ni(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r||"")}}function Li(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?$i(e,n,t):Pi(e,r,t)});function $i(e,t,r){qr(e,Ft,""),{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 Pi(e,t,r){qr(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((g,y)=>y<t.indexOf("out"))),t.includes("out")&&!n&&(t=t.filter((g,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,f=l?xe(t,"scale",95)/100:1,h=xe(t,"delay",0),x=xe(t,"origin","center"),$="opacity, transform",E=xe(t,"duration",150)/1e3,le=xe(t,"duration",75)/1e3,d="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(e._x_transition.enter.during={transformOrigin:x,transitionDelay:h,transitionProperty:$,transitionDuration:`${E}s`,transitionTimingFunction:d},e._x_transition.enter.start={opacity:u,transform:`scale(${f})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),o&&(e._x_transition.leave.during={transformOrigin:x,transitionDelay:h,transitionProperty:$,transitionDuration:`${le}s`,transitionTimingFunction:d},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:u,transform:`scale(${f})`})}function qr(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=zr(e);a?(a._x_hideChildren||(a._x_hideChildren=[]),a._x_hideChildren.push(e)):i(()=>{let s=l=>{let u=Promise.all([l._x_hidePromise,...(l._x_hideChildren||[]).map(s)]).then(([f])=>f());return delete l._x_hidePromise,delete l._x_hideChildren,u};s(e).catch(l=>{if(!l.isFromCancelledTransition)throw l})})})};function zr(e){let t=e.parentNode;if(!!t)return t._x_hidePromise?t:zr(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,l,u;Ii(e,{start(){s=t(e,n)},during(){l=t(e,r)},before:o,end(){s(),u=t(e,i)},after:a,cleanup(){l(),u()}})}function Ii(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()}),Ti(),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 xe(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 Be(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;U(e,(n,i)=>{ie(n,(o,a)=>{if(t&&Ci(o))return a();t=!0,i(o,a)})})}function ji(e){let t=Te;ar((r,n)=>{let i=t(r);return Fe(i),()=>{}}),e(),ar(t)}function Vr(e,t,r,n=[]){switch(e._x_bindings||(e._x_bindings=he({})),e._x_bindings[t]=r,t=n.includes("camel")?Wi(t):t,t){case"value":Ki(e,r);break;case"style":Bi(e,r);break;case"class":Hi(e,r);break;default:qi(e,t,r);break}}function Ki(e,t){if(e.type==="radio")e.attributes.value===void 0&&(e.value=t),window.fromModel&&(e.checked=ur(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=>ur(r,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")Vi(e,t);else{if(e.value===t)return;e.value=t}}function Hi(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=Ft(e,t)}function Bi(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=He(e,t)}function qi(e,t,r){[null,void 0,!1].includes(r)&&Ui(t)?e.removeAttribute(t):(Wr(t)&&(r=t),zi(e,t,r))}function zi(e,t,r){e.getAttribute(t)!=r&&e.setAttribute(t,r)}function Vi(e,t){let r=[].concat(t).map(n=>n+"");Array.from(e.options).forEach(n=>{n.selected=r.includes(n.value)})}function Wi(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function ur(e,t){return e==t}function Wr(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 Ui(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function Gi(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:Wr(t)?!![t,"true"].includes(n):n}function Ur(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 Gr(e,t){let r;return function(){let n=this,i=arguments;r||(e.apply(n,i),r=!0,setTimeout(()=>r=!1,t))}}function Yi(e){e(Re)}var ee={},cr=!1;function Xi(e,t){if(cr||(ee=he(ee),cr=!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(),wr(ee[e])}function Ji(){return ee}var Yr={};function Zi(e,t){let r=typeof t!="function"?()=>t:t;e instanceof Element?Xr(e,r()):Yr[e]=r}function Qi(e){return Object.entries(Yr).forEach(([t,r])=>{Object.defineProperty(e,t,{get(){return(...n)=>r(...n)}})}),e}function Xr(e,t,r){let n=[];for(;n.length;)n.pop()();let i=Object.entries(t).map(([a,s])=>({name:a,value:s})),o=Cr(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 Jr={};function eo(e,t){Jr[e]=t}function to(e,t){return Object.entries(Jr).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}var ro={get reactive(){return he},get release(){return Fe},get effect(){return Te},get raw(){return hr},version:"3.10.5",flushAndStopDeferringMutations:pi,dontAutoEvaluateFunctions:mi,disableEffectScheduling:ni,setReactivityEngine:ii,closestDataStack:fe,skipDuringClone:Be,addRootSelector:Hr,addInitSelector:Br,addScopeToNode:Oe,deferMutations:di,mapAttributes:Pt,evaluateLater:M,setEvaluator:gi,mergeProxies:Ce,findClosest:Ke,closestRoot:je,interceptor:Er,transition:Et,setStyles:He,mutateDom:T,directive:A,throttle:Gr,debounce:Ur,evaluate:ce,initTree:U,nextTick:Dr,prefixed:_e,prefix:yi,plugin:Yi,magic:F,store:Xi,start:Oi,clone:Di,bound:Gi,$data:yr,data:eo,bind:Zi},Re=ro;function Zr(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 no="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",La=Zr(no+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected"),io=Object.freeze({}),$a=Object.freeze([]),Qr=Object.assign,oo=Object.prototype.hasOwnProperty,qe=(e,t)=>oo.call(e,t),re=Array.isArray,Ae=e=>en(e)==="[object Map]",ao=e=>typeof e=="string",jt=e=>typeof e=="symbol",ze=e=>e!==null&&typeof e=="object",so=Object.prototype.toString,en=e=>so.call(e),tn=e=>en(e).slice(8,-1),Kt=e=>ao(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ve=e=>{let t=Object.create(null);return r=>t[r]||(t[r]=e(r))},lo=/-(\w)/g,Pa=Ve(e=>e.replace(lo,(t,r)=>r?r.toUpperCase():"")),uo=/\B([A-Z])/g,Ia=Ve(e=>e.replace(uo,"-$1").toLowerCase()),rn=Ve(e=>e.charAt(0).toUpperCase()+e.slice(1)),Da=Ve(e=>e?`on${rn(e)}`:""),nn=(e,t)=>e!==t&&(e===e||t===t),St=new WeakMap,be=[],q,ne=Symbol("iterate"),Tt=Symbol("Map key iterate");function co(e){return e&&e._isEffect===!0}function fo(e,t=io){co(e)&&(e=e.raw);let r=_o(e,t);return t.lazy||r(),r}function po(e){e.active&&(on(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)){on(r);try{return go(),be.push(r),q=r,e()}finally{be.pop(),an(),q=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 on(e){let{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++)t[r].delete(e);t.length=0}}var pe=!0,Ht=[];function mo(){Ht.push(pe),pe=!1}function go(){Ht.push(pe),pe=!0}function an(){let e=Ht.pop();pe=e===void 0?!0:e}function D(e,t,r){if(!pe||q===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(q)||(i.add(q),q.deps.push(i),q.options.onTrack&&q.options.onTrack({effect:q,target:e,type:t,key:r}))}function G(e,t,r,n,i,o){let a=St.get(e);if(!a)return;let s=new Set,l=f=>{f&&f.forEach(h=>{(h!==q||h.allowRecurse)&&s.add(h)})};if(t==="clear")a.forEach(l);else if(r==="length"&&re(e))a.forEach((f,h)=>{(h==="length"||h>=n)&&l(f)});else switch(r!==void 0&&l(a.get(r)),t){case"add":re(e)?Kt(r)&&l(a.get("length")):(l(a.get(ne)),Ae(e)&&l(a.get(Tt)));break;case"delete":re(e)||(l(a.get(ne)),Ae(e)&&l(a.get(Tt)));break;case"set":Ae(e)&&l(a.get(ne));break}let u=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(u)}var vo=Zr("__proto__,__v_isRef,__isVue"),sn=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(jt)),xo=We(),bo=We(!1,!0),yo=We(!0),wo=We(!0,!0),De={};["includes","indexOf","lastIndexOf"].forEach(e=>{let t=Array.prototype[e];De[e]=function(...r){let n=b(this);for(let o=0,a=this.length;o<a;o++)D(n,"get",o+"");let i=t.apply(n,r);return i===-1||i===!1?t.apply(n,r.map(b)):i}});["push","pop","shift","unshift","splice"].forEach(e=>{let t=Array.prototype[e];De[e]=function(...r){mo();let n=t.apply(this,r);return an(),n}});function We(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?No:yn:t?ko:bn).get(n))return n;let a=re(n);if(!e&&a&&qe(De,i))return Reflect.get(De,i,o);let s=Reflect.get(n,i,o);return(jt(i)?sn.has(i):vo(i))||(e||D(n,"get",i),t)?s:Ot(s)?!a||!Kt(i)?s.value:s:ze(s)?e?wn(s):Vt(s):s}}var Eo=ln(),Ao=ln(!0);function ln(e=!1){return function(r,n,i,o){let a=r[n];if(!e&&(i=b(i),a=b(a),!re(r)&&Ot(a)&&!Ot(i)))return a.value=i,!0;let s=re(r)&&Kt(n)?Number(n)<r.length:qe(r,n),l=Reflect.set(r,n,i,o);return r===b(o)&&(s?nn(i,a)&&G(r,"set",n,i,a):G(r,"add",n,i)),l}}function So(e,t){let r=qe(e,t),n=e[t],i=Reflect.deleteProperty(e,t);return i&&r&&G(e,"delete",t,void 0,n),i}function To(e,t){let r=Reflect.has(e,t);return(!jt(t)||!sn.has(t))&&D(e,"has",t),r}function Oo(e){return D(e,"iterate",re(e)?"length":ne),Reflect.ownKeys(e)}var un={get:xo,set:Eo,deleteProperty:So,has:To,ownKeys:Oo},cn={get:yo,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=Qr({},un,{get:bo,set:Ao}),ja=Qr({},cn,{get:wo}),Bt=e=>ze(e)?Vt(e):e,qt=e=>ze(e)?wn(e):e,zt=e=>e,Ue=e=>Reflect.getPrototypeOf(e);function Ge(e,t,r=!1,n=!1){e=e.__v_raw;let i=b(e),o=b(t);t!==o&&!r&&D(i,"get",t),!r&&D(i,"get",o);let{has:a}=Ue(i),s=n?zt:r?qt:Bt;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 Ye(e,t=!1){let r=this.__v_raw,n=b(r),i=b(e);return e!==i&&!t&&D(n,"has",e),!t&&D(n,"has",i),e===i?r.has(e):r.has(e)||r.has(i)}function Xe(e,t=!1){return e=e.__v_raw,!t&&D(b(e),"iterate",ne),Reflect.get(e,"size",e)}function fn(e){e=b(e);let t=b(this);return Ue(t).has.call(t,e)||(t.add(e),G(t,"add",e,e)),this}function dn(e,t){t=b(t);let r=b(this),{has:n,get:i}=Ue(r),o=n.call(r,e);o?xn(r,n,e):(e=b(e),o=n.call(r,e));let a=i.call(r,e);return r.set(e,t),o?nn(t,a)&&G(r,"set",e,t,a):G(r,"add",e,t),this}function pn(e){let t=b(this),{has:r,get:n}=Ue(t),i=r.call(t,e);i?xn(t,r,e):(e=b(e),i=r.call(t,e));let o=n?n.call(t,e):void 0,a=t.delete(e);return i&&G(t,"delete",e,void 0,o),a}function hn(){let e=b(this),t=e.size!==0,r=Ae(e)?new Map(e):new Set(e),n=e.clear();return t&&G(e,"clear",void 0,void 0,r),n}function Je(e,t){return function(n,i){let o=this,a=o.__v_raw,s=b(a),l=t?zt:e?qt:Bt;return!e&&D(s,"iterate",ne),a.forEach((u,f)=>n.call(i,l(u),l(f),o))}}function Le(e,t,r){return function(...n){let i=this.__v_raw,o=b(i),a=Ae(o),s=e==="entries"||e===Symbol.iterator&&a,l=e==="keys"&&a,u=i[e](...n),f=r?zt:t?qt:Bt;return!t&&D(o,"iterate",l?Tt:ne),{next(){let{value:h,done:x}=u.next();return x?{value:h,done:x}:{value:s?[f(h[0]),f(h[1])]:f(h),done:x}},[Symbol.iterator](){return this}}}}function W(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";console.warn(`${rn(e)} operation ${r}failed: target is readonly.`,b(this))}return e==="delete"?!1:this}}var _n={get(e){return Ge(this,e)},get size(){return Xe(this)},has:Ye,add:fn,set:dn,delete:pn,clear:hn,forEach:Je(!1,!1)},mn={get(e){return Ge(this,e,!1,!0)},get size(){return Xe(this)},has:Ye,add:fn,set:dn,delete:pn,clear:hn,forEach:Je(!1,!0)},gn={get(e){return Ge(this,e,!0)},get size(){return Xe(this,!0)},has(e){return Ye.call(this,e,!0)},add:W("add"),set:W("set"),delete:W("delete"),clear:W("clear"),forEach:Je(!0,!1)},vn={get(e){return Ge(this,e,!0,!0)},get size(){return Xe(this,!0)},has(e){return Ye.call(this,e,!0)},add:W("add"),set:W("set"),delete:W("delete"),clear:W("clear"),forEach:Je(!0,!0)},Co=["keys","values","entries",Symbol.iterator];Co.forEach(e=>{_n[e]=Le(e,!1,!1),gn[e]=Le(e,!0,!1),mn[e]=Le(e,!1,!0),vn[e]=Le(e,!0,!0)});function Ze(e,t){let r=t?e?vn:mn:e?gn:_n;return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(qe(r,i)&&i in n?r:n,i,o)}var Ro={get:Ze(!1,!1)},Ka={get:Ze(!1,!0)},Mo={get:Ze(!0,!1)},Ha={get:Ze(!0,!0)};function xn(e,t,r){let n=b(r);if(n!==r&&t.call(e,n)){let i=tn(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 bn=new WeakMap,ko=new WeakMap,yn=new WeakMap,No=new WeakMap;function Lo(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function $o(e){return e.__v_skip||!Object.isExtensible(e)?0:Lo(tn(e))}function Vt(e){return e&&e.__v_isReadonly?e:En(e,!1,un,Ro,bn)}function wn(e){return En(e,!0,cn,Mo,yn)}function En(e,t,r,n,i){if(!ze(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=$o(e);if(a===0)return e;let s=new Proxy(e,a===2?n:r);return i.set(e,s),s}function b(e){return e&&b(e.__v_raw)||e}function Ot(e){return Boolean(e&&e.__v_isRef===!0)}F("nextTick",()=>Dr);F("dispatch",e=>Ee.bind(Ee,e));F("watch",(e,{evaluateLater:t,effect:r})=>(n,i)=>{let o=t(n),a=!0,s,l=r(()=>o(u=>{JSON.stringify(u),a?s=u:queueMicrotask(()=>{i(u,s),s=u}),a=!1}));e._x_effects.delete(l)});F("store",Ji);F("data",e=>yr(e));F("root",e=>je(e));F("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=Ce(Po(e))),e._x_refs_proxy));function Po(e){let t=[],r=e;for(;r;)r._x_refs&&t.push(r._x_refs),r=r.parentNode;return t}var ft={};function An(e){return ft[e]||(ft[e]=0),++ft[e]}function Io(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]=An(t))}F("id",e=>(t,r=null)=>{let n=Io(e,t),i=n?n._x_ids[t]:An(t);return r?`${t}-${i}-${r}`:`${t}-${i}`});F("el",e=>e);Sn("Focus","focus","focus");Sn("Persist","persist","persist");function Sn(e,t,r){F(t,n=>de(`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 u;return i(f=>u=f),u},a=n(`${t} = __placeholder`),s=u=>a(()=>{},{scope:{__placeholder:u}}),l=o();s(l),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let u=e._x_model.get,f=e._x_model.set;r(()=>s(u())),r(()=>f(o()))})});A("teleport",(e,{expression:t},{cleanup:r})=>{e.tagName.toLowerCase()!=="template"&&de("x-teleport can only be used on a <template> tag",e);let n=document.querySelector(t);n||de(`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))})}),Oe(i,{},e),T(()=>{n.appendChild(i),U(i),i._x_ignore=!0}),r(()=>i.remove())});var Tn=()=>{};Tn.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",Tn);A("effect",(e,{expression:t},{effect:r})=>r(M(e,t)));function On(e,t,r,n){let i=e,o=l=>n(l),a={},s=(l,u)=>f=>u(l,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,(l,u)=>{u.preventDefault(),l(u)})),r.includes("stop")&&(o=s(o,(l,u)=>{u.stopPropagation(),l(u)})),r.includes("self")&&(o=s(o,(l,u)=>{u.target===e&&l(u)})),(r.includes("away")||r.includes("outside"))&&(i=document,o=s(o,(l,u)=>{e.contains(u.target)||u.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&l(u))})),r.includes("once")&&(o=s(o,(l,u)=>{l(u),i.removeEventListener(t,o,a)})),o=s(o,(l,u)=>{Ho(t)&&Bo(u,r)||l(u)}),r.includes("debounce")){let l=r[r.indexOf("debounce")+1]||"invalid-wait",u=Ct(l.split("ms")[0])?Number(l.split("ms")[0]):250;o=Ur(o,u)}if(r.includes("throttle")){let l=r[r.indexOf("throttle")+1]||"invalid-wait",u=Ct(l.split("ms")[0])?Number(l.split("ms")[0]):250;o=Gr(o,u)}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 Ct(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 Bo(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,Ct((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0||r.length===1&&fr(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&&fr(e.key).includes(r[0]))}function fr(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=M(e,r),a=`${r} = rightSideOfExpression($event, ${r})`,s=M(e,a);var l=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let u=qo(e,t,r),f=On(e,l,t,x=>{s(()=>{},{scope:{$event:x,rightSideOfExpression:u}})});e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=f,i(()=>e._x_removeModelListeners.default());let h=M(e,`${r} = __placeholder`);e._x_model={get(){let x;return o($=>x=$),x},set(x){h(()=>{},{scope:{__placeholder:x}})}},e._x_forceModelUpdate=()=>{o(x=>{x===void 0&&r.match(/\./)&&(x=""),window.fromModel=!0,T(()=>Vr(e,"value",x)),delete window.fromModel})},n(()=>{t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate()})});function qo(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=>!zo(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 Vo(t)?t:e}function zo(e,t){return e==t}function Vo(e){return!Array.isArray(e)&&!isNaN(e)}A("cloak",e=>queueMicrotask(()=>T(()=>e.removeAttribute(_e("cloak")))));Br(()=>`[${_e("init")}]`);A("init",Be((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,U(e),delete e._x_ignoreSelf})})})});Pt(kr(":",Nr(_e("bind:"))));A("bind",(e,{value:t,modifiers:r,expression:n,original:i},{effect:o})=>{if(!t){let s={};Qi(s),M(e,n)(u=>{Xr(e,u,i)},{scope:s});return}if(t==="key")return Wo(e,n);let a=M(e,n);o(()=>a(s=>{s===void 0&&typeof n=="string"&&n.match(/\./)&&(s=""),T(()=>Vr(e,t,s,r))}))});function Wo(e,t){e._x_keyExpression=t}Hr(()=>`[${_e("data")}]`);A("data",Be((e,{expression:t},{cleanup:r})=>{t=t===""?"{}":t;let n={};gt(n,e);let i={};to(i,n);let o=ce(e,t,{scope:i});o===void 0&&(o={}),gt(o,e);let a=he(o);wr(a);let s=Oe(e,a);a.init&&ce(e,a.init),r(()=>{a.destroy&&ce(e,a.destroy),s()})}));A("show",(e,{modifiers:t,expression:r},{effect:n})=>{let i=M(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),l=wt(h=>h?a():o(),h=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,h,a,o):h?s():o()}),u,f=!0;n(()=>i(h=>{!f&&h===u||(t.includes("immediate")&&(h?s():o()),l(h),u=h,f=!1)}))});A("for",(e,{expression:t},{effect:r,cleanup:n})=>{let i=Go(t),o=M(e,i.items),a=M(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},r(()=>Uo(e,i,o,a)),n(()=>{Object.values(e._x_lookup).forEach(s=>s.remove()),delete e._x_prevKeys,delete e._x_lookup})});function Uo(e,t,r,n){let i=a=>typeof a=="object"&&!Array.isArray(a),o=e;r(a=>{Yo(a)&&a>=0&&(a=Array.from(Array(a).keys(),d=>d+1)),a===void 0&&(a=[]);let s=e._x_lookup,l=e._x_prevKeys,u=[],f=[];if(i(a))a=Object.entries(a).map(([d,g])=>{let y=dr(t,g,d,a);n(C=>f.push(C),{scope:v({index:d},y)}),u.push(y)});else for(let d=0;d<a.length;d++){let g=dr(t,a[d],d,a);n(y=>f.push(y),{scope:v({index:d},g)}),u.push(g)}let h=[],x=[],$=[],E=[];for(let d=0;d<l.length;d++){let g=l[d];f.indexOf(g)===-1&&$.push(g)}l=l.filter(d=>!$.includes(d));let le="template";for(let d=0;d<f.length;d++){let g=f[d],y=l.indexOf(g);if(y===-1)l.splice(d,0,g),h.push([le,d]);else if(y!==d){let C=l.splice(d,1)[0],k=l.splice(y-1,1)[0];l.splice(d,0,k),l.splice(y,0,C),x.push([C,k])}else E.push(g);le=g}for(let d=0;d<$.length;d++){let g=$[d];s[g]._x_effects&&s[g]._x_effects.forEach(pr),s[g].remove(),s[g]=null,delete s[g]}for(let d=0;d<x.length;d++){let[g,y]=x[d],C=s[g],k=s[y],V=document.createElement("div");T(()=>{k.after(V),C.after(k),k._x_currentIfEl&&k.after(k._x_currentIfEl),V.before(C),C._x_currentIfEl&&C.after(C._x_currentIfEl),V.remove()}),sr(k,u[f.indexOf(y)])}for(let d=0;d<h.length;d++){let[g,y]=h[d],C=g==="template"?o:s[g];C._x_currentIfEl&&(C=C._x_currentIfEl);let k=u[y],V=f[y],I=document.importNode(o.content,!0).firstElementChild;Oe(I,he(k),o),T(()=>{C.after(I),U(I)}),typeof V=="object"&&de("x-for key cannot be an object, it must be a string or an integer",o),s[V]=I}for(let d=0;d<E.length;d++)sr(s[E[d]],u[f.indexOf(E[d])]);o._x_prevKeys=f})}function Go(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 dr(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 Yo(e){return!Array.isArray(e)&&!isNaN(e)}function Cn(){}Cn.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",Cn);A("if",(e,{expression:t},{effect:r,cleanup:n})=>{let i=M(e,t),o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let s=e.content.cloneNode(!0).firstElementChild;return Oe(s,{},e),T(()=>{e.after(s),U(s)}),e._x_currentIfEl=s,e._x_undoIf=()=>{ie(s,l=>{l._x_effects&&l._x_effects.forEach(pr)}),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(kr("@",Nr(_e("on:"))));A("on",Be((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let o=n?M(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())}));Qe("Collapse","collapse","collapse");Qe("Intersect","intersect","intersect");Qe("Focus","trap","focus");Qe("Mask","mask","mask");function Qe(e,t,r){A(t,n=>de(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}Re.setEvaluator(Tr);Re.setReactivityEngine({reactive:Vt,effect:fo,release:po,raw:b});var Xo=Re,Wt=Xo;var Jo=class{constructor(e){lt(this,"el");lt(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 O(e){return new Jo(e)}function Zo(e){let t=document.createElement("template");return t.innerHTML=e,t.content.firstElementChild}function Qo(e){return e.nodeType===3||e.nodeType===8}var Rn=()=>{},Mn=()=>{};async function Ut(e,t,r){let n,i,o,a,s,l,u,f,h,x,$;function E(c){if(!!$)return Mn((c||"").replace(`
6
+ `,"\\n"),n,i),new Promise(p=>Rn=()=>p())}function le(c={}){let p=P=>P.getAttribute("key"),_=()=>{};s=c.updating||_,l=c.updated||_,u=c.removing||_,f=c.removed||_,h=c.adding||_,x=c.added||_,o=c.key||p,a=c.lookahead||!1,$=c.debug||!1}async function d(c,p){if(g(c,p)){let P=y(c,p);return await E("Swap elements"),P}let _=!1;if(!me(s,c,p,()=>_=!0)){if(window.Alpine&&ea(c,p,()=>_=!0),Qo(p)){await C(c,p),l(c,p);return}_||await k(c,p),l(c,p),await V(c,p)}}function g(c,p){return c.nodeType!=p.nodeType||c.nodeName!=p.nodeName||I(c)!=I(p)}function y(c,p){if(me(u,c))return;let _=p.cloneNode(!0);me(h,_)||(O(c).replace(_),f(c),x(_))}async function C(c,p){let _=p.nodeValue;c.nodeValue!==_&&(c.nodeValue=_,await E("Change text node to: "+_))}async function k(c,p){if(c._x_isShown&&!p._x_isShown||!c._x_isShown&&p._x_isShown)return;let _=Array.from(c.attributes),P=Array.from(p.attributes);for(let z=_.length-1;z>=0;z--){let H=_[z].name;p.hasAttribute(H)||(c.removeAttribute(H),await E("Remove attribute"))}for(let z=P.length-1;z>=0;z--){let H=P[z].name,w=P[z].value;c.getAttribute(H)!==w&&(c.setAttribute(H,w),await E(`Set [${H}] attribute to: "${w}"`))}}async function V(c,p){let _=c.childNodes,P=p.childNodes,z=rr(P),H=rr(_),w=O(p).nodes().first(),m=O(c).nodes().first(),Q={};for(;w;){let N=I(w),B=I(m);if(!m)if(N&&Q[N]){let L=Q[N];O(c).append(L),m=L,await E("Add element (from key)")}else{let L=Vn(w,c)||{};await E("Add element: "+(L.outerHTML||L.nodeValue)),w=O(w).nodes().next();continue}if(a){let L=O(w).next(),nr=!1;for(;!nr&&L;)m.isEqualNode(L)&&(nr=!0,m=ot(w,m),B=I(m),await E("Move element (lookahead)")),L=O(L).next()}if(N!==B){if(!N&&B){Q[B]=m,m=ot(w,m),Q[B].remove(),m=O(m).nodes().next(),w=O(w).nodes().next(),await E('No "to" key');continue}if(N&&!B&&H[N]&&(m=O(m).replace(H[N]),await E('No "from" key')),N&&B){Q[B]=m;let L=H[N];if(L)m=O(m).replace(L),await E('Move "from" key');else{Q[B]=m,m=ot(w,m),Q[B].remove(),m=O(m).next(),w=O(w).next(),await E("Swap elements with keys");continue}}}let Wn=m&&O(m).nodes().next();await d(m,w),w=w&&O(w).nodes().next(),m=Wn}let at=[];for(;m;)me(u,m)||at.push(m),m=O(m).nodes().next();for(;at.length;){let N=at.shift();N.remove(),await E("remove el"),f(N)}}function I(c){return c&&c.nodeType===1&&o(c)}function rr(c){let p={};return c.forEach(_=>{let P=I(_);P&&(p[P]=_)}),p}function Vn(c,p){if(!me(h,c)){let _=c.cloneNode(!0);return O(p).append(_),x(_),_}return null}function ot(c,p){if(!me(h,c)){let _=c.cloneNode(!0);return O(p).before(_),x(_),_}return p}return le(r),n=e,i=Zo(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=()=>Rn();Ut.log=e=>{Mn=e};function me(e,...t){let r=!1;return e(...t,()=>r=!0),r}function ea(e,t,r){e.nodeType===1&&e._x_dataStack&&window.Alpine.clone(e,t)}function ta(e){e.morph=Ut}var kn=ta;Wt.plugin(kn);var ra=/INPUT/i,na=/date|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/i,ia=/TEXTAREA/i;function oa(e,t,r,n){if(e.nodeType!==Node.ELEMENT_NODE||e!==document.activeElement)return;if(e.tagName.match(ia)||e.tagName.match(ra)&&e.getAttribute("type").match(na))return n()}function aa(e,t){e.forEach(r=>Wt.morph(r,t,{updating:oa}))}var Nn=aa;function sa(e,t,r){if(e.match(/^dispatch(Event)?$/))return or(r,t[0],t[1]||{});if(e.match(/^morph|mutate$/))return Nn(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 l=s,u=n.split(".");for(;u.length>0;)l=l[u.shift()];return l})),sa(i,o,a)}var Gt=la;if(!self.Turbo)throw new Error("`Turbo` is not defined! Be sure to import `turbo_ready` 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.TurboReady={StreamActions:{invoke:Gt}};console.info("TurboReady has initialized and has registered new stream actions with Turbo.");var Yt=class{get element(){return document.querySelector('meta[name="turbo-reflex"]')}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 Y={start:"turbo-reflex:start",success:"turbo-reflex:success",finish:"turbo-reflex:finish",abort:"turbo-reflex:abort",clientError:"turbo-reflex:client-error",serverError:"turbo-reflex:server-error"},X={stateLoad:"turbo-reflex:state-load",stateChange:"turbo-reflex:state-change"},j=v(v({},Y),X);function R(e,t=document,r={},n=!1){try{t=t||document;let i=new CustomEvent(e,{detail:r,cancelable:!1,bubbles:!0});t.dispatchEvent(i)}catch(i){if(n)throw i;R(Y.clientError,t,v({error:i},r),!0)}}var Xt;function et(e,t=null){if(!e||typeof e!="object")return e;let r=new Proxy(e,{deleteProperty(n,i){return delete n[i],R(X.stateChange,S.element,{state:Xt}),!0},set(n,i,o,a){return n[i]=et(o,this),R(X.stateChange,S.element,{state:Xt}),!0}});if(Array.isArray(e))e.forEach((n,i)=>e[i]=et(n,r));else if(typeof e=="object")for(let[n,i]of Object.entries(e))e[n]=et(i,r);return t||(Xt=r),r}var Ln=et;var Jt,oe,tt,$n;function Pn(){if(!S.element)return ge();let e=atob(S.element.dataset.state);tt={},oe=Ln(JSON.parse(e)),Jt=v({},oe),delete S.element.dataset.clientStateChange,setTimeout(()=>R(X.stateLoad,S.element,{state:oe}))}function ge(){clearTimeout($n),$n=setTimeout(Pn,10)}Jt||Pn();addEventListener("DOMContentLoaded",ge);addEventListener("load",ge);addEventListener("turbo:load",ge);addEventListener("turbo:frame-load",ge);addEventListener("turbo-reflex:success",ge);addEventListener(X.stateChange,e=>{tt={};for(let[t,r]of Object.entries(oe))Jt[t]!==r&&(tt[t]=r);S.element.dataset.clientStateChange=!0,S.element.dataset.state=btoa(JSON.stringify(oe))});var ae={events:X,get current(){return oe},get delta(){return tt},get payloadChunks(){return btoa(JSON.stringify(oe)).match(/.{1,2000}/g)}};function ua(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 ca(e){document.body.insertAdjacentHTML("beforeend",e)}var se={append:ca,replaceDocument:ua};var rt={};function fa(e){rt[e.id]=e}function da(e){delete rt[e]}var nt={add:fa,remove:da,get reflexes(){return[...Object.values(rt)]},get length(){return Object.keys(rt).length}};function In(e){e.detail.endedAt=new Date().getTime(),e.detail.milliseconds=e.detail.endedAt-e.detail.startedAt,setTimeout(()=>R(Y.finish,e.target,e.detail),20)}addEventListener(Y.serverError,In);addEventListener(Y.success,In);addEventListener(Y.finish,e=>nt.remove(e.detail.id),!0);var J={events:Y};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-reflex.html",r.headers.Accept];n=n.filter(i=>i&&i.trim().length>0).join(", "),r.headers.Accept=n,r.headers["TurboReflex-Token"]=S.token}ae.payloadChunks.forEach((n,i)=>{r.headers[`TurboReflex-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("TurboReflex")){if(r.statusCode<200||r.statusCode>399){let n=`Server returned a ${r.statusCode} status code! TurboReflex requires 2XX-3XX status codes.`;R(J.events.clientError,document,ue(v({},e.detail),{error:n}),!0)}r.header("TurboReflex")==="Append"&&(e.preventDefault(),r.responseText.then(n=>se.append(n)))}});addEventListener("turbo:frame-load",e=>{let t=e.target.closest("turbo-frame");t.dataset.turboReflexSrc=Zt[t.id]||t.src||t.dataset.turboReflexSrc,delete Zt[t.id]});var pa={frameAttribute:"data-turbo-frame",methodAttribute:"data-turbo-method",reflexAttribute:"data-turbo-reflex"},K=v({},pa);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 ma(e,t){return e===_a(t)}var Z={events:it,register:ha,isRegisteredForElement:ma,set handler(e){Dn=e}};function ga(e){return e.closest(`[${K.reflexAttribute}]`)}function va(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 ba(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[K.reflexAttribute],delete t[K.frameAttribute],t}var Me={buildAttributePayload:ba,findClosestReflex:ga,findClosestFrame:va};function ya(e,t={}){t.token=S.token;let r=document.createElement("input");r.type="hidden",r.name="turbo_reflex",r.value=JSON.stringify(t),e.appendChild(r)}var Fn={invokeReflex:ya};function wa(e,t={}){let r=document.createElement("a");r.href=e;let n=new URL(r);return n.searchParams.set("turbo_reflex",JSON.stringify(t)),n}var ve={build:wa};function Ea(e,t){let r=t.src;t=v({},t),delete t.src,e.src=ve.build(r,t)}var Qt={invokeReflex:Ea};function Aa(e,t={}){let r=t.src;t=v({},t),delete t.src,delete t.href,e.setAttribute("href",ve.build(r,t))}var jn={invokeReflex:Aa};function Sa(e){let t=e.target;R(J.events.abort,document,v({xhr:t},e.detail))}function er(e){let t=e.target;t.getResponseHeader("TurboReflex")==="Append"?se.append(t.responseText):se.replaceDocument(t.responseText);let r=`Server returned a ${t.status} status code! TurboReflex requires 2XX-3XX status codes.`;R(J.events.clientError,document,ue(v({xhr:t},e.detail),{error:r}),!0)}function Ta(e){let t=e.target;if(t.status<200||t.status>399)return er(e);let r=t.responseText;t.getResponseHeader("TurboReflex")==="Append"?se.append(t.responseText):se.replaceDocument(t.responseText)}function Oa(e){let t=e.src;e=v({},e),delete e.src;try{let r=new XMLHttpRequest;r.open("GET",ve.build(t,e),!0),r.setRequestHeader("Accept","text/vnd.turbo-reflex.html, text/html, application/xhtml+xml"),r.setRequestHeader("TurboReflex-Token",S.token),ae.payloadChunks.forEach((n,i)=>r.setRequestHeader(`TurboReflex-State-${i.toString().padStart(4,"0")}`,n)),r.addEventListener("abort",Sa),r.addEventListener("error",er),r.addEventListener("load",Ta),r.send()}catch(r){let n=`Unexpected error sending HTTP request! ${r.message}`;er(r,{detail:{message:n}})}}var Kn={invokeReflex:Oa};function tr(e,t){return t=t||{dataset:{}},e.href||t.src||t.dataset.turboReflexSrc||location.href}function Ca(e){let t=Me.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,invokeReflex:Fn.invokeReflex}:n&&n.length>0?{name:"method",reason:"Element defines data-turbo-method.",frame:t,src:e.href,invokeReflex:jn.invokeReflex}:r&&r!=="_self"?(t=document.getElementById(r),{name:"frame",reason:"element targets a frame that is not _self",frame:t,src:tr(e,t),invokeReflex:Qt.invokeReflex}):(!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),invokeReflex:Qt.invokeReflex}:{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),invokeReflex:Kn.invokeReflex}}var Hn={find:Ca};var ke="unknown",Bn={debug:Object.values(j),info:Object.values(j),warn:[j.abort,j.clientError,j.serverError],error:[j.clientError,j.serverError],unknown:[]};Object.values(j).forEach(e=>{addEventListener(e,t=>{Bn[ke].includes(t.type)&&console[ke==="debug"?"log":ke](t.type,{target:t.target,detail:t.detail})})});var qn={get level(){return ke},set level(e){return Object.keys(Bn).includes(e)||(e="unknown"),ke=e}};function Ra(){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:Ra};function Ma(e){let t,r={};try{if(t=Me.findClosestReflex(e.target),!t||!Z.isRegisteredForElement(e.type,t))return;let n=Hn.find(t);switch(r={id:`reflex-${zn.v4()}`,name:t.dataset.turboReflex,driver:n.name,src:n.src,frameId:n.frame?n.frame.id:null,elementId:t.id.length>0?t.id:null,elementAttributes:Me.buildAttributePayload(t),startedAt:new Date().getTime()},nt.add(r),R(J.events.start,t,r),["frame","window"].includes(n.name)&&e.preventDefault(),S.busy=!0,setTimeout(()=>S.busy=!1,10),n.name){case"method":return n.invokeReflex(t,r);case"form":return n.invokeReflex(t,r);case"frame":return n.invokeReflex(n.frame,r);case"window":return n.invokeReflex(r)}}catch(n){R(J.events.clientError,t,v({error:n},r))}}Z.handler=Ma;Z.register("change",[`input[${K.reflexAttribute}]`,`select[${K.reflexAttribute}]`,`textarea[${K.reflexAttribute}]`]);Z.register("submit",[`form[${K.reflexAttribute}]`]);Z.register("click",[`[${K.reflexAttribute}]`]);self.TurboReflex={logger:qn,schema:K,registerEventDelegate:Z.register,get eventDelegates(){return v({},Z.events)},get events(){return v({},j)},get state(){return ae.current},get stateDelta(){return ae.delta}};var ml=self.TurboReflex;export{ml as default};
2
7
  //# sourceMappingURL=turbo_reflex.js.map