//#region ../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/utils/resizeObservers.js
var e = [], t = function() {
	return e.some(function(e) {
		return e.activeTargets.length > 0;
	});
}, n = function() {
	return e.some(function(e) {
		return e.skippedTargets.length > 0;
	});
}, r = "ResizeObserver loop completed with undelivered notifications.", i = function() {
	var e;
	typeof ErrorEvent == "function" ? e = new ErrorEvent("error", { message: r }) : (e = document.createEvent("Event"), e.initEvent("error", !1, !1), e.message = r), window.dispatchEvent(e);
}, a;
(function(e) {
	e.BORDER_BOX = "border-box", e.CONTENT_BOX = "content-box", e.DEVICE_PIXEL_CONTENT_BOX = "device-pixel-content-box";
})(a ||= {});
//#endregion
//#region ../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/utils/freeze.js
var o = function(e) {
	return Object.freeze(e);
}, s = function() {
	function e(e, t) {
		this.inlineSize = e, this.blockSize = t, o(this);
	}
	return e;
}(), c = function() {
	function e(e, t, n, r) {
		return this.x = e, this.y = t, this.width = n, this.height = r, this.top = this.y, this.left = this.x, this.bottom = this.top + this.height, this.right = this.left + this.width, o(this);
	}
	return e.prototype.toJSON = function() {
		var e = this;
		return {
			x: e.x,
			y: e.y,
			top: e.top,
			right: e.right,
			bottom: e.bottom,
			left: e.left,
			width: e.width,
			height: e.height
		};
	}, e.fromRect = function(t) {
		return new e(t.x, t.y, t.width, t.height);
	}, e;
}(), l = function(e) {
	return e instanceof SVGElement && "getBBox" in e;
}, u = function(e) {
	if (l(e)) {
		var t = e.getBBox(), n = t.width, r = t.height;
		return !n && !r;
	}
	var i = e, a = i.offsetWidth, o = i.offsetHeight;
	return !(a || o || e.getClientRects().length);
}, d = function(e) {
	if (e instanceof Element) return !0;
	var t = e?.ownerDocument?.defaultView;
	return !!(t && e instanceof t.Element);
}, f = function(e) {
	switch (e.tagName) {
		case "INPUT": if (e.type !== "image") break;
		case "VIDEO":
		case "AUDIO":
		case "EMBED":
		case "OBJECT":
		case "CANVAS":
		case "IFRAME":
		case "IMG": return !0;
	}
	return !1;
}, p = typeof window < "u" ? window : {}, m = /* @__PURE__ */ new WeakMap(), h = /auto|scroll/, g = /^tb|vertical/, _ = /msie|trident/i.test(p.navigator && p.navigator.userAgent), v = function(e) {
	return parseFloat(e || "0");
}, y = function(e, t, n) {
	return e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = !1), new s((n ? t : e) || 0, (n ? e : t) || 0);
}, b = o({
	devicePixelContentBoxSize: y(),
	borderBoxSize: y(),
	contentBoxSize: y(),
	contentRect: new c(0, 0, 0, 0)
}), x = function(e, t) {
	if (t === void 0 && (t = !1), m.has(e) && !t) return m.get(e);
	if (u(e)) return m.set(e, b), b;
	var n = getComputedStyle(e), r = l(e) && e.ownerSVGElement && e.getBBox(), i = !_ && n.boxSizing === "border-box", a = g.test(n.writingMode || ""), s = !r && h.test(n.overflowY || ""), d = !r && h.test(n.overflowX || ""), f = r ? 0 : v(n.paddingTop), p = r ? 0 : v(n.paddingRight), x = r ? 0 : v(n.paddingBottom), S = r ? 0 : v(n.paddingLeft), C = r ? 0 : v(n.borderTopWidth), w = r ? 0 : v(n.borderRightWidth), T = r ? 0 : v(n.borderBottomWidth), E = r ? 0 : v(n.borderLeftWidth), D = S + p, O = f + x, k = E + w, A = C + T, j = d ? e.offsetHeight - A - e.clientHeight : 0, M = s ? e.offsetWidth - k - e.clientWidth : 0, N = i ? D + k : 0, P = i ? O + A : 0, F = r ? r.width : v(n.width) - N - M, I = r ? r.height : v(n.height) - P - j, L = F + D + M + k, R = I + O + j + A, z = o({
		devicePixelContentBoxSize: y(Math.round(F * devicePixelRatio), Math.round(I * devicePixelRatio), a),
		borderBoxSize: y(L, R, a),
		contentBoxSize: y(F, I, a),
		contentRect: new c(S, f, F, I)
	});
	return m.set(e, z), z;
}, S = function(e, t, n) {
	var r = x(e, n), i = r.borderBoxSize, o = r.contentBoxSize, s = r.devicePixelContentBoxSize;
	switch (t) {
		case a.DEVICE_PIXEL_CONTENT_BOX: return s;
		case a.BORDER_BOX: return i;
		default: return o;
	}
}, C = function() {
	function e(e) {
		var t = x(e);
		this.target = e, this.contentRect = t.contentRect, this.borderBoxSize = o([t.borderBoxSize]), this.contentBoxSize = o([t.contentBoxSize]), this.devicePixelContentBoxSize = o([t.devicePixelContentBoxSize]);
	}
	return e;
}(), w = function(e) {
	if (u(e)) return Infinity;
	for (var t = 0, n = e.parentNode; n;) t += 1, n = n.parentNode;
	return t;
}, T = function() {
	var t = Infinity, n = [];
	e.forEach(function(e) {
		if (e.activeTargets.length !== 0) {
			var r = [];
			e.activeTargets.forEach(function(e) {
				var n = new C(e.target), i = w(e.target);
				r.push(n), e.lastReportedSize = S(e.target, e.observedBox), i < t && (t = i);
			}), n.push(function() {
				e.callback.call(e.observer, r, e.observer);
			}), e.activeTargets.splice(0, e.activeTargets.length);
		}
	});
	for (var r = 0, i = n; r < i.length; r++) {
		var a = i[r];
		a();
	}
	return t;
}, E = function(t) {
	e.forEach(function(e) {
		e.activeTargets.splice(0, e.activeTargets.length), e.skippedTargets.splice(0, e.skippedTargets.length), e.observationTargets.forEach(function(n) {
			n.isActive() && (w(n.target) > t ? e.activeTargets.push(n) : e.skippedTargets.push(n));
		});
	});
}, D = function() {
	var e = 0;
	for (E(e); t();) e = T(), E(e);
	return n() && i(), e > 0;
}, O, k = [], A = function() {
	return k.splice(0).forEach(function(e) {
		return e();
	});
}, j = function(e) {
	if (!O) {
		var t = 0, n = document.createTextNode("");
		new MutationObserver(function() {
			return A();
		}).observe(n, { characterData: !0 }), O = function() {
			n.textContent = `${t ? t-- : t++}`;
		};
	}
	k.push(e), O();
}, M = function(e) {
	j(function() {
		requestAnimationFrame(e);
	});
}, N = 0, P = function() {
	return !!N;
}, F = 250, I = {
	attributes: !0,
	characterData: !0,
	childList: !0,
	subtree: !0
}, L = [
	"resize",
	"load",
	"transitionend",
	"animationend",
	"animationstart",
	"animationiteration",
	"keyup",
	"keydown",
	"mouseup",
	"mousedown",
	"mouseover",
	"mouseout",
	"blur",
	"focus"
], R = function(e) {
	return e === void 0 && (e = 0), Date.now() + e;
}, z = !1, B = new (function() {
	function e() {
		var e = this;
		this.stopped = !0, this.listener = function() {
			return e.schedule();
		};
	}
	return e.prototype.run = function(e) {
		var t = this;
		if (e === void 0 && (e = F), !z) {
			z = !0;
			var n = R(e);
			M(function() {
				var r = !1;
				try {
					r = D();
				} finally {
					if (z = !1, e = n - R(), !P()) return;
					r ? t.run(1e3) : e > 0 ? t.run(e) : t.start();
				}
			});
		}
	}, e.prototype.schedule = function() {
		this.stop(), this.run();
	}, e.prototype.observe = function() {
		var e = this, t = function() {
			return e.observer && e.observer.observe(document.body, I);
		};
		document.body ? t() : p.addEventListener("DOMContentLoaded", t);
	}, e.prototype.start = function() {
		var e = this;
		this.stopped && (this.stopped = !1, this.observer = new MutationObserver(this.listener), this.observe(), L.forEach(function(t) {
			return p.addEventListener(t, e.listener, !0);
		}));
	}, e.prototype.stop = function() {
		var e = this;
		this.stopped ||= (this.observer && this.observer.disconnect(), L.forEach(function(t) {
			return p.removeEventListener(t, e.listener, !0);
		}), !0);
	}, e;
}())(), V = function(e) {
	!N && e > 0 && B.start(), N += e, !N && B.stop();
}, H = function(e) {
	return !l(e) && !f(e) && getComputedStyle(e).display === "inline";
}, U = function() {
	function e(e, t) {
		this.target = e, this.observedBox = t || a.CONTENT_BOX, this.lastReportedSize = {
			inlineSize: 0,
			blockSize: 0
		};
	}
	return e.prototype.isActive = function() {
		var e = S(this.target, this.observedBox, !0);
		return H(this.target) && (this.lastReportedSize = e), this.lastReportedSize.inlineSize !== e.inlineSize || this.lastReportedSize.blockSize !== e.blockSize;
	}, e;
}(), W = function() {
	function e(e, t) {
		this.activeTargets = [], this.skippedTargets = [], this.observationTargets = [], this.observer = e, this.callback = t;
	}
	return e;
}(), G = /* @__PURE__ */ new WeakMap(), K = function(e, t) {
	for (var n = 0; n < e.length; n += 1) if (e[n].target === t) return n;
	return -1;
}, q = function() {
	function t() {}
	return t.connect = function(e, t) {
		var n = new W(e, t);
		G.set(e, n);
	}, t.observe = function(t, n, r) {
		var i = G.get(t), a = i.observationTargets.length === 0;
		K(i.observationTargets, n) < 0 && (a && e.push(i), i.observationTargets.push(new U(n, r && r.box)), V(1), B.schedule());
	}, t.unobserve = function(t, n) {
		var r = G.get(t), i = K(r.observationTargets, n), a = r.observationTargets.length === 1;
		i >= 0 && (a && e.splice(e.indexOf(r), 1), r.observationTargets.splice(i, 1), V(-1));
	}, t.disconnect = function(e) {
		var t = this, n = G.get(e);
		n.observationTargets.slice().forEach(function(n) {
			return t.unobserve(e, n.target);
		}), n.activeTargets.splice(0, n.activeTargets.length);
	}, t;
}(), J = function() {
	function e(e) {
		if (arguments.length === 0) throw TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
		if (typeof e != "function") throw TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
		q.connect(this, e);
	}
	return e.prototype.observe = function(e, t) {
		if (arguments.length === 0) throw TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
		if (!d(e)) throw TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
		q.observe(this, e, t);
	}, e.prototype.unobserve = function(e) {
		if (arguments.length === 0) throw TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
		if (!d(e)) throw TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
		q.unobserve(this, e);
	}, e.prototype.disconnect = function() {
		q.disconnect(this);
	}, e.toString = function() {
		return "function ResizeObserver () { [polyfill code] }";
	}, e;
}();
//#endregion
export { J as t };

//# sourceMappingURL=resize-observer.js.map