trade-safety 1.11.0 → 1.13.0
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/components/DetailedResult/AISummarySection.d.ts +2 -2
- package/dist/components/DetailedResult/AISummarySection.d.ts.map +1 -1
- package/dist/components/HomeHeroSection.d.ts +5 -1
- package/dist/components/HomeHeroSection.d.ts.map +1 -1
- package/dist/components/PageHeader.d.ts.map +1 -1
- package/dist/components/UrlPreviewCard.d.ts +7 -0
- package/dist/components/UrlPreviewCard.d.ts.map +1 -0
- package/dist/components/UrlPreviewCardSkeleton.d.ts +2 -0
- package/dist/components/UrlPreviewCardSkeleton.d.ts.map +1 -0
- package/dist/i18n/translations.d.ts +36 -0
- package/dist/i18n/translations.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1166 -379
- package/dist/index.mjs.map +1 -1
- package/dist/isChromatic-5i32AXac-BWePUv7P.js +2 -0
- package/dist/isChromatic-5i32AXac-BWePUv7P.js.map +1 -0
- package/dist/isChromatic-5i32AXac-CtZ5BKgh.mjs +8 -0
- package/dist/isChromatic-5i32AXac-CtZ5BKgh.mjs.map +1 -0
- package/dist/locale.js +25 -25
- package/dist/locale.mjs +49 -49
- package/dist/lottie-react.esm-BUHy0Xb6.mjs +6105 -0
- package/dist/lottie-react.esm-BUHy0Xb6.mjs.map +1 -0
- package/dist/lottie-react.esm-Bv7L41xK.js +257 -0
- package/dist/lottie-react.esm-Bv7L41xK.js.map +1 -0
- package/dist/repositories/TradeSafetyRepository.d.ts +13 -13
- package/dist/types.d.ts +10 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
interface AISummarySectionProps {
|
|
2
|
-
summary: string;
|
|
2
|
+
summary: string[];
|
|
3
3
|
}
|
|
4
|
-
export declare function AISummarySection({ summary }: AISummarySectionProps): import("react").JSX.Element;
|
|
4
|
+
export declare function AISummarySection({ summary }: AISummarySectionProps): import("react").JSX.Element | null;
|
|
5
5
|
export {};
|
|
6
6
|
//# sourceMappingURL=AISummarySection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AISummarySection.d.ts","sourceRoot":"","sources":["../../../src/components/DetailedResult/AISummarySection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AISummarySection.d.ts","sourceRoot":"","sources":["../../../src/components/DetailedResult/AISummarySection.tsx"],"names":[],"mappings":"AAUA,UAAU,qBAAqB;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE,qBAAqB,sCAyBlE"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { LinkPreviewData } from '../types';
|
|
1
2
|
export interface HomeHeroSectionProps {
|
|
2
3
|
value: string;
|
|
3
4
|
onChange: (value: string) => void;
|
|
4
5
|
onSubmit: () => void;
|
|
5
6
|
isLoading: boolean;
|
|
6
7
|
error: string | null;
|
|
8
|
+
previewData: LinkPreviewData | null;
|
|
9
|
+
isLoadingPreview: boolean;
|
|
10
|
+
previewError: string | null;
|
|
7
11
|
}
|
|
8
|
-
export declare
|
|
12
|
+
export declare const HomeHeroSection: import('react').MemoExoticComponent<({ value, onChange, onSubmit, isLoading, error, previewData, isLoadingPreview, previewError, }: HomeHeroSectionProps) => import("react").JSX.Element>;
|
|
9
13
|
//# sourceMappingURL=HomeHeroSection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomeHeroSection.d.ts","sourceRoot":"","sources":["../../src/components/HomeHeroSection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HomeHeroSection.d.ts","sourceRoot":"","sources":["../../src/components/HomeHeroSection.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,eAAe,GAAG,IAAI,CAAC;IACpC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,eAAe,sIAUvB,oBAAoB,iCA+JxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/components/PageHeader.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/components/PageHeader.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAQD,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,eAAe,+BAsC3D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LinkPreviewData } from '../types';
|
|
2
|
+
interface UrlPreviewCardProps {
|
|
3
|
+
data: LinkPreviewData;
|
|
4
|
+
}
|
|
5
|
+
export declare function UrlPreviewCard({ data }: UrlPreviewCardProps): import("react").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=UrlPreviewCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UrlPreviewCard.d.ts","sourceRoot":"","sources":["../../src/components/UrlPreviewCard.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,UAAU,mBAAmB;IAC3B,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,EAAE,mBAAmB,+BAqC3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UrlPreviewCardSkeleton.d.ts","sourceRoot":"","sources":["../../src/components/UrlPreviewCardSkeleton.tsx"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,gCAiBrC"}
|
|
@@ -32,6 +32,7 @@ export declare const tradeSafetyTranslations: {
|
|
|
32
32
|
analyzingDescription: string;
|
|
33
33
|
tryExample: string;
|
|
34
34
|
disclaimer: string;
|
|
35
|
+
previewError: string;
|
|
35
36
|
};
|
|
36
37
|
features: {
|
|
37
38
|
title: string;
|
|
@@ -116,14 +117,17 @@ export declare const tradeSafetyTranslations: {
|
|
|
116
117
|
};
|
|
117
118
|
safetyLevel: {
|
|
118
119
|
safe: {
|
|
120
|
+
badge: string;
|
|
119
121
|
title: string;
|
|
120
122
|
description: string;
|
|
121
123
|
};
|
|
122
124
|
caution: {
|
|
125
|
+
badge: string;
|
|
123
126
|
title: string;
|
|
124
127
|
description: string;
|
|
125
128
|
};
|
|
126
129
|
danger: {
|
|
130
|
+
badge: string;
|
|
127
131
|
title: string;
|
|
128
132
|
description: string;
|
|
129
133
|
};
|
|
@@ -160,6 +164,7 @@ export declare const tradeSafetyTranslations: {
|
|
|
160
164
|
analyzingDescription: string;
|
|
161
165
|
tryExample: string;
|
|
162
166
|
disclaimer: string;
|
|
167
|
+
previewError: string;
|
|
163
168
|
};
|
|
164
169
|
features: {
|
|
165
170
|
title: string;
|
|
@@ -244,14 +249,17 @@ export declare const tradeSafetyTranslations: {
|
|
|
244
249
|
};
|
|
245
250
|
safetyLevel: {
|
|
246
251
|
safe: {
|
|
252
|
+
badge: string;
|
|
247
253
|
title: string;
|
|
248
254
|
description: string;
|
|
249
255
|
};
|
|
250
256
|
caution: {
|
|
257
|
+
badge: string;
|
|
251
258
|
title: string;
|
|
252
259
|
description: string;
|
|
253
260
|
};
|
|
254
261
|
danger: {
|
|
262
|
+
badge: string;
|
|
255
263
|
title: string;
|
|
256
264
|
description: string;
|
|
257
265
|
};
|
|
@@ -288,6 +296,7 @@ export declare const tradeSafetyTranslations: {
|
|
|
288
296
|
analyzingDescription: string;
|
|
289
297
|
tryExample: string;
|
|
290
298
|
disclaimer: string;
|
|
299
|
+
previewError: string;
|
|
291
300
|
};
|
|
292
301
|
features: {
|
|
293
302
|
title: string;
|
|
@@ -372,14 +381,17 @@ export declare const tradeSafetyTranslations: {
|
|
|
372
381
|
};
|
|
373
382
|
safetyLevel: {
|
|
374
383
|
safe: {
|
|
384
|
+
badge: string;
|
|
375
385
|
title: string;
|
|
376
386
|
description: string;
|
|
377
387
|
};
|
|
378
388
|
caution: {
|
|
389
|
+
badge: string;
|
|
379
390
|
title: string;
|
|
380
391
|
description: string;
|
|
381
392
|
};
|
|
382
393
|
danger: {
|
|
394
|
+
badge: string;
|
|
383
395
|
title: string;
|
|
384
396
|
description: string;
|
|
385
397
|
};
|
|
@@ -416,6 +428,7 @@ export declare const tradeSafetyTranslations: {
|
|
|
416
428
|
analyzingDescription: string;
|
|
417
429
|
tryExample: string;
|
|
418
430
|
disclaimer: string;
|
|
431
|
+
previewError: string;
|
|
419
432
|
};
|
|
420
433
|
features: {
|
|
421
434
|
title: string;
|
|
@@ -500,14 +513,17 @@ export declare const tradeSafetyTranslations: {
|
|
|
500
513
|
};
|
|
501
514
|
safetyLevel: {
|
|
502
515
|
safe: {
|
|
516
|
+
badge: string;
|
|
503
517
|
title: string;
|
|
504
518
|
description: string;
|
|
505
519
|
};
|
|
506
520
|
caution: {
|
|
521
|
+
badge: string;
|
|
507
522
|
title: string;
|
|
508
523
|
description: string;
|
|
509
524
|
};
|
|
510
525
|
danger: {
|
|
526
|
+
badge: string;
|
|
511
527
|
title: string;
|
|
512
528
|
description: string;
|
|
513
529
|
};
|
|
@@ -544,6 +560,7 @@ export declare const tradeSafetyTranslations: {
|
|
|
544
560
|
analyzingDescription: string;
|
|
545
561
|
tryExample: string;
|
|
546
562
|
disclaimer: string;
|
|
563
|
+
previewError: string;
|
|
547
564
|
};
|
|
548
565
|
features: {
|
|
549
566
|
title: string;
|
|
@@ -628,14 +645,17 @@ export declare const tradeSafetyTranslations: {
|
|
|
628
645
|
};
|
|
629
646
|
safetyLevel: {
|
|
630
647
|
safe: {
|
|
648
|
+
badge: string;
|
|
631
649
|
title: string;
|
|
632
650
|
description: string;
|
|
633
651
|
};
|
|
634
652
|
caution: {
|
|
653
|
+
badge: string;
|
|
635
654
|
title: string;
|
|
636
655
|
description: string;
|
|
637
656
|
};
|
|
638
657
|
danger: {
|
|
658
|
+
badge: string;
|
|
639
659
|
title: string;
|
|
640
660
|
description: string;
|
|
641
661
|
};
|
|
@@ -672,6 +692,7 @@ export declare const tradeSafetyTranslations: {
|
|
|
672
692
|
analyzingDescription: string;
|
|
673
693
|
tryExample: string;
|
|
674
694
|
disclaimer: string;
|
|
695
|
+
previewError: string;
|
|
675
696
|
};
|
|
676
697
|
features: {
|
|
677
698
|
title: string;
|
|
@@ -756,14 +777,17 @@ export declare const tradeSafetyTranslations: {
|
|
|
756
777
|
};
|
|
757
778
|
safetyLevel: {
|
|
758
779
|
safe: {
|
|
780
|
+
badge: string;
|
|
759
781
|
title: string;
|
|
760
782
|
description: string;
|
|
761
783
|
};
|
|
762
784
|
caution: {
|
|
785
|
+
badge: string;
|
|
763
786
|
title: string;
|
|
764
787
|
description: string;
|
|
765
788
|
};
|
|
766
789
|
danger: {
|
|
790
|
+
badge: string;
|
|
767
791
|
title: string;
|
|
768
792
|
description: string;
|
|
769
793
|
};
|
|
@@ -800,6 +824,7 @@ export declare const tradeSafetyTranslations: {
|
|
|
800
824
|
analyzingDescription: string;
|
|
801
825
|
tryExample: string;
|
|
802
826
|
disclaimer: string;
|
|
827
|
+
previewError: string;
|
|
803
828
|
};
|
|
804
829
|
features: {
|
|
805
830
|
title: string;
|
|
@@ -884,14 +909,17 @@ export declare const tradeSafetyTranslations: {
|
|
|
884
909
|
};
|
|
885
910
|
safetyLevel: {
|
|
886
911
|
safe: {
|
|
912
|
+
badge: string;
|
|
887
913
|
title: string;
|
|
888
914
|
description: string;
|
|
889
915
|
};
|
|
890
916
|
caution: {
|
|
917
|
+
badge: string;
|
|
891
918
|
title: string;
|
|
892
919
|
description: string;
|
|
893
920
|
};
|
|
894
921
|
danger: {
|
|
922
|
+
badge: string;
|
|
895
923
|
title: string;
|
|
896
924
|
description: string;
|
|
897
925
|
};
|
|
@@ -928,6 +956,7 @@ export declare const tradeSafetyTranslations: {
|
|
|
928
956
|
analyzingDescription: string;
|
|
929
957
|
tryExample: string;
|
|
930
958
|
disclaimer: string;
|
|
959
|
+
previewError: string;
|
|
931
960
|
};
|
|
932
961
|
features: {
|
|
933
962
|
title: string;
|
|
@@ -1012,14 +1041,17 @@ export declare const tradeSafetyTranslations: {
|
|
|
1012
1041
|
};
|
|
1013
1042
|
safetyLevel: {
|
|
1014
1043
|
safe: {
|
|
1044
|
+
badge: string;
|
|
1015
1045
|
title: string;
|
|
1016
1046
|
description: string;
|
|
1017
1047
|
};
|
|
1018
1048
|
caution: {
|
|
1049
|
+
badge: string;
|
|
1019
1050
|
title: string;
|
|
1020
1051
|
description: string;
|
|
1021
1052
|
};
|
|
1022
1053
|
danger: {
|
|
1054
|
+
badge: string;
|
|
1023
1055
|
title: string;
|
|
1024
1056
|
description: string;
|
|
1025
1057
|
};
|
|
@@ -1056,6 +1088,7 @@ export declare const tradeSafetyTranslations: {
|
|
|
1056
1088
|
analyzingDescription: string;
|
|
1057
1089
|
tryExample: string;
|
|
1058
1090
|
disclaimer: string;
|
|
1091
|
+
previewError: string;
|
|
1059
1092
|
};
|
|
1060
1093
|
features: {
|
|
1061
1094
|
title: string;
|
|
@@ -1140,14 +1173,17 @@ export declare const tradeSafetyTranslations: {
|
|
|
1140
1173
|
};
|
|
1141
1174
|
safetyLevel: {
|
|
1142
1175
|
safe: {
|
|
1176
|
+
badge: string;
|
|
1143
1177
|
title: string;
|
|
1144
1178
|
description: string;
|
|
1145
1179
|
};
|
|
1146
1180
|
caution: {
|
|
1181
|
+
badge: string;
|
|
1147
1182
|
title: string;
|
|
1148
1183
|
description: string;
|
|
1149
1184
|
};
|
|
1150
1185
|
danger: {
|
|
1186
|
+
badge: string;
|
|
1151
1187
|
title: string;
|
|
1152
1188
|
description: string;
|
|
1153
1189
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../src/i18n/translations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,6BAA6B;AAC7B,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../src/i18n/translations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,6BAA6B;AAC7B,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUnC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),d=require("react-i18next");require("i18next");require("i18next-resources-to-backend");const o=require("./locale.js"),u=require("react"),E=require("@aioia/core"),a=require("zod");function k(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const p=k(u);function z(e){var t,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=z(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function y(){for(var e,t,r=0,s="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=z(e))&&(s&&(s+=" "),s+=t);return s}const A={danger:"bg-error/10 text-error",caution:"bg-error/10 text-error",safe:"bg-neutral/10 text-neutral"},P={danger:"result.danger.badge",caution:"result.caution.badge",safe:"result.safe.badge"},R={sm:"text-xl font-bold",lg:"text-2xl font-bold"};function x({badgeVariant:e,subtitle:t,icon:r,title:s,titleSize:i="lg",children:l}){const{t:h}=d.useTranslation(o.TRADE_SAFETY_NS);return n.jsxs("section",{className:"rounded-2xl bg-neutral-content p-6 shadow-sm",children:[n.jsxs("header",{className:"mb-4 flex flex-col items-start",children:[e&&n.jsx("div",{className:y("mb-2 rounded-full px-4 py-1 text-sm font-bold",A[e]),children:h(P[e])}),t&&n.jsx("p",{className:"mb-1 break-keep text-lg font-medium text-neutral",children:t}),n.jsxs("div",{className:"flex items-center gap-2 text-neutral",children:[r&&n.jsx("span",{className:"text-base",children:r}),n.jsx("h2",{className:y("whitespace-pre-line break-keep sm:whitespace-normal",R[i]),children:s})]})]}),n.jsx("div",{children:l})]})}function D({summary:e}){const{t}=d.useTranslation(o.TRADE_SAFETY_NS);return n.jsx(x,{title:t("result.aiSummary"),children:n.jsx("p",{className:"rounded-lg bg-base-200 p-6 text-sm leading-relaxed text-base-content",children:e})})}function m({title:e,content:t}){return n.jsxs("div",{className:"text-neutral",children:[n.jsx("h3",{className:"mb-1 break-keep text-lg font-semibold",children:e}),n.jsx("p",{className:"break-keep",children:t})]})}function C({data:e}){const{t,i18n:r}=d.useTranslation(o.TRADE_SAFETY_NS);return e?n.jsx(x,{subtitle:t("result.priceAnalysis.subtitle"),title:t("result.priceAnalysis.title"),children:n.jsxs("div",{className:"space-y-4",children:[e.market_price_range&&n.jsx(m,{title:t("result.marketPrice"),content:e.market_price_range}),e.offered_price&&n.jsx(m,{title:t("result.offeredPrice"),content:new Intl.NumberFormat(r.language,{style:"currency",currency:e.currency||"USD"}).format(e.offered_price)}),e.price_assessment&&n.jsx(m,{title:t("result.priceAssessment"),content:e.price_assessment})]})}):null}function F({title:e,titleId:t,...r},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?p.createElement("title",{id:t},e):null,p.createElement("path",{fillRule:"evenodd",d:"M2.625 6.75a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875 0A.75.75 0 0 1 8.25 6h12a.75.75 0 0 1 0 1.5h-12a.75.75 0 0 1-.75-.75ZM2.625 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0ZM7.5 12a.75.75 0 0 1 .75-.75h12a.75.75 0 0 1 0 1.5h-12A.75.75 0 0 1 7.5 12Zm-4.875 5.25a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875 0a.75.75 0 0 1 .75-.75h12a.75.75 0 0 1 0 1.5h-12a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"}))}const L=p.forwardRef(F);function H({items:e}){const{t}=d.useTranslation(o.TRADE_SAFETY_NS);return e.length===0?null:n.jsx(x,{icon:n.jsx(L,{className:"size-6"}),title:t("result.safetyChecklist"),titleSize:"sm",children:n.jsx("div",{className:"space-y-4",children:e.map((r,s)=>n.jsxs("label",{className:"label cursor-pointer gap-4 rounded-2xl bg-base-200 p-4",children:[n.jsx("span",{className:"label-text break-keep text-neutral",children:r}),n.jsx("input",{type:"checkbox",className:"checkbox checkbox-sm [--chkbg:theme(colors.neutral)] [--chkfg:theme(colors.neutral-content)]"})]},s))})})}const Y={danger:"result.danger.title",caution:"result.caution.title",safe:"result.safe.title"};function j({signals:e,variant:t}){const{t:r}=d.useTranslation(o.TRADE_SAFETY_NS);return e.length===0?null:n.jsx(x,{badgeVariant:t,title:r(Y[t]),children:n.jsx("div",{className:"divide-y divide-base-300",children:e.map((s,i)=>n.jsxs("div",{className:"space-y-4 py-4 first:pt-0 last:pb-0",children:[n.jsx(m,{title:s.title,content:s.description}),n.jsx(m,{title:r("result.whatToDo"),content:s.what_to_do})]},i))})})}function M({translation:e,nuance:t}){const{t:r}=d.useTranslation(o.TRADE_SAFETY_NS);return n.jsx(x,{subtitle:r("result.translation.subtitle"),title:r("result.translation.title"),children:n.jsxs("div",{className:"space-y-4",children:[e&&n.jsx(m,{title:r("result.translation.label"),content:e}),t&&n.jsx(m,{title:r("result.nuance.label"),content:t})]})})}function q({analysis:e}){return n.jsxs("div",{className:"space-y-6",children:[e.ai_summary&&n.jsx(D,{summary:e.ai_summary}),e.risk_signals.length>0&&n.jsx(j,{signals:e.risk_signals,variant:"danger"}),e.cautions.length>0&&n.jsx(j,{signals:e.cautions,variant:"caution"}),e.safe_indicators.length>0&&n.jsx(j,{signals:e.safe_indicators,variant:"safe"}),e.safety_checklist.length>0&&n.jsx(H,{items:e.safety_checklist}),(e.translation||e.nuance_explanation)&&n.jsx(M,{translation:e.translation,nuance:e.nuance_explanation}),e.price_analysis&&n.jsx(C,{data:e.price_analysis})]})}var w={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},S=u.createContext&&u.createContext(w),B=["attr","size","title"];function I(e,t){if(e==null)return{};var r=Z(e,t),s,i;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)s=l[i],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function Z(e,t){if(e==null)return{};var r={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;r[s]=e[s]}return r}function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},b.apply(this,arguments)}function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,s)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?N(Object(r),!0).forEach(function(s){W(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function W(e,t,r){return t=$(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $(e){var t=K(e,"string");return typeof t=="symbol"?t:t+""}function K(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var s=r.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function T(e){return e&&e.map((t,r)=>u.createElement(t.tag,g({key:r},t.attr),T(t.child)))}function O(e){return t=>u.createElement(U,b({attr:g({},e.attr)},t),T(e.child))}function U(e){var t=r=>{var{attr:s,size:i,title:l}=e,h=I(e,B),f=i||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),u.createElement("svg",b({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,s,h,{className:c,style:g(g({color:e.color||r.color},r.style),e.style),height:f,width:f,xmlns:"http://www.w3.org/2000/svg"}),l&&u.createElement("title",null,l),e.children)};return S!==void 0?u.createElement(S.Consumer,null,r=>t(r)):t(w)}function X(e){return O({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M0 256C0 114.6 114.6 0 256 0S512 114.6 512 256s-114.6 256-256 256L37.1 512c-13.7 0-20.5-16.5-10.9-26.2L75 437C28.7 390.7 0 326.7 0 256zM349.6 153.6c23.6 0 42.7-19.1 42.7-42.7s-19.1-42.7-42.7-42.7c-20.6 0-37.8 14.6-41.8 34c-34.5 3.7-61.4 33-61.4 68.4l0 .2c-37.5 1.6-71.8 12.3-99 29.1c-10.1-7.8-22.8-12.5-36.5-12.5c-33 0-59.8 26.8-59.8 59.8c0 24 14.1 44.6 34.4 54.1c2 69.4 77.6 125.2 170.6 125.2s168.7-55.9 170.6-125.3c20.2-9.6 34.1-30.2 34.1-54c0-33-26.8-59.8-59.8-59.8c-13.7 0-26.3 4.6-36.4 12.4c-27.4-17-62.1-27.7-100-29.1l0-.2c0-25.4 18.9-46.5 43.4-49.9l0 0c4.4 18.8 21.3 32.8 41.5 32.8zM177.1 246.9c16.7 0 29.5 17.6 28.5 39.3s-13.5 29.6-30.3 29.6s-31.4-8.8-30.4-30.5s15.4-38.3 32.1-38.3zm190.1 38.3c1 21.7-13.7 30.5-30.4 30.5s-29.3-7.9-30.3-29.6c-1-21.7 11.8-39.3 28.5-39.3s31.2 16.6 32.1 38.3zm-48.1 56.7c-10.3 24.6-34.6 41.9-63 41.9s-52.7-17.3-63-41.9c-1.2-2.9 .8-6.2 3.9-6.5c18.4-1.9 38.3-2.9 59.1-2.9s40.7 1 59.1 2.9c3.1 .3 5.1 3.6 3.9 6.5z"},child:[]}]})(e)}function G(e){return O({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"},child:[]}]})(e)}function J({value:e,onChange:t,onSubmit:r,isLoading:s,error:i}){const{t:l}=d.useTranslation(o.TRADE_SAFETY_NS),h=s?n.jsx("span",{className:"loading loading-spinner loading-sm"}):l("hero.checkSafety"),f=s||!e.trim();return n.jsx("div",{className:"flex w-full flex-col items-center justify-center",children:n.jsxs("div",{className:"w-full lg:max-w-[720px]",children:[n.jsx("h1",{className:"mb-2 text-left text-3xl font-bold text-base-content sm:mb-8 sm:text-center sm:text-4xl md:mb-8",children:l("hero.title")}),n.jsx("p",{className:"mb-4 text-left text-sm text-base-content/70 sm:mb-8 sm:text-center sm:text-base md:mb-16",children:l("hero.subtitle")}),n.jsxs("div",{className:y("mb-4",!i&&"sm:mb-8 md:mb-12"),children:[n.jsxs("div",{className:"relative hidden lg:block",children:[n.jsx("input",{type:"text",className:"input input-bordered h-[72px] w-full pr-36 text-sm placeholder:text-base-300 focus:outline-none",placeholder:l("hero.placeholder"),"aria-label":l("hero.placeholder"),value:e,onChange:c=>t(c.target.value),disabled:s,onKeyDown:c=>{c.key==="Enter"&&!f&&r()}}),n.jsx("button",{className:"btn btn-neutral absolute right-2 top-1/2 h-[56px] min-h-0 -translate-y-1/2 !animate-none px-6 font-bold text-neutral-content",onClick:r,disabled:f,children:h})]}),n.jsx("div",{className:"block lg:hidden",children:n.jsxs("div",{className:"relative h-[400px] w-full overflow-hidden rounded-xl border border-base-300 bg-base-100",children:[!e&&n.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden p-5 pb-24 text-base text-base-300","aria-hidden":"true",children:n.jsxs("div",{className:"whitespace-pre-line leading-relaxed",children:[n.jsx("p",{className:"mb-4 text-base-300",children:l("hero.placeholder")}),l("hero.placeholderExample")]})}),n.jsx("div",{className:"absolute inset-0 overflow-hidden pb-24",children:n.jsx("textarea",{className:"textarea size-full resize-none overflow-auto bg-transparent p-4 leading-6 text-base-content focus:outline-none",value:e,"aria-label":l("hero.placeholder"),onChange:c=>t(c.target.value),disabled:s,placeholder:""})}),n.jsx("div",{className:"absolute inset-x-4 bottom-4 z-10",children:n.jsx("button",{className:"btn btn-neutral h-16 w-full text-base font-medium text-neutral-content",onClick:r,disabled:f,children:h})})]})})]}),i&&n.jsx("div",{className:"alert alert-error mb-6 flex items-center gap-2 text-sm",children:n.jsx("span",{children:i})}),n.jsx("p",{className:"mb-4 text-left text-xs text-base-content/60 sm:mb-8 sm:text-center md:mb-12",children:l("hero.disclaimer")}),n.jsxs("div",{className:"flex items-center justify-start gap-6 sm:justify-center",children:[n.jsx("a",{href:"https://x.com",target:"_blank",rel:"noopener noreferrer","aria-label":"X",children:n.jsx(G,{className:"size-6 text-base-content transition-colors hover:text-base-content/70"})}),n.jsx("a",{href:"https://reddit.com",target:"_blank",rel:"noopener noreferrer","aria-label":"Reddit",children:n.jsx(X,{className:"size-6 text-base-content transition-colors hover:text-base-content/70"})})]})]})})}function Q({level:e,score:t}){const{t:r}=d.useTranslation(o.TRADE_SAFETY_NS);return n.jsxs("div",{className:"mb-4 rounded-lg",children:[n.jsx("h1",{className:"mb-2 text-3xl font-bold",children:r(`result.safetyLevel.${e}.title`)}),n.jsx("p",{className:"mt-2 text-sm text-neutral",children:r(`result.safetyLevel.${e}.description`,{score:t})})]})}const _={safe:70,caution:40},V=e=>e>=_.safe?"safe":e>=_.caution?"caution":"danger",v=a.z.object({category:a.z.enum(["payment","seller","platform","price","content"]),severity:a.z.enum(["high","medium","low"]),title:a.z.string(),description:a.z.string(),what_to_do:a.z.string()}),ee=a.z.object({market_price_range:a.z.string().nullish(),offered_price:a.z.number().nullish(),currency:a.z.string().nullish(),price_assessment:a.z.string(),warnings:a.z.array(a.z.string())}),te=a.z.object({ai_summary:a.z.string(),translation:a.z.string().nullish(),nuance_explanation:a.z.string().nullish(),risk_signals:a.z.array(v),cautions:a.z.array(v),safe_indicators:a.z.array(v),price_analysis:ee,safety_checklist:a.z.array(a.z.string()),safe_score:a.z.number(),recommendation:a.z.string(),emotional_support:a.z.string()}),re=a.z.object({id:a.z.string(),user_id:a.z.string().nullish(),input_text:a.z.string(),llm_analysis:te,safe_score:a.z.number(),expert_advice:a.z.string().nullish(),expert_reviewed:a.z.boolean(),expert_reviewed_at:a.z.string().nullish(),expert_reviewed_by:a.z.string().nullish(),created_at:a.z.string(),updated_at:a.z.string()}),ne=a.z.enum(["twitter"]),se=a.z.object({platform:ne,author:a.z.string(),created_at:a.z.string().nullish(),text:a.z.string(),text_preview:a.z.string(),images:a.z.array(a.z.string())}),ae=a.z.object({data:se});class ie extends E.BaseCrudRepository{constructor(){super(...arguments),this.resource="trade-safety"}getDataSchema(){return re}async fetchPreview(t,r){const s=`${this.apiService.buildUrl(this.resource)}/preview`,i=await this.apiService.request(s,{...r,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t})});return this.validateResponse(i,ae).data}}exports.TRADE_SAFETY_NS=o.TRADE_SAFETY_NS;exports.tradeSafetyTranslations=o.tradeSafetyTranslations;exports.DetailedResult=q;exports.HomeHeroSection=J;exports.PageHeader=Q;exports.SAFETY_SCORE_THRESHOLDS=_;exports.TradeSafetyRepository=ie;exports.getSafetyLevel=V;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),T=require("react-i18next");require("i18next");require("i18next-resources-to-backend");const z=require("./locale.js"),j=require("react"),Pt=require("next/image"),Ct=require("@aioia/core"),c=require("zod");function At(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(n,s,o.get?o:{enumerable:!0,get:()=>t[s]})}}return n.default=t,Object.freeze(n)}const D=At(j);function Dt({title:t,titleId:n,...s},o){return D.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},s),t?D.createElement("title",{id:n},t):null,D.createElement("path",{fillRule:"evenodd",d:"M2.625 6.75a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875 0A.75.75 0 0 1 8.25 6h12a.75.75 0 0 1 0 1.5h-12a.75.75 0 0 1-.75-.75ZM2.625 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0ZM7.5 12a.75.75 0 0 1 .75-.75h12a.75.75 0 0 1 0 1.5h-12A.75.75 0 0 1 7.5 12Zm-4.875 5.25a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875 0a.75.75 0 0 1 .75-.75h12a.75.75 0 0 1 0 1.5h-12a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"}))}const Ft=D.forwardRef(Dt);function $t({title:t,titleId:n,...s},o){return D.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},s),t?D.createElement("title",{id:n},t):null,D.createElement("path",{fillRule:"evenodd",d:"M9 4.5a.75.75 0 0 1 .721.544l.813 2.846a3.75 3.75 0 0 0 2.576 2.576l2.846.813a.75.75 0 0 1 0 1.442l-2.846.813a3.75 3.75 0 0 0-2.576 2.576l-.813 2.846a.75.75 0 0 1-1.442 0l-.813-2.846a3.75 3.75 0 0 0-2.576-2.576l-2.846-.813a.75.75 0 0 1 0-1.442l2.846-.813A3.75 3.75 0 0 0 7.466 7.89l.813-2.846A.75.75 0 0 1 9 4.5ZM18 1.5a.75.75 0 0 1 .728.568l.258 1.036c.236.94.97 1.674 1.91 1.91l1.036.258a.75.75 0 0 1 0 1.456l-1.036.258c-.94.236-1.674.97-1.91 1.91l-.258 1.036a.75.75 0 0 1-1.456 0l-.258-1.036a2.625 2.625 0 0 0-1.91-1.91l-1.036-.258a.75.75 0 0 1 0-1.456l1.036-.258a2.625 2.625 0 0 0 1.91-1.91l.258-1.036A.75.75 0 0 1 18 1.5ZM16.5 15a.75.75 0 0 1 .712.513l.394 1.183c.15.447.5.799.948.948l1.183.395a.75.75 0 0 1 0 1.422l-1.183.395c-.447.15-.799.5-.948.948l-.395 1.183a.75.75 0 0 1-1.422 0l-.395-1.183a1.5 1.5 0 0 0-.948-.948l-1.183-.395a.75.75 0 0 1 0-1.422l1.183-.395c.447-.15.799-.5.948-.948l.395-1.183A.75.75 0 0 1 16.5 15Z",clipRule:"evenodd"}))}const It=D.forwardRef($t);function Ue(t){var n,s,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var d=t.length;for(n=0;n<d;n++)t[n]&&(s=Ue(t[n]))&&(o&&(o+=" "),o+=s)}else for(s in t)t[s]&&(o&&(o+=" "),o+=s);return o}function U(){for(var t,n,s=0,o="",d=arguments.length;s<d;s++)(t=arguments[s])&&(n=Ue(t))&&(o&&(o+=" "),o+=n);return o}const Lt={danger:"bg-error/10 text-error",caution:"bg-error/10 text-error",safe:"bg-neutral/10 text-neutral"},Mt={danger:"result.danger.badge",caution:"result.caution.badge",safe:"result.safe.badge"},Yt={sm:"text-xl font-bold",lg:"text-2xl font-bold"};function B({badgeVariant:t,subtitle:n,icon:s,title:o,titleSize:d="lg",children:x}){const{t:S}=T.useTranslation(z.TRADE_SAFETY_NS);return r.jsxs("section",{className:"rounded-2xl bg-neutral-content p-6 shadow-sm",children:[r.jsxs("header",{className:"mb-4 flex flex-col items-start",children:[t&&r.jsx("div",{className:U("mb-2 rounded-full px-4 py-1 text-sm font-bold",Lt[t]),children:S(Mt[t])}),n&&r.jsx("p",{className:"mb-1 break-keep text-lg font-medium text-neutral",children:n}),r.jsxs("div",{className:"flex items-center gap-2 text-neutral",children:[s&&r.jsx("span",{className:"text-base",children:s}),r.jsx("h2",{className:U("whitespace-pre-line break-keep sm:whitespace-normal",Yt[d]),children:o})]})]}),r.jsx("div",{children:x})]})}function Ht({summary:t}){const{t:n}=T.useTranslation(z.TRADE_SAFETY_NS);return t.length===0?null:r.jsx(B,{title:n("result.aiSummary"),icon:r.jsx(It,{className:"size-6"}),children:r.jsx("div",{children:t.map((s,o)=>r.jsx("p",{className:U("py-2 text-sm leading-relaxed text-neutral first:pt-0",o<t.length-1&&"border-b border-base-300"),children:s},`${s}-${o}`))})})}function I({title:t,content:n}){return r.jsxs("div",{className:"text-neutral",children:[r.jsx("h3",{className:"mb-1 break-keep text-lg font-semibold",children:t}),r.jsx("p",{className:"break-keep",children:n})]})}function qt({data:t}){const{t:n,i18n:s}=T.useTranslation(z.TRADE_SAFETY_NS);return t?r.jsx(B,{subtitle:n("result.priceAnalysis.subtitle"),title:n("result.priceAnalysis.title"),children:r.jsxs("div",{className:"space-y-4",children:[t.market_price_range&&r.jsx(I,{title:n("result.marketPrice"),content:t.market_price_range}),t.offered_price&&r.jsx(I,{title:n("result.offeredPrice"),content:new Intl.NumberFormat(s.language,{style:"currency",currency:t.currency||"USD"}).format(t.offered_price)}),t.price_assessment&&r.jsx(I,{title:n("result.priceAssessment"),content:t.price_assessment})]})}):null}function Wt({items:t}){const{t:n}=T.useTranslation(z.TRADE_SAFETY_NS);return t.length===0?null:r.jsx(B,{icon:r.jsx(Ft,{className:"size-6"}),title:n("result.safetyChecklist"),titleSize:"sm",children:r.jsx("div",{className:"space-y-4",children:t.map((s,o)=>r.jsxs("label",{className:"label cursor-pointer gap-4 rounded-2xl bg-base-200 p-4",children:[r.jsx("span",{className:"label-text break-keep text-neutral",children:s}),r.jsx("input",{type:"checkbox",className:"checkbox checkbox-sm [--chkbg:theme(colors.neutral)] [--chkfg:theme(colors.neutral-content)]"})]},o))})})}const Ut={danger:"result.danger.title",caution:"result.caution.title",safe:"result.safe.title"};function ce({signals:t,variant:n}){const{t:s}=T.useTranslation(z.TRADE_SAFETY_NS);return t.length===0?null:r.jsx(B,{badgeVariant:n,title:s(Ut[n]),children:r.jsx("div",{className:"divide-y divide-base-300",children:t.map((o,d)=>r.jsxs("div",{className:"space-y-4 py-4 first:pt-0 last:pb-0",children:[r.jsx(I,{title:o.title,content:o.description}),r.jsx(I,{title:s("result.whatToDo"),content:o.what_to_do})]},d))})})}function Bt({translation:t,nuance:n}){const{t:s}=T.useTranslation(z.TRADE_SAFETY_NS);return r.jsx(B,{subtitle:s("result.translation.subtitle"),title:s("result.translation.title"),children:r.jsxs("div",{className:"space-y-4",children:[t&&r.jsx(I,{title:s("result.translation.label"),content:t}),n&&r.jsx(I,{title:s("result.nuance.label"),content:n})]})})}function Zt({analysis:t}){return r.jsxs("div",{className:"space-y-6",children:[t.ai_summary.length>0&&r.jsx(Ht,{summary:t.ai_summary}),t.risk_signals.length>0&&r.jsx(ce,{signals:t.risk_signals,variant:"danger"}),t.cautions.length>0&&r.jsx(ce,{signals:t.cautions,variant:"caution"}),t.safe_indicators.length>0&&r.jsx(ce,{signals:t.safe_indicators,variant:"safe"}),t.safety_checklist.length>0&&r.jsx(Wt,{items:t.safety_checklist}),(t.translation||t.nuance_explanation)&&r.jsx(Bt,{translation:t.translation,nuance:t.nuance_explanation}),t.price_analysis&&r.jsx(qt,{data:t.price_analysis})]})}var Be={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Le=j.createContext&&j.createContext(Be),Kt=["attr","size","title"];function Jt(t,n){if(t==null)return{};var s=Vt(t,n),o,d;if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(t);for(d=0;d<x.length;d++)o=x[d],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(s[o]=t[o])}return s}function Vt(t,n){if(t==null)return{};var s={};for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){if(n.indexOf(o)>=0)continue;s[o]=t[o]}return s}function Q(){return Q=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(t[o]=s[o])}return t},Q.apply(this,arguments)}function Me(t,n){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(d){return Object.getOwnPropertyDescriptor(t,d).enumerable})),s.push.apply(s,o)}return s}function ee(t){for(var n=1;n<arguments.length;n++){var s=arguments[n]!=null?arguments[n]:{};n%2?Me(Object(s),!0).forEach(function(o){Xt(t,o,s[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):Me(Object(s)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(s,o))})}return t}function Xt(t,n,s){return n=Gt(n),n in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,t}function Gt(t){var n=Qt(t,"string");return typeof n=="symbol"?n:n+""}function Qt(t,n){if(typeof t!="object"||!t)return t;var s=t[Symbol.toPrimitive];if(s!==void 0){var o=s.call(t,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}function Ze(t){return t&&t.map((n,s)=>j.createElement(n.tag,ee({key:s},n.attr),Ze(n.child)))}function Ke(t){return n=>j.createElement(er,Q({attr:ee({},t.attr)},n),Ze(t.child))}function er(t){var n=s=>{var{attr:o,size:d,title:x}=t,S=Jt(t,Kt),_=d||s.size||"1em",f;return s.className&&(f=s.className),t.className&&(f=(f?f+" ":"")+t.className),j.createElement("svg",Q({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,o,S,{className:f,style:ee(ee({color:t.color||s.color},s.style),t.style),height:_,width:_,xmlns:"http://www.w3.org/2000/svg"}),x&&j.createElement("title",null,x),t.children)};return Le!==void 0?j.createElement(Le.Consumer,null,s=>n(s)):n(Be)}function tr(t){return Ke({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M0 256C0 114.6 114.6 0 256 0S512 114.6 512 256s-114.6 256-256 256L37.1 512c-13.7 0-20.5-16.5-10.9-26.2L75 437C28.7 390.7 0 326.7 0 256zM349.6 153.6c23.6 0 42.7-19.1 42.7-42.7s-19.1-42.7-42.7-42.7c-20.6 0-37.8 14.6-41.8 34c-34.5 3.7-61.4 33-61.4 68.4l0 .2c-37.5 1.6-71.8 12.3-99 29.1c-10.1-7.8-22.8-12.5-36.5-12.5c-33 0-59.8 26.8-59.8 59.8c0 24 14.1 44.6 34.4 54.1c2 69.4 77.6 125.2 170.6 125.2s168.7-55.9 170.6-125.3c20.2-9.6 34.1-30.2 34.1-54c0-33-26.8-59.8-59.8-59.8c-13.7 0-26.3 4.6-36.4 12.4c-27.4-17-62.1-27.7-100-29.1l0-.2c0-25.4 18.9-46.5 43.4-49.9l0 0c4.4 18.8 21.3 32.8 41.5 32.8zM177.1 246.9c16.7 0 29.5 17.6 28.5 39.3s-13.5 29.6-30.3 29.6s-31.4-8.8-30.4-30.5s15.4-38.3 32.1-38.3zm190.1 38.3c1 21.7-13.7 30.5-30.4 30.5s-29.3-7.9-30.3-29.6c-1-21.7 11.8-39.3 28.5-39.3s31.2 16.6 32.1 38.3zm-48.1 56.7c-10.3 24.6-34.6 41.9-63 41.9s-52.7-17.3-63-41.9c-1.2-2.9 .8-6.2 3.9-6.5c18.4-1.9 38.3-2.9 59.1-2.9s40.7 1 59.1 2.9c3.1 .3 5.1 3.6 3.9 6.5z"},child:[]}]})(t)}function rr(t){return Ke({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"},child:[]}]})(t)}function nr({data:t}){const n=t.images.slice(0,3),s=n.length>0;return r.jsxs("div",{className:"relative rounded-l-md border-l-4 border-neutral/50 bg-base-100 px-5 py-2",children:[r.jsxs("div",{className:"mb-3",children:[r.jsx("h3",{className:"mb-2 text-sm font-bold text-base-content",children:t.title}),r.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-sm text-base-content/60",children:[r.jsx("span",{className:"truncate",children:t.author}),t.date&&r.jsx("span",{className:"shrink-0 whitespace-nowrap",children:t.date})]})]}),s&&r.jsx("div",{className:"flex gap-2",children:n.map((o,d)=>r.jsx("div",{className:"relative size-14 overflow-hidden rounded bg-base-200",children:r.jsx(Pt,{src:o,alt:`Image ${d+1} from post by ${t.author}`,fill:!0,className:"object-cover"})},`${o}-${d}`))})]})}function ar(){return r.jsxs("div",{className:"relative border-l-4 border-base-300 bg-base-100 px-5 py-2",children:[r.jsxs("div",{className:"mb-3",children:[r.jsx("div",{className:"skeleton mb-2 h-4 w-3/4"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"skeleton h-3 w-20"}),r.jsx("div",{className:"skeleton h-3 w-16"})]})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("div",{className:"skeleton size-14 rounded"}),r.jsx("div",{className:"skeleton size-14 rounded"}),r.jsx("div",{className:"skeleton size-14 rounded"})]})]})}const Je=j.memo(({value:t,onChange:n,onSubmit:s,isLoading:o,error:d,previewData:x,isLoadingPreview:S,previewError:_})=>{const{t:f}=T.useTranslation(z.TRADE_SAFETY_NS),k=j.useRef(null),v=j.useRef(!0),y=!t&&!x&&!S&&!_;j.useEffect(()=>{if(v.current&&!y&&k.current){k.current.focus();const Z=k.current.value.length;k.current.setSelectionRange(Z,Z)}v.current=y},[y]);const E=o?r.jsx("span",{className:"loading loading-spinner loading-sm"}):f("hero.checkSafety"),C=o||!t.trim();return r.jsx("div",{className:"flex w-full flex-col items-center justify-center",children:r.jsxs("div",{className:"w-full lg:max-w-3xl",children:[r.jsx("h1",{className:"mb-2 text-left text-3xl font-bold text-base-content sm:mb-8 sm:text-center sm:text-4xl md:mb-8",children:f("hero.title")}),r.jsx("p",{className:"mb-4 text-left text-sm text-base-content/70 sm:mb-8 sm:text-center sm:text-base md:mb-16",children:f("hero.subtitle")}),r.jsxs("div",{className:U("mb-4",!d&&"sm:mb-8 md:mb-12"),children:[y?r.jsx("div",{className:"hidden lg:block",children:r.jsxs("div",{className:"relative",children:[r.jsx("input",{type:"text",className:"input input-bordered h-20 w-full pr-36 text-sm placeholder:text-base-300 focus:outline-none",placeholder:f("hero.placeholder"),"aria-label":f("hero.placeholder"),value:t,onChange:P=>n(P.target.value),disabled:o,onKeyDown:P=>{P.key==="Enter"&&!C&&s()}}),r.jsx("button",{className:"btn btn-neutral absolute right-2 top-1/2 h-14 min-h-0 -translate-y-1/2 !animate-none px-6 font-bold text-neutral-content",onClick:s,disabled:C,children:E})]})}):null,r.jsx("div",{className:U(y?"block lg:hidden":"block"),children:r.jsxs("div",{className:"relative flex min-h-[400px] w-full flex-col overflow-hidden rounded-xl border border-base-300 bg-base-100",children:[!t&&r.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden p-5 pb-24 text-base text-base-300","aria-hidden":"true",children:r.jsxs("div",{className:"whitespace-pre-line leading-relaxed",children:[r.jsx("p",{className:"mb-4 text-base-300",children:f("hero.placeholder")}),f("hero.placeholderExample")]})}),r.jsxs("div",{className:"flex flex-1 flex-col pb-24",children:[r.jsx("textarea",{ref:k,className:"flex-1 resize-none overflow-auto border-none bg-transparent p-4 leading-6 text-base-content outline-none",value:t,"aria-label":f("hero.placeholder"),onChange:P=>n(P.target.value),disabled:o,placeholder:""}),x&&r.jsx("div",{className:"px-4 pb-4",children:r.jsx(nr,{data:x})}),S&&r.jsx("div",{className:"px-4 pb-4",children:r.jsx(ar,{})}),_&&r.jsx("div",{className:"alert alert-error mx-4 mb-4 flex w-auto items-center text-sm",children:r.jsx("span",{children:_})})]}),r.jsx("div",{className:"absolute inset-x-4 bottom-4 z-10",children:r.jsx("button",{className:"btn btn-neutral h-16 w-full text-base font-medium text-neutral-content",onClick:s,disabled:C,children:E})})]})})]}),d&&r.jsx("div",{className:"alert alert-error mb-6 flex items-center gap-2 text-sm",children:r.jsx("span",{children:d})}),r.jsx("p",{className:"mb-4 text-left text-xs text-base-content/60 sm:mb-8 sm:text-center md:mb-12",children:f("hero.disclaimer")}),r.jsxs("div",{className:"flex items-center justify-start gap-6 sm:justify-center",children:[r.jsx("a",{href:"https://x.com",target:"_blank",rel:"noopener noreferrer","aria-label":"X",children:r.jsx(rr,{className:"size-6 text-base-content transition-colors hover:text-base-content/70"})}),r.jsx("a",{href:"https://reddit.com",target:"_blank",rel:"noopener noreferrer","aria-label":"Reddit",children:r.jsx(tr,{className:"size-6 text-base-content transition-colors hover:text-base-content/70"})})]})]})})});Je.displayName="HomeHeroSection";var ue={exports:{}},W={},Ye;function sr(){if(Ye)return W;Ye=1;var t=j,n=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,d=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,x={key:!0,ref:!0,__self:!0,__source:!0};function S(_,f,k){var v,y={},E=null,C=null;k!==void 0&&(E=""+k),f.key!==void 0&&(E=""+f.key),f.ref!==void 0&&(C=f.ref);for(v in f)o.call(f,v)&&!x.hasOwnProperty(v)&&(y[v]=f[v]);if(_&&_.defaultProps)for(v in f=_.defaultProps,f)y[v]===void 0&&(y[v]=f[v]);return{$$typeof:n,type:_,key:E,ref:C,props:y,_owner:d.current}}return W.Fragment=s,W.jsx=S,W.jsxs=S,W}var G={},He;function or(){return He||(He=1,process.env.NODE_ENV!=="production"&&(function(){var t=j,n=Symbol.for("react.element"),s=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),_=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),C=Symbol.for("react.offscreen"),P=Symbol.iterator,Z="@@iterator";function Ve(e){if(e===null||typeof e!="object")return null;var a=P&&e[P]||e[Z];return typeof a=="function"?a:null}var L=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(e){{for(var a=arguments.length,i=new Array(a>1?a-1:0),l=1;l<a;l++)i[l-1]=arguments[l];Xe("error",e,i)}}function Xe(e,a,i){{var l=L.ReactDebugCurrentFrame,m=l.getStackAddendum();m!==""&&(a+="%s",i=i.concat([m]));var h=i.map(function(p){return String(p)});h.unshift("Warning: "+a),Function.prototype.apply.call(console[e],console,h)}}var Ge=!1,Qe=!1,et=!1,tt=!1,rt=!1,me;me=Symbol.for("react.module.reference");function nt(e){return!!(typeof e=="string"||typeof e=="function"||e===o||e===x||rt||e===d||e===k||e===v||tt||e===C||Ge||Qe||et||typeof e=="object"&&e!==null&&(e.$$typeof===E||e.$$typeof===y||e.$$typeof===S||e.$$typeof===_||e.$$typeof===f||e.$$typeof===me||e.getModuleId!==void 0))}function at(e,a,i){var l=e.displayName;if(l)return l;var m=a.displayName||a.name||"";return m!==""?i+"("+m+")":i}function he(e){return e.displayName||"Context"}function A(e){if(e==null)return null;if(typeof e.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case o:return"Fragment";case s:return"Portal";case x:return"Profiler";case d:return"StrictMode";case k:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _:var a=e;return he(a)+".Consumer";case S:var i=e;return he(i._context)+".Provider";case f:return at(e,e.render,"ForwardRef");case y:var l=e.displayName||null;return l!==null?l:A(e.type)||"Memo";case E:{var m=e,h=m._payload,p=m._init;try{return A(p(h))}catch{return null}}}return null}var F=Object.assign,H=0,be,ye,ge,xe,ve,je,_e;function Se(){}Se.__reactDisabledLog=!0;function st(){{if(H===0){be=console.log,ye=console.info,ge=console.warn,xe=console.error,ve=console.group,je=console.groupCollapsed,_e=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Se,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}H++}}function ot(){{if(H--,H===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},e,{value:be}),info:F({},e,{value:ye}),warn:F({},e,{value:ge}),error:F({},e,{value:xe}),group:F({},e,{value:ve}),groupCollapsed:F({},e,{value:je}),groupEnd:F({},e,{value:_e})})}H<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var te=L.ReactCurrentDispatcher,re;function K(e,a,i){{if(re===void 0)try{throw Error()}catch(m){var l=m.stack.trim().match(/\n( *(at )?)/);re=l&&l[1]||""}return`
|
|
2
|
+
`+re+e}}var ne=!1,J;{var it=typeof WeakMap=="function"?WeakMap:Map;J=new it}function we(e,a){if(!e||ne)return"";{var i=J.get(e);if(i!==void 0)return i}var l;ne=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var h;h=te.current,te.current=null,st();try{if(a){var p=function(){throw Error()};if(Object.defineProperty(p.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(p,[])}catch(O){l=O}Reflect.construct(e,[],p)}else{try{p.call()}catch(O){l=O}e.call(p.prototype)}}else{try{throw Error()}catch(O){l=O}e()}}catch(O){if(O&&l&&typeof O.stack=="string"){for(var u=O.stack.split(`
|
|
3
|
+
`),N=l.stack.split(`
|
|
4
|
+
`),b=u.length-1,g=N.length-1;b>=1&&g>=0&&u[b]!==N[g];)g--;for(;b>=1&&g>=0;b--,g--)if(u[b]!==N[g]){if(b!==1||g!==1)do if(b--,g--,g<0||u[b]!==N[g]){var R=`
|
|
5
|
+
`+u[b].replace(" at new "," at ");return e.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",e.displayName)),typeof e=="function"&&J.set(e,R),R}while(b>=1&&g>=0);break}}}finally{ne=!1,te.current=h,ot(),Error.prepareStackTrace=m}var Y=e?e.displayName||e.name:"",$=Y?K(Y):"";return typeof e=="function"&&J.set(e,$),$}function lt(e,a,i){return we(e,!1)}function ct(e){var a=e.prototype;return!!(a&&a.isReactComponent)}function V(e,a,i){if(e==null)return"";if(typeof e=="function")return we(e,ct(e));if(typeof e=="string")return K(e);switch(e){case k:return K("Suspense");case v:return K("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return lt(e.render);case y:return V(e.type,a,i);case E:{var l=e,m=l._payload,h=l._init;try{return V(h(m),a,i)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,Ne={},ke=L.ReactDebugCurrentFrame;function X(e){if(e){var a=e._owner,i=V(e.type,e._source,a?a.type:null);ke.setExtraStackFrame(i)}else ke.setExtraStackFrame(null)}function ut(e,a,i,l,m){{var h=Function.call.bind(q);for(var p in e)if(h(e,p)){var u=void 0;try{if(typeof e[p]!="function"){var N=Error((l||"React class")+": "+i+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw N.name="Invariant Violation",N}u=e[p](a,p,l,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(b){u=b}u&&!(u instanceof Error)&&(X(m),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",l||"React class",i,p,typeof u),X(null)),u instanceof Error&&!(u.message in Ne)&&(Ne[u.message]=!0,X(m),w("Failed %s type: %s",i,u.message),X(null))}}}var ft=Array.isArray;function ae(e){return ft(e)}function pt(e){{var a=typeof Symbol=="function"&&Symbol.toStringTag,i=a&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function dt(e){try{return Oe(e),!1}catch{return!0}}function Oe(e){return""+e}function Ee(e){if(dt(e))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",pt(e)),Oe(e)}var Re=L.ReactCurrentOwner,mt={key:!0,ref:!0,__self:!0,__source:!0},Te,ze;function ht(e){if(q.call(e,"ref")){var a=Object.getOwnPropertyDescriptor(e,"ref").get;if(a&&a.isReactWarning)return!1}return e.ref!==void 0}function bt(e){if(q.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function yt(e,a){typeof e.ref=="string"&&Re.current}function gt(e,a){{var i=function(){Te||(Te=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",a))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}}function xt(e,a){{var i=function(){ze||(ze=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",a))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}}var vt=function(e,a,i,l,m,h,p){var u={$$typeof:n,type:e,key:a,ref:i,props:p,_owner:h};return u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:m}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u};function jt(e,a,i,l,m){{var h,p={},u=null,N=null;i!==void 0&&(Ee(i),u=""+i),bt(a)&&(Ee(a.key),u=""+a.key),ht(a)&&(N=a.ref,yt(a));for(h in a)q.call(a,h)&&!mt.hasOwnProperty(h)&&(p[h]=a[h]);if(e&&e.defaultProps){var b=e.defaultProps;for(h in b)p[h]===void 0&&(p[h]=b[h])}if(u||N){var g=typeof e=="function"?e.displayName||e.name||"Unknown":e;u&>(p,g),N&&xt(p,g)}return vt(e,u,N,m,l,Re.current,p)}}var se=L.ReactCurrentOwner,Pe=L.ReactDebugCurrentFrame;function M(e){if(e){var a=e._owner,i=V(e.type,e._source,a?a.type:null);Pe.setExtraStackFrame(i)}else Pe.setExtraStackFrame(null)}var oe;oe=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function Ce(){{if(se.current){var e=A(se.current.type);if(e)return`
|
|
6
|
+
|
|
7
|
+
Check the render method of \``+e+"`."}return""}}function _t(e){return""}var Ae={};function St(e){{var a=Ce();if(!a){var i=typeof e=="string"?e:e.displayName||e.name;i&&(a=`
|
|
8
|
+
|
|
9
|
+
Check the top-level render call using <`+i+">.")}return a}}function De(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var i=St(a);if(Ae[i])return;Ae[i]=!0;var l="";e&&e._owner&&e._owner!==se.current&&(l=" It was passed a child from "+A(e._owner.type)+"."),M(e),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,l),M(null)}}function Fe(e,a){{if(typeof e!="object")return;if(ae(e))for(var i=0;i<e.length;i++){var l=e[i];ie(l)&&De(l,a)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var m=Ve(e);if(typeof m=="function"&&m!==e.entries)for(var h=m.call(e),p;!(p=h.next()).done;)ie(p.value)&&De(p.value,a)}}}function wt(e){{var a=e.type;if(a==null||typeof a=="string")return;var i;if(typeof a=="function")i=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===f||a.$$typeof===y))i=a.propTypes;else return;if(i){var l=A(a);ut(i,e.props,"prop",l,e)}else if(a.PropTypes!==void 0&&!oe){oe=!0;var m=A(a);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",m||"Unknown")}typeof a.getDefaultProps=="function"&&!a.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Nt(e){{for(var a=Object.keys(e.props),i=0;i<a.length;i++){var l=a[i];if(l!=="children"&&l!=="key"){M(e),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",l),M(null);break}}e.ref!==null&&(M(e),w("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}var $e={};function Ie(e,a,i,l,m,h){{var p=nt(e);if(!p){var u="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(u+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var N=_t();N?u+=N:u+=Ce();var b;e===null?b="null":ae(e)?b="array":e!==void 0&&e.$$typeof===n?(b="<"+(A(e.type)||"Unknown")+" />",u=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,u)}var g=jt(e,a,i,m,h);if(g==null)return g;if(p){var R=a.children;if(R!==void 0)if(l)if(ae(R)){for(var Y=0;Y<R.length;Y++)Fe(R[Y],e);Object.freeze&&Object.freeze(R)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Fe(R,e)}if(q.call(a,"key")){var $=A(e),O=Object.keys(a).filter(function(zt){return zt!=="key"}),le=O.length>0?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}";if(!$e[$+le]){var Tt=O.length>0?"{"+O.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
|
|
10
|
+
let props = %s;
|
|
11
|
+
<%s {...props} />
|
|
12
|
+
React keys must be passed directly to JSX without using spread:
|
|
13
|
+
let props = %s;
|
|
14
|
+
<%s key={someKey} {...props} />`,le,$,Tt,$),$e[$+le]=!0}}return e===o?Nt(g):wt(g),g}}function kt(e,a,i){return Ie(e,a,i,!0)}function Ot(e,a,i){return Ie(e,a,i,!1)}var Et=Ot,Rt=kt;G.Fragment=o,G.jsx=Et,G.jsxs=Rt})()),G}var qe;function ir(){return qe||(qe=1,process.env.NODE_ENV==="production"?ue.exports=sr():ue.exports=or()),ue.exports}var We=ir();function lr({src:t,autoplay:n,loop:s=!0,...o}){const[d,x]=j.useState(!1),[S,_]=j.useState(null),[f,k]=j.useState(!1);return j.useEffect(()=>{let v=!0;return x(!0),Promise.all([Promise.resolve().then(()=>require("./lottie-react.esm-Bv7L41xK.js")),Promise.resolve().then(()=>require("./isChromatic-5i32AXac-BWePUv7P.js"))]).then(([{Player:y},{default:E}])=>{v&&(_(()=>y),k(E()))}).catch(y=>{throw console.error("[LottiePlayer] Failed to load dependencies:",y),y}),()=>{v=!1}},[]),!d||!S?We.jsx("div",{...o}):We.jsx(S,{src:t,loop:s,autoplay:n!==void 0?n:!f,...o})}const cr={danger:{lottie:"https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a8/lottie.json",webp:"https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a8/512.webp",gif:"https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a8/512.gif",alt:"🚨"},caution:{lottie:"https://fonts.gstatic.com/s/e/notoemoji/latest/26a0_fe0f/lottie.json",webp:"https://fonts.gstatic.com/s/e/notoemoji/latest/26a0_fe0f/512.webp",gif:"https://fonts.gstatic.com/s/e/notoemoji/latest/26a0_fe0f/512.gif",alt:"⚠️"},safe:{lottie:"https://fonts.gstatic.com/s/e/notoemoji/latest/2705/lottie.json",webp:"https://fonts.gstatic.com/s/e/notoemoji/latest/2705/512.webp",gif:"https://fonts.gstatic.com/s/e/notoemoji/latest/2705/512.gif",alt:"✅"}},fe={danger:"font-bold text-error",caution:"font-bold text-warning",safe:"font-bold text-success"};function ur({level:t,score:n}){const{t:s}=T.useTranslation(z.TRADE_SAFETY_NS),o=cr[t];return r.jsxs("div",{className:"mb-8 flex flex-col items-center text-center",children:[r.jsx("div",{className:"mb-5 rounded-full bg-neutral/75 px-4 py-1.5",children:r.jsx("span",{className:"text-sm font-medium text-neutral-content",children:s(`result.safetyLevel.${t}.badge`)})}),r.jsx("h1",{className:"mb-9 break-keep text-4xl font-bold leading-tight text-base-content",children:r.jsx(T.Trans,{t:s,i18nKey:`result.safetyLevel.${t}.title`,components:[r.jsx("strong",{className:fe[t]},"0")]})}),r.jsx("div",{className:"mb-9 flex size-32 items-center justify-center",children:r.jsx(lr,{src:o.lottie,autoplay:!0,loop:!0,className:"size-full"})}),r.jsx("p",{className:"max-w-md break-keep text-xl leading-relaxed text-base-content",children:r.jsx(T.Trans,{t:s,i18nKey:`result.safetyLevel.${t}.description`,values:{score:n},components:[r.jsx("strong",{className:fe[t]},"0"),r.jsx("strong",{className:fe[t]},"1")]})})]})}const de={safe:70,caution:40},fr=t=>t>=de.safe?"safe":t>=de.caution?"caution":"danger",pe=c.z.object({category:c.z.enum(["payment","seller","platform","price","content"]),severity:c.z.enum(["high","medium","low"]),title:c.z.string(),description:c.z.string(),what_to_do:c.z.string()}),pr=c.z.object({market_price_range:c.z.string().nullish(),offered_price:c.z.number().nullish(),currency:c.z.string().nullish(),price_assessment:c.z.string(),warnings:c.z.array(c.z.string())}),dr=c.z.object({ai_summary:c.z.array(c.z.string()),translation:c.z.string().nullish(),nuance_explanation:c.z.string().nullish(),risk_signals:c.z.array(pe),cautions:c.z.array(pe),safe_indicators:c.z.array(pe),price_analysis:pr,safety_checklist:c.z.array(c.z.string()),safe_score:c.z.number(),recommendation:c.z.string(),emotional_support:c.z.string()}),mr=c.z.object({id:c.z.string(),user_id:c.z.string().nullish(),input_text:c.z.string(),llm_analysis:dr,safe_score:c.z.number(),expert_advice:c.z.string().nullish(),expert_reviewed:c.z.boolean(),expert_reviewed_at:c.z.string().nullish(),expert_reviewed_by:c.z.string().nullish(),created_at:c.z.string(),updated_at:c.z.string()}),hr=c.z.enum(["twitter","reddit"]),br=c.z.object({platform:hr,author:c.z.string(),created_at:c.z.string().nullish(),text:c.z.string(),text_preview:c.z.string(),images:c.z.array(c.z.string())}),yr=c.z.object({data:br});class gr extends Ct.BaseCrudRepository{constructor(){super(...arguments),this.resource="trade-safety"}getDataSchema(){return mr}async fetchPreview(n,s){const o=`${this.apiService.buildUrl(this.resource)}/preview`,d=await this.apiService.request(o,{...s,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:n})});return this.validateResponse(d,yr).data}}exports.TRADE_SAFETY_NS=z.TRADE_SAFETY_NS;exports.tradeSafetyTranslations=z.tradeSafetyTranslations;exports.DetailedResult=Zt;exports.HomeHeroSection=Je;exports.PageHeader=ur;exports.SAFETY_SCORE_THRESHOLDS=de;exports.TradeSafetyRepository=gr;exports.getSafetyLevel=fr;
|
|
2
15
|
//# sourceMappingURL=index.js.map
|