From 42aafab494ef9b4980cb7d6ff6d4de290c13ae31 Mon Sep 17 00:00:00 2001 From: Jeffrey van Rossum Date: Wed, 16 Oct 2024 20:49:46 +0800 Subject: [PATCH] Refactor/cleanup (#3) --- assets/js/frame.js | 2 +- assets/js/paver.js | 2 +- resources/js/alpine/tooltip.js | 2 +- resources/js/frame.js | 37 +++++++++++++------------------ resources/js/paver.js | 28 ++++++++++++----------- resources/views/block-toolbar.php | 8 +++---- resources/views/editor.php | 10 ++++----- 7 files changed, 43 insertions(+), 46 deletions(-) diff --git a/assets/js/frame.js b/assets/js/frame.js index fe3c1f5..490eec7 100644 --- a/assets/js/frame.js +++ b/assets/js/frame.js @@ -1,2 +1,2 @@ /*! For license information please see frame.js.LICENSE.txt */ -(()=>{var e={32:()=>{document.addEventListener("alpine:init",(function(){Alpine.directive("tooltip",(function(e,t,n){var r=t.expression,i=n.effect,o=(0,n.evaluate)(r);i((function(){tippy(e,{content:o})}))}))}))},196:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(314),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,'.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity;white-space:normal}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.tippy-content{padding:5px 9px;position:relative;z-index:1}',""]);const o=i},314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var o=0;o{"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0,(()=>{"use strict";var e,t,r,i,o=!1,a=!1,s=[],c=-1;function u(e){!function(e){s.includes(e)||s.push(e);a||o||(o=!0,queueMicrotask(f))}(e)}function l(e){let t=s.indexOf(e);-1!==t&&t>c&&s.splice(t,1)}function f(){o=!1,a=!0;for(let e=0;e{let t=e();JSON.stringify(t),o?i=t:queueMicrotask((()=>{n(t,i),i=t})),o=!1}));return()=>r(a)}var v=[],m=[],y=[];function g(e,t){"function"==typeof t?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,m.push(t))}function b(e){v.push(e)}function x(e,t,n){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(n)}function _(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach((([n,r])=>{(void 0===t||t.includes(n))&&(r.forEach((e=>e())),delete e._x_attributeCleanups[n])}))}var w=new MutationObserver(T),O=!1;function E(){w.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),O=!0}function k(){!function(){let e=w.takeRecords();A.push((()=>e.length>0&&T(e)));let t=A.length;queueMicrotask((()=>{if(A.length===t)for(;A.length>0;)A.shift()()}))}(),w.disconnect(),O=!1}var A=[];function S(e){if(!O)return e();k();let t=e();return E(),t}var j=!1,L=[];function T(e){if(j)return void(L=L.concat(e));let t=new Set,n=new Set,r=new Map,i=new Map;for(let o=0;o1===e.nodeType&&t.add(e))),e[o].removedNodes.forEach((e=>1===e.nodeType&&n.add(e)))),"attributes"===e[o].type)){let t=e[o].target,n=e[o].attributeName,a=e[o].oldValue,s=()=>{r.has(t)||r.set(t,[]),r.get(t).push({name:n,value:t.getAttribute(n)})},c=()=>{i.has(t)||i.set(t,[]),i.get(t).push(n)};t.hasAttribute(n)&&null===a?s():t.hasAttribute(n)?(c(),s()):c()}i.forEach(((e,t)=>{_(t,e)})),r.forEach(((e,t)=>{v.forEach((n=>n(t,e)))}));for(let e of n)t.has(e)||m.forEach((t=>t(e)));t.forEach((e=>{e._x_ignoreSelf=!0,e._x_ignore=!0}));for(let e of t)n.has(e)||e.isConnected&&(delete e._x_ignoreSelf,delete e._x_ignore,y.forEach((t=>t(e))),e._x_ignore=!0,e._x_ignoreSelf=!0);t.forEach((e=>{delete e._x_ignoreSelf,delete e._x_ignore})),t=null,n=null,r=null,i=null}function C(e){return D(P(e))}function N(e,t,n){return e._x_dataStack=[t,...P(n||e)],()=>{e._x_dataStack=e._x_dataStack.filter((e=>e!==t))}}function P(e){return e._x_dataStack?e._x_dataStack:"function"==typeof ShadowRoot&&e instanceof ShadowRoot?P(e.host):e.parentNode?P(e.parentNode):[]}function D(e){return new Proxy({objects:e},M)}var M={ownKeys:({objects:e})=>Array.from(new Set(e.flatMap((e=>Object.keys(e))))),has:({objects:e},t)=>t!=Symbol.unscopables&&e.some((e=>Object.prototype.hasOwnProperty.call(e,t)||Reflect.has(e,t))),get:({objects:e},t,n)=>"toJSON"==t?$:Reflect.get(e.find((e=>Reflect.has(e,t)))||{},t,n),set({objects:e},t,n,r){const i=e.find((e=>Object.prototype.hasOwnProperty.call(e,t)))||e[e.length-1],o=Object.getOwnPropertyDescriptor(i,t);return o?.set&&o?.get?o.set.call(r,n)||!0:Reflect.set(i,t,n)}};function $(){return Reflect.ownKeys(this).reduce(((e,t)=>(e[t]=Reflect.get(this,t),e)),{})}function B(e){let t=(n,r="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach((([i,{value:o,enumerable:a}])=>{if(!1===a||void 0===o)return;if("object"==typeof o&&null!==o&&o.__v_skip)return;let s=""===r?i:`${r}.${i}`;var c;"object"==typeof o&&null!==o&&o._x_interceptor?n[i]=o.initialize(e,s,i):"object"!=typeof(c=o)||Array.isArray(c)||null===c||o===n||o instanceof Element||t(o,s)}))};return t(e)}function R(e,t=()=>{}){let n={initialValue:void 0,_x_interceptor:!0,initialize(t,n,r){return e(this.initialValue,(()=>function(e,t){return t.split(".").reduce(((e,t)=>e[t]),e)}(t,n)),(e=>I(t,n,e)),n,r)}};return t(n),e=>{if("object"==typeof e&&null!==e&&e._x_interceptor){let t=n.initialize.bind(n);n.initialize=(r,i,o)=>{let a=e.initialize(r,i,o);return n.initialValue=a,t(r,i,o)}}else n.initialValue=e;return n}}function I(e,t,n){if("string"==typeof t&&(t=t.split(".")),1!==t.length){if(0===t.length)throw error;return e[t[0]]||(e[t[0]]={}),I(e[t[0]],t.slice(1),n)}e[t[0]]=n}var F={};function W(e,t){F[e]=t}function H(e,t){return Object.entries(F).forEach((([n,r])=>{let i=null;Object.defineProperty(e,`$${n}`,{get:()=>r(t,function(){if(i)return i;{let[e,n]=ce(t);return i={interceptor:R,...e},g(t,n),i}}()),enumerable:!1})})),e}function V(e,t,n,...r){try{return n(...r)}catch(n){q(n,e,t)}}function q(e,t,n=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:n}),console.warn(`Alpine Expression Error: ${e.message}\n\n${n?'Expression: "'+n+'"\n\n':""}`,t),setTimeout((()=>{throw e}),0)}var z=!0;function U(e){let t=z;z=!1;let n=e();return z=t,n}function J(e,t,n={}){let r;return G(e,t)((e=>r=e),n),r}function G(...e){return K(...e)}var K=Y;function Y(e,t){let n={};H(n,e);let r=[n,...P(e)],i="function"==typeof t?function(e,t){return(n=()=>{},{scope:r={},params:i=[]}={})=>{Z(n,t.apply(D([r,...e]),i))}}(r,t):function(e,t,n){let r=function(e,t){if(X[e])return X[e];let n=Object.getPrototypeOf((async function(){})).constructor,r=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e;const i=()=>{try{let t=new n(["__self","scope"],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`);return Object.defineProperty(t,"name",{value:`[Alpine] ${e}`}),t}catch(n){return q(n,t,e),Promise.resolve()}};let o=i();return X[e]=o,o}(t,n);return(i=()=>{},{scope:o={},params:a=[]}={})=>{r.result=void 0,r.finished=!1;let s=D([o,...e]);if("function"==typeof r){let e=r(r,s).catch((e=>q(e,n,t)));r.finished?(Z(i,r.result,s,a,n),r.result=void 0):e.then((e=>{Z(i,e,s,a,n)})).catch((e=>q(e,n,t))).finally((()=>r.result=void 0))}}}(r,t,e);return V.bind(null,e,t,i)}var X={};function Z(e,t,n,r,i){if(z&&"function"==typeof t){let o=t.apply(n,r);o instanceof Promise?o.then((t=>Z(e,t,n,r))).catch((e=>q(e,i,t))):e(o)}else"object"==typeof t&&t instanceof Promise?t.then((t=>e(t))):e(t)}var Q="x-";function ee(e=""){return Q+e}var te={};function ne(e,t){return te[e]=t,{before(t){if(!te[t])return void console.warn(String.raw`Cannot find directive \`${t}\`. \`${e}\` will use the default order of execution`);const n=me.indexOf(t);me.splice(n>=0?n:me.indexOf("DEFAULT"),0,e)}}}function re(e,t,n){if(t=Array.from(t),e._x_virtualDirectives){let n=Object.entries(e._x_virtualDirectives).map((([e,t])=>({name:e,value:t}))),r=ie(n);n=n.map((e=>r.find((t=>t.name===e.name))?{name:`x-bind:${e.name}`,value:`"${e.value}"`}:e)),t=t.concat(n)}let r={},i=t.map(le(((e,t)=>r[e]=t))).filter(de).map(function(e,t){return({name:n,value:r})=>{let i=n.match(he()),o=n.match(/:([a-zA-Z0-9\-_:]+)/),a=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],s=t||e[n]||n;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:a.map((e=>e.replace(".",""))),expression:r,original:s}}}(r,n)).sort(ye);return i.map((t=>function(e,t){let n=()=>{},r=te[t.type]||n,[i,o]=ce(e);x(e,t.original,o);let a=()=>{e._x_ignore||e._x_ignoreSelf||(r.inline&&r.inline(e,t,i),r=r.bind(r,e,t,i),oe?ae.get(se).push(r):r())};return a.runCleanups=o,a}(e,t)))}function ie(e){return Array.from(e).map(le()).filter((e=>!de(e)))}var oe=!1,ae=new Map,se=Symbol();function ce(e){let n=[],[i,o]=function(e){let n=()=>{};return[i=>{let o=t(i);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach((e=>e()))}),e._x_effects.add(o),n=()=>{void 0!==o&&(e._x_effects.delete(o),r(o))},o},()=>{n()}]}(e);n.push(o);return[{Alpine:pt,effect:i,cleanup:e=>n.push(e),evaluateLater:G.bind(G,e),evaluate:J.bind(J,e)},()=>n.forEach((e=>e()))]}var ue=(e,t)=>({name:n,value:r})=>(n.startsWith(e)&&(n=n.replace(e,t)),{name:n,value:r});function le(e=()=>{}){return({name:t,value:n})=>{let{name:r,value:i}=fe.reduce(((e,t)=>t(e)),{name:t,value:n});return r!==t&&e(r,t),{name:r,value:i}}}var fe=[];function pe(e){fe.push(e)}function de({name:e}){return he().test(e)}var he=()=>new RegExp(`^${Q}([^:^.]+)\\b`);var ve="DEFAULT",me=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",ve,"teleport"];function ye(e,t){let n=-1===me.indexOf(e.type)?ve:e.type,r=-1===me.indexOf(t.type)?ve:t.type;return me.indexOf(n)-me.indexOf(r)}function ge(e,t,n={}){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}function be(e,t){if("function"==typeof ShadowRoot&&e instanceof ShadowRoot)return void Array.from(e.children).forEach((e=>be(e,t)));let n=!1;if(t(e,(()=>n=!0)),n)return;let r=e.firstElementChild;for(;r;)be(r,t),r=r.nextElementSibling}function xe(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var _e=!1;var we=[],Oe=[];function Ee(){return we.map((e=>e()))}function ke(){return we.concat(Oe).map((e=>e()))}function Ae(e){we.push(e)}function Se(e){Oe.push(e)}function je(e,t=!1){return Le(e,(e=>{if((t?ke():Ee()).some((t=>e.matches(t))))return!0}))}function Le(e,t){if(e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),e.parentElement)return Le(e.parentElement,t)}}var Te=[];function Ce(e,t=be,n=()=>{}){!function(e){oe=!0;let t=Symbol();se=t,ae.set(t,[]);let n=()=>{for(;ae.get(t).length;)ae.get(t).shift()();ae.delete(t)};e(n),oe=!1,n()}((()=>{t(e,((e,t)=>{n(e,t),Te.forEach((n=>n(e,t))),re(e,e.attributes).forEach((e=>e())),e._x_ignore&&t()}))}))}function Ne(e,t=be){t(e,(e=>{_(e),function(e){if(e._x_cleanups)for(;e._x_cleanups.length;)e._x_cleanups.pop()()}(e)}))}var Pe=[],De=!1;function Me(e=()=>{}){return queueMicrotask((()=>{De||setTimeout((()=>{$e()}))})),new Promise((t=>{Pe.push((()=>{e(),t()}))}))}function $e(){for(De=!1;Pe.length;)Pe.shift()()}function Be(e,t){return Array.isArray(t)?Re(e,t.join(" ")):"object"==typeof t&&null!==t?function(e,t){let n=e=>e.split(" ").filter(Boolean),r=Object.entries(t).flatMap((([e,t])=>!!t&&n(e))).filter(Boolean),i=Object.entries(t).flatMap((([e,t])=>!t&&n(e))).filter(Boolean),o=[],a=[];return i.forEach((t=>{e.classList.contains(t)&&(e.classList.remove(t),a.push(t))})),r.forEach((t=>{e.classList.contains(t)||(e.classList.add(t),o.push(t))})),()=>{a.forEach((t=>e.classList.add(t))),o.forEach((t=>e.classList.remove(t)))}}(e,t):"function"==typeof t?Be(e,t()):Re(e,t)}function Re(e,t){return t=!0===t?t="":t||"",n=t.split(" ").filter((t=>!e.classList.contains(t))).filter(Boolean),e.classList.add(...n),()=>{e.classList.remove(...n)};var n}function Ie(e,t){return"object"==typeof t&&null!==t?function(e,t){let n={};return Object.entries(t).forEach((([t,r])=>{n[t]=e.style[t],t.startsWith("--")||(t=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()),e.style.setProperty(t,r)})),setTimeout((()=>{0===e.style.length&&e.removeAttribute("style")})),()=>{Ie(e,n)}}(e,t):function(e,t){let n=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",n||"")}}(e,t)}function Fe(e,t=()=>{}){let n=!1;return function(){n?t.apply(this,arguments):(n=!0,e.apply(this,arguments))}}function We(e,t,n={}){e._x_transition||(e._x_transition={enter:{during:n,start:n,end:n},leave:{during:n,start:n,end:n},in(n=()=>{},r=()=>{}){Ve(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,r)},out(n=()=>{},r=()=>{}){Ve(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,r)}})}function He(e){let t=e.parentNode;if(t)return t._x_hidePromise?t:He(t)}function Ve(e,t,{during:n,start:r,end:i}={},o=()=>{},a=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),0===Object.keys(n).length&&0===Object.keys(r).length&&0===Object.keys(i).length)return o(),void a();let s,c,u;!function(e,t){let n,r,i,o=Fe((()=>{S((()=>{n=!0,r||t.before(),i||(t.end(),$e()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning}))}));e._x_transitioning={beforeCancels:[],beforeCancel(e){this.beforeCancels.push(e)},cancel:Fe((function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()})),finish:o},S((()=>{t.start(),t.during()})),De=!0,requestAnimationFrame((()=>{if(n)return;let o=1e3*Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s","")),a=1e3*Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""));0===o&&(o=1e3*Number(getComputedStyle(e).animationDuration.replace("s",""))),S((()=>{t.before()})),r=!0,requestAnimationFrame((()=>{n||(S((()=>{t.end()})),$e(),setTimeout(e._x_transitioning.finish,o+a),i=!0)}))}))}(e,{start(){s=t(e,r)},during(){c=t(e,n)},before:o,end(){s(),u=t(e,i)},after:a,cleanup(){c(),u()}})}function qe(e,t,n){if(-1===e.indexOf(t))return n;const r=e[e.indexOf(t)+1];if(!r)return n;if("scale"===t&&isNaN(r))return n;if("duration"===t||"delay"===t){let e=r.match(/([0-9]+)ms/);if(e)return e[1]}return"origin"===t&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[r,e[e.indexOf(t)+2]].join(" "):r}ne("transition",((e,{value:t,modifiers:n,expression:r},{evaluate:i})=>{"function"==typeof r&&(r=i(r)),!1!==r&&(r&&"boolean"!=typeof r?function(e,t,n){We(e,Be,"");let r={enter:t=>{e._x_transition.enter.during=t},"enter-start":t=>{e._x_transition.enter.start=t},"enter-end":t=>{e._x_transition.enter.end=t},leave:t=>{e._x_transition.leave.during=t},"leave-start":t=>{e._x_transition.leave.start=t},"leave-end":t=>{e._x_transition.leave.end=t}};r[n](t)}(e,r,t):function(e,t,n){We(e,Ie);let r=!t.includes("in")&&!t.includes("out")&&!n,i=r||t.includes("in")||["enter"].includes(n),o=r||t.includes("out")||["leave"].includes(n);t.includes("in")&&!r&&(t=t.filter(((e,n)=>nn>t.indexOf("out"))));let a=!t.includes("opacity")&&!t.includes("scale"),s=a||t.includes("opacity"),c=a||t.includes("scale"),u=s?0:1,l=c?qe(t,"scale",95)/100:1,f=qe(t,"delay",0)/1e3,p=qe(t,"origin","center"),d="opacity, transform",h=qe(t,"duration",150)/1e3,v=qe(t,"duration",75)/1e3,m="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(e._x_transition.enter.during={transformOrigin:p,transitionDelay:`${f}s`,transitionProperty:d,transitionDuration:`${h}s`,transitionTimingFunction:m},e._x_transition.enter.start={opacity:u,transform:`scale(${l})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"});o&&(e._x_transition.leave.during={transformOrigin:p,transitionDelay:`${f}s`,transitionProperty:d,transitionDuration:`${v}s`,transitionTimingFunction:m},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:u,transform:`scale(${l})`})}(e,n,t))})),window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,n,r){const i="visible"===document.visibilityState?requestAnimationFrame:setTimeout;let o=()=>i(n);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):o():e._x_transition?e._x_transition.in(n):o():(e._x_hidePromise=e._x_transition?new Promise(((t,n)=>{e._x_transition.out((()=>{}),(()=>t(r))),e._x_transitioning&&e._x_transitioning.beforeCancel((()=>n({isFromCancelledTransition:!0})))})):Promise.resolve(r),queueMicrotask((()=>{let t=He(e);t?(t._x_hideChildren||(t._x_hideChildren=[]),t._x_hideChildren.push(e)):i((()=>{let t=e=>{let n=Promise.all([e._x_hidePromise,...(e._x_hideChildren||[]).map(t)]).then((([e])=>e?.()));return delete e._x_hidePromise,delete e._x_hideChildren,n};t(e).catch((e=>{if(!e.isFromCancelledTransition)throw e}))}))})))};var ze=!1;function Ue(e,t=()=>{}){return(...n)=>ze?t(...n):e(...n)}var Je=[];function Ge(e){Je.push(e)}var Ke=!1;function Ye(e){let n=t;d(((e,t)=>{let i=n(e);return r(i),()=>{}})),e(),d(n)}function Xe(t,n,r,i=[]){switch(t._x_bindings||(t._x_bindings=e({})),t._x_bindings[n]=r,n=i.includes("camel")?n.toLowerCase().replace(/-(\w)/g,((e,t)=>t.toUpperCase())):n){case"value":!function(e,t){if("radio"===e.type)void 0===e.attributes.value&&(e.value=t),window.fromModel&&(e.checked="boolean"==typeof t?et(e.value)===t:Qe(e.value,t));else if("checkbox"===e.type)Number.isInteger(t)?e.value=t:Array.isArray(t)||"boolean"==typeof t||[null,void 0].includes(t)?Array.isArray(t)?e.checked=t.some((t=>Qe(t,e.value))):e.checked=!!t:e.value=String(t);else if("SELECT"===e.tagName)!function(e,t){const n=[].concat(t).map((e=>e+""));Array.from(e.options).forEach((e=>{e.selected=n.includes(e.value)}))}(e,t);else{if(e.value===t)return;e.value=void 0===t?"":t}}(t,r);break;case"style":!function(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles();e._x_undoAddedStyles=Ie(e,t)}(t,r);break;case"class":!function(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses();e._x_undoAddedClasses=Be(e,t)}(t,r);break;case"selected":case"checked":!function(e,t,n){Ze(e,t,n),function(e,t,n){e[t]!==n&&(e[t]=n)}(e,t,n)}(t,n,r);break;default:Ze(t,n,r)}}function Ze(e,t,n){[null,void 0,!1].includes(n)&&function(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}(t)?e.removeAttribute(t):(tt(t)&&(n=t),function(e,t,n){e.getAttribute(t)!=n&&e.setAttribute(t,n)}(e,t,n))}function Qe(e,t){return e==t}function et(e){return!![1,"1","true","on","yes",!0].includes(e)||![0,"0","false","off","no",!1].includes(e)&&(e?Boolean(e):null)}function tt(e){return["disabled","checked","required","readonly","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function nt(e,t,n){let r=e.getAttribute(t);return null===r?"function"==typeof n?n():n:""===r||(tt(t)?!![t,"true"].includes(r):r)}function rt(e,t){var n;return function(){var r=this,i=arguments;clearTimeout(n),n=setTimeout((function(){n=null,e.apply(r,i)}),t)}}function it(e,t){let n;return function(){let r=this,i=arguments;n||(e.apply(r,i),n=!0,setTimeout((()=>n=!1),t))}}function ot({get:e,set:n},{get:i,set:o}){let a,s,c=!0,u=t((()=>{let t=e(),r=i();if(c)o(at(t)),c=!1;else{let e=JSON.stringify(t),i=JSON.stringify(r);e!==a?o(at(t)):e!==i&&n(at(r))}a=JSON.stringify(e()),s=JSON.stringify(i())}));return()=>{r(u)}}function at(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}var st={},ct=!1;var ut={};function lt(e,t,n){let r=[];for(;r.length;)r.pop()();let i=Object.entries(t).map((([e,t])=>({name:e,value:t}))),o=ie(i);return i=i.map((e=>o.find((t=>t.name===e.name))?{name:`x-bind:${e.name}`,value:`"${e.value}"`}:e)),re(e,i,n).map((e=>{r.push(e.runCleanups),e()})),()=>{for(;r.length;)r.pop()()}}var ft={};var pt={get reactive(){return e},get release(){return r},get effect(){return t},get raw(){return i},version:"3.14.1",flushAndStopDeferringMutations:function(){j=!1,T(L),L=[]},dontAutoEvaluateFunctions:U,disableEffectScheduling:function(e){p=!1,e(),p=!0},startObservingMutations:E,stopObservingMutations:k,setReactivityEngine:function(n){e=n.reactive,r=n.release,t=e=>n.effect(e,{scheduler:e=>{p?u(e):e()}}),i=n.raw},onAttributeRemoved:x,onAttributesAdded:b,closestDataStack:P,skipDuringClone:Ue,onlyDuringClone:function(e){return(...t)=>ze&&e(...t)},addRootSelector:Ae,addInitSelector:Se,interceptClone:Ge,addScopeToNode:N,deferMutations:function(){j=!0},mapAttributes:pe,evaluateLater:G,interceptInit:function(e){Te.push(e)},setEvaluator:function(e){K=e},mergeProxies:D,extractProp:function(e,t,n,r=!0){if(e._x_bindings&&void 0!==e._x_bindings[t])return e._x_bindings[t];if(e._x_inlineBindings&&void 0!==e._x_inlineBindings[t]){let n=e._x_inlineBindings[t];return n.extract=r,U((()=>J(e,n.expression)))}return nt(e,t,n)},findClosest:Le,onElRemoved:g,closestRoot:je,destroyTree:Ne,interceptor:R,transition:Ve,setStyles:Ie,mutateDom:S,directive:ne,entangle:ot,throttle:it,debounce:rt,evaluate:J,initTree:Ce,nextTick:Me,prefixed:ee,prefix:function(e){Q=e},plugin:function(e){(Array.isArray(e)?e:[e]).forEach((e=>e(pt)))},magic:W,store:function(t,n){if(ct||(st=e(st),ct=!0),void 0===n)return st[t];st[t]=n,"object"==typeof n&&null!==n&&n.hasOwnProperty("init")&&"function"==typeof n.init&&st[t].init(),B(st[t])},start:function(){var e;_e&&xe("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),_e=!0,document.body||xe("Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's `