From 33c3f47826b51db19b12a0f2c78806d54c8f5867 Mon Sep 17 00:00:00 2001 From: "Nate Hopkins (hopsoft)" Date: Mon, 16 Jan 2023 22:11:38 -0700 Subject: [PATCH 01/16] Add busy slot to show activity --- app/assets/builds/@turbo-boost/elements.js | 3104 ++++++++++++++++- .../builds/@turbo-boost/elements.js.map | 8 +- .../turbo_boost/elements/toggle_command.rb | 1 - .../devtools/elements/tooltip_element.js | 22 +- app/javascript/devtools/toggle.js | 64 +- app/javascript/elements/index.js | 8 +- .../target_element.js} | 4 +- .../target_focus.js} | 0 .../trigger_element.js} | 29 +- .../elements/turbo_boost_element.js | 9 +- lib/turbo_boost/elements/engine.rb | 1 + .../elements/tag_builders/base_tag_builder.rb | 9 +- .../tag_builders/toggle_tags_builder.rb | 28 +- package.json | 2 +- 14 files changed, 3207 insertions(+), 82 deletions(-) rename app/javascript/elements/{toggle_target_element.js => toggle/target_element.js} (95%) rename app/javascript/elements/{toggle_target_focus.js => toggle/target_focus.js} (100%) rename app/javascript/elements/{toggle_trigger_element.js => toggle/trigger_element.js} (83%) diff --git a/app/assets/builds/@turbo-boost/elements.js b/app/assets/builds/@turbo-boost/elements.js index 792f152..ad9ae45 100644 --- a/app/assets/builds/@turbo-boost/elements.js +++ b/app/assets/builds/@turbo-boost/elements.js @@ -1,15 +1,2413 @@ -var _o=Object.defineProperty,yo=Object.defineProperties;var xo=Object.getOwnPropertyDescriptors;var yr=Object.getOwnPropertySymbols;var Eo=Object.prototype.hasOwnProperty,wo=Object.prototype.propertyIsEnumerable;var xr=(e,t,r)=>t in e?_o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,X=(e,t)=>{for(var r in t||(t={}))Eo.call(t,r)&&xr(e,r,t[r]);if(yr)for(var r of yr(t))wo.call(t,r)&&xr(e,r,t[r]);return e},K=(e,t)=>yo(e,xo(t));var ko=Object.defineProperty,To=Object.defineProperties,Ao=Object.getOwnPropertyDescriptors,Er=Object.getOwnPropertySymbols,So=Object.prototype.hasOwnProperty,Co=Object.prototype.propertyIsEnumerable,wr=(e,t,r)=>t in e?ko(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,S=(e,t)=>{for(var r in t||(t={}))So.call(t,r)&&wr(e,r,t[r]);if(Er)for(var r of Er(t))Co.call(t,r)&&wr(e,r,t[r]);return e},G=(e,t)=>To(e,Ao(t)),Oo=Object.defineProperty,Lo=Object.defineProperties,$o=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertySymbols,jo=Object.prototype.hasOwnProperty,Mo=Object.prototype.propertyIsEnumerable,Ot=(e,t,r)=>t in e?Oo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xe=(e,t)=>{for(var r in t||(t={}))jo.call(t,r)&&Ot(e,r,t[r]);if(kr)for(var r of kr(t))Mo.call(t,r)&&Ot(e,r,t[r]);return e},No=(e,t)=>Lo(e,$o(t)),Tr=(e,t,r)=>(Ot(e,typeof t!="symbol"?t+"":t,r),r);function Ro(e,t,r={}){let n=new CustomEvent(t,r);e.forEach(o=>o.dispatchEvent(n))}var Po=Ro,Lt=!1,$t=!1,ne=[];function Do(e){Bo(e)}function Bo(e){ne.includes(e)||ne.push(e),Ho()}function Dr(e){let t=ne.indexOf(e);t!==-1&&ne.splice(t,1)}function Ho(){!$t&&!Lt&&(Lt=!0,queueMicrotask(qo))}function qo(){Lt=!1,$t=!0;for(let e=0;ee.effect(t,{scheduler:r=>{jt?Do(r):r()}}),Br=e.raw}function Ar(e){je=e}function Fo(e){let t=()=>{};return[r=>{let n=je(r);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(n),t=()=>{n!==void 0&&(e._x_effects.delete(n),et(n))},n},()=>{t()}]}var Hr=[],qr=[],Ir=[];function Wo(e){Ir.push(e)}function zr(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,qr.push(t))}function Vo(e){Hr.push(e)}function Uo(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function Fr(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(o=>o()),delete e._x_attributeCleanups[r])})}var Xt=new MutationObserver(Zt),Kt=!1;function Wr(){Xt.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Kt=!0}function Xo(){Ko(),Xt.disconnect(),Kt=!1}var Te=[],wt=!1;function Ko(){Te=Te.concat(Xt.takeRecords()),Te.length&&!wt&&(wt=!0,queueMicrotask(()=>{Jo(),wt=!1}))}function Jo(){Zt(Te),Te.length=0}function T(e){if(!Kt)return e();Xo();let t=e();return Wr(),t}var Jt=!1,Ke=[];function Zo(){Jt=!0}function Go(){Jt=!1,Zt(Ke),Ke=[]}function Zt(e){if(Jt){Ke=Ke.concat(e);return}let t=[],r=[],n=new Map,o=new Map;for(let i=0;is.nodeType===1&&t.push(s)),e[i].removedNodes.forEach(s=>s.nodeType===1&&r.push(s))),e[i].type==="attributes")){let s=e[i].target,a=e[i].attributeName,l=e[i].oldValue,u=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},d=()=>{o.has(s)||o.set(s,[]),o.get(s).push(a)};s.hasAttribute(a)&&l===null?u():s.hasAttribute(a)?(d(),u()):d()}o.forEach((i,s)=>{Fr(s,i)}),n.forEach((i,s)=>{Hr.forEach(a=>a(s,i))});for(let i of r)if(!t.includes(i)&&(qr.forEach(s=>s(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)r.includes(i)||i.isConnected&&(delete i._x_ignoreSelf,delete i._x_ignore,Ir.forEach(s=>s(i)),i._x_ignore=!0,i._x_ignoreSelf=!0);t.forEach(i=>{delete i._x_ignoreSelf,delete i._x_ignore}),t=null,r=null,n=null,o=null}function Vr(e){return Ne(he(e))}function Me(e,t,r){return e._x_dataStack=[t,...he(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,o])=>{r[n]=o})}function he(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?he(e.host):e.parentNode?he(e.parentNode):[]}function Ne(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(r=>Object.keys(r)))),has:(r,n)=>e.some(o=>o.hasOwnProperty(n)),get:(r,n)=>(e.find(o=>{if(o.hasOwnProperty(n)){let i=Object.getOwnPropertyDescriptor(o,n);if(i.get&&i.get._x_alreadyBound||i.set&&i.set._x_alreadyBound)return!0;if((i.get||i.set)&&i.enumerable){let s=i.get,a=i.set,l=i;s=s&&s.bind(t),a=a&&a.bind(t),s&&(s._x_alreadyBound=!0),a&&(a._x_alreadyBound=!0),Object.defineProperty(o,n,No(Xe({},l),{get:s,set:a}))}return!0}return!1})||{})[n],set:(r,n,o)=>{let i=e.find(s=>s.hasOwnProperty(n));return i?i[n]=o:e[e.length-1][n]=o,!0}});return t}function Ur(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,o="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([i,{value:s,enumerable:a}])=>{if(a===!1||s===void 0)return;let l=o===""?i:`${o}.${i}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[i]=s.initialize(e,l,i):t(s)&&s!==n&&!(s instanceof Element)&&r(s,l)})};return r(e)}function Xr(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,o,i){return e(this.initialValue,()=>Yo(n,o),s=>Kr(n,o,s),o,i)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let o=r.initialize.bind(r);r.initialize=(i,s,a)=>{let l=n.initialize(i,s,a);return r.initialValue=l,o(i,s,a)}}else r.initialValue=n;return r}}function Yo(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function Kr(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]]={}),Kr(e[t[0]],t.slice(1),r)}}var Jr={};function H(e,t){Jr[e]=t}function Mt(e,t){return Object.entries(Jr).forEach(([r,n])=>{Object.defineProperty(e,`$${r}`,{get(){let[o,i]=tn(t);return o=Xe({interceptor:Xr},o),zr(t,i),n(t,o)},enumerable:!1})}),e}function Qo(e,t,r,...n){try{return r(...n)}catch(o){Oe(o,e,t)}}function Oe(e,t,r=void 0){Object.assign(e,{el:t,expression:r}),console.warn(`Alpine Expression Error: ${e.message} +var __defProp = Object.defineProperty; +var __defProps = Object.defineProperties; +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols = Object.getOwnPropertySymbols; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __propIsEnum = Object.prototype.propertyIsEnumerable; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues = (a, b2) => { + for (var prop in b2 || (b2 = {})) + if (__hasOwnProp.call(b2, prop)) + __defNormalProp(a, prop, b2[prop]); + if (__getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(b2)) { + if (__propIsEnum.call(b2, prop)) + __defNormalProp(a, prop, b2[prop]); + } + return a; +}; +var __spreadProps = (a, b2) => __defProps(a, __getOwnPropDescs(b2)); -${r?'Expression: "'+r+`" +// node_modules/@turbo-boost/commands/app/assets/builds/@turbo-boost/commands.js +var Xr = Object.defineProperty; +var Jr = Object.defineProperties; +var Zr = Object.getOwnPropertyDescriptors; +var nn = Object.getOwnPropertySymbols; +var Yr = Object.prototype.hasOwnProperty; +var Gr = Object.prototype.propertyIsEnumerable; +var rn = (e, t, n) => t in e ? Xr(e, t, { enumerable: true, configurable: true, writable: true, value: n }) : e[t] = n; +var 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; +}; +var B = (e, t) => Jr(e, Zr(t)); +var Qr = Object.defineProperty; +var eo = Object.defineProperties; +var to = Object.getOwnPropertyDescriptors; +var on = Object.getOwnPropertySymbols; +var no = Object.prototype.hasOwnProperty; +var ro = Object.prototype.propertyIsEnumerable; +var ft = (e, t, n) => t in e ? Qr(e, t, { enumerable: true, configurable: true, writable: true, value: n }) : e[t] = n; +var 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; +}; +var oo = (e, t) => eo(e, to(t)); +var 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; +var mt = false; +var pt = false; +var 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 = true, queueMicrotask(co)); +} +function co() { + mt = false, pt = true; + for (let e = 0; e < te.length; e++) + te[e](); + te.length = 0, pt = false; +} +var me; +var Ae; +var qe; +var hn; +var ht = true; +function fo(e) { + ht = false, e(), ht = true; +} +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 = /* @__PURE__ */ 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 = []; +var vn = []; +var 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); +var Tt = false; +function yn() { + Ot.observe(document, { subtree: true, childList: true, attributes: true, attributeOldValue: true }), Tt = true; +} +function go() { + bo(), Ot.disconnect(), Tt = false; +} +var ye = []; +var lt = false; +function bo() { + ye = ye.concat(Ot.takeRecords()), ye.length && !lt && (lt = true, queueMicrotask(() => { + xo(), lt = false; + })); +} +function xo() { + Lt(ye), ye.length = 0; +} +function C(e) { + if (!Tt) + return e(); + go(); + let t = e(); + return yn(), t; +} +var $t = false; +var Be = []; +function yo() { + $t = true; +} +function wo() { + $t = false, Lt(Be), Be = []; +} +function Lt(e) { + if ($t) { + Be = Be.concat(e); + return; + } + let t = [], n = [], r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ 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 = true, i._x_ignore = true; + }); + 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 = true, i._x_ignoreSelf = true); + 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 true; + 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 = true), s && (s._x_alreadyBound = true), Object.defineProperty(o, r, oo(Re({}, l), { get: a, set: s })); + } + return true; + } + return false; + }) || {})[r], set: (n, r, o) => { + let i = e.find((a) => a.hasOwnProperty(r)); + return i ? i[r] = o : e[e.length - 1][r] = o, true; + } }); + 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 === false || 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: true, 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: false }); + }), 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} + +${n ? 'Expression: "' + n + `" + +` : ""}`, t), setTimeout(() => { + throw e; + }, 0); +} +var Me = true; +function Ao(e) { + let t = Me; + Me = false, 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 = false; + 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 = false; +var xe = /* @__PURE__ */ new Map(); +var Ln = Symbol(); +function Lo(e) { + vt = true; + let t = Symbol(); + Ln = t, xe.set(t, []); + let n = () => { + for (; xe.get(t).length; ) + xe.get(t).shift()(); + xe.delete(t); + }, r = () => { + vt = false, 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 }); +var 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"; +var 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: true, composed: true, cancelable: true })); +} +var bt = []; +var Mt = false; +function In(e = () => { +}) { + return queueMicrotask(() => { + Mt || setTimeout(() => { + xt(); + }); + }), new Promise((t) => { + bt.push(() => { + e(), t(); + }); + }); +} +function xt() { + for (Mt = false; bt.length; ) + bt.shift()(); +} +function Mo() { + Mt = true; +} +function oe(e, t) { + if (typeof ShadowRoot == "function" && e instanceof ShadowRoot) { + Array.from(e.children).forEach((o) => oe(o, t)); + return; + } + let n = false; + if (t(e, () => n = true), n) + return; + let r = e.firstElementChild; + for (; r; ) + oe(r, t, false), 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 `` is available. Did you forget to add `defer` in Alpine's `