import { axios_default } from "./chunk-45ZXIL56.js"; import { require_cjs, require_lib, require_lodash, require_lodash2 } from "./chunk-RSXHRAOD.js"; import "./chunk-62MYU7PF.js"; import { computed, createSSRApp, defineComponent, h, isReactive, markRaw, reactive, ref, shallowRef, watch } from "./chunk-F4MNEPC5.js"; import { __commonJS, __toESM } from "./chunk-V4OQ3NZ2.js"; // node_modules/nprogress/nprogress.js var require_nprogress = __commonJS({ "node_modules/nprogress/nprogress.js"(exports, module) { (function(root, factory) { if (typeof define === "function" && define.amd) { define(factory); } else if (typeof exports === "object") { module.exports = factory(); } else { root.NProgress = factory(); } })(exports, function() { var NProgress = {}; NProgress.version = "0.2.0"; var Settings = NProgress.settings = { minimum: 0.08, easing: "ease", positionUsing: "", speed: 200, trickle: true, trickleRate: 0.02, trickleSpeed: 800, showSpinner: true, barSelector: '[role="bar"]', spinnerSelector: '[role="spinner"]', parent: "body", template: '
' }; NProgress.configure = function(options) { var key, value; for (key in options) { value = options[key]; if (value !== void 0 && options.hasOwnProperty(key)) Settings[key] = value; } return this; }; NProgress.status = null; NProgress.set = function(n) { var started = NProgress.isStarted(); n = clamp(n, Settings.minimum, 1); NProgress.status = n === 1 ? null : n; var progress = NProgress.render(!started), bar = progress.querySelector(Settings.barSelector), speed = Settings.speed, ease = Settings.easing; progress.offsetWidth; queue(function(next) { if (Settings.positionUsing === "") Settings.positionUsing = NProgress.getPositioningCSS(); css(bar, barPositionCSS(n, speed, ease)); if (n === 1) { css(progress, { transition: "none", opacity: 1 }); progress.offsetWidth; setTimeout(function() { css(progress, { transition: "all " + speed + "ms linear", opacity: 0 }); setTimeout(function() { NProgress.remove(); next(); }, speed); }, speed); } else { setTimeout(next, speed); } }); return this; }; NProgress.isStarted = function() { return typeof NProgress.status === "number"; }; NProgress.start = function() { if (!NProgress.status) NProgress.set(0); var work = function() { setTimeout(function() { if (!NProgress.status) return; NProgress.trickle(); work(); }, Settings.trickleSpeed); }; if (Settings.trickle) work(); return this; }; NProgress.done = function(force) { if (!force && !NProgress.status) return this; return NProgress.inc(0.3 + 0.5 * Math.random()).set(1); }; NProgress.inc = function(amount) { var n = NProgress.status; if (!n) { return NProgress.start(); } else { if (typeof amount !== "number") { amount = (1 - n) * clamp(Math.random() * n, 0.1, 0.95); } n = clamp(n + amount, 0, 0.994); return NProgress.set(n); } }; NProgress.trickle = function() { return NProgress.inc(Math.random() * Settings.trickleRate); }; (function() { var initial = 0, current = 0; NProgress.promise = function($promise) { if (!$promise || $promise.state() === "resolved") { return this; } if (current === 0) { NProgress.start(); } initial++; current++; $promise.always(function() { current--; if (current === 0) { initial = 0; NProgress.done(); } else { NProgress.set((initial - current) / initial); } }); return this; }; })(); NProgress.render = function(fromStart) { if (NProgress.isRendered()) return document.getElementById("nprogress"); addClass(document.documentElement, "nprogress-busy"); var progress = document.createElement("div"); progress.id = "nprogress"; progress.innerHTML = Settings.template; var bar = progress.querySelector(Settings.barSelector), perc = fromStart ? "-100" : toBarPerc(NProgress.status || 0), parent = document.querySelector(Settings.parent), spinner; css(bar, { transition: "all 0 linear", transform: "translate3d(" + perc + "%,0,0)" }); if (!Settings.showSpinner) { spinner = progress.querySelector(Settings.spinnerSelector); spinner && removeElement(spinner); } if (parent != document.body) { addClass(parent, "nprogress-custom-parent"); } parent.appendChild(progress); return progress; }; NProgress.remove = function() { removeClass(document.documentElement, "nprogress-busy"); removeClass(document.querySelector(Settings.parent), "nprogress-custom-parent"); var progress = document.getElementById("nprogress"); progress && removeElement(progress); }; NProgress.isRendered = function() { return !!document.getElementById("nprogress"); }; NProgress.getPositioningCSS = function() { var bodyStyle = document.body.style; var vendorPrefix = "WebkitTransform" in bodyStyle ? "Webkit" : "MozTransform" in bodyStyle ? "Moz" : "msTransform" in bodyStyle ? "ms" : "OTransform" in bodyStyle ? "O" : ""; if (vendorPrefix + "Perspective" in bodyStyle) { return "translate3d"; } else if (vendorPrefix + "Transform" in bodyStyle) { return "translate"; } else { return "margin"; } }; function clamp(n, min, max) { if (n < min) return min; if (n > max) return max; return n; } function toBarPerc(n) { return (-1 + n) * 100; } function barPositionCSS(n, speed, ease) { var barCSS; if (Settings.positionUsing === "translate3d") { barCSS = { transform: "translate3d(" + toBarPerc(n) + "%,0,0)" }; } else if (Settings.positionUsing === "translate") { barCSS = { transform: "translate(" + toBarPerc(n) + "%,0)" }; } else { barCSS = { "margin-left": toBarPerc(n) + "%" }; } barCSS.transition = "all " + speed + "ms " + ease; return barCSS; } var queue = /* @__PURE__ */ function() { var pending = []; function next() { var fn = pending.shift(); if (fn) { fn(next); } } return function(fn) { pending.push(fn); if (pending.length == 1) next(); }; }(); var css = /* @__PURE__ */ function() { var cssPrefixes = ["Webkit", "O", "Moz", "ms"], cssProps = {}; function camelCase(string) { return string.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function(match, letter) { return letter.toUpperCase(); }); } function getVendorProp(name) { var style = document.body.style; if (name in style) return name; var i = cssPrefixes.length, capName = name.charAt(0).toUpperCase() + name.slice(1), vendorName; while (i--) { vendorName = cssPrefixes[i] + capName; if (vendorName in style) return vendorName; } return name; } function getStyleProp(name) { name = camelCase(name); return cssProps[name] || (cssProps[name] = getVendorProp(name)); } function applyCss(element, prop, value) { prop = getStyleProp(prop); element.style[prop] = value; } return function(element, properties) { var args = arguments, prop, value; if (args.length == 2) { for (prop in properties) { value = properties[prop]; if (value !== void 0 && properties.hasOwnProperty(prop)) applyCss(element, prop, value); } } else { applyCss(element, args[1], args[2]); } }; }(); function hasClass(element, name) { var list = typeof element == "string" ? element : classList(element); return list.indexOf(" " + name + " ") >= 0; } function addClass(element, name) { var oldList = classList(element), newList = oldList + name; if (hasClass(oldList, name)) return; element.className = newList.substring(1); } function removeClass(element, name) { var oldList = classList(element), newList; if (!hasClass(element, name)) return; newList = oldList.replace(" " + name + " ", " "); element.className = newList.substring(1, newList.length - 1); } function classList(element) { return (" " + (element.className || "") + " ").replace(/\s+/gi, " "); } function removeElement(element) { element && element.parentNode && element.parentNode.removeChild(element); } return NProgress; }); } }); // node_modules/@inertiajs/core/dist/index.esm.js var import_deepmerge = __toESM(require_cjs()); var O = __toESM(require_lib()); var import_nprogress = __toESM(require_nprogress()); function T(t, e) { let i; return function(...r) { clearTimeout(i), i = setTimeout(() => t.apply(this, r), e); }; } function f(t, e) { return document.dispatchEvent(new CustomEvent(`inertia:${t}`, e)); } var H = (t) => f("before", { cancelable: true, detail: { visit: t } }); var q = (t) => f("error", { detail: { errors: t } }); var $ = (t) => f("exception", { cancelable: true, detail: { exception: t } }); var N = (t) => f("finish", { detail: { visit: t } }); var W = (t) => f("invalid", { cancelable: true, detail: { response: t } }); var P = (t) => f("navigate", { detail: { page: t } }); var K = (t) => f("progress", { detail: { progress: t } }); var X = (t) => f("start", { detail: { visit: t } }); var B = (t) => f("success", { detail: { page: t } }); function I(t) { return t instanceof File || t instanceof Blob || t instanceof FileList && t.length > 0 || t instanceof FormData && Array.from(t.values()).some((e) => I(e)) || typeof t == "object" && t !== null && Object.values(t).some((e) => I(e)); } function k(t, e = new FormData(), i = null) { t = t || {}; for (let r in t) Object.prototype.hasOwnProperty.call(t, r) && z(e, J(i, r), t[r]); return e; } function J(t, e) { return t ? t + "[" + e + "]" : e; } function z(t, e, i) { if (Array.isArray(i)) return Array.from(i.keys()).forEach((r) => z(t, J(e, r.toString()), i[r])); if (i instanceof Date) return t.append(e, i.toISOString()); if (i instanceof File) return t.append(e, i, i.name); if (i instanceof Blob) return t.append(e, i); if (typeof i == "boolean") return t.append(e, i ? "1" : "0"); if (typeof i == "string") return t.append(e, i); if (typeof i == "number") return t.append(e, `${i}`); if (i == null) return t.append(e, ""); k(i, t, e); } var _ = { modal: null, listener: null, show(t) { typeof t == "object" && (t = `All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.
${JSON.stringify(t)}`); let e = document.createElement("html"); e.innerHTML = t, e.querySelectorAll("a").forEach((r) => r.setAttribute("target", "_top")), this.modal = document.createElement("div"), this.modal.style.position = "fixed", this.modal.style.width = "100vw", this.modal.style.height = "100vh", this.modal.style.padding = "50px", this.modal.style.boxSizing = "border-box", this.modal.style.backgroundColor = "rgba(0, 0, 0, .6)", this.modal.style.zIndex = 2e5, this.modal.addEventListener("click", () => this.hide()); let i = document.createElement("iframe"); if (i.style.backgroundColor = "white", i.style.borderRadius = "5px", i.style.width = "100%", i.style.height = "100%", this.modal.appendChild(i), document.body.prepend(this.modal), document.body.style.overflow = "hidden", !i.contentWindow) throw new Error("iframe not yet ready."); i.contentWindow.document.open(), i.contentWindow.document.write(e.outerHTML), i.contentWindow.document.close(), this.listener = this.hideOnEscape.bind(this), document.addEventListener("keydown", this.listener); }, hide() { this.modal.outerHTML = "", this.modal = null, document.body.style.overflow = "visible", document.removeEventListener("keydown", this.listener); }, hideOnEscape(t) { t.keyCode === 27 && this.hide(); } }; function b(t) { return new URL(t.toString(), window.location.toString()); } function D(t, e, i, r = "brackets") { let s = /^https?:\/\//.test(e.toString()), l = s || e.toString().startsWith("/"), h2 = !l && !e.toString().startsWith("#") && !e.toString().startsWith("?"), g2 = e.toString().includes("?") || t === "get" && Object.keys(i).length, m = e.toString().includes("#"), c2 = new URL(e.toString(), "http://localhost"); return t === "get" && Object.keys(i).length && (c2.search = O.stringify((0, import_deepmerge.default)(O.parse(c2.search, { ignoreQueryPrefix: true }), i), { encodeValuesOnly: true, arrayFormat: r }), i = {}), [[s ? `${c2.protocol}//${c2.host}` : "", l ? c2.pathname : "", h2 ? c2.pathname.substring(1) : "", g2 ? c2.search : "", m ? c2.hash : ""].join(""), i]; } function E(t) { return t = new URL(t.href), t.hash = "", t; } var C = typeof window > "u"; var Y = !C && /CriOS/.test(window.navigator.userAgent); var Z = (t) => { requestAnimationFrame(() => { requestAnimationFrame(t); }); }; var F = class { constructor() { this.visitId = null; } init({ initialPage: e, resolveComponent: i, swapComponent: r }) { this.page = e, this.resolveComponent = i, this.swapComponent = r, this.setNavigationType(), this.clearRememberedStateOnReload(), this.isBackForwardVisit() ? this.handleBackForwardVisit(this.page) : this.isLocationVisit() ? this.handleLocationVisit(this.page) : this.handleInitialPageVisit(this.page), this.setupEventListeners(); } setNavigationType() { this.navigationType = window.performance && window.performance.getEntriesByType && window.performance.getEntriesByType("navigation").length > 0 ? window.performance.getEntriesByType("navigation")[0].type : "navigate"; } clearRememberedStateOnReload() { var _a; this.navigationType === "reload" && ((_a = window.history.state) == null ? void 0 : _a.rememberedState) && delete window.history.state.rememberedState; } handleInitialPageVisit(e) { let i = window.location.hash; this.page.url.includes(i) || (this.page.url += i), this.setPage(e, { preserveScroll: true, preserveState: true }).then(() => P(e)); } setupEventListeners() { window.addEventListener("popstate", this.handlePopstateEvent.bind(this)), document.addEventListener("scroll", T(this.handleScrollEvent.bind(this), 100), true); } scrollRegions() { return document.querySelectorAll("[scroll-region]"); } handleScrollEvent(e) { typeof e.target.hasAttribute == "function" && e.target.hasAttribute("scroll-region") && this.saveScrollPositions(); } saveScrollPositions() { this.replaceState({ ...this.page, scrollRegions: Array.from(this.scrollRegions()).map((e) => ({ top: e.scrollTop, left: e.scrollLeft })) }); } resetScrollPositions() { Z(() => { var _a; window.scrollTo(0, 0), this.scrollRegions().forEach((e) => { typeof e.scrollTo == "function" ? e.scrollTo(0, 0) : (e.scrollTop = 0, e.scrollLeft = 0); }), this.saveScrollPositions(), window.location.hash && ((_a = document.getElementById(window.location.hash.slice(1))) == null ? void 0 : _a.scrollIntoView()); }); } restoreScrollPositions() { Z(() => { this.page.scrollRegions && this.scrollRegions().forEach((e, i) => { let r = this.page.scrollRegions[i]; if (r) typeof e.scrollTo == "function" ? e.scrollTo(r.left, r.top) : (e.scrollTop = r.top, e.scrollLeft = r.left); else return; }); }); } isBackForwardVisit() { return window.history.state && this.navigationType === "back_forward"; } handleBackForwardVisit(e) { window.history.state.version = e.version, this.setPage(window.history.state, { preserveScroll: true, preserveState: true }).then(() => { this.restoreScrollPositions(), P(e); }); } locationVisit(e, i) { try { let r = { preserveScroll: i }; window.sessionStorage.setItem("inertiaLocationVisit", JSON.stringify(r)), window.location.href = e.href, E(window.location).href === E(e).href && window.location.reload(); } catch { return false; } } isLocationVisit() { try { return window.sessionStorage.getItem("inertiaLocationVisit") !== null; } catch { return false; } } handleLocationVisit(e) { var _a, _b; let i = JSON.parse(window.sessionStorage.getItem("inertiaLocationVisit") || ""); window.sessionStorage.removeItem("inertiaLocationVisit"), e.url += window.location.hash, e.rememberedState = ((_a = window.history.state) == null ? void 0 : _a.rememberedState) ?? {}, e.scrollRegions = ((_b = window.history.state) == null ? void 0 : _b.scrollRegions) ?? [], this.setPage(e, { preserveScroll: i.preserveScroll, preserveState: true }).then(() => { i.preserveScroll && this.restoreScrollPositions(), P(e); }); } isLocationVisitResponse(e) { return !!(e && e.status === 409 && e.headers["x-inertia-location"]); } isInertiaResponse(e) { return !!(e == null ? void 0 : e.headers["x-inertia"]); } createVisitId() { return this.visitId = {}, this.visitId; } cancelVisit(e, { cancelled: i = false, interrupted: r = false }) { e && !e.completed && !e.cancelled && !e.interrupted && (e.cancelToken.abort(), e.onCancel(), e.completed = false, e.cancelled = i, e.interrupted = r, N(e), e.onFinish(e)); } finishVisit(e) { !e.cancelled && !e.interrupted && (e.completed = true, e.cancelled = false, e.interrupted = false, N(e), e.onFinish(e)); } resolvePreserveOption(e, i) { return typeof e == "function" ? e(i) : e === "errors" ? Object.keys(i.props.errors || {}).length > 0 : e; } cancel() { this.activeVisit && this.cancelVisit(this.activeVisit, { cancelled: true }); } visit(e, { method: i = "get", data: r = {}, replace: s = false, preserveScroll: l = false, preserveState: h2 = false, only: g2 = [], except: m = [], headers: c2 = {}, errorBag: o = "", forceFormData: v = false, onCancelToken: L2 = () => { }, onBefore: d2 = () => { }, onStart: p = () => { }, onProgress: x2 = () => { }, onFinish: y = () => { }, onCancel: ne = () => { }, onSuccess: U = () => { }, onError: G = () => { }, queryStringArrayFormat: A = "brackets" } = {}) { let S = typeof e == "string" ? b(e) : e; if ((I(r) || v) && !(r instanceof FormData) && (r = k(r)), !(r instanceof FormData)) { let [n, a] = D(i, S, r, A); S = b(n), r = a; } let R2 = { url: S, method: i, data: r, replace: s, preserveScroll: l, preserveState: h2, only: g2, except: m, headers: c2, errorBag: o, forceFormData: v, queryStringArrayFormat: A, cancelled: false, completed: false, interrupted: false }; if (d2(R2) === false || !H(R2)) return; this.activeVisit && this.cancelVisit(this.activeVisit, { interrupted: true }), this.saveScrollPositions(); let M2 = this.createVisitId(); this.activeVisit = { ...R2, onCancelToken: L2, onBefore: d2, onStart: p, onProgress: x2, onFinish: y, onCancel: ne, onSuccess: U, onError: G, queryStringArrayFormat: A, cancelToken: new AbortController() }, L2({ cancel: () => { this.activeVisit && this.cancelVisit(this.activeVisit, { cancelled: true }); } }), X(R2), p(R2); let j2 = !!(g2.length || m.length); axios_default({ method: i, url: E(S).href, data: i === "get" ? {} : r, params: i === "get" ? r : {}, signal: this.activeVisit.cancelToken.signal, headers: { ...c2, Accept: "text/html, application/xhtml+xml", "X-Requested-With": "XMLHttpRequest", "X-Inertia": true, ...j2 ? { "X-Inertia-Partial-Component": this.page.component } : {}, ...g2.length ? { "X-Inertia-Partial-Data": g2.join(",") } : {}, ...m.length ? { "X-Inertia-Partial-Except": m.join(",") } : {}, ...o && o.length ? { "X-Inertia-Error-Bag": o } : {}, ...this.page.version ? { "X-Inertia-Version": this.page.version } : {} }, onUploadProgress: (n) => { r instanceof FormData && (n.percentage = n.progress ? Math.round(n.progress * 100) : 0, K(n), x2(n)); } }).then((n) => { var _a; if (!this.isInertiaResponse(n)) return Promise.reject({ response: n }); let a = n.data; j2 && a.component === this.page.component && (a.props = { ...this.page.props, ...a.props }), l = this.resolvePreserveOption(l, a), h2 = this.resolvePreserveOption(h2, a), h2 && ((_a = window.history.state) == null ? void 0 : _a.rememberedState) && a.component === this.page.component && (a.rememberedState = window.history.state.rememberedState); let w = S, V = b(a.url); return w.hash && !V.hash && E(w).href === V.href && (V.hash = w.hash, a.url = V.href), this.setPage(a, { visitId: M2, replace: s, preserveScroll: l, preserveState: h2 }); }).then(() => { let n = this.page.props.errors || {}; if (Object.keys(n).length > 0) { let a = o ? n[o] ? n[o] : {} : n; return q(a), G(a); } return B(this.page), U(this.page); }).catch((n) => { if (this.isInertiaResponse(n.response)) return this.setPage(n.response.data, { visitId: M2 }); if (this.isLocationVisitResponse(n.response)) { let a = b(n.response.headers["x-inertia-location"]), w = S; w.hash && !a.hash && E(w).href === a.href && (a.hash = w.hash), this.locationVisit(a, l === true); } else if (n.response) W(n.response) && _.show(n.response.data); else return Promise.reject(n); }).then(() => { this.activeVisit && this.finishVisit(this.activeVisit); }).catch((n) => { if (!axios_default.isCancel(n)) { let a = $(n); if (this.activeVisit && this.finishVisit(this.activeVisit), a) return Promise.reject(n); } }); } setPage(e, { visitId: i = this.createVisitId(), replace: r = false, preserveScroll: s = false, preserveState: l = false } = {}) { return Promise.resolve(this.resolveComponent(e.component)).then((h2) => { i === this.visitId && (e.scrollRegions = this.page.scrollRegions || [], e.rememberedState = e.rememberedState || {}, r = r || b(e.url).href === window.location.href, r ? this.replaceState(e) : this.pushState(e), this.swapComponent({ component: h2, page: e, preserveState: l }).then(() => { s ? this.restoreScrollPositions() : this.resetScrollPositions(), r || P(e); })); }); } pushState(e) { this.page = e, Y ? setTimeout(() => window.history.pushState(e, "", e.url)) : window.history.pushState(e, "", e.url); } replaceState(e) { this.page = e, Y ? setTimeout(() => window.history.replaceState(e, "", e.url)) : window.history.replaceState(e, "", e.url); } handlePopstateEvent(e) { if (e.state !== null) { let i = e.state, r = this.createVisitId(); Promise.resolve(this.resolveComponent(i.component)).then((s) => { r === this.visitId && (this.page = i, this.swapComponent({ component: s, page: i, preserveState: false }).then(() => { this.restoreScrollPositions(), P(i); })); }); } else { let i = b(this.page.url); i.hash = window.location.hash, this.replaceState({ ...this.page, url: i.href }), this.resetScrollPositions(); } } get(e, i = {}, r = {}) { return this.visit(e, { ...r, method: "get", data: i }); } reload(e = {}) { return this.visit(window.location.href, { ...e, preserveScroll: true, preserveState: true }); } replace(e, i = {}) { return console.warn(`Inertia.replace() has been deprecated and will be removed in a future release. Please use Inertia.${i.method ?? "get"}() instead.`), this.visit(e, { preserveState: true, ...i, replace: true }); } post(e, i = {}, r = {}) { return this.visit(e, { preserveState: true, ...r, method: "post", data: i }); } put(e, i = {}, r = {}) { return this.visit(e, { preserveState: true, ...r, method: "put", data: i }); } patch(e, i = {}, r = {}) { return this.visit(e, { preserveState: true, ...r, method: "patch", data: i }); } delete(e, i = {}) { return this.visit(e, { preserveState: true, ...i, method: "delete" }); } remember(e, i = "default") { var _a; C || this.replaceState({ ...this.page, rememberedState: { ...(_a = this.page) == null ? void 0 : _a.rememberedState, [i]: e } }); } restore(e = "default") { var _a, _b; if (!C) return (_b = (_a = window.history.state) == null ? void 0 : _a.rememberedState) == null ? void 0 : _b[e]; } on(e, i) { if (C) return () => { }; let r = (s) => { let l = i(s); s.cancelable && !s.defaultPrevented && l === false && s.preventDefault(); }; return document.addEventListener(`inertia:${e}`, r), () => document.removeEventListener(`inertia:${e}`, r); } }; var se = { buildDOMElement(t) { let e = document.createElement("template"); e.innerHTML = t; let i = e.content.firstChild; if (!t.startsWith("