@moontra/moonui-pro 2.31.0 → 2.31.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -50,7 +50,14 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
50
50
  var __getOwnPropNames = Object.getOwnPropertyNames;
51
51
  var __getProtoOf = Object.getPrototypeOf;
52
52
  var __hasOwnProp = Object.prototype.hasOwnProperty;
53
- var __commonJS = (cb, mod) => function __require() {
53
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
54
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
55
+ }) : x)(function(x) {
56
+ if (typeof require !== "undefined")
57
+ return require.apply(this, arguments);
58
+ throw new Error('Dynamic require of "' + x + '" is not supported');
59
+ });
60
+ var __commonJS = (cb, mod) => function __require2() {
54
61
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
55
62
  };
56
63
  var __copyProps = (to, from2, except, desc) => {
@@ -4721,6 +4728,207 @@ var useCollapsibleAnalytics = () => {
4721
4728
  }, []);
4722
4729
  return { analytics, trackOpen, trackClose };
4723
4730
  };
4731
+ var CACHE_KEY = "moonui_license_cache";
4732
+ var CACHE_DURATION = 24 * 60 * 60 * 1e3;
4733
+ var OFFLINE_GRACE_PERIOD = 7 * 24 * 60 * 60 * 1e3;
4734
+ function useSubscription() {
4735
+ const [isLoading, setIsLoading] = useState(true);
4736
+ const [hasProAccess, setHasProAccess] = useState(false);
4737
+ const [isAuthenticated, setIsAuthenticated] = useState(false);
4738
+ useEffect(() => {
4739
+ const checkLicense = async () => {
4740
+ try {
4741
+ const cached = localStorage.getItem(CACHE_KEY);
4742
+ if (cached) {
4743
+ const cacheData = JSON.parse(cached);
4744
+ const now = Date.now();
4745
+ if (now - cacheData.timestamp < CACHE_DURATION) {
4746
+ setHasProAccess(cacheData.valid && cacheData.hasLifetimeAccess);
4747
+ setIsAuthenticated(cacheData.valid);
4748
+ setIsLoading(false);
4749
+ return;
4750
+ }
4751
+ if (now - cacheData.timestamp < OFFLINE_GRACE_PERIOD) {
4752
+ validateLicense().catch(() => {
4753
+ setHasProAccess(cacheData.valid && cacheData.hasLifetimeAccess);
4754
+ setIsAuthenticated(cacheData.valid);
4755
+ });
4756
+ setIsLoading(false);
4757
+ return;
4758
+ }
4759
+ }
4760
+ await validateLicense();
4761
+ } catch (error) {
4762
+ console.error("License check error:", error);
4763
+ setHasProAccess(false);
4764
+ setIsAuthenticated(false);
4765
+ } finally {
4766
+ setIsLoading(false);
4767
+ }
4768
+ };
4769
+ checkLicense();
4770
+ }, []);
4771
+ const getAuthToken = async () => {
4772
+ {
4773
+ if (typeof window !== "undefined") {
4774
+ const browserToken = localStorage.getItem("moonui_auth_token");
4775
+ if (browserToken)
4776
+ return browserToken;
4777
+ }
4778
+ if (typeof window === "undefined") {
4779
+ try {
4780
+ const fs = __require("fs");
4781
+ const path = __require("path");
4782
+ const os2 = __require("os");
4783
+ const authPath = path.join(os2.homedir(), ".moonui", "auth.encrypted");
4784
+ if (fs.existsSync(authPath)) {
4785
+ return "cli-authenticated";
4786
+ }
4787
+ } catch (error) {
4788
+ console.debug("CLI auth check failed:", error);
4789
+ }
4790
+ }
4791
+ }
4792
+ return process.env.NEXT_PUBLIC_MOONUI_AUTH_TOKEN || process.env.MOONUI_LICENSE_KEY || null;
4793
+ };
4794
+ const validateLicense = async () => {
4795
+ const token = await getAuthToken();
4796
+ if (!token) {
4797
+ setHasProAccess(false);
4798
+ setIsAuthenticated(false);
4799
+ return;
4800
+ }
4801
+ if (token === "cli-authenticated") {
4802
+ setHasProAccess(true);
4803
+ setIsAuthenticated(true);
4804
+ if (typeof window !== "undefined") {
4805
+ const cacheData = {
4806
+ valid: true,
4807
+ hasLifetimeAccess: true,
4808
+ timestamp: Date.now()
4809
+ };
4810
+ localStorage.setItem(CACHE_KEY, JSON.stringify(cacheData));
4811
+ }
4812
+ return;
4813
+ }
4814
+ try {
4815
+ const response = await fetch("https://moonui.dev/api/auth/validate", {
4816
+ headers: {
4817
+ "Authorization": `Bearer ${token}`
4818
+ }
4819
+ });
4820
+ if (response.ok) {
4821
+ const data = await response.json();
4822
+ const cacheData = {
4823
+ valid: data.valid,
4824
+ hasLifetimeAccess: data.user?.hasLifetimeAccess || false,
4825
+ timestamp: Date.now(),
4826
+ cacheUntil: data.cacheUntil ? new Date(data.cacheUntil).getTime() : void 0
4827
+ };
4828
+ localStorage.setItem(CACHE_KEY, JSON.stringify(cacheData));
4829
+ setHasProAccess(data.valid && (data.user?.hasLifetimeAccess || data.user?.features?.includes("pro_components")));
4830
+ setIsAuthenticated(data.valid);
4831
+ } else {
4832
+ localStorage.removeItem(CACHE_KEY);
4833
+ setHasProAccess(false);
4834
+ setIsAuthenticated(false);
4835
+ }
4836
+ } catch (error) {
4837
+ const cached = localStorage.getItem(CACHE_KEY);
4838
+ if (cached) {
4839
+ const cacheData = JSON.parse(cached);
4840
+ const now = Date.now();
4841
+ if (now - cacheData.timestamp < OFFLINE_GRACE_PERIOD) {
4842
+ setHasProAccess(cacheData.valid && cacheData.hasLifetimeAccess);
4843
+ setIsAuthenticated(cacheData.valid);
4844
+ return;
4845
+ }
4846
+ }
4847
+ setHasProAccess(false);
4848
+ setIsAuthenticated(false);
4849
+ }
4850
+ };
4851
+ return {
4852
+ isLoading,
4853
+ isAuthenticated,
4854
+ isAdmin: false,
4855
+ hasProAccess,
4856
+ subscriptionPlan: hasProAccess ? "lifetime" : "free",
4857
+ subscription: {
4858
+ status: hasProAccess ? "active" : "inactive",
4859
+ plan: hasProAccess ? "lifetime" : "free"
4860
+ }
4861
+ };
4862
+ }
4863
+ function ProLockScreen({
4864
+ componentName = "Pro Component",
4865
+ className,
4866
+ compact = false
4867
+ }) {
4868
+ if (compact) {
4869
+ return /* @__PURE__ */ jsxs("div", { className: cn(
4870
+ "flex flex-col items-center justify-center p-4 text-center",
4871
+ "rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-700",
4872
+ "bg-gray-50/50 dark:bg-gray-900/50",
4873
+ className
4874
+ ), children: [
4875
+ /* @__PURE__ */ jsx(Lock, { className: "h-8 w-8 text-gray-400 dark:text-gray-600 mb-2" }),
4876
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "CLI Authentication Required" }),
4877
+ /* @__PURE__ */ jsx(
4878
+ "a",
4879
+ {
4880
+ href: "https://moonui.dev/docs/cli#authentication" ,
4881
+ target: "_blank",
4882
+ rel: "noopener noreferrer",
4883
+ className: "text-xs text-primary hover:underline font-medium mt-1",
4884
+ children: "Setup CLI Auth \u2192"
4885
+ }
4886
+ )
4887
+ ] });
4888
+ }
4889
+ return /* @__PURE__ */ jsxs("div", { className: cn(
4890
+ "flex flex-col items-center justify-center",
4891
+ "rounded-lg border-2 border-dashed border-gray-300 dark:border-gray-700",
4892
+ "bg-gradient-to-b from-gray-50 to-gray-100/50 dark:from-gray-900 dark:to-gray-950/50",
4893
+ "p-8 text-center min-h-[200px]",
4894
+ className
4895
+ ), children: [
4896
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
4897
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-primary/20 blur-xl rounded-full" }),
4898
+ /* @__PURE__ */ jsx(Lock, { className: "relative h-12 w-12 text-gray-400 dark:text-gray-600 mb-4" })
4899
+ ] }),
4900
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: componentName }),
4901
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 mb-4 max-w-sm", children: "CLI authentication required to access Pro components" }),
4902
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
4903
+ /* @__PURE__ */ jsxs(
4904
+ "a",
4905
+ {
4906
+ href: "https://moonui.dev/docs/cli#authentication" ,
4907
+ target: "_blank",
4908
+ rel: "noopener noreferrer",
4909
+ className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",
4910
+ children: [
4911
+ /* @__PURE__ */ jsx(Lock, { className: "h-3 w-3" }),
4912
+ "Setup CLI Authentication"
4913
+ ]
4914
+ }
4915
+ ),
4916
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
4917
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Run: moonui login" }),
4918
+ /* @__PURE__ */ jsx(
4919
+ "a",
4920
+ {
4921
+ href: "https://moonui.dev/pricing",
4922
+ target: "_blank",
4923
+ rel: "noopener noreferrer",
4924
+ className: "text-xs text-primary hover:underline",
4925
+ children: "View Pro Plans \u2192"
4926
+ }
4927
+ )
4928
+ ] })
4929
+ ] })
4930
+ ] });
4931
+ }
4724
4932
  var defaultColors = [
4725
4933
  "#000000",
4726
4934
  "#374151",
@@ -4748,6 +4956,7 @@ var MoonUIColorPickerPro = ({
4748
4956
  size: size4 = "default",
4749
4957
  presets = defaultColors
4750
4958
  }) => {
4959
+ const { hasProAccess, isLoading } = useSubscription();
4751
4960
  const [currentColor, setCurrentColor] = useState(value);
4752
4961
  const handleColorChange = (color) => {
4753
4962
  setCurrentColor(color);
@@ -4758,6 +4967,15 @@ var MoonUIColorPickerPro = ({
4758
4967
  default: "w-8 h-8",
4759
4968
  lg: "w-10 h-10"
4760
4969
  };
4970
+ if (!isLoading && !hasProAccess) {
4971
+ return /* @__PURE__ */ jsx(
4972
+ ProLockScreen,
4973
+ {
4974
+ componentName: "Color Picker",
4975
+ compact: true
4976
+ }
4977
+ );
4978
+ }
4761
4979
  return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-2", className), children: [
4762
4980
  showInput && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 items-center", children: [
4763
4981
  /* @__PURE__ */ jsx(
@@ -8102,6 +8320,7 @@ var MoonUITabsPro = t.forwardRef(({
8102
8320
  onValueChange,
8103
8321
  ...props
8104
8322
  }, ref) => {
8323
+ const { hasProAccess, isLoading } = useSubscription();
8105
8324
  const [items, setItems] = t.useState(initialItems);
8106
8325
  const [localValue, setLocalValue] = t.useState(() => {
8107
8326
  if (persistKey && typeof window !== "undefined") {
@@ -8206,6 +8425,15 @@ var MoonUITabsPro = t.forwardRef(({
8206
8425
  scrollRef.current.scrollBy({ left: 200, behavior: "smooth" });
8207
8426
  }
8208
8427
  };
8428
+ if (!isLoading && !hasProAccess) {
8429
+ return /* @__PURE__ */ jsx(
8430
+ ProLockScreen,
8431
+ {
8432
+ componentName: "Tabs Pro",
8433
+ compact: true
8434
+ }
8435
+ );
8436
+ }
8209
8437
  return /* @__PURE__ */ jsxs("div", { className: cn(
8210
8438
  "relative w-full",
8211
8439
  variant === "gradient" && "bg-gradient-to-r from-primary/10 to-secondary/10 rounded-lg p-1",
@@ -12644,102 +12872,6 @@ var NavigationMenuIndicator2 = t.forwardRef(({ className, ...props }, ref) => /*
12644
12872
  }
12645
12873
  ));
12646
12874
  NavigationMenuIndicator2.displayName = Indicator3.displayName;
12647
- var CACHE_KEY = "moonui_license_cache";
12648
- var CACHE_DURATION = 24 * 60 * 60 * 1e3;
12649
- var OFFLINE_GRACE_PERIOD = 7 * 24 * 60 * 60 * 1e3;
12650
- function useSubscription() {
12651
- const [isLoading, setIsLoading] = useState(true);
12652
- const [hasProAccess, setHasProAccess] = useState(true);
12653
- const [isAuthenticated, setIsAuthenticated] = useState(true);
12654
- useEffect(() => {
12655
- const checkLicense = async () => {
12656
- try {
12657
- const cached = localStorage.getItem(CACHE_KEY);
12658
- if (cached) {
12659
- const cacheData = JSON.parse(cached);
12660
- const now = Date.now();
12661
- if (now - cacheData.timestamp < CACHE_DURATION) {
12662
- setHasProAccess(cacheData.valid && cacheData.hasLifetimeAccess);
12663
- setIsAuthenticated(cacheData.valid);
12664
- setIsLoading(false);
12665
- return;
12666
- }
12667
- if (now - cacheData.timestamp < OFFLINE_GRACE_PERIOD) {
12668
- validateLicense().catch(() => {
12669
- setHasProAccess(cacheData.valid && cacheData.hasLifetimeAccess);
12670
- setIsAuthenticated(cacheData.valid);
12671
- });
12672
- setIsLoading(false);
12673
- return;
12674
- }
12675
- }
12676
- await validateLicense();
12677
- } catch (error) {
12678
- console.error("License check error:", error);
12679
- setHasProAccess(true);
12680
- setIsAuthenticated(true);
12681
- } finally {
12682
- setIsLoading(false);
12683
- }
12684
- };
12685
- checkLicense();
12686
- }, []);
12687
- const validateLicense = async () => {
12688
- const token = process.env.NEXT_PUBLIC_MOONUI_AUTH_TOKEN || localStorage.getItem("moonui_auth_token");
12689
- if (!token) {
12690
- setHasProAccess(true);
12691
- setIsAuthenticated(true);
12692
- return;
12693
- }
12694
- try {
12695
- const response = await fetch("https://moonui.dev/api/auth/validate", {
12696
- headers: {
12697
- "Authorization": `Bearer ${token}`
12698
- }
12699
- });
12700
- if (response.ok) {
12701
- const data = await response.json();
12702
- const cacheData = {
12703
- valid: data.valid,
12704
- hasLifetimeAccess: data.user?.hasLifetimeAccess || false,
12705
- timestamp: Date.now(),
12706
- cacheUntil: data.cacheUntil ? new Date(data.cacheUntil).getTime() : void 0
12707
- };
12708
- localStorage.setItem(CACHE_KEY, JSON.stringify(cacheData));
12709
- setHasProAccess(data.valid && (data.user?.hasLifetimeAccess || data.user?.features?.includes("pro_components")));
12710
- setIsAuthenticated(data.valid);
12711
- } else {
12712
- localStorage.removeItem(CACHE_KEY);
12713
- setHasProAccess(false);
12714
- setIsAuthenticated(false);
12715
- }
12716
- } catch (error) {
12717
- const cached = localStorage.getItem(CACHE_KEY);
12718
- if (cached) {
12719
- const cacheData = JSON.parse(cached);
12720
- const now = Date.now();
12721
- if (now - cacheData.timestamp < OFFLINE_GRACE_PERIOD) {
12722
- setHasProAccess(cacheData.valid && cacheData.hasLifetimeAccess);
12723
- setIsAuthenticated(cacheData.valid);
12724
- return;
12725
- }
12726
- }
12727
- setHasProAccess(false);
12728
- setIsAuthenticated(false);
12729
- }
12730
- };
12731
- return {
12732
- isLoading,
12733
- isAuthenticated,
12734
- isAdmin: false,
12735
- hasProAccess,
12736
- subscriptionPlan: hasProAccess ? "lifetime" : "free",
12737
- subscription: {
12738
- status: hasProAccess ? "active" : "inactive",
12739
- plan: hasProAccess ? "lifetime" : "free"
12740
- }
12741
- };
12742
- }
12743
12875
  var gestureDrawerVariants = cva(
12744
12876
  "fixed bg-background shadow-2xl overflow-hidden",
12745
12877
  {
@@ -13150,6 +13282,7 @@ function useLightbox() {
13150
13282
  return context;
13151
13283
  }
13152
13284
  function LightboxProvider({ children, items = [], defaultIndex = 0 }) {
13285
+ const { hasProAccess, isLoading } = useSubscription();
13153
13286
  const [currentIndex, setCurrentIndex] = t.useState(defaultIndex);
13154
13287
  const [isOpen, setIsOpen] = t.useState(false);
13155
13288
  const [zoom, setZoom] = t.useState(1);
@@ -13165,6 +13298,15 @@ function LightboxProvider({ children, items = [], defaultIndex = 0 }) {
13165
13298
  }),
13166
13299
  [items, currentIndex, isOpen, zoom]
13167
13300
  );
13301
+ if (!isLoading && !hasProAccess) {
13302
+ return /* @__PURE__ */ jsx(
13303
+ ProLockScreen,
13304
+ {
13305
+ componentName: "Lightbox",
13306
+ compact: true
13307
+ }
13308
+ );
13309
+ }
13168
13310
  return /* @__PURE__ */ jsx(LightboxContext.Provider, { value, children });
13169
13311
  }
13170
13312
  var LightboxTrigger = t.forwardRef(
@@ -13661,6 +13803,7 @@ var MoonUIMediaGalleryPro = t.forwardRef(({
13661
13803
  lightboxProps,
13662
13804
  ...props
13663
13805
  }, ref) => {
13806
+ const { hasProAccess, isLoading } = useSubscription();
13664
13807
  const [activeCategory, setActiveCategory] = t.useState(defaultCategory);
13665
13808
  const [activeSort, setActiveSort] = t.useState(defaultSort);
13666
13809
  const [showFilters, setShowFilters] = t.useState(false);
@@ -13820,6 +13963,15 @@ var MoonUIMediaGalleryPro = t.forwardRef(({
13820
13963
  return itemContent;
13821
13964
  };
13822
13965
  const renderSkeleton = () => /* @__PURE__ */ jsx("div", { className: cn(galleryItemVariants({ variant, aspectRatio })), children: /* @__PURE__ */ jsx("div", { className: "w-full h-full bg-muted animate-pulse" }) });
13966
+ if (!isLoading && !hasProAccess) {
13967
+ return /* @__PURE__ */ jsx(
13968
+ ProLockScreen,
13969
+ {
13970
+ componentName: "Media Gallery",
13971
+ compact: true
13972
+ }
13973
+ );
13974
+ }
13823
13975
  const galleryContent = /* @__PURE__ */ jsxs(Fragment, { children: [
13824
13976
  (enableFiltering || enableSorting) && /* @__PURE__ */ jsxs("div", { className: "mb-6", children: [
13825
13977
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4", children: [
@@ -13990,6 +14142,7 @@ function DraggableList({
13990
14142
  dragPreviewStyle = "clone",
13991
14143
  hapticFeedback = true
13992
14144
  }) {
14145
+ const { hasProAccess, isLoading } = useSubscription();
13993
14146
  const [draggedIndex, setDraggedIndex] = useState(null);
13994
14147
  const [dropPosition, setDropPosition] = useState(null);
13995
14148
  const [isDragging, setIsDragging] = useState(false);
@@ -14186,6 +14339,15 @@ function DraggableList({
14186
14339
  }
14187
14340
  return null;
14188
14341
  };
14342
+ if (!isLoading && !hasProAccess) {
14343
+ return /* @__PURE__ */ jsx(
14344
+ ProLockScreen,
14345
+ {
14346
+ componentName: "Draggable List",
14347
+ compact: true
14348
+ }
14349
+ );
14350
+ }
14189
14351
  return /* @__PURE__ */ jsxs(
14190
14352
  "div",
14191
14353
  {
@@ -17174,17 +17336,13 @@ function CalendarInternal({
17174
17336
  function Calendar3(props) {
17175
17337
  const { hasProAccess, isLoading } = useSubscription();
17176
17338
  if (!isLoading && !hasProAccess) {
17177
- return /* @__PURE__ */ jsx(MoonUICardPro, { className: cn("w-full", props.className), children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "py-12 text-center", children: /* @__PURE__ */ jsxs("div", { className: "max-w-md mx-auto space-y-4", children: [
17178
- /* @__PURE__ */ jsx("div", { className: "rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto", children: /* @__PURE__ */ jsx(Lock, { className: "h-6 w-6 text-purple-600 dark:text-purple-400" }) }),
17179
- /* @__PURE__ */ jsxs("div", { children: [
17180
- /* @__PURE__ */ jsx("h3", { className: "font-semibold text-lg mb-2", children: "Pro Feature" }),
17181
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm mb-4", children: "Advanced Calendar is available exclusively to MoonUI Pro subscribers." }),
17182
- /* @__PURE__ */ jsx("a", { href: "/pricing", children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { size: "sm", children: [
17183
- /* @__PURE__ */ jsx(Sparkles, { className: "mr-2 h-4 w-4" }),
17184
- "Upgrade to Pro"
17185
- ] }) })
17186
- ] })
17187
- ] }) }) });
17339
+ return /* @__PURE__ */ jsx(
17340
+ ProLockScreen,
17341
+ {
17342
+ componentName: "Advanced Calendar",
17343
+ className: cn("w-full", props.className)
17344
+ }
17345
+ );
17188
17346
  }
17189
17347
  return /* @__PURE__ */ jsx(CalendarInternal, { ...props });
17190
17348
  }
@@ -58349,17 +58507,13 @@ function RichTextEditor({
58349
58507
  }) {
58350
58508
  const { hasProAccess, isLoading } = useSubscription();
58351
58509
  if (!isLoading && !hasProAccess) {
58352
- return /* @__PURE__ */ jsx(MoonUICardPro, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "py-12 text-center", children: /* @__PURE__ */ jsxs("div", { className: "max-w-md mx-auto space-y-4", children: [
58353
- /* @__PURE__ */ jsx("div", { className: "rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto", children: /* @__PURE__ */ jsx(Lock, { className: "h-6 w-6 text-purple-600 dark:text-purple-400" }) }),
58354
- /* @__PURE__ */ jsxs("div", { children: [
58355
- /* @__PURE__ */ jsx("h3", { className: "font-semibold text-lg mb-2", children: "Pro Feature" }),
58356
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm mb-4", children: "Advanced Rich Text Editor is available exclusively to MoonUI Pro subscribers." }),
58357
- /* @__PURE__ */ jsx("div", { className: "flex gap-3 justify-center", children: /* @__PURE__ */ jsx("a", { href: "/pricing", children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { size: "sm", children: [
58358
- /* @__PURE__ */ jsx(Sparkles, { className: "mr-2 h-4 w-4" }),
58359
- "Upgrade to Pro"
58360
- ] }) }) })
58361
- ] })
58362
- ] }) }) });
58510
+ return /* @__PURE__ */ jsx(
58511
+ ProLockScreen,
58512
+ {
58513
+ componentName: "Advanced Rich Text Editor",
58514
+ className: cn("w-full", className)
58515
+ }
58516
+ );
58363
58517
  }
58364
58518
  const [aiSettings, setAiSettings] = useState(() => {
58365
58519
  if (persistAISettings && typeof window !== "undefined") {
@@ -63385,16 +63539,13 @@ function AdvancedChartInternal({
63385
63539
  function AdvancedChart(props) {
63386
63540
  const { hasProAccess } = useSubscription();
63387
63541
  if (!hasProAccess) {
63388
- return /* @__PURE__ */ jsx(MoonUICardPro, { className: "w-full", children: /* @__PURE__ */ jsxs(MoonUICardContentPro, { className: "flex flex-col items-center justify-center py-12", children: [
63389
- /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 mb-4", children: /* @__PURE__ */ jsx(Lock, { className: "w-8 h-8 text-primary" }) }),
63390
- /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-center mb-2", children: "Advanced Chart - Pro Feature" }),
63391
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-center text-sm mb-6 max-w-sm", children: "Professional chart component with advanced features like animations, themes, and interactive controls requires a Pro subscription." }),
63392
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs(MoonUIBadgePro, { variant: "secondary", className: "bg-gradient-to-r from-purple-500/10 to-pink-500/10 text-purple-700 dark:text-purple-300", children: [
63393
- /* @__PURE__ */ jsx(Sparkles, { className: "w-3 h-3 mr-1" }),
63394
- "Pro Feature"
63395
- ] }) }),
63396
- /* @__PURE__ */ jsx(MoonUIButtonPro, { className: "mt-4", size: "sm", children: "Upgrade to Pro" })
63397
- ] }) });
63542
+ return /* @__PURE__ */ jsx(
63543
+ ProLockScreen,
63544
+ {
63545
+ componentName: "Advanced Chart",
63546
+ className: "w-full"
63547
+ }
63548
+ );
63398
63549
  }
63399
63550
  return /* @__PURE__ */ jsx(AdvancedChartInternal, { ...props });
63400
63551
  }
@@ -66865,17 +67016,13 @@ var DashboardInternal = t__default.memo(function DashboardInternal2({
66865
67016
  var Dashboard = t__default.memo(function Dashboard2(props) {
66866
67017
  const { hasProAccess, isLoading } = useSubscription();
66867
67018
  if (!isLoading && !hasProAccess) {
66868
- return /* @__PURE__ */ jsx(MoonUICardPro, { className: cn("w-full", props.className), children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "py-12 text-center", children: /* @__PURE__ */ jsxs("div", { className: "max-w-md mx-auto space-y-4", children: [
66869
- /* @__PURE__ */ jsx("div", { className: "rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto", children: /* @__PURE__ */ jsx(Lock, { className: "h-6 w-6 text-purple-600 dark:text-purple-400" }) }),
66870
- /* @__PURE__ */ jsxs("div", { children: [
66871
- /* @__PURE__ */ jsx("h3", { className: "font-semibold text-lg mb-2", children: "Pro Feature" }),
66872
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm mb-4", children: "Dashboard is available exclusively to MoonUI Pro subscribers." }),
66873
- /* @__PURE__ */ jsx("a", { href: "/pricing", children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { size: "sm", children: [
66874
- /* @__PURE__ */ jsx(Sparkles, { className: "mr-2 h-4 w-4" }),
66875
- "Upgrade to Pro"
66876
- ] }) })
66877
- ] })
66878
- ] }) }) });
67019
+ return /* @__PURE__ */ jsx(
67020
+ ProLockScreen,
67021
+ {
67022
+ componentName: "Dashboard",
67023
+ className: cn("w-full", props.className)
67024
+ }
67025
+ );
66879
67026
  }
66880
67027
  return /* @__PURE__ */ jsx(DashboardInternal, { ...props });
66881
67028
  });
@@ -74005,17 +74152,13 @@ function DataTable({
74005
74152
  }, [originalColumns]);
74006
74153
  const { hasProAccess, isLoading } = useSubscription();
74007
74154
  if (!isLoading && !hasProAccess) {
74008
- return /* @__PURE__ */ jsx(MoonUICardPro, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "py-12 text-center", children: /* @__PURE__ */ jsxs("div", { className: "max-w-md mx-auto space-y-4", children: [
74009
- /* @__PURE__ */ jsx("div", { className: "rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto", children: /* @__PURE__ */ jsx(Lock, { className: "h-6 w-6 text-purple-600 dark:text-purple-400" }) }),
74010
- /* @__PURE__ */ jsxs("div", { children: [
74011
- /* @__PURE__ */ jsx("h3", { className: "font-semibold text-lg mb-2", children: "Pro Feature" }),
74012
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm mb-4", children: "Data Table is available exclusively to MoonUI Pro subscribers." }),
74013
- /* @__PURE__ */ jsx("div", { className: "flex gap-3 justify-center", children: /* @__PURE__ */ jsx("a", { href: "/pricing", children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { size: "sm", children: [
74014
- /* @__PURE__ */ jsx(Sparkles, { className: "mr-2 h-4 w-4" }),
74015
- "Upgrade to Pro"
74016
- ] }) }) })
74017
- ] })
74018
- ] }) }) });
74155
+ return /* @__PURE__ */ jsx(
74156
+ ProLockScreen,
74157
+ {
74158
+ componentName: "Data Table",
74159
+ className: cn("w-full", className)
74160
+ }
74161
+ );
74019
74162
  }
74020
74163
  const [sorting, setSorting] = t__default.useState([]);
74021
74164
  const [columnFilters, setColumnFilters] = t__default.useState([]);
@@ -75426,17 +75569,14 @@ function SidebarInternal({
75426
75569
  function Sidebar(props) {
75427
75570
  const { hasProAccess, isLoading } = useSubscription();
75428
75571
  if (!isLoading && !hasProAccess) {
75429
- return /* @__PURE__ */ jsx(MoonUICardPro, { className: cn("w-full max-w-xs", props.className), children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "py-12 text-center", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
75430
- /* @__PURE__ */ jsx("div", { className: "rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto", children: /* @__PURE__ */ jsx(Lock, { className: "h-6 w-6 text-purple-600 dark:text-purple-400" }) }),
75431
- /* @__PURE__ */ jsxs("div", { children: [
75432
- /* @__PURE__ */ jsx("h3", { className: "font-semibold text-lg mb-2", children: "Pro Feature" }),
75433
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm mb-4", children: "Advanced Sidebar is available exclusively to MoonUI Pro subscribers." }),
75434
- /* @__PURE__ */ jsx("a", { href: "/pricing", children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { size: "sm", children: [
75435
- /* @__PURE__ */ jsx(Sparkles, { className: "mr-2 h-4 w-4" }),
75436
- "Upgrade to Pro"
75437
- ] }) })
75438
- ] })
75439
- ] }) }) });
75572
+ return /* @__PURE__ */ jsx(
75573
+ ProLockScreen,
75574
+ {
75575
+ componentName: "Advanced Sidebar",
75576
+ compact: true,
75577
+ className: cn("w-full max-w-xs", props.className)
75578
+ }
75579
+ );
75440
75580
  }
75441
75581
  return /* @__PURE__ */ jsx(SidebarInternal, { ...props });
75442
75582
  }
@@ -76300,17 +76440,13 @@ function NavbarInternal({
76300
76440
  function Navbar(props) {
76301
76441
  const { hasProAccess, isLoading } = useSubscription();
76302
76442
  if (!isLoading && !hasProAccess) {
76303
- return /* @__PURE__ */ jsx(MoonUICardPro, { className: cn("w-full", props.className), children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "py-8 text-center", children: /* @__PURE__ */ jsxs("div", { className: "max-w-md mx-auto space-y-4", children: [
76304
- /* @__PURE__ */ jsx("div", { className: "rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto", children: /* @__PURE__ */ jsx(Lock, { className: "h-6 w-6 text-purple-600 dark:text-purple-400" }) }),
76305
- /* @__PURE__ */ jsxs("div", { children: [
76306
- /* @__PURE__ */ jsx("h3", { className: "font-semibold text-lg mb-2", children: "Pro Feature" }),
76307
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm mb-4", children: "Advanced Navbar is available exclusively to MoonUI Pro subscribers." }),
76308
- /* @__PURE__ */ jsx("a", { href: "/pricing", children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { size: "sm", children: [
76309
- /* @__PURE__ */ jsx(Sparkles, { className: "mr-2 h-4 w-4" }),
76310
- "Upgrade to Pro"
76311
- ] }) })
76312
- ] })
76313
- ] }) }) });
76443
+ return /* @__PURE__ */ jsx(
76444
+ ProLockScreen,
76445
+ {
76446
+ componentName: "Advanced Navbar",
76447
+ className: cn("w-full", props.className)
76448
+ }
76449
+ );
76314
76450
  }
76315
76451
  return /* @__PURE__ */ jsx(NavbarInternal, { ...props });
76316
76452
  }
@@ -85526,6 +85662,7 @@ var MoonUIAvatarPro2 = t.forwardRef(({
85526
85662
  error = false,
85527
85663
  ...props
85528
85664
  }, ref) => {
85665
+ useSubscription();
85529
85666
  const animationClasses = {
85530
85667
  pulse: "animate-pulse",
85531
85668
  bounce: "animate-bounce",
@@ -85623,6 +85760,7 @@ var MoonUIAvatarPro2 = t.forwardRef(({
85623
85760
  });
85624
85761
  MoonUIAvatarPro2.displayName = "MoonUIAvatarPro";
85625
85762
  var MoonUIAvatarGroupPro2 = t.forwardRef(({ children, max: max2 = 4, size: size4 = "md", spacing = "normal", className }, ref) => {
85763
+ const { hasProAccess, isLoading: isCheckingAuth } = useSubscription();
85626
85764
  const childrenArray = t.Children.toArray(children);
85627
85765
  const visibleChildren = childrenArray.slice(0, max2);
85628
85766
  const remainingCount = childrenArray.length - max2;
@@ -85631,6 +85769,15 @@ var MoonUIAvatarGroupPro2 = t.forwardRef(({ children, max: max2 = 4, size: size4
85631
85769
  normal: "-space-x-2",
85632
85770
  loose: "-space-x-1"
85633
85771
  };
85772
+ if (!isCheckingAuth && !hasProAccess) {
85773
+ return /* @__PURE__ */ jsx(
85774
+ ProLockScreen,
85775
+ {
85776
+ componentName: "Avatar Pro",
85777
+ compact: true
85778
+ }
85779
+ );
85780
+ }
85634
85781
  return /* @__PURE__ */ jsxs(
85635
85782
  "div",
85636
85783
  {
@@ -85667,6 +85814,7 @@ var MoonUIAvatarGroupPro2 = t.forwardRef(({ children, max: max2 = 4, size: size4
85667
85814
  });
85668
85815
  MoonUIAvatarGroupPro2.displayName = "MoonUIAvatarGroupPro";
85669
85816
  var MoonUIAsyncAvatarPro = t.forwardRef(({ userId, fetchUser, ...props }, ref) => {
85817
+ const { hasProAccess, isLoading: isCheckingAuth } = useSubscription();
85670
85818
  const [userData, setUserData] = t.useState(null);
85671
85819
  const [isLoading, setIsLoading] = t.useState(false);
85672
85820
  const [hasError, setHasError] = t.useState(false);
@@ -85677,6 +85825,15 @@ var MoonUIAsyncAvatarPro = t.forwardRef(({ userId, fetchUser, ...props }, ref) =
85677
85825
  fetchUser(userId).then(setUserData).catch(() => setHasError(true)).finally(() => setIsLoading(false));
85678
85826
  }
85679
85827
  }, [userId, fetchUser]);
85828
+ if (!isCheckingAuth && !hasProAccess) {
85829
+ return /* @__PURE__ */ jsx(
85830
+ ProLockScreen,
85831
+ {
85832
+ componentName: "Avatar Pro",
85833
+ compact: true
85834
+ }
85835
+ );
85836
+ }
85680
85837
  return /* @__PURE__ */ jsx(
85681
85838
  MoonUIAvatarPro2,
85682
85839
  {
@@ -85859,6 +86016,7 @@ function KPIWidget({
85859
86016
  onKPIClick,
85860
86017
  ...widgetProps
85861
86018
  }) {
86019
+ const { hasProAccess, isLoading } = useSubscription();
85862
86020
  const kpis = Array.isArray(data) ? data : [data];
85863
86021
  const formatValue = (value, unit) => {
85864
86022
  if (typeof value === "string")
@@ -86021,6 +86179,15 @@ function KPIWidget({
86021
86179
  index2
86022
86180
  );
86023
86181
  };
86182
+ if (!isLoading && !hasProAccess) {
86183
+ return /* @__PURE__ */ jsx(
86184
+ ProLockScreen,
86185
+ {
86186
+ componentName: "KPI Widget",
86187
+ compact: true
86188
+ }
86189
+ );
86190
+ }
86024
86191
  return /* @__PURE__ */ jsx(
86025
86192
  WidgetBase,
86026
86193
  {
@@ -86052,6 +86219,7 @@ function ChartWidget2({
86052
86219
  onDataPointClick,
86053
86220
  ...widgetProps
86054
86221
  }) {
86222
+ const { hasProAccess, isLoading } = useSubscription();
86055
86223
  const [hoveredIndex, setHoveredIndex] = t__default.useState(null);
86056
86224
  const defaultColors2 = [
86057
86225
  "#3b82f6",
@@ -86417,6 +86585,15 @@ function ChartWidget2({
86417
86585
  return renderBarChart();
86418
86586
  }
86419
86587
  };
86588
+ if (!isLoading && !hasProAccess) {
86589
+ return /* @__PURE__ */ jsx(
86590
+ ProLockScreen,
86591
+ {
86592
+ componentName: "Chart Widget",
86593
+ compact: true
86594
+ }
86595
+ );
86596
+ }
86420
86597
  return /* @__PURE__ */ jsx(
86421
86598
  WidgetBase,
86422
86599
  {
@@ -86469,6 +86646,7 @@ function GaugeWidget({
86469
86646
  onGaugeClick,
86470
86647
  ...widgetProps
86471
86648
  }) {
86649
+ const { hasProAccess, isLoading } = useSubscription();
86472
86650
  const gauges = Array.isArray(data) ? data : [data];
86473
86651
  const sizeConfig = {
86474
86652
  sm: { width: 120, height: 120, fontSize: "text-lg", strokeWidth: 8 },
@@ -86725,6 +86903,15 @@ function GaugeWidget({
86725
86903
  return renderRadialGauge(gauge, index2);
86726
86904
  }
86727
86905
  };
86906
+ if (!isLoading && !hasProAccess) {
86907
+ return /* @__PURE__ */ jsx(
86908
+ ProLockScreen,
86909
+ {
86910
+ componentName: "Gauge Widget",
86911
+ compact: true
86912
+ }
86913
+ );
86914
+ }
86728
86915
  return /* @__PURE__ */ jsx(
86729
86916
  WidgetBase,
86730
86917
  {
@@ -86757,6 +86944,7 @@ function FunnelWidget({
86757
86944
  onStageClick,
86758
86945
  ...widgetProps
86759
86946
  }) {
86947
+ const { hasProAccess, isLoading } = useSubscription();
86760
86948
  const [hoveredStage, setHoveredStage] = t__default.useState(null);
86761
86949
  const formatNumber2 = (value) => {
86762
86950
  if (value % 1 !== 0) {
@@ -87055,6 +87243,15 @@ function FunnelWidget({
87055
87243
  return renderVerticalFunnel();
87056
87244
  }
87057
87245
  };
87246
+ if (!isLoading && !hasProAccess) {
87247
+ return /* @__PURE__ */ jsx(
87248
+ ProLockScreen,
87249
+ {
87250
+ componentName: "Funnel Widget",
87251
+ compact: true
87252
+ }
87253
+ );
87254
+ }
87058
87255
  return /* @__PURE__ */ jsx(
87059
87256
  WidgetBase,
87060
87257
  {
@@ -87105,6 +87302,7 @@ function RevenueWidget({
87105
87302
  onMetricClick,
87106
87303
  ...widgetProps
87107
87304
  }) {
87305
+ const { hasProAccess, isLoading } = useSubscription();
87108
87306
  const [selectedTab, setSelectedTab] = t__default.useState("overview");
87109
87307
  const formatNumber2 = (value) => {
87110
87308
  if (value % 1 !== 0) {
@@ -87514,6 +87712,15 @@ function RevenueWidget({
87514
87712
  ] });
87515
87713
  }
87516
87714
  };
87715
+ if (!isLoading && !hasProAccess) {
87716
+ return /* @__PURE__ */ jsx(
87717
+ ProLockScreen,
87718
+ {
87719
+ componentName: "Revenue Widget",
87720
+ compact: true
87721
+ }
87722
+ );
87723
+ }
87517
87724
  return /* @__PURE__ */ jsx(
87518
87725
  WidgetBase,
87519
87726
  {
@@ -87540,6 +87747,7 @@ function ServerMonitorWidget({
87540
87747
  onAlertClick,
87541
87748
  ...widgetProps
87542
87749
  }) {
87750
+ const { hasProAccess, isLoading } = useSubscription();
87543
87751
  const servers = Array.isArray(data) ? data : [data];
87544
87752
  const [selectedTab, setSelectedTab] = t__default.useState("overview");
87545
87753
  const [liveData, setLiveData] = t__default.useState(servers);
@@ -87893,6 +88101,15 @@ function ServerMonitorWidget({
87893
88101
  return /* @__PURE__ */ jsx("div", { className: "space-y-4", children: liveData.map((server) => /* @__PURE__ */ jsx("div", { children: renderServerCard(server) }, server.id)) });
87894
88102
  }
87895
88103
  };
88104
+ if (!isLoading && !hasProAccess) {
88105
+ return /* @__PURE__ */ jsx(
88106
+ ProLockScreen,
88107
+ {
88108
+ componentName: "Server Monitor Widget",
88109
+ compact: true
88110
+ }
88111
+ );
88112
+ }
87896
88113
  return /* @__PURE__ */ jsx(
87897
88114
  WidgetBase,
87898
88115
  {