| 1 |
import { j as jsxRuntimeExports, r as reactExports } from "./react-vendor-CithbthY.js"; |
| 2 |
import { B as Button } from "../../admin/dist/js/app.js"; |
| 3 |
import { o as __ } from "./index-Dec_weLB.js"; |
| 4 |
const ProBadge = ({ isProActive }) => { |
| 5 |
if (!isProActive) { |
| 6 |
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gradient-to-r from-purple-500 to-blue-500 text-white", children: "PRO" }); |
| 7 |
} |
| 8 |
return null; |
| 9 |
}; |
| 10 |
const ProFeature = ({ |
| 11 |
title, |
| 12 |
description, |
| 13 |
moduleName, |
| 14 |
pricingUrl, |
| 15 |
isProActive, |
| 16 |
isModuleEnabled, |
| 17 |
children |
| 18 |
}) => { |
| 19 |
const modulesPageUrl = reactExports.useMemo(() => { |
| 20 |
var _a; |
| 21 |
const baseUrl = ((_a = window.yatraAdmin) == null ? void 0 : _a.siteUrl) ? `${window.yatraAdmin.siteUrl}/wp-admin/admin.php?page=yatra` : "/wp-admin/admin.php?page=yatra"; |
| 22 |
return `${baseUrl}&subpage=modules`; |
| 23 |
}, []); |
| 24 |
if (isProActive && isModuleEnabled) { |
| 25 |
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children }); |
| 26 |
} |
| 27 |
if (isProActive && !isModuleEnabled) { |
| 28 |
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 bg-gradient-to-r from-amber-50 to-orange-50 dark:from-amber-900/20 dark:to-orange-900/20 rounded-lg border border-amber-200 dark:border-amber-800", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-3", children: [ |
| 29 |
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx( |
| 30 |
"svg", |
| 31 |
{ |
| 32 |
className: "w-6 h-6 text-amber-500", |
| 33 |
fill: "none", |
| 34 |
stroke: "currentColor", |
| 35 |
viewBox: "0 0 24 24", |
| 36 |
children: /* @__PURE__ */ jsxRuntimeExports.jsx( |
| 37 |
"path", |
| 38 |
{ |
| 39 |
strokeLinecap: "round", |
| 40 |
strokeLinejoin: "round", |
| 41 |
strokeWidth: 2, |
| 42 |
d: "M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4" |
| 43 |
} |
| 44 |
) |
| 45 |
} |
| 46 |
) }), |
| 47 |
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [ |
| 48 |
/* @__PURE__ */ jsxRuntimeExports.jsxs("h4", { className: "text-sm font-semibold text-amber-900 dark:text-amber-100", children: [ |
| 49 |
__("Please activate", "yatra"), |
| 50 |
" ", |
| 51 |
moduleName |
| 52 |
] }), |
| 53 |
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-amber-700 dark:text-amber-300 mt-1", children: [ |
| 54 |
__("You have Yatra Pro installed. Enable the", "yatra"), |
| 55 |
" ", |
| 56 |
moduleName, |
| 57 |
" ", |
| 58 |
__("module to access", "yatra"), |
| 59 |
" ", |
| 60 |
description.toLowerCase(), |
| 61 |
" ", |
| 62 |
__("features.", "yatra") |
| 63 |
] }), |
| 64 |
/* @__PURE__ */ jsxRuntimeExports.jsx( |
| 65 |
Button, |
| 66 |
{ |
| 67 |
type: "button", |
| 68 |
onClick: () => window.open(modulesPageUrl, "_blank"), |
| 69 |
className: "mt-3 bg-amber-600 hover:bg-amber-700 text-white", |
| 70 |
children: __("Activate Module", "yatra") |
| 71 |
} |
| 72 |
) |
| 73 |
] }) |
| 74 |
] }) }); |
| 75 |
} |
| 76 |
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 bg-gradient-to-r from-purple-50 to-blue-50 dark:from-purple-900/20 dark:to-blue-900/20 border border-purple-200 dark:border-purple-800 rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-3", children: [ |
| 77 |
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx( |
| 78 |
"svg", |
| 79 |
{ |
| 80 |
className: "w-6 h-6 text-purple-500", |
| 81 |
fill: "none", |
| 82 |
stroke: "currentColor", |
| 83 |
viewBox: "0 0 24 24", |
| 84 |
children: /* @__PURE__ */ jsxRuntimeExports.jsx( |
| 85 |
"path", |
| 86 |
{ |
| 87 |
strokeLinecap: "round", |
| 88 |
strokeLinejoin: "round", |
| 89 |
strokeWidth: 2, |
| 90 |
d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" |
| 91 |
} |
| 92 |
) |
| 93 |
} |
| 94 |
) }), |
| 95 |
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [ |
| 96 |
/* @__PURE__ */ jsxRuntimeExports.jsxs("h4", { className: "text-sm font-semibold text-purple-900 dark:text-purple-100", children: [ |
| 97 |
__("Upgrade to Pro for", "yatra"), |
| 98 |
" ", |
| 99 |
moduleName |
| 100 |
] }), |
| 101 |
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-purple-700 dark:text-purple-300 mt-1", children: __( |
| 102 |
`Get Yatra Pro to access ${description} and unlock all premium features.`, |
| 103 |
"yatra" |
| 104 |
) }), |
| 105 |
/* @__PURE__ */ jsxRuntimeExports.jsxs( |
| 106 |
"a", |
| 107 |
{ |
| 108 |
href: pricingUrl, |
| 109 |
target: "_blank", |
| 110 |
rel: "noopener noreferrer", |
| 111 |
className: "inline-flex items-center gap-2 mt-3 px-4 py-2 bg-gradient-to-r from-purple-600 to-blue-600 text-white rounded-lg text-sm font-medium hover:from-purple-700 hover:to-blue-700 transition-all", |
| 112 |
children: [ |
| 113 |
__("Upgrade to Pro", "yatra"), |
| 114 |
/* @__PURE__ */ jsxRuntimeExports.jsx( |
| 115 |
"svg", |
| 116 |
{ |
| 117 |
className: "w-4 h-4", |
| 118 |
fill: "none", |
| 119 |
stroke: "currentColor", |
| 120 |
viewBox: "0 0 24 24", |
| 121 |
children: /* @__PURE__ */ jsxRuntimeExports.jsx( |
| 122 |
"path", |
| 123 |
{ |
| 124 |
strokeLinecap: "round", |
| 125 |
strokeLinejoin: "round", |
| 126 |
strokeWidth: 2, |
| 127 |
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" |
| 128 |
} |
| 129 |
) |
| 130 |
} |
| 131 |
) |
| 132 |
] |
| 133 |
} |
| 134 |
) |
| 135 |
] }) |
| 136 |
] }) }); |
| 137 |
}; |
| 138 |
export { |
| 139 |
ProBadge as P, |
| 140 |
ProFeature as a |
| 141 |
}; |
| 142 |
//# sourceMappingURL=ProFeature-DE6oH70S.js.map |
| 143 |
|