//#region ../core/dist/dev/core/utils/define-class-prop-hooks.js
function defineClassPropHooks(Class, BaseClassProto) {
	for (const prop of Object.getOwnPropertyNames(BaseClassProto)) {
		if (prop in Class.prototype) continue;
		const descriptor = Object.getOwnPropertyDescriptor(BaseClassProto, prop);
		if (!descriptor) continue;
		const config = {};
		if (typeof descriptor.value === "function") config.value = function(...args) {
			return this.call?.(prop, ...args);
		};
		else if (descriptor.get) {
			config.get = function() {
				return this.get?.(prop);
			};
			if (descriptor.set) config.set = function(val) {
				this.set?.(prop, val);
			};
		}
		Object.defineProperty(Class.prototype, prop, config);
	}
}

//#endregion
//#region ../core/dist/dev/core/media/proxy.js
/**
* This mixin creates an API from the passed classes and proxies the methods and properties to the attached target.
*
* Many methods and properties will need no translation and are proxied directly to the attached target.
* For example, the `play` and `pause` methods are proxied directly to the attached target.
*
* Child classes can override the proxied methods and properties to provide custom behavior.
* For example, the `src` property for HLS media is proxied to the HLS engine, not the target itself.
*
* The `get`, `set`, and `call` methods can be overridden to provide catch-all custom behavior.
*/
const ProxyMixin = (PrimaryClass, ...AdditionalClasses) => {
	class MediaProxy {
		#target = null;
		get target() {
			return this.#target;
		}
		get(prop) {
			return this.target?.[prop];
		}
		set(prop, val) {
			if (this.target) this.target[prop] = val;
		}
		call(prop, ...args) {
			return (this.target?.[prop])?.apply(this.target, args);
		}
		attach(target) {
			if (!target || this.#target === target) return;
			this.#target = target;
		}
		detach() {
			if (!this.#target) return;
			this.#target = null;
		}
	}
	for (const Class of [PrimaryClass, ...AdditionalClasses]) defineClassPropHooks(MediaProxy, Class.prototype);
	return MediaProxy;
};

//#endregion
export { defineClassPropHooks as n, ProxyMixin as t };
//# sourceMappingURL=proxy-XzDf9gyk.js.map