(() => { var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); // ../../../../../../node_modules/@kingshott/iodine/dist/iodine.min.js var require_iodine_min = __commonJS({ "../../../../../../node_modules/@kingshott/iodine/dist/iodine.min.js"(exports, module) { var e = class { constructor() { this.locale = void 0, this.messages = { after: "The date must be after: '[PARAM]'", afterOrEqual: "The date must be after or equal to: '[PARAM]'", array: "[FIELD] must be an array", before: "The date must be before: '[PARAM]'", beforeOrEqual: "The date must be before or equal to: '[PARAM]'", boolean: "[FIELD] must be true or false", date: "[FIELD] must be a date", different: "[FIELD] must be different to '[PARAM]'", endsWith: "[FIELD] must end with '[PARAM]'", email: "[FIELD] must be a valid email address", falsy: "[FIELD] must be a falsy value (false, 'false', 0 or '0')", in: "[FIELD] must be one of the following options: [PARAM]", integer: "[FIELD] must be an integer", json: "[FIELD] must be a parsable JSON object string", max: "[FIELD] must be less than or equal to [PARAM]", min: "[FIELD] must be greater than or equal to [PARAM]", maxLength: "[FIELD] must not be greater than '[PARAM]' in character length", minLength: "[FIELD] must not be less than '[PARAM]' character length", notIn: "[FIELD] must not be one of the following options: [PARAM]", numeric: "[FIELD] must be numeric", optional: "[FIELD] is optional", regexMatch: "[FIELD] must satisify the regular expression: [PARAM]", required: "[FIELD] must be present", same: "[FIELD] must be '[PARAM]'", startsWith: "[FIELD] must start with '[PARAM]'", string: "[FIELD] must be a string", truthy: "[FIELD] must be a truthy value (true, 'true', 1 or '1')", url: "[FIELD] must be a valid url", uuid: "[FIELD] must be a valid UUID" }; } _compare(e2, t, r, s = false) { return !!this.assertDate(e2) && !(!this.assertDate(t) && !this.assertInteger(t)) && (t = "number" == typeof t ? t : t.getTime(), "less" === r && s ? e2.getTime() <= t : "less" !== r || s ? "more" === r && s ? e2.getTime() >= t : "more" !== r || s ? void 0 : e2.getTime() > t : e2.getTime() < t); } _error(e2, t) { let { param: r, field: s } = "object" == typeof t ? t : { param: t, field: void 0 }; const a = e2.split(":"); let i = a.shift(); r = r || a.join(":"), ["after", "afterOrEqual", "before", "beforeOrEqual"].includes(i) && (r = new Date(parseInt(r)).toLocaleTimeString(this.locale, { year: "numeric", month: "short", day: "numeric", hour: "2-digit", minute: "numeric", hour12: false })); let n = [null, void 0, ""].includes(r) ? this.messages[i] : this.messages[i].replace("[PARAM]", r); return [null, void 0, ""].includes(s) ? n.replace("[FIELD]", this.default_field_name ?? "Value") : n.replace("[FIELD]", s); } _missing() { return { valid: false, rule: "None", error: "Rules exist, but no value was provided to check" }; } _prepare(e2, t = []) { return t.length ? "optional" === t[0] && this.assertOptional(e2) ? [] : t.filter((e3) => "optional" !== e3).map((e3) => "string" == typeof e3 ? [e3, this._title(e3.split(":").shift()), e3.split(":").slice(1).join(":")] : [`${e3.rule}:${e3.param}`, this._title(e3.rule), e3.param]) : []; } _title(e2) { return `${e2[0].toUpperCase()}${e2.slice(1)}`; } _validate(e2, t) { for (let r in t = this._prepare(e2, t)) if (!this[`assert${t[r][1]}`].apply(this, [e2, t[r][2]])) return { valid: false, rule: t[r][0], error: this._error(t[r][0]) }; return { valid: true, rule: "", error: "" }; } assert(e2, t) { if (Array.isArray(t)) return this._validate(e2, t); let r = Object.keys(t), s = { valid: true, fields: {} }; for (let a = 0; a < r.length; a++) s.fields[r[a]] = e2.hasOwnProperty(r[a]) ? this._validate(e2[r[a]], t[r[a]]) : this._missing(), s.fields[r[a]].valid || (s.valid = false); return s; } assertAfter(e2, t) { return this._compare(e2, t, "more", false); } assertAfterOrEqual(e2, t) { return this._compare(e2, t, "more", true); } assertArray(e2) { return Array.isArray(e2); } assertBefore(e2, t) { return this._compare(e2, t, "less", false); } assertBeforeOrEqual(e2, t) { return this._compare(e2, t, "less", true); } assertBoolean(e2) { return [true, false].includes(e2); } assertDate(e2) { return e2 && "[object Date]" === Object.prototype.toString.call(e2) && !isNaN(e2); } assertDifferent(e2, t) { return e2 != t; } assertEndsWith(e2, t) { return this.assertString(e2) && e2.endsWith(t); } assertEmail(e2) { return new RegExp("^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$").test(String(e2).toLowerCase()); } assertFalsy(e2) { return [0, "0", false, "false"].includes(e2); } assertIn(e2, t) { return ("string" == typeof t ? t.split(",") : t).includes(e2); } assertInteger(e2) { return Number.isInteger(e2) && parseInt(e2).toString() === e2.toString(); } assertJson(e2) { try { return "object" == typeof JSON.parse(e2); } catch (e3) { return false; } } assertMax(e2, t) { return parseFloat(e2) <= t; } assertMin(e2, t) { return parseFloat(e2) >= t; } assertMaxLength(e2, t) { return "string" == typeof e2 && e2.length <= t; } assertMinLength(e2, t) { return "string" == typeof e2 && e2.length >= t; } assertNotIn(e2, t) { return !this.assertIn(e2, t); } assertNumeric(e2) { return !isNaN(parseFloat(e2)) && isFinite(e2); } assertOptional(e2) { return [null, void 0, ""].includes(e2); } assertRegexMatch(e2, t) { return new RegExp(t).test(String(e2)); } assertRequired(e2) { return !this.assertOptional(e2); } assertSame(e2, t) { return e2 == t; } assertStartsWith(e2, t) { return this.assertString(e2) && e2.startsWith(t); } assertString(e2) { return "string" == typeof e2; } assertTruthy(e2) { return [1, "1", true, "true"].includes(e2); } assertUrl(e2) { return new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$").test(String(e2).toLowerCase()); } assertUuid(e2) { return new RegExp("^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$").test(String(e2).toLowerCase()); } rule(t, r) { e.prototype[`assert${this._title(t)}`] = r; } setErrorMessages(e2) { this.messages = e2; } setErrorMessage(e2, t) { this.messages[e2] = t; } setLocale(e2) { this.locale = e2; } setDefaultFieldName(e2) { this.default_field_name = e2; } }; "undefined" != typeof window && (window.Iodine = new e()), module.exports = e; } }); // assets/js/main.js var import_iodine = __toESM(require_iodine_min()); // ../../../../../../node_modules/alpinejs/dist/module.esm.js var flushPending = false; var flushing = false; var queue = []; function scheduler(callback) { queueJob(callback); } function queueJob(job) { if (!queue.includes(job)) queue.push(job); queueFlush(); } function dequeueJob(job) { let index = queue.indexOf(job); if (index !== -1) queue.splice(index, 1); } function queueFlush() { if (!flushing && !flushPending) { flushPending = true; queueMicrotask(flushJobs); } } function flushJobs() { flushPending = false; flushing = true; for (let i = 0; i < queue.length; i++) { queue[i](); } queue.length = 0; flushing = false; } var reactive; var effect; var release; var raw; var shouldSchedule = true; function disableEffectScheduling(callback) { shouldSchedule = false; callback(); shouldSchedule = true; } function setReactivityEngine(engine) { reactive = engine.reactive; release = engine.release; effect = (callback) => engine.effect(callback, { scheduler: (task) => { if (shouldSchedule) { scheduler(task); } else { task(); } } }); raw = engine.raw; } function overrideEffect(override) { effect = override; } function elementBoundEffect(el) { let cleanup2 = () => { }; let wrappedEffect = (callback) => { let effectReference = effect(callback); if (!el._x_effects) { el._x_effects = /* @__PURE__ */ new Set(); el._x_runEffects = () => { el._x_effects.forEach((i) => i()); }; } el._x_effects.add(effectReference); cleanup2 = () => { if (effectReference === void 0) return; el._x_effects.delete(effectReference); release(effectReference); }; return effectReference; }; return [wrappedEffect, () => { cleanup2(); }]; } var onAttributeAddeds = []; var onElRemoveds = []; var onElAddeds = []; function onElAdded(callback) { onElAddeds.push(callback); } function onElRemoved(el, callback) { if (typeof callback === "function") { if (!el._x_cleanups) el._x_cleanups = []; el._x_cleanups.push(callback); } else { callback = el; onElRemoveds.push(callback); } } function onAttributesAdded(callback) { onAttributeAddeds.push(callback); } function onAttributeRemoved(el, name, callback) { if (!el._x_attributeCleanups) el._x_attributeCleanups = {}; if (!el._x_attributeCleanups[name]) el._x_attributeCleanups[name] = []; el._x_attributeCleanups[name].push(callback); } function cleanupAttributes(el, names) { if (!el._x_attributeCleanups) return; Object.entries(el._x_attributeCleanups).forEach(([name, value]) => { if (names === void 0 || names.includes(name)) { value.forEach((i) => i()); delete el._x_attributeCleanups[name]; } }); } var observer = new MutationObserver(onMutate); var currentlyObserving = false; function startObservingMutations() { observer.observe(document, { subtree: true, childList: true, attributes: true, attributeOldValue: true }); currentlyObserving = true; } function stopObservingMutations() { flushObserver(); observer.disconnect(); currentlyObserving = false; } var recordQueue = []; var willProcessRecordQueue = false; function flushObserver() { recordQueue = recordQueue.concat(observer.takeRecords()); if (recordQueue.length && !willProcessRecordQueue) { willProcessRecordQueue = true; queueMicrotask(() => { processRecordQueue(); willProcessRecordQueue = false; }); } } function processRecordQueue() { onMutate(recordQueue); recordQueue.length = 0; } function mutateDom(callback) { if (!currentlyObserving) return callback(); stopObservingMutations(); let result = callback(); startObservingMutations(); return result; } var isCollecting = false; var deferredMutations = []; function deferMutations() { isCollecting = true; } function flushAndStopDeferringMutations() { isCollecting = false; onMutate(deferredMutations); deferredMutations = []; } function onMutate(mutations) { if (isCollecting) { deferredMutations = deferredMutations.concat(mutations); return; } let addedNodes = []; let removedNodes = []; let addedAttributes = /* @__PURE__ */ new Map(); let removedAttributes = /* @__PURE__ */ new Map(); for (let i = 0; i < mutations.length; i++) { if (mutations[i].target._x_ignoreMutationObserver) continue; if (mutations[i].type === "childList") { mutations[i].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.push(node)); mutations[i].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.push(node)); } if (mutations[i].type === "attributes") { let el = mutations[i].target; let name = mutations[i].attributeName; let oldValue = mutations[i].oldValue; let add2 = () => { if (!addedAttributes.has(el)) addedAttributes.set(el, []); addedAttributes.get(el).push({ name, value: el.getAttribute(name) }); }; let remove = () => { if (!removedAttributes.has(el)) removedAttributes.set(el, []); removedAttributes.get(el).push(name); }; if (el.hasAttribute(name) && oldValue === null) { add2(); } else if (el.hasAttribute(name)) { remove(); add2(); } else { remove(); } } } removedAttributes.forEach((attrs, el) => { cleanupAttributes(el, attrs); }); addedAttributes.forEach((attrs, el) => { onAttributeAddeds.forEach((i) => i(el, attrs)); }); for (let node of removedNodes) { if (addedNodes.includes(node)) continue; onElRemoveds.forEach((i) => i(node)); if (node._x_cleanups) { while (node._x_cleanups.length) node._x_cleanups.pop()(); } } addedNodes.forEach((node) => { node._x_ignoreSelf = true; node._x_ignore = true; }); for (let node of addedNodes) { if (removedNodes.includes(node)) continue; if (!node.isConnected) continue; delete node._x_ignoreSelf; delete node._x_ignore; onElAddeds.forEach((i) => i(node)); node._x_ignore = true; node._x_ignoreSelf = true; } addedNodes.forEach((node) => { delete node._x_ignoreSelf; delete node._x_ignore; }); addedNodes = null; removedNodes = null; addedAttributes = null; removedAttributes = null; } function scope(node) { return mergeProxies(closestDataStack(node)); } function addScopeToNode(node, data2, referenceNode) { node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)]; return () => { node._x_dataStack = node._x_dataStack.filter((i) => i !== data2); }; } function refreshScope(element, scope2) { let existingScope = element._x_dataStack[0]; Object.entries(scope2).forEach(([key, value]) => { existingScope[key] = value; }); } function closestDataStack(node) { if (node._x_dataStack) return node._x_dataStack; if (typeof ShadowRoot === "function" && node instanceof ShadowRoot) { return closestDataStack(node.host); } if (!node.parentNode) { return []; } return closestDataStack(node.parentNode); } function mergeProxies(objects) { let thisProxy = new Proxy({}, { ownKeys: () => { return Array.from(new Set(objects.flatMap((i) => Object.keys(i)))); }, has: (target, name) => { return objects.some((obj) => obj.hasOwnProperty(name)); }, get: (target, name) => { return (objects.find((obj) => { if (obj.hasOwnProperty(name)) { let descriptor = Object.getOwnPropertyDescriptor(obj, name); if (descriptor.get && descriptor.get._x_alreadyBound || descriptor.set && descriptor.set._x_alreadyBound) { return true; } if ((descriptor.get || descriptor.set) && descriptor.enumerable) { let getter = descriptor.get; let setter = descriptor.set; let property = descriptor; getter = getter && getter.bind(thisProxy); setter = setter && setter.bind(thisProxy); if (getter) getter._x_alreadyBound = true; if (setter) setter._x_alreadyBound = true; Object.defineProperty(obj, name, { ...property, get: getter, set: setter }); } return true; } return false; }) || {})[name]; }, set: (target, name, value) => { let closestObjectWithKey = objects.find((obj) => obj.hasOwnProperty(name)); if (closestObjectWithKey) { closestObjectWithKey[name] = value; } else { objects[objects.length - 1][name] = value; } return true; } }); return thisProxy; } function initInterceptors(data2) { let isObject2 = (val) => typeof val === "object" && !Array.isArray(val) && val !== null; let recurse = (obj, basePath = "") => { Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, { value, enumerable }]) => { if (enumerable === false || value === void 0) return; let path = basePath === "" ? key : `${basePath}.${key}`; if (typeof value === "object" && value !== null && value._x_interceptor) { obj[key] = value.initialize(data2, path, key); } else { if (isObject2(value) && value !== obj && !(value instanceof Element)) { recurse(value, path); } } }); }; return recurse(data2); } function interceptor(callback, mutateObj = () => { }) { let obj = { initialValue: void 0, _x_interceptor: true, initialize(data2, path, key) { return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key); } }; mutateObj(obj); return (initialValue) => { if (typeof initialValue === "object" && initialValue !== null && initialValue._x_interceptor) { let initialize = obj.initialize.bind(obj); obj.initialize = (data2, path, key) => { let innerValue = initialValue.initialize(data2, path, key); obj.initialValue = innerValue; return initialize(data2, path, key); }; } else { obj.initialValue = initialValue; } return obj; }; } function get(obj, path) { return path.split(".").reduce((carry, segment) => carry[segment], obj); } function set(obj, path, value) { if (typeof path === "string") path = path.split("."); if (path.length === 1) obj[path[0]] = value; else if (path.length === 0) throw error; else { if (obj[path[0]]) return set(obj[path[0]], path.slice(1), value); else { obj[path[0]] = {}; return set(obj[path[0]], path.slice(1), value); } } } var magics = {}; function magic(name, callback) { magics[name] = callback; } function injectMagics(obj, el) { Object.entries(magics).forEach(([name, callback]) => { Object.defineProperty(obj, `$${name}`, { get() { let [utilities, cleanup2] = getElementBoundUtilities(el); utilities = { interceptor, ...utilities }; onElRemoved(el, cleanup2); return callback(el, utilities); }, enumerable: false }); }); return obj; } function tryCatch(el, expression, callback, ...args) { try { return callback(...args); } catch (e) { handleError(e, el, expression); } } function handleError(error2, el, expression = void 0) { Object.assign(error2, { el, expression }); console.warn(`Alpine Expression Error: ${error2.message} ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); setTimeout(() => { throw error2; }, 0); } var shouldAutoEvaluateFunctions = true; function dontAutoEvaluateFunctions(callback) { let cache = shouldAutoEvaluateFunctions; shouldAutoEvaluateFunctions = false; callback(); shouldAutoEvaluateFunctions = cache; } function evaluate(el, expression, extras = {}) { let result; evaluateLater(el, expression)((value) => result = value, extras); return result; } function evaluateLater(...args) { return theEvaluatorFunction(...args); } var theEvaluatorFunction = normalEvaluator; function setEvaluator(newEvaluator) { theEvaluatorFunction = newEvaluator; } function normalEvaluator(el, expression) { let overriddenMagics = {}; injectMagics(overriddenMagics, el); let dataStack = [overriddenMagics, ...closestDataStack(el)]; if (typeof expression === "function") { return generateEvaluatorFromFunction(dataStack, expression); } let evaluator = generateEvaluatorFromString(dataStack, expression, el); return tryCatch.bind(null, el, expression, evaluator); } function generateEvaluatorFromFunction(dataStack, func) { return (receiver = () => { }, { scope: scope2 = {}, params = [] } = {}) => { let result = func.apply(mergeProxies([scope2, ...dataStack]), params); runIfTypeOfFunction(receiver, result); }; } var evaluatorMemo = {}; function generateFunctionFromString(expression, el) { if (evaluatorMemo[expression]) { return evaluatorMemo[expression]; } let AsyncFunction = Object.getPrototypeOf(async function() { }).constructor; let rightSideSafeExpression = /^[\n\s]*if.*\(.*\)/.test(expression) || /^(let|const)\s/.test(expression) ? `(() => { ${expression} })()` : expression; const safeAsyncFunction = () => { try { return new AsyncFunction(["__self", "scope"], `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`); } catch (error2) { handleError(error2, el, expression); return Promise.resolve(); } }; let func = safeAsyncFunction(); evaluatorMemo[expression] = func; return func; } function generateEvaluatorFromString(dataStack, expression, el) { let func = generateFunctionFromString(expression, el); return (receiver = () => { }, { scope: scope2 = {}, params = [] } = {}) => { func.result = void 0; func.finished = false; let completeScope = mergeProxies([scope2, ...dataStack]); if (typeof func === "function") { let promise = func(func, completeScope).catch((error2) => handleError(error2, el, expression)); if (func.finished) { runIfTypeOfFunction(receiver, func.result, completeScope, params, el); func.result = void 0; } else { promise.then((result) => { runIfTypeOfFunction(receiver, result, completeScope, params, el); }).catch((error2) => handleError(error2, el, expression)).finally(() => func.result = void 0); } } }; } function runIfTypeOfFunction(receiver, value, scope2, params, el) { if (shouldAutoEvaluateFunctions && typeof value === "function") { let result = value.apply(scope2, params); if (result instanceof Promise) { result.then((i) => runIfTypeOfFunction(receiver, i, scope2, params)).catch((error2) => handleError(error2, el, value)); } else { receiver(result); } } else { receiver(value); } } var prefixAsString = "x-"; function prefix(subject = "") { return prefixAsString + subject; } function setPrefix(newPrefix) { prefixAsString = newPrefix; } var directiveHandlers = {}; function directive(name, callback) { directiveHandlers[name] = callback; } function directives(el, attributes, originalAttributeOverride) { attributes = Array.from(attributes); if (el._x_virtualDirectives) { let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({ name, value })); let staticAttributes = attributesOnly(vAttributes); vAttributes = vAttributes.map((attribute) => { if (staticAttributes.find((attr) => attr.name === attribute.name)) { return { name: `x-bind:${attribute.name}`, value: `"${attribute.value}"` }; } return attribute; }); attributes = attributes.concat(vAttributes); } let transformedAttributeMap = {}; let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority); return directives2.map((directive2) => { return getDirectiveHandler(el, directive2); }); } function attributesOnly(attributes) { return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr)); } var isDeferringHandlers = false; var directiveHandlerStacks = /* @__PURE__ */ new Map(); var currentHandlerStackKey = Symbol(); function deferHandlingDirectives(callback) { isDeferringHandlers = true; let key = Symbol(); currentHandlerStackKey = key; directiveHandlerStacks.set(key, []); let flushHandlers = () => { while (directiveHandlerStacks.get(key).length) directiveHandlerStacks.get(key).shift()(); directiveHandlerStacks.delete(key); }; let stopDeferring = () => { isDeferringHandlers = false; flushHandlers(); }; callback(flushHandlers); stopDeferring(); } function getElementBoundUtilities(el) { let cleanups = []; let cleanup2 = (callback) => cleanups.push(callback); let [effect3, cleanupEffect] = elementBoundEffect(el); cleanups.push(cleanupEffect); let utilities = { Alpine: alpine_default, effect: effect3, cleanup: cleanup2, evaluateLater: evaluateLater.bind(evaluateLater, el), evaluate: evaluate.bind(evaluate, el) }; let doCleanup = () => cleanups.forEach((i) => i()); return [utilities, doCleanup]; } function getDirectiveHandler(el, directive2) { let noop = () => { }; let handler3 = directiveHandlers[directive2.type] || noop; let [utilities, cleanup2] = getElementBoundUtilities(el); onAttributeRemoved(el, directive2.original, cleanup2); let fullHandler = () => { if (el._x_ignore || el._x_ignoreSelf) return; handler3.inline && handler3.inline(el, directive2, utilities); handler3 = handler3.bind(handler3, el, directive2, utilities); isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler3) : handler3(); }; fullHandler.runCleanups = cleanup2; return fullHandler; } var startingWith = (subject, replacement) => ({ name, value }) => { if (name.startsWith(subject)) name = name.replace(subject, replacement); return { name, value }; }; var into = (i) => i; function toTransformedAttributes(callback = () => { }) { return ({ name, value }) => { let { name: newName, value: newValue } = attributeTransformers.reduce((carry, transform) => { return transform(carry); }, { name, value }); if (newName !== name) callback(newName, name); return { name: newName, value: newValue }; }; } var attributeTransformers = []; function mapAttributes(callback) { attributeTransformers.push(callback); } function outNonAlpineAttributes({ name }) { return alpineAttributeRegex().test(name); } var alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\b`); function toParsedDirectives(transformedAttributeMap, originalAttributeOverride) { return ({ name, value }) => { let typeMatch = name.match(alpineAttributeRegex()); let valueMatch = name.match(/:([a-zA-Z0-9\-:]+)/); let modifiers = name.match(/\.[^.\]]+(?=[^\]]*$)/g) || []; let original = originalAttributeOverride || transformedAttributeMap[name] || name; return { type: typeMatch ? typeMatch[1] : null, value: valueMatch ? valueMatch[1] : null, modifiers: modifiers.map((i) => i.replace(".", "")), expression: value, original }; }; } var DEFAULT = "DEFAULT"; var directiveOrder = [ "ignore", "ref", "data", "id", "bind", "init", "for", "mask", "model", "modelable", "transition", "show", "if", DEFAULT, "teleport" ]; function byPriority(a, b) { let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type; let typeB = directiveOrder.indexOf(b.type) === -1 ? DEFAULT : b.type; return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB); } function dispatch(el, name, detail = {}) { el.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true, cancelable: true })); } var tickStack = []; var isHolding = false; function nextTick(callback = () => { }) { queueMicrotask(() => { isHolding || setTimeout(() => { releaseNextTicks(); }); }); return new Promise((res) => { tickStack.push(() => { callback(); res(); }); }); } function releaseNextTicks() { isHolding = false; while (tickStack.length) tickStack.shift()(); } function holdNextTicks() { isHolding = true; } function walk(el, callback) { if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) { Array.from(el.children).forEach((el2) => walk(el2, callback)); return; } let skip = false; callback(el, () => skip = true); if (skip) return; let node = el.firstElementChild; while (node) { walk(node, callback, false); node = node.nextElementSibling; } } function warn(message, ...args) { console.warn(`Alpine Warning: ${message}`, ...args); } function start() { if (!document.body) warn("Unable to initialize. Trying to load Alpine before `
` is available. Did you forget to add `defer` in Alpine's `