const require_chunk = require("./chunk-9hOWP6kD.cjs");
const require_static_dict_adapter = require("./static-dict-adapter-JAau5LHb.cjs");
const require_translation_api_context_factory = require("./translation-api-context-factory-BSRK6Z50.cjs");
const require_use_store = require("./use-store-lOOUcpRT.cjs");
let react = require("react");
let react_jsx_runtime = require("react/jsx-runtime");
let lucide_react = require("lucide-react");
let clsx = require("clsx");
let tailwind_merge = require("tailwind-merge");
//#region ../app-download-ui/src/translation-api-context.ts
const { Provider, useTranslation } = require_translation_api_context_factory.createTranslationContext("AppDownload");
const AppDownloadTranslationProvider = Provider;
const useAppDownloadTranslation = useTranslation;
//#endregion
//#region ../app-download-ui/src/components/AppStoreButtons.tsx
function AppleIcon() {
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
		xmlns: "http://www.w3.org/2000/svg",
		viewBox: "0 0 384 512",
		fill: "currentColor",
		className: "size-5",
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-62.1 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z" })
	});
}
function GooglePlayIcon() {
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
		xmlns: "http://www.w3.org/2000/svg",
		viewBox: "0 0 512 512",
		fill: "currentColor",
		className: "size-5",
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M325.3 234.3L104.6 13l280.8 161.2-60.1 60.1zM47 0C34 6.8 25.3 19.2 25.3 35.3v441.3c0 16.1 8.7 28.5 21.7 35.3l256.6-256L47 0zm425.2 225.6l-58.9-34.1-65.7 64.5 65.7 64.5 60.1-34.1c18-14.3 18-46.5-1.2-60.8zM104.6 499l280.8-161.2-60.1-60.1L104.6 499z" })
	});
}
function AppStoreButtons({ appstoreUrl, playstoreUrl }) {
	const { t } = useAppDownloadTranslation();
	return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
		className: `grid gap-4 ${playstoreUrl ? "grid-cols-1 sm:grid-cols-2" : "grid-cols-1"}`,
		children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
			href: appstoreUrl,
			target: "_blank",
			rel: "noopener noreferrer",
			className: "block cursor-pointer rounded-sm border bg-white p-4 text-gray-900 transition-colors hover:bg-gray-50",
			children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
				className: "flex justify-between",
				children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
					className: "flex flex-col items-baseline",
					children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppleIcon, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
						className: "mt-1 text-left text-xs font-semibold",
						children: t("open_app_store")
					})]
				}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
					className: "flex items-start",
					children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ExternalLink, { className: "size-4" })
				})]
			})
		}), playstoreUrl && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
			href: playstoreUrl,
			target: "_blank",
			rel: "noopener noreferrer",
			className: "block cursor-pointer rounded-sm border bg-white p-4 text-gray-900 transition-colors hover:bg-gray-50",
			children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
				className: "flex justify-between",
				children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
					className: "flex flex-col items-baseline",
					children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(GooglePlayIcon, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
						className: "mt-1 text-left text-xs font-semibold",
						children: t("open_play_store")
					})]
				}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
					className: "flex items-start",
					children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ExternalLink, { className: "size-4" })
				})]
			})
		})]
	});
}
//#endregion
//#region ../app-download-ui/src/components/QrCodeSection.tsx
function QrCodeSection({ companyId }) {
	const { t } = useAppDownloadTranslation();
	const redirectUrl = `https://api.fluid.app/mobile_app_download/${companyId}`;
	const qrCodeUrl = `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(redirectUrl)}`;
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
		href: redirectUrl,
		target: "_blank",
		rel: "noopener noreferrer",
		className: "block cursor-pointer rounded-sm border bg-white p-4 text-gray-900 transition-colors hover:bg-gray-50",
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
			className: "flex items-end justify-between",
			children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
				className: "flex flex-col items-baseline",
				children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
					className: "mt-1 text-left text-xs font-semibold",
					children: t("scan_to_download")
				})
			}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
				className: "flex",
				children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
					src: qrCodeUrl,
					alt: t("qr_code_alt"),
					className: "size-16",
					loading: "lazy"
				})
			})]
		})
	});
}
//#endregion
//#region ../app-download-ui/src/components/ImageSection.tsx
const DEFAULT_IMAGE = "https://assets.fluid.app/fluid-admin/images/we-commerce/iphone_product.png";
const DEFAULT_LOGO = "https://assets.fluid.app/fluid-admin/images/we-commerce/we-commerce.png";
function ImageSection({ logoUrl, screenshotUrl, appName }) {
	const { t } = useAppDownloadTranslation();
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
		className: "flex flex-col overflow-hidden",
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
			className: "-mb-px flex flex-1 flex-col",
			children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
				className: "flex h-20 px-3 pt-8",
				children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
					src: logoUrl || DEFAULT_LOGO,
					alt: appName ?? t("default_app_name"),
					width: 150,
					height: 150,
					className: "object-contain"
				})
			}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
				className: screenshotUrl ? "mt-8 flex flex-1 items-end justify-start" : "-ml-20 flex flex-1 items-end justify-start",
				children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
					src: screenshotUrl || DEFAULT_IMAGE,
					alt: t("mobile_app_screenshot_alt"),
					width: 480,
					height: 500,
					className: "h-full w-auto object-cover"
				})
			})]
		})
	});
}
//#endregion
//#region ../app-download-ui/src/lib/cn.ts
function cn(...inputs) {
	return (0, tailwind_merge.twMerge)((0, clsx.clsx)(inputs));
}
//#endregion
//#region ../app-download-ui/src/components/AppDownloadScreen.tsx
const DEFAULT_APPSTORE_URL = "https://apps.apple.com/app/wecommerce/id1564463740";
const DEFAULT_PLAYSTORE_URL = "https://play.google.com/store/apps/details?id=com.fluid.crm";
function AppDownloadScreen$1({ companyId, appstoreUrl, playstoreUrl, logoUrl, screenshotUrl, appName, className }) {
	const { t } = useAppDownloadTranslation();
	const resolvedAppstoreUrl = appstoreUrl?.trim() || DEFAULT_APPSTORE_URL;
	const resolvedPlaystoreUrl = playstoreUrl?.trim() || DEFAULT_PLAYSTORE_URL;
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
		className: cn("flex h-full items-center justify-center p-4", className),
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
			className: "bg-muted relative mx-4 w-full max-w-6xl overflow-hidden rounded-xl px-6 shadow-xl",
			children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
				className: "grid h-150 w-full grid-cols-1 lg:grid-cols-2",
				children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImageSection, {
					logoUrl,
					screenshotUrl,
					appName
				}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
					className: "space-y-2 pt-8 pb-8",
					children: [
						/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
							className: "mt-12 text-left text-[32px] leading-tight font-black text-gray-900",
							children: t("heading_line_1")
						}),
						/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
							className: "-mt-2 text-left text-[32px] leading-tight font-black text-gray-900",
							children: t("heading_line_2")
						}),
						/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
							className: "-mt-1 text-left text-[14px] leading-relaxed text-gray-600",
							children: t("description")
						}),
						/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
							className: "mt-16 text-left text-[12px] font-bold text-gray-900",
							children: t("download_the_app")
						}),
						/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppStoreButtons, {
							appstoreUrl: resolvedAppstoreUrl,
							playstoreUrl: resolvedPlaystoreUrl
						}),
						/* @__PURE__ */ (0, react_jsx_runtime.jsx)(QrCodeSection, { companyId })
					]
				})]
			})
		})
	});
}
//#endregion
//#region ../app-download-ui/src/translation-adapter.ts
const appDownloadDomain = require_static_dict_adapter.createDomainTranslations({
	fallback: {
		heading_line_1: "EVERYTHING YOU NEED",
		heading_line_2: "AT YOUR FINGERTIPS",
		description: "Everything you need at your fingertips. Run your business from one place while on the go. Share, message, sell, and manage from the mobile app.",
		download_the_app: "Download the App",
		open_app_store: "Open App Store",
		open_play_store: "Open Play Store",
		scan_to_download: "Scan to Download",
		qr_code_alt: "QR code for mobile app download",
		mobile_app_screenshot_alt: "Mobile app interface",
		default_app_name: "App"
	},
	loaders: {
		de: () => Promise.resolve().then(() => require("./de-DDV6of6J.cjs")).then((m) => m.default),
		el: () => Promise.resolve().then(() => require("./el-BPXewMzp.cjs")).then((m) => m.default),
		es: () => Promise.resolve().then(() => require("./es-CeA-EJie.cjs")).then((m) => m.default),
		fr: () => Promise.resolve().then(() => require("./fr-BQlgvtE2.cjs")).then((m) => m.default),
		he: () => Promise.resolve().then(() => require("./he-Bjnd625O.cjs")).then((m) => m.default),
		hu: () => Promise.resolve().then(() => require("./hu-D8DXXtLk.cjs")).then((m) => m.default),
		id: () => Promise.resolve().then(() => require("./id-qyTGeK_x.cjs")).then((m) => m.default),
		it: () => Promise.resolve().then(() => require("./it-CS6ex2Ri.cjs")).then((m) => m.default),
		ja: () => Promise.resolve().then(() => require("./ja-D5w8RORE.cjs")).then((m) => m.default),
		ko: () => Promise.resolve().then(() => require("./ko-DkrYkIw5.cjs")).then((m) => m.default),
		nl: () => Promise.resolve().then(() => require("./nl-9yMkvcTI.cjs")).then((m) => m.default),
		pl: () => Promise.resolve().then(() => require("./pl-DX_bHpgR.cjs")).then((m) => m.default),
		pt: () => Promise.resolve().then(() => require("./pt-jLDXN5kS.cjs")).then((m) => m.default),
		ro: () => Promise.resolve().then(() => require("./ro-C_Lfxfts.cjs")).then((m) => m.default),
		ru: () => Promise.resolve().then(() => require("./ru-DK61PMoE.cjs")).then((m) => m.default),
		th: () => Promise.resolve().then(() => require("./th-C7YgoPSU.cjs")).then((m) => m.default),
		tl: () => Promise.resolve().then(() => require("./tl-DmnTyb-P.cjs")).then((m) => m.default),
		tr: () => Promise.resolve().then(() => require("./tr-CKBfEiNL.cjs")).then((m) => m.default),
		zh_CN: () => Promise.resolve().then(() => require("./zh_CN-C04bbrAU.cjs")).then((m) => m.default),
		zh_TW: () => Promise.resolve().then(() => require("./zh_TW-Vk9EBGBL.cjs")).then((m) => m.default)
	}
});
function createAppDownloadTranslationAdapter(locale, dict) {
	return require_static_dict_adapter.createStaticDictAdapter(locale, dict);
}
//#endregion
//#region src/providers/AppDownloadTranslationBridge.tsx
function AppDownloadTranslationBridge({ children }) {
	const { locale } = require_static_dict_adapter.useActiveLocale();
	const dict = require_static_dict_adapter.useDomainDict(appDownloadDomain, locale);
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppDownloadTranslationProvider, {
		value: (0, react.useMemo)(() => createAppDownloadTranslationAdapter(locale, dict), [locale, dict]),
		children
	});
}
//#endregion
//#region src/screens/AppDownloadScreen.tsx
var AppDownloadScreen_exports = /* @__PURE__ */ require_chunk.__exportAll({
	AppDownloadScreen: () => AppDownloadScreen,
	appDownloadScreenPropertySchema: () => appDownloadScreenPropertySchema
});
const appDownloadScreenPropertySchema = {
	widgetType: "AppDownloadScreen",
	displayName: "App Download Screen",
	fields: []
};
function AppDownloadScreen() {
	const { data: store } = require_use_store.useStore();
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppDownloadTranslationBridge, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppDownloadScreen$1, {
		companyId: store?.id ?? 0,
		appstoreUrl: store?.appstore_url ?? void 0,
		playstoreUrl: store?.playstore_url ?? void 0,
		logoUrl: store?.logo_url ?? void 0
	}) });
}
//#endregion
Object.defineProperty(exports, "AppDownloadScreen_exports", {
	enumerable: true,
	get: function() {
		return AppDownloadScreen_exports;
	}
});

//# sourceMappingURL=AppDownloadScreen-DIcwvAZ4.cjs.map