trade-safety 1.10.0 → 1.11.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.
@@ -1,9 +1,12 @@
1
+ import { SafetyLevel } from '../../types';
1
2
  interface AnalysisCardProps {
2
- title?: string;
3
+ badgeVariant?: SafetyLevel;
4
+ subtitle?: string;
3
5
  icon?: React.ReactNode;
4
- variant?: "default" | "error" | "warning" | "success" | "info";
6
+ title: string;
7
+ titleSize?: "sm" | "lg";
5
8
  children: React.ReactNode;
6
9
  }
7
- export declare function AnalysisCard({ title, icon, variant, children, }: AnalysisCardProps): import("react").JSX.Element | null;
10
+ export declare function AnalysisCard({ badgeVariant, subtitle, icon, title, titleSize, children, }: AnalysisCardProps): import("react").JSX.Element;
8
11
  export {};
9
12
  //# sourceMappingURL=AnalysisCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AnalysisCard.d.ts","sourceRoot":"","sources":["../../../src/components/DetailedResult/AnalysisCard.tsx"],"names":[],"mappings":"AAEA,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IAC/D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAUD,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,IAAI,EACJ,OAAmB,EACnB,QAAQ,GACT,EAAE,iBAAiB,sCAcnB"}
1
+ {"version":3,"file":"AnalysisCard.d.ts","sourceRoot":"","sources":["../../../src/components/DetailedResult/AnalysisCard.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,UAAU,iBAAiB;IACzB,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAmBD,wBAAgB,YAAY,CAAC,EAC3B,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,SAAgB,EAChB,QAAQ,GACT,EAAE,iBAAiB,+BAuCnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"PriceAnalysisSection.d.ts","sourceRoot":"","sources":["../../../src/components/DetailedResult/PriceAnalysisSection.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxC,UAAU,yBAAyB;IACjC,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,EAAE,yBAAyB,sCAiCvE"}
1
+ {"version":3,"file":"PriceAnalysisSection.d.ts","sourceRoot":"","sources":["../../../src/components/DetailedResult/PriceAnalysisSection.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAKxC,UAAU,yBAAyB;IACjC,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,EAAE,yBAAyB,sCAoCvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"SafetyChecklistSection.d.ts","sourceRoot":"","sources":["../../../src/components/DetailedResult/SafetyChecklistSection.tsx"],"names":[],"mappings":"AASA,UAAU,2BAA2B;IACnC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,wBAAgB,sBAAsB,CAAC,EAAE,KAAK,EAAE,EAAE,2BAA2B,sCAuB5E"}
1
+ {"version":3,"file":"SafetyChecklistSection.d.ts","sourceRoot":"","sources":["../../../src/components/DetailedResult/SafetyChecklistSection.tsx"],"names":[],"mappings":"AASA,UAAU,2BAA2B;IACnC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,wBAAgB,sBAAsB,CAAC,EAAE,KAAK,EAAE,EAAE,2BAA2B,sCA2B5E"}
@@ -0,0 +1,7 @@
1
+ interface SectionContentProps {
2
+ title: string;
3
+ content: string;
4
+ }
5
+ export declare function SectionContent({ title, content }: SectionContentProps): import("react").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=SectionContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionContent.d.ts","sourceRoot":"","sources":["../../../src/components/DetailedResult/SectionContent.tsx"],"names":[],"mappings":"AAAA,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,mBAAmB,+BAOrE"}
@@ -1,8 +1,8 @@
1
- import { RiskSignal } from '../../types';
1
+ import { RiskSignal, SafetyLevel } from '../../types';
2
2
  interface SignalsSectionProps {
3
3
  signals: RiskSignal[];
4
- variant?: "error" | "warning" | "success";
4
+ variant: SafetyLevel;
5
5
  }
6
- export declare function SignalsSection({ signals, variant, }: SignalsSectionProps): import("react").JSX.Element | null;
6
+ export declare function SignalsSection({ signals, variant }: SignalsSectionProps): import("react").JSX.Element | null;
7
7
  export {};
8
8
  //# sourceMappingURL=SignalsSection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignalsSection.d.ts","sourceRoot":"","sources":["../../../src/components/DetailedResult/SignalsSection.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC,UAAU,mBAAmB;IAC3B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;CAC3C;AAcD,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,OAAiB,GAClB,EAAE,mBAAmB,sCA8BrB"}
1
+ {"version":3,"file":"SignalsSection.d.ts","sourceRoot":"","sources":["../../../src/components/DetailedResult/SignalsSection.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAKlD,UAAU,mBAAmB;IAC3B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,OAAO,EAAE,WAAW,CAAC;CACtB;AAQD,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,mBAAmB,sCAoBvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"TranslationSection.d.ts","sourceRoot":"","sources":["../../../src/components/DetailedResult/TranslationSection.tsx"],"names":[],"mappings":"AAQA,UAAU,uBAAuB;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,WAAW,EACX,MAAM,GACP,EAAE,uBAAuB,+BAoBzB"}
1
+ {"version":3,"file":"TranslationSection.d.ts","sourceRoot":"","sources":["../../../src/components/DetailedResult/TranslationSection.tsx"],"names":[],"mappings":"AASA,UAAU,uBAAuB;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,WAAW,EACX,MAAM,GACP,EAAE,uBAAuB,+BAsBzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DetailedResult/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAS9C,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,mBAAmB,CAAC;CAC/B;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB,+BAgD/D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DetailedResult/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAQ9C,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,mBAAmB,CAAC;CAC/B;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB,+BAyC/D"}
@@ -78,10 +78,18 @@ export declare const tradeSafetyTranslations: {
78
78
  signupButton: string;
79
79
  signupToView: string;
80
80
  whatToDo: string;
81
- translation: string;
82
- translationTitle: string;
83
- nuanceTitle: string;
84
- priceAnalysis: string;
81
+ translation: {
82
+ subtitle: string;
83
+ title: string;
84
+ label: string;
85
+ };
86
+ nuance: {
87
+ label: string;
88
+ };
89
+ priceAnalysis: {
90
+ subtitle: string;
91
+ title: string;
92
+ };
85
93
  marketPrice: string;
86
94
  offeredPrice: string;
87
95
  priceAssessment: string;
@@ -125,6 +133,18 @@ export declare const tradeSafetyTranslations: {
125
133
  description: string;
126
134
  button: string;
127
135
  };
136
+ danger: {
137
+ badge: string;
138
+ title: string;
139
+ };
140
+ caution: {
141
+ badge: string;
142
+ title: string;
143
+ };
144
+ safe: {
145
+ badge: string;
146
+ title: string;
147
+ };
128
148
  };
129
149
  };
130
150
  es: {
@@ -186,10 +206,18 @@ export declare const tradeSafetyTranslations: {
186
206
  signupButton: string;
187
207
  signupToView: string;
188
208
  whatToDo: string;
189
- translation: string;
190
- translationTitle: string;
191
- nuanceTitle: string;
192
- priceAnalysis: string;
209
+ translation: {
210
+ subtitle: string;
211
+ title: string;
212
+ label: string;
213
+ };
214
+ nuance: {
215
+ label: string;
216
+ };
217
+ priceAnalysis: {
218
+ subtitle: string;
219
+ title: string;
220
+ };
193
221
  marketPrice: string;
194
222
  offeredPrice: string;
195
223
  priceAssessment: string;
@@ -233,6 +261,18 @@ export declare const tradeSafetyTranslations: {
233
261
  description: string;
234
262
  button: string;
235
263
  };
264
+ danger: {
265
+ badge: string;
266
+ title: string;
267
+ };
268
+ caution: {
269
+ badge: string;
270
+ title: string;
271
+ };
272
+ safe: {
273
+ badge: string;
274
+ title: string;
275
+ };
236
276
  };
237
277
  };
238
278
  id: {
@@ -294,10 +334,18 @@ export declare const tradeSafetyTranslations: {
294
334
  signupButton: string;
295
335
  signupToView: string;
296
336
  whatToDo: string;
297
- translation: string;
298
- translationTitle: string;
299
- nuanceTitle: string;
300
- priceAnalysis: string;
337
+ translation: {
338
+ subtitle: string;
339
+ title: string;
340
+ label: string;
341
+ };
342
+ nuance: {
343
+ label: string;
344
+ };
345
+ priceAnalysis: {
346
+ subtitle: string;
347
+ title: string;
348
+ };
301
349
  marketPrice: string;
302
350
  offeredPrice: string;
303
351
  priceAssessment: string;
@@ -341,6 +389,18 @@ export declare const tradeSafetyTranslations: {
341
389
  description: string;
342
390
  button: string;
343
391
  };
392
+ danger: {
393
+ badge: string;
394
+ title: string;
395
+ };
396
+ caution: {
397
+ badge: string;
398
+ title: string;
399
+ };
400
+ safe: {
401
+ badge: string;
402
+ title: string;
403
+ };
344
404
  };
345
405
  };
346
406
  ja: {
@@ -402,10 +462,18 @@ export declare const tradeSafetyTranslations: {
402
462
  signupButton: string;
403
463
  signupToView: string;
404
464
  whatToDo: string;
405
- translation: string;
406
- translationTitle: string;
407
- nuanceTitle: string;
408
- priceAnalysis: string;
465
+ translation: {
466
+ subtitle: string;
467
+ title: string;
468
+ label: string;
469
+ };
470
+ nuance: {
471
+ label: string;
472
+ };
473
+ priceAnalysis: {
474
+ subtitle: string;
475
+ title: string;
476
+ };
409
477
  marketPrice: string;
410
478
  offeredPrice: string;
411
479
  priceAssessment: string;
@@ -449,6 +517,18 @@ export declare const tradeSafetyTranslations: {
449
517
  description: string;
450
518
  button: string;
451
519
  };
520
+ danger: {
521
+ badge: string;
522
+ title: string;
523
+ };
524
+ caution: {
525
+ badge: string;
526
+ title: string;
527
+ };
528
+ safe: {
529
+ badge: string;
530
+ title: string;
531
+ };
452
532
  };
453
533
  };
454
534
  ko: {
@@ -510,10 +590,18 @@ export declare const tradeSafetyTranslations: {
510
590
  signupButton: string;
511
591
  signupToView: string;
512
592
  whatToDo: string;
513
- translation: string;
514
- translationTitle: string;
515
- nuanceTitle: string;
516
- priceAnalysis: string;
593
+ translation: {
594
+ subtitle: string;
595
+ title: string;
596
+ label: string;
597
+ };
598
+ nuance: {
599
+ label: string;
600
+ };
601
+ priceAnalysis: {
602
+ subtitle: string;
603
+ title: string;
604
+ };
517
605
  marketPrice: string;
518
606
  offeredPrice: string;
519
607
  priceAssessment: string;
@@ -557,6 +645,18 @@ export declare const tradeSafetyTranslations: {
557
645
  description: string;
558
646
  button: string;
559
647
  };
648
+ danger: {
649
+ badge: string;
650
+ title: string;
651
+ };
652
+ caution: {
653
+ badge: string;
654
+ title: string;
655
+ };
656
+ safe: {
657
+ badge: string;
658
+ title: string;
659
+ };
560
660
  };
561
661
  };
562
662
  th: {
@@ -618,10 +718,18 @@ export declare const tradeSafetyTranslations: {
618
718
  signupButton: string;
619
719
  signupToView: string;
620
720
  whatToDo: string;
621
- translation: string;
622
- translationTitle: string;
623
- nuanceTitle: string;
624
- priceAnalysis: string;
721
+ translation: {
722
+ subtitle: string;
723
+ title: string;
724
+ label: string;
725
+ };
726
+ nuance: {
727
+ label: string;
728
+ };
729
+ priceAnalysis: {
730
+ subtitle: string;
731
+ title: string;
732
+ };
625
733
  marketPrice: string;
626
734
  offeredPrice: string;
627
735
  priceAssessment: string;
@@ -665,6 +773,18 @@ export declare const tradeSafetyTranslations: {
665
773
  description: string;
666
774
  button: string;
667
775
  };
776
+ danger: {
777
+ badge: string;
778
+ title: string;
779
+ };
780
+ caution: {
781
+ badge: string;
782
+ title: string;
783
+ };
784
+ safe: {
785
+ badge: string;
786
+ title: string;
787
+ };
668
788
  };
669
789
  };
670
790
  tl: {
@@ -726,10 +846,18 @@ export declare const tradeSafetyTranslations: {
726
846
  signupButton: string;
727
847
  signupToView: string;
728
848
  whatToDo: string;
729
- translation: string;
730
- translationTitle: string;
731
- nuanceTitle: string;
732
- priceAnalysis: string;
849
+ translation: {
850
+ subtitle: string;
851
+ title: string;
852
+ label: string;
853
+ };
854
+ nuance: {
855
+ label: string;
856
+ };
857
+ priceAnalysis: {
858
+ subtitle: string;
859
+ title: string;
860
+ };
733
861
  marketPrice: string;
734
862
  offeredPrice: string;
735
863
  priceAssessment: string;
@@ -773,6 +901,18 @@ export declare const tradeSafetyTranslations: {
773
901
  description: string;
774
902
  button: string;
775
903
  };
904
+ danger: {
905
+ badge: string;
906
+ title: string;
907
+ };
908
+ caution: {
909
+ badge: string;
910
+ title: string;
911
+ };
912
+ safe: {
913
+ badge: string;
914
+ title: string;
915
+ };
776
916
  };
777
917
  };
778
918
  vi: {
@@ -834,10 +974,18 @@ export declare const tradeSafetyTranslations: {
834
974
  signupButton: string;
835
975
  signupToView: string;
836
976
  whatToDo: string;
837
- translation: string;
838
- translationTitle: string;
839
- nuanceTitle: string;
840
- priceAnalysis: string;
977
+ translation: {
978
+ subtitle: string;
979
+ title: string;
980
+ label: string;
981
+ };
982
+ nuance: {
983
+ label: string;
984
+ };
985
+ priceAnalysis: {
986
+ subtitle: string;
987
+ title: string;
988
+ };
841
989
  marketPrice: string;
842
990
  offeredPrice: string;
843
991
  priceAssessment: string;
@@ -881,6 +1029,18 @@ export declare const tradeSafetyTranslations: {
881
1029
  description: string;
882
1030
  button: string;
883
1031
  };
1032
+ danger: {
1033
+ badge: string;
1034
+ title: string;
1035
+ };
1036
+ caution: {
1037
+ badge: string;
1038
+ title: string;
1039
+ };
1040
+ safe: {
1041
+ badge: string;
1042
+ title: string;
1043
+ };
884
1044
  };
885
1045
  };
886
1046
  zh: {
@@ -942,10 +1102,18 @@ export declare const tradeSafetyTranslations: {
942
1102
  signupButton: string;
943
1103
  signupToView: string;
944
1104
  whatToDo: string;
945
- translation: string;
946
- translationTitle: string;
947
- nuanceTitle: string;
948
- priceAnalysis: string;
1105
+ translation: {
1106
+ subtitle: string;
1107
+ title: string;
1108
+ label: string;
1109
+ };
1110
+ nuance: {
1111
+ label: string;
1112
+ };
1113
+ priceAnalysis: {
1114
+ subtitle: string;
1115
+ title: string;
1116
+ };
949
1117
  marketPrice: string;
950
1118
  offeredPrice: string;
951
1119
  priceAssessment: string;
@@ -989,6 +1157,18 @@ export declare const tradeSafetyTranslations: {
989
1157
  description: string;
990
1158
  button: string;
991
1159
  };
1160
+ danger: {
1161
+ badge: string;
1162
+ title: string;
1163
+ };
1164
+ caution: {
1165
+ badge: string;
1166
+ title: string;
1167
+ };
1168
+ safe: {
1169
+ badge: string;
1170
+ title: string;
1171
+ };
992
1172
  };
993
1173
  };
994
1174
  };
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUnC,CAAC"}
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,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),m=require("react-i18next");require("i18next");require("i18next-resources-to-backend");const d=require("./locale.js"),u=require("react"),T=require("@aioia/core"),a=require("zod");function O(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 c=O(u);function _(e){var t,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(r=_(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function N(){for(var e,t,r=0,s="",l=arguments.length;r<l;r++)(e=arguments[r])&&(t=_(e))&&(s&&(s+=" "),s+=t);return s}const R={default:"border-base-300",error:"border-error bg-error/10",warning:"border-warning bg-warning/10",success:"border-success bg-success/10",info:"border-info bg-info/10"};function h({title:e,icon:t,variant:r="default",children:s}){return s?n.jsxs("div",{className:N("rounded-lg border p-6",R[r]),children:[e&&n.jsxs("h2",{className:"mb-2 flex items-center gap-2 font-bold",children:[e,t]}),s]}):null}function A({summary:e}){const{t}=m.useTranslation(d.TRADE_SAFETY_NS);return n.jsx(h,{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 P({data:e}){const{t,i18n:r}=m.useTranslation(d.TRADE_SAFETY_NS);return e?n.jsxs(h,{title:t("result.priceAnalysis"),children:[e.market_price_range&&n.jsxs("div",{className:"mb-2",children:[n.jsx("h3",{className:"text-sm font-bold",children:t("result.marketPrice")}),n.jsx("p",{className:"text-xs",children:e.market_price_range})]}),e.offered_price&&n.jsxs("div",{className:"mb-2",children:[n.jsx("h3",{className:"text-sm font-bold",children:t("result.offeredPrice")}),n.jsx("p",{className:"text-xs",children:new Intl.NumberFormat(r.language,{style:"currency",currency:e.currency||"USD"}).format(e.offered_price)})]}),e.price_assessment&&n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-bold",children:t("result.priceAssessment")}),n.jsx("p",{className:"text-xs",children:e.price_assessment})]})]}):null}function C({recommendation:e}){const{t}=m.useTranslation(d.TRADE_SAFETY_NS);return e?n.jsx(h,{title:t("result.recommendation"),children:n.jsx("p",{className:"text-xs",children:e})}):null}function D({title:e,titleId:t,...r},s){return c.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?c.createElement("title",{id:t},e):null,c.createElement("path",{fillRule:"evenodd",d:"M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Zm7.007 6.387a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const k=c.forwardRef(D);function F({title:e,titleId:t,...r},s){return c.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?c.createElement("title",{id:t},e):null,c.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75Zm0 8.25a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",clipRule:"evenodd"}))}const H=c.forwardRef(F);function L({title:e,titleId:t,...r},s){return c.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?c.createElement("title",{id:t},e):null,c.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-2.625 6c-.54 0-.828.419-.936.634a1.96 1.96 0 0 0-.189.866c0 .298.059.605.189.866.108.215.395.634.936.634.54 0 .828-.419.936-.634.13-.26.189-.568.189-.866 0-.298-.059-.605-.189-.866-.108-.215-.395-.634-.936-.634Zm4.314.634c.108-.215.395-.634.936-.634.54 0 .828.419.936.634.13.26.189.568.189.866 0 .298-.059.605-.189.866-.108.215-.395.634-.936.634-.54 0-.828-.419-.936-.634a1.96 1.96 0 0 1-.189-.866c0-.298.059-.605.189-.866Zm-4.34 7.964a.75.75 0 0 1-1.061-1.06 5.236 5.236 0 0 1 3.73-1.538 5.236 5.236 0 0 1 3.695 1.538.75.75 0 1 1-1.061 1.06 3.736 3.736 0 0 0-2.639-1.098 3.736 3.736 0 0 0-2.664 1.098Z",clipRule:"evenodd"}))}const M=c.forwardRef(L);function Y({title:e,titleId:t,...r},s){return c.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?c.createElement("title",{id:t},e):null,c.createElement("path",{fillRule:"evenodd",d:"M11.484 2.17a.75.75 0 0 1 1.032 0 11.209 11.209 0 0 0 7.877 3.08.75.75 0 0 1 .722.515 12.74 12.74 0 0 1 .635 3.985c0 5.942-4.064 10.933-9.563 12.348a.749.749 0 0 1-.374 0C6.314 20.683 2.25 15.692 2.25 9.75c0-1.39.223-2.73.635-3.985a.75.75 0 0 1 .722-.516l.143.001c2.996 0 5.718-1.17 7.734-3.08ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75ZM12 15a.75.75 0 0 0-.75.75v.008c0 .414.336.75.75.75h.008a.75.75 0 0 0 .75-.75v-.008a.75.75 0 0 0-.75-.75H12Z",clipRule:"evenodd"}))}const Z=c.forwardRef(Y);function B({items:e}){const{t}=m.useTranslation(d.TRADE_SAFETY_NS);return e.length===0?null:n.jsxs("div",{className:"mb-4",children:[n.jsxs("h2",{className:"flex items-center gap-1 py-4 font-bold",children:[t("result.safetyChecklist")," ",n.jsx(k,{className:"size-6"})]}),n.jsx(h,{variant:"info",children:e.map((r,s)=>n.jsxs("label",{className:"label w-fit cursor-pointer gap-2",children:[n.jsx("input",{type:"checkbox",className:"checkbox rounded-full [--chkbg:theme(colors.neutral)] [--chkfg:theme(colors.neutral-content)]"}),n.jsx("span",{className:"label-text",children:r})]},s))})]})}const I={error:M,warning:H,success:Z},q={error:"result.riskSignals",warning:"result.cautions",success:"result.safeIndicators"};function g({signals:e,variant:t="error"}){const{t:r}=m.useTranslation(d.TRADE_SAFETY_NS);if(e.length===0)return null;const s=I[t];return n.jsxs("div",{className:"mb-4",children:[n.jsxs("h2",{className:"flex items-center gap-1 py-4 font-bold",children:[r(q[t])," ",n.jsx(s,{className:"size-6"})]}),n.jsx("div",{className:"space-y-3",children:e.map((l,i)=>n.jsx(h,{variant:t,children:n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-bold",children:l.title}),n.jsx("p",{className:"text-xs",children:l.description})]}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-bold",children:r("result.whatToDo")}),n.jsx("p",{className:"text-xs",children:l.what_to_do})]})]})},i))})]})}function $({translation:e,nuance:t}){const{t:r}=m.useTranslation(d.TRADE_SAFETY_NS);return n.jsxs(h,{title:r("result.translation"),children:[e&&n.jsxs("div",{className:"mb-2",children:[n.jsx("h3",{className:"text-sm font-bold",children:r("result.translationTitle")}),n.jsx("p",{className:"text-xs",children:e})]}),t&&n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-bold",children:r("result.nuanceTitle")}),n.jsx("p",{className:"text-xs",children:t})]})]})}function W({analysis:e}){return n.jsxs("div",{children:[e.ai_summary&&n.jsx(A,{summary:e.ai_summary}),n.jsxs("div",{className:"my-4 flex flex-col gap-4",children:[(e.translation||e.nuance_explanation)&&n.jsx($,{translation:e.translation,nuance:e.nuance_explanation}),e.price_analysis&&n.jsx(P,{data:e.price_analysis}),e.recommendation&&n.jsx(C,{recommendation:e.recommendation})]}),e.risk_signals.length>0&&n.jsx(g,{signals:e.risk_signals,variant:"error"}),e.cautions.length>0&&n.jsx(g,{signals:e.cautions,variant:"warning"}),e.safe_indicators.length>0&&n.jsx(g,{signals:e.safe_indicators,variant:"success"}),e.safety_checklist.length>0&&n.jsx(B,{items:e.safety_checklist})]})}var S={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},y=u.createContext&&u.createContext(S),K=["attr","size","title"];function U(e,t){if(e==null)return{};var r=V(e,t),s,l;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(l=0;l<i.length;l++)s=i[l],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function V(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 p(){return p=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},p.apply(this,arguments)}function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),r.push.apply(r,s)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?w(Object(r),!0).forEach(function(s){X(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function X(e,t,r){return t=G(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function G(e){var t=J(e,"string");return typeof t=="symbol"?t:t+""}function J(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 z(e){return e&&e.map((t,r)=>u.createElement(t.tag,b({key:r},t.attr),z(t.child)))}function E(e){return t=>u.createElement(Q,p({attr:b({},e.attr)},t),z(e.child))}function Q(e){var t=r=>{var{attr:s,size:l,title:i}=e,x=U(e,K),f=l||r.size||"1em",o;return r.className&&(o=r.className),e.className&&(o=(o?o+" ":"")+e.className),u.createElement("svg",p({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,s,x,{className:o,style:b(b({color:e.color||r.color},r.style),e.style),height:f,width:f,xmlns:"http://www.w3.org/2000/svg"}),i&&u.createElement("title",null,i),e.children)};return y!==void 0?u.createElement(y.Consumer,null,r=>t(r)):t(S)}function ee(e){return E({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 te(e){return E({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 re({value:e,onChange:t,onSubmit:r,isLoading:s,error:l}){const{t:i}=m.useTranslation(d.TRADE_SAFETY_NS),x=s?n.jsx("span",{className:"loading loading-spinner loading-sm"}):i("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:i("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:i("hero.subtitle")}),n.jsxs("div",{className:N("mb-4",!l&&"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:i("hero.placeholder"),"aria-label":i("hero.placeholder"),value:e,onChange:o=>t(o.target.value),disabled:s,onKeyDown:o=>{o.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:x})]}),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:i("hero.placeholder")}),i("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":i("hero.placeholder"),onChange:o=>t(o.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:x})})]})})]}),l&&n.jsx("div",{className:"alert alert-error mb-6 flex items-center gap-2 text-sm",children:n.jsx("span",{children:l})}),n.jsx("p",{className:"mb-4 text-left text-xs text-base-content/60 sm:mb-8 sm:text-center md:mb-12",children:i("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(te,{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(ee,{className:"size-6 text-base-content transition-colors hover:text-base-content/70"})})]})]})})}function ne({level:e,score:t}){const{t:r}=m.useTranslation(d.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 v={safe:70,caution:40},se=e=>e>=v.safe?"safe":e>=v.caution?"caution":"danger",j=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()}),ae=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())}),le=a.z.object({ai_summary:a.z.string(),translation:a.z.string().nullish(),nuance_explanation:a.z.string().nullish(),risk_signals:a.z.array(j),cautions:a.z.array(j),safe_indicators:a.z.array(j),price_analysis:ae,safety_checklist:a.z.array(a.z.string()),safe_score:a.z.number(),recommendation:a.z.string(),emotional_support:a.z.string()}),ie=a.z.object({id:a.z.string(),user_id:a.z.string().nullish(),input_text:a.z.string(),llm_analysis:le,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()}),ce=a.z.enum(["twitter"]),oe=a.z.object({platform:ce,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())}),de=a.z.object({data:oe});class ue extends T.BaseCrudRepository{constructor(){super(...arguments),this.resource="trade-safety"}getDataSchema(){return ie}async fetchPreview(t,r){const s=`${this.apiService.buildUrl(this.resource)}/preview`,l=await this.apiService.request(s,{...r,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t})});return this.validateResponse(l,de).data}}exports.TRADE_SAFETY_NS=d.TRADE_SAFETY_NS;exports.tradeSafetyTranslations=d.tradeSafetyTranslations;exports.DetailedResult=W;exports.HomeHeroSection=re;exports.PageHeader=ne;exports.SAFETY_SCORE_THRESHOLDS=v;exports.TradeSafetyRepository=ue;exports.getSafetyLevel=se;
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;
2
2
  //# sourceMappingURL=index.js.map