Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../chunk-9hOWP6kD.cjs");
const require_build_widget_registry = require("../build-widget-registry-BQ1Re7ib.cjs");
require("../ScreenRenderer-EGk5-w0h.cjs");
require("../use-account-CPOGOGl6.cjs");
require("../use-optional-store-CIM4spDu.cjs");
require("../registry-context-Dw3vg1Fz.cjs");
require("../WidgetInteractionContext-D4gaGBYO.cjs");
require("../RepUserContext-BAByOdBZ.cjs");
require("../QuickLinksWidget-mDiAucKr.cjs");
require("../WidgetRenderStateContext-CzQGfxrW.cjs");
require("../src-BRyZgUFh.cjs");
require("../use-share-link-Dp0CQzKq.cjs");
require("../translation-api-context-factory-DkXq_vPq.cjs");
require("../shell-translation-api-context-C1O6mKNu.cjs");
require("../error-state-Du7X9xIM.cjs");
require("../PointsWidget-BcBtWxS2.cjs");
require("../task-composer-form-oKkUtTAg.cjs");
require("../LayoutWidget-CS8fOr1e.cjs");
const require_registries = require("../registries-zFvhorZ2.cjs");
require("../fields-Dj1992kh.cjs");
require("../TextWidget-CY71e66E.cjs");
require("../AlertWidget-BJekf1r1.cjs");
require("../BulletListWidget-Dz_32RH1.cjs");
require("../preview-context-C10PndIF.cjs");
require("../CalendarWidget-DasX2RBc.cjs");
require("../CardWidget-CGbAcMeq.cjs");
require("../purify.es-C0e28NH_.cjs");
require("../MediaRenderer-LbEmnnhA.cjs");
require("../CarouselWidget-DnwHco7T.cjs");
require("../CatchUpWidget-D1U4Vtmr.cjs");
require("../src-CfWQyJTB.cjs");
require("../ChartWidget-84gwfoVQ.cjs");
require("../ContainerWidget-BOZYpAH1.cjs");
require("../EmbedWidget-CnNDAp-L.cjs");
require("../ImageWidget-Paeyj_Yk.cjs");
require("../LinkWidget-Bd1eErkP.cjs");
require("../ListWidget-B4b088gA.cjs");
require("../MySiteWidget-DBVtISZS.cjs");
require("../NestedWidget-C3_u-_zO.cjs");
require("../QuickShareWidget-_SFt9Dul.cjs");
require("../RecentActivityWidget-Cw5sY9lh.cjs");
require("../SeparatorWidget-D4LUXvlT.cjs");
require("../SpacerWidget-CBr--iyL.cjs");
require("../TableWidget-RK-dUeyg.cjs");
require("../ToDoWidget-BFY7UXfe.cjs");
require("../VideoWidget-C1s49h0T.cjs");
require("../ShopWidget-B9NX-1jS.cjs");
//#region src/utils/build-remote-widget-plugin-manifests.ts
/**
* Projects accepted canonical packages into builder manifests using the same
* package-atomic acceptance pass as the runtime registry.
*/
function buildRemoteWidgetPluginManifests(packages, hostOptions = {}) {
	const { warningSink, ...registryOptions } = hostOptions;
	return require_build_widget_registry.projectRemoteWidgetPackages({}, packages, registryOptions, warningSink ?? console.warn).acceptedWidgets.map(({ widget, component }) => toWidgetManifest(widget, component));
}
function toWidgetManifest(widget, component) {
	const resizable = toResizable(widget.resizable);
	return {
		manifestVersion: 1,
		type: widget.type,
		component,
		displayName: widget.displayName,
		description: widget.description,
		icon: widget.icon,
		category: widget.category,
		propertySchema: normalizePropertySchema(widget),
		defaultProps: { ...widget.defaultProps },
		minSdkVersion: widget.minSdkVersion,
		...resizable === void 0 ? {} : { resizable }
	};
}
function normalizePropertySchema(widget) {
	const fields = Array.isArray(widget.propertySchema.fields) ? widget.propertySchema.fields.filter(isPropertyField) : [];
	return {
		...widget.propertySchema,
		widgetType: widget.type,
		displayName: typeof widget.propertySchema.displayName === "string" ? widget.propertySchema.displayName : widget.displayName,
		fields
	};
}
function toResizable(resizable) {
	if (resizable === false) return void 0;
	if (resizable === true || resizable === "both") return {
		horizontal: true,
		vertical: true
	};
	return resizable === "horizontal" ? { horizontal: true } : { vertical: true };
}
function isPropertyField(value) {
	return typeof value === "object" && value !== null && "key" in value && typeof value.key === "string" && "label" in value && typeof value.label === "string" && "type" in value && typeof value.type === "string" && require_registries.isPropertyFieldType(value.type);
}
//#endregion
exports.buildRemoteWidgetPluginManifests = buildRemoteWidgetPluginManifests;

//# sourceMappingURL=build-remote-widget-plugin-manifests.cjs.map