randmarcomps 1.209.0 → 1.210.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.
@@ -281,39 +281,39 @@ const createLucideIcon = (e, t) => {
281
281
  * This source code is licensed under the ISC license.
282
282
  * See the LICENSE file in the root directory of this source tree.
283
283
  */
284
- const __iconNode$Z = [
284
+ const __iconNode$_ = [
285
285
  ["path", { d: "M12 5v14", key: "s699le" }],
286
286
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
287
- ], ArrowDown = createLucideIcon("ArrowDown", __iconNode$Z);
287
+ ], ArrowDown = createLucideIcon("ArrowDown", __iconNode$_);
288
288
  /**
289
289
  * @license lucide-react v0.479.0 - ISC
290
290
  *
291
291
  * This source code is licensed under the ISC license.
292
292
  * See the LICENSE file in the root directory of this source tree.
293
293
  */
294
- const __iconNode$Y = [
294
+ const __iconNode$Z = [
295
295
  ["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
296
296
  ["path", { d: "M17 20V4", key: "1ejh1v" }],
297
297
  ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
298
298
  ["path", { d: "M7 4v16", key: "1glfcx" }]
299
- ], ArrowUpDown = createLucideIcon("ArrowUpDown", __iconNode$Y);
299
+ ], ArrowUpDown = createLucideIcon("ArrowUpDown", __iconNode$Z);
300
300
  /**
301
301
  * @license lucide-react v0.479.0 - ISC
302
302
  *
303
303
  * This source code is licensed under the ISC license.
304
304
  * See the LICENSE file in the root directory of this source tree.
305
305
  */
306
- const __iconNode$X = [
306
+ const __iconNode$Y = [
307
307
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
308
308
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
309
- ], ArrowUp = createLucideIcon("ArrowUp", __iconNode$X);
309
+ ], ArrowUp = createLucideIcon("ArrowUp", __iconNode$Y);
310
310
  /**
311
311
  * @license lucide-react v0.479.0 - ISC
312
312
  *
313
313
  * This source code is licensed under the ISC license.
314
314
  * See the LICENSE file in the root directory of this source tree.
315
315
  */
316
- const __iconNode$W = [
316
+ const __iconNode$X = [
317
317
  [
318
318
  "path",
319
319
  {
@@ -322,39 +322,39 @@ const __iconNode$W = [
322
322
  }
323
323
  ],
324
324
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
325
- ], BadgeCheck = createLucideIcon("BadgeCheck", __iconNode$W);
325
+ ], BadgeCheck = createLucideIcon("BadgeCheck", __iconNode$X);
326
326
  /**
327
327
  * @license lucide-react v0.479.0 - ISC
328
328
  *
329
329
  * This source code is licensed under the ISC license.
330
330
  * See the LICENSE file in the root directory of this source tree.
331
331
  */
332
- const __iconNode$V = [
332
+ const __iconNode$W = [
333
333
  ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "2", key: "9lu3g6" }],
334
334
  ["circle", { cx: "12", cy: "12", r: "2", key: "1c9p78" }],
335
335
  ["path", { d: "M6 12h.01M18 12h.01", key: "113zkx" }]
336
- ], Banknote = createLucideIcon("Banknote", __iconNode$V);
336
+ ], Banknote = createLucideIcon("Banknote", __iconNode$W);
337
337
  /**
338
338
  * @license lucide-react v0.479.0 - ISC
339
339
  *
340
340
  * This source code is licensed under the ISC license.
341
341
  * See the LICENSE file in the root directory of this source tree.
342
342
  */
343
- const __iconNode$U = [
343
+ const __iconNode$V = [
344
344
  ["path", { d: "M12 8V4H8", key: "hb8ula" }],
345
345
  ["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
346
346
  ["path", { d: "M2 14h2", key: "vft8re" }],
347
347
  ["path", { d: "M20 14h2", key: "4cs60a" }],
348
348
  ["path", { d: "M15 13v2", key: "1xurst" }],
349
349
  ["path", { d: "M9 13v2", key: "rq6x2g" }]
350
- ], Bot = createLucideIcon("Bot", __iconNode$U);
350
+ ], Bot = createLucideIcon("Bot", __iconNode$V);
351
351
  /**
352
352
  * @license lucide-react v0.479.0 - ISC
353
353
  *
354
354
  * This source code is licensed under the ISC license.
355
355
  * See the LICENSE file in the root directory of this source tree.
356
356
  */
357
- const __iconNode$T = [
357
+ const __iconNode$U = [
358
358
  ["path", { d: "M8 2v4", key: "1cmpym" }],
359
359
  ["path", { d: "M16 2v4", key: "4m81vk" }],
360
360
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
@@ -365,14 +365,14 @@ const __iconNode$T = [
365
365
  ["path", { d: "M8 18h.01", key: "lrp35t" }],
366
366
  ["path", { d: "M12 18h.01", key: "mhygvu" }],
367
367
  ["path", { d: "M16 18h.01", key: "kzsmim" }]
368
- ], CalendarDays = createLucideIcon("CalendarDays", __iconNode$T);
368
+ ], CalendarDays = createLucideIcon("CalendarDays", __iconNode$U);
369
369
  /**
370
370
  * @license lucide-react v0.479.0 - ISC
371
371
  *
372
372
  * This source code is licensed under the ISC license.
373
373
  * See the LICENSE file in the root directory of this source tree.
374
374
  */
375
- const __iconNode$S = [
375
+ const __iconNode$T = [
376
376
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
377
377
  ["path", { d: "M16 2v4", key: "4m81vk" }],
378
378
  ["path", { d: "M3 10h18", key: "8toen8" }],
@@ -381,123 +381,123 @@ const __iconNode$S = [
381
381
  ["path", { d: "M13 18H7", key: "bb0bb7" }],
382
382
  ["path", { d: "M7 14h.01", key: "1qa3f1" }],
383
383
  ["path", { d: "M17 18h.01", key: "1bdyru" }]
384
- ], CalendarRange = createLucideIcon("CalendarRange", __iconNode$S);
384
+ ], CalendarRange = createLucideIcon("CalendarRange", __iconNode$T);
385
385
  /**
386
386
  * @license lucide-react v0.479.0 - ISC
387
387
  *
388
388
  * This source code is licensed under the ISC license.
389
389
  * See the LICENSE file in the root directory of this source tree.
390
390
  */
391
- const __iconNode$R = [
391
+ const __iconNode$S = [
392
392
  ["path", { d: "M8 2v4", key: "1cmpym" }],
393
393
  ["path", { d: "M16 2v4", key: "4m81vk" }],
394
394
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
395
395
  ["path", { d: "M3 10h18", key: "8toen8" }]
396
- ], Calendar = createLucideIcon("Calendar", __iconNode$R);
396
+ ], Calendar = createLucideIcon("Calendar", __iconNode$S);
397
397
  /**
398
398
  * @license lucide-react v0.479.0 - ISC
399
399
  *
400
400
  * This source code is licensed under the ISC license.
401
401
  * See the LICENSE file in the root directory of this source tree.
402
402
  */
403
- const __iconNode$Q = [
403
+ const __iconNode$R = [
404
404
  ["line", { x1: "12", x2: "12", y1: "20", y2: "10", key: "1vz5eb" }],
405
405
  ["line", { x1: "18", x2: "18", y1: "20", y2: "4", key: "cun8e5" }],
406
406
  ["line", { x1: "6", x2: "6", y1: "20", y2: "16", key: "hq0ia6" }]
407
- ], ChartNoAxesColumnIncreasing = createLucideIcon("ChartNoAxesColumnIncreasing", __iconNode$Q);
407
+ ], ChartNoAxesColumnIncreasing = createLucideIcon("ChartNoAxesColumnIncreasing", __iconNode$R);
408
408
  /**
409
409
  * @license lucide-react v0.479.0 - ISC
410
410
  *
411
411
  * This source code is licensed under the ISC license.
412
412
  * See the LICENSE file in the root directory of this source tree.
413
413
  */
414
- const __iconNode$P = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Check = createLucideIcon("Check", __iconNode$P);
414
+ const __iconNode$Q = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Check = createLucideIcon("Check", __iconNode$Q);
415
415
  /**
416
416
  * @license lucide-react v0.479.0 - ISC
417
417
  *
418
418
  * This source code is licensed under the ISC license.
419
419
  * See the LICENSE file in the root directory of this source tree.
420
420
  */
421
- const __iconNode$O = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], ChevronDown = createLucideIcon("ChevronDown", __iconNode$O);
421
+ const __iconNode$P = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], ChevronDown = createLucideIcon("ChevronDown", __iconNode$P);
422
422
  /**
423
423
  * @license lucide-react v0.479.0 - ISC
424
424
  *
425
425
  * This source code is licensed under the ISC license.
426
426
  * See the LICENSE file in the root directory of this source tree.
427
427
  */
428
- const __iconNode$N = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], ChevronLeft = createLucideIcon("ChevronLeft", __iconNode$N);
428
+ const __iconNode$O = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], ChevronLeft = createLucideIcon("ChevronLeft", __iconNode$O);
429
429
  /**
430
430
  * @license lucide-react v0.479.0 - ISC
431
431
  *
432
432
  * This source code is licensed under the ISC license.
433
433
  * See the LICENSE file in the root directory of this source tree.
434
434
  */
435
- const __iconNode$M = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], ChevronRight = createLucideIcon("ChevronRight", __iconNode$M);
435
+ const __iconNode$N = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], ChevronRight = createLucideIcon("ChevronRight", __iconNode$N);
436
436
  /**
437
437
  * @license lucide-react v0.479.0 - ISC
438
438
  *
439
439
  * This source code is licensed under the ISC license.
440
440
  * See the LICENSE file in the root directory of this source tree.
441
441
  */
442
- const __iconNode$L = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], ChevronUp = createLucideIcon("ChevronUp", __iconNode$L);
442
+ const __iconNode$M = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], ChevronUp = createLucideIcon("ChevronUp", __iconNode$M);
443
443
  /**
444
444
  * @license lucide-react v0.479.0 - ISC
445
445
  *
446
446
  * This source code is licensed under the ISC license.
447
447
  * See the LICENSE file in the root directory of this source tree.
448
448
  */
449
- const __iconNode$K = [
449
+ const __iconNode$L = [
450
450
  ["path", { d: "m11 17-5-5 5-5", key: "13zhaf" }],
451
451
  ["path", { d: "m18 17-5-5 5-5", key: "h8a8et" }]
452
- ], ChevronsLeft = createLucideIcon("ChevronsLeft", __iconNode$K);
452
+ ], ChevronsLeft = createLucideIcon("ChevronsLeft", __iconNode$L);
453
453
  /**
454
454
  * @license lucide-react v0.479.0 - ISC
455
455
  *
456
456
  * This source code is licensed under the ISC license.
457
457
  * See the LICENSE file in the root directory of this source tree.
458
458
  */
459
- const __iconNode$J = [
459
+ const __iconNode$K = [
460
460
  ["path", { d: "m6 17 5-5-5-5", key: "xnjwq" }],
461
461
  ["path", { d: "m13 17 5-5-5-5", key: "17xmmf" }]
462
- ], ChevronsRight = createLucideIcon("ChevronsRight", __iconNode$J);
462
+ ], ChevronsRight = createLucideIcon("ChevronsRight", __iconNode$K);
463
463
  /**
464
464
  * @license lucide-react v0.479.0 - ISC
465
465
  *
466
466
  * This source code is licensed under the ISC license.
467
467
  * See the LICENSE file in the root directory of this source tree.
468
468
  */
469
- const __iconNode$I = [
469
+ const __iconNode$J = [
470
470
  ["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
471
471
  ["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
472
- ], ChevronsUpDown = createLucideIcon("ChevronsUpDown", __iconNode$I);
472
+ ], ChevronsUpDown = createLucideIcon("ChevronsUpDown", __iconNode$J);
473
473
  /**
474
474
  * @license lucide-react v0.479.0 - ISC
475
475
  *
476
476
  * This source code is licensed under the ISC license.
477
477
  * See the LICENSE file in the root directory of this source tree.
478
478
  */
479
- const __iconNode$H = [
479
+ const __iconNode$I = [
480
480
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
481
481
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
482
482
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
483
- ], CircleAlert = createLucideIcon("CircleAlert", __iconNode$H);
483
+ ], CircleAlert = createLucideIcon("CircleAlert", __iconNode$I);
484
484
  /**
485
485
  * @license lucide-react v0.479.0 - ISC
486
486
  *
487
487
  * This source code is licensed under the ISC license.
488
488
  * See the LICENSE file in the root directory of this source tree.
489
489
  */
490
- const __iconNode$G = [
490
+ const __iconNode$H = [
491
491
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
492
492
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
493
- ], CircleCheck = createLucideIcon("CircleCheck", __iconNode$G);
493
+ ], CircleCheck = createLucideIcon("CircleCheck", __iconNode$H);
494
494
  /**
495
495
  * @license lucide-react v0.479.0 - ISC
496
496
  *
497
497
  * This source code is licensed under the ISC license.
498
498
  * See the LICENSE file in the root directory of this source tree.
499
499
  */
500
- const __iconNode$F = [
500
+ const __iconNode$G = [
501
501
  ["path", { d: "M10.1 2.182a10 10 0 0 1 3.8 0", key: "5ilxe3" }],
502
502
  ["path", { d: "M13.9 21.818a10 10 0 0 1-3.8 0", key: "11zvb9" }],
503
503
  ["path", { d: "M17.609 3.721a10 10 0 0 1 2.69 2.7", key: "1iw5b2" }],
@@ -506,73 +506,73 @@ const __iconNode$F = [
506
506
  ["path", { d: "M21.818 10.1a10 10 0 0 1 0 3.8", key: "qkgqxc" }],
507
507
  ["path", { d: "M3.721 6.391a10 10 0 0 1 2.7-2.69", key: "1mcia2" }],
508
508
  ["path", { d: "M6.391 20.279a10 10 0 0 1-2.69-2.7", key: "1fvljs" }]
509
- ], CircleDashed = createLucideIcon("CircleDashed", __iconNode$F);
509
+ ], CircleDashed = createLucideIcon("CircleDashed", __iconNode$G);
510
510
  /**
511
511
  * @license lucide-react v0.479.0 - ISC
512
512
  *
513
513
  * This source code is licensed under the ISC license.
514
514
  * See the LICENSE file in the root directory of this source tree.
515
515
  */
516
- const __iconNode$E = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], Circle = createLucideIcon("Circle", __iconNode$E);
516
+ const __iconNode$F = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], Circle = createLucideIcon("Circle", __iconNode$F);
517
517
  /**
518
518
  * @license lucide-react v0.479.0 - ISC
519
519
  *
520
520
  * This source code is licensed under the ISC license.
521
521
  * See the LICENSE file in the root directory of this source tree.
522
522
  */
523
- const __iconNode$D = [
523
+ const __iconNode$E = [
524
524
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
525
525
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
526
- ], Copy = createLucideIcon("Copy", __iconNode$D);
526
+ ], Copy = createLucideIcon("Copy", __iconNode$E);
527
527
  /**
528
528
  * @license lucide-react v0.479.0 - ISC
529
529
  *
530
530
  * This source code is licensed under the ISC license.
531
531
  * See the LICENSE file in the root directory of this source tree.
532
532
  */
533
- const __iconNode$C = [
533
+ const __iconNode$D = [
534
534
  ["rect", { width: "20", height: "14", x: "2", y: "5", rx: "2", key: "ynyp8z" }],
535
535
  ["line", { x1: "2", x2: "22", y1: "10", y2: "10", key: "1b3vmo" }]
536
- ], CreditCard = createLucideIcon("CreditCard", __iconNode$C);
536
+ ], CreditCard = createLucideIcon("CreditCard", __iconNode$D);
537
537
  /**
538
538
  * @license lucide-react v0.479.0 - ISC
539
539
  *
540
540
  * This source code is licensed under the ISC license.
541
541
  * See the LICENSE file in the root directory of this source tree.
542
542
  */
543
- const __iconNode$B = [
543
+ const __iconNode$C = [
544
544
  ["line", { x1: "12", x2: "12", y1: "2", y2: "22", key: "7eqyqh" }],
545
545
  ["path", { d: "M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6", key: "1b0p4s" }]
546
- ], DollarSign = createLucideIcon("DollarSign", __iconNode$B);
546
+ ], DollarSign = createLucideIcon("DollarSign", __iconNode$C);
547
547
  /**
548
548
  * @license lucide-react v0.479.0 - ISC
549
549
  *
550
550
  * This source code is licensed under the ISC license.
551
551
  * See the LICENSE file in the root directory of this source tree.
552
552
  */
553
- const __iconNode$A = [
553
+ const __iconNode$B = [
554
554
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
555
555
  ["polyline", { points: "7 10 12 15 17 10", key: "2ggqvy" }],
556
556
  ["line", { x1: "12", x2: "12", y1: "15", y2: "3", key: "1vk2je" }]
557
- ], Download = createLucideIcon("Download", __iconNode$A);
557
+ ], Download = createLucideIcon("Download", __iconNode$B);
558
558
  /**
559
559
  * @license lucide-react v0.479.0 - ISC
560
560
  *
561
561
  * This source code is licensed under the ISC license.
562
562
  * See the LICENSE file in the root directory of this source tree.
563
563
  */
564
- const __iconNode$z = [
564
+ const __iconNode$A = [
565
565
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
566
566
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
567
567
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
568
- ], ExternalLink = createLucideIcon("ExternalLink", __iconNode$z);
568
+ ], ExternalLink = createLucideIcon("ExternalLink", __iconNode$A);
569
569
  /**
570
570
  * @license lucide-react v0.479.0 - ISC
571
571
  *
572
572
  * This source code is licensed under the ISC license.
573
573
  * See the LICENSE file in the root directory of this source tree.
574
574
  */
575
- const __iconNode$y = [
575
+ const __iconNode$z = [
576
576
  [
577
577
  "path",
578
578
  {
@@ -581,34 +581,34 @@ const __iconNode$y = [
581
581
  }
582
582
  ],
583
583
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
584
- ], Eye = createLucideIcon("Eye", __iconNode$y);
584
+ ], Eye = createLucideIcon("Eye", __iconNode$z);
585
585
  /**
586
586
  * @license lucide-react v0.479.0 - ISC
587
587
  *
588
588
  * This source code is licensed under the ISC license.
589
589
  * See the LICENSE file in the root directory of this source tree.
590
590
  */
591
- const __iconNode$x = [
591
+ const __iconNode$y = [
592
592
  ["polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3", key: "1yg77f" }]
593
- ], Filter = createLucideIcon("Filter", __iconNode$x);
593
+ ], Filter = createLucideIcon("Filter", __iconNode$y);
594
594
  /**
595
595
  * @license lucide-react v0.479.0 - ISC
596
596
  *
597
597
  * This source code is licensed under the ISC license.
598
598
  * See the LICENSE file in the root directory of this source tree.
599
599
  */
600
- const __iconNode$w = [
600
+ const __iconNode$x = [
601
601
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
602
602
  ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
603
603
  ["path", { d: "M2 12h20", key: "9i4pu4" }]
604
- ], Globe = createLucideIcon("Globe", __iconNode$w);
604
+ ], Globe = createLucideIcon("Globe", __iconNode$x);
605
605
  /**
606
606
  * @license lucide-react v0.479.0 - ISC
607
607
  *
608
608
  * This source code is licensed under the ISC license.
609
609
  * See the LICENSE file in the root directory of this source tree.
610
610
  */
611
- const __iconNode$v = [
611
+ const __iconNode$w = [
612
612
  ["path", { d: "m11 17 2 2a1 1 0 1 0 3-3", key: "efffak" }],
613
613
  [
614
614
  "path",
@@ -620,19 +620,30 @@ const __iconNode$v = [
620
620
  ["path", { d: "m21 3 1 11h-2", key: "1tisrp" }],
621
621
  ["path", { d: "M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3", key: "1uvwmv" }],
622
622
  ["path", { d: "M3 4h8", key: "1ep09j" }]
623
- ], Handshake = createLucideIcon("Handshake", __iconNode$v);
623
+ ], Handshake = createLucideIcon("Handshake", __iconNode$w);
624
624
  /**
625
625
  * @license lucide-react v0.479.0 - ISC
626
626
  *
627
627
  * This source code is licensed under the ISC license.
628
628
  * See the LICENSE file in the root directory of this source tree.
629
629
  */
630
- const __iconNode$u = [
630
+ const __iconNode$v = [
631
631
  ["path", { d: "M10 10V5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v5", key: "1p9q5i" }],
632
632
  ["path", { d: "M14 6a6 6 0 0 1 6 6v3", key: "1hnv84" }],
633
633
  ["path", { d: "M4 15v-3a6 6 0 0 1 6-6", key: "9ciidu" }],
634
634
  ["rect", { x: "2", y: "15", width: "20", height: "4", rx: "1", key: "g3x8cw" }]
635
- ], HardHat = createLucideIcon("HardHat", __iconNode$u);
635
+ ], HardHat = createLucideIcon("HardHat", __iconNode$v);
636
+ /**
637
+ * @license lucide-react v0.479.0 - ISC
638
+ *
639
+ * This source code is licensed under the ISC license.
640
+ * See the LICENSE file in the root directory of this source tree.
641
+ */
642
+ const __iconNode$u = [
643
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
644
+ ["path", { d: "M12 16v-4", key: "1dtifu" }],
645
+ ["path", { d: "M12 8h.01", key: "e9boi3" }]
646
+ ], Info = createLucideIcon("Info", __iconNode$u);
636
647
  /**
637
648
  * @license lucide-react v0.479.0 - ISC
638
649
  *
@@ -66818,7 +66829,23 @@ function useRouterNavigationGuard(e) {
66818
66829
  NavigationGuardDialog: f
66819
66830
  };
66820
66831
  }
66821
- const Opportunities = ({
66832
+ function getEndDateStatus(e) {
66833
+ if (!e) return { text: "No End Date", variant: "neutral", daysRemaining: null };
66834
+ const t = new Date(e);
66835
+ if (isNaN(t.getTime()))
66836
+ return { text: "Invalid Date", variant: "neutral", daysRemaining: null };
66837
+ const n = /* @__PURE__ */ new Date(), o = new Date(t.getFullYear(), t.getMonth(), t.getDate()), l = new Date(n.getFullYear(), n.getMonth(), n.getDate()), d = o.getTime() - l.getTime(), f = Math.ceil(d / (1e3 * 60 * 60 * 24));
66838
+ return f < 0 ? { text: `Ended ${Math.abs(f)}d ago`, variant: "destructive", daysRemaining: f } : f === 0 ? { text: "Ends today", variant: "destructive", daysRemaining: f } : f <= 7 ? { text: `Ends in ${f}d`, variant: "destructive", daysRemaining: f } : f <= 30 ? { text: `Ends in ${f}d`, variant: "warning", daysRemaining: f } : { text: `Ends in ${f}d`, variant: "neutral", daysRemaining: f };
66839
+ }
66840
+ const formatDate = (e) => {
66841
+ if (!e) return "N/A";
66842
+ try {
66843
+ const t = new Date(e);
66844
+ return isNaN(t.getTime()) ? "Invalid Date" : t.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
66845
+ } catch {
66846
+ return "Invalid Date";
66847
+ }
66848
+ }, Opportunities = ({
66822
66849
  applicationId: e,
66823
66850
  opportunities: t = null,
66824
66851
  loading: n = !1
@@ -66842,13 +66869,11 @@ const Opportunities = ({
66842
66869
  routeResellerId: e,
66843
66870
  manufacturerId: te.ManufacturerId ?? "",
66844
66871
  opportunityNumber: ae
66845
- // API expects opportunityNumber here
66846
66872
  }).unwrap().then(() => {
66847
66873
  o({
66848
66874
  title: "Success",
66849
66875
  description: `Opportunity "${te.OpportunityName || te.Opportunity || ae}" was successfully set as default.`,
66850
66876
  variant: "success"
66851
- // Assuming "success" variant is configured
66852
66877
  });
66853
66878
  }).catch((ie) => {
66854
66879
  var se;
@@ -66900,24 +66925,9 @@ const Opportunities = ({
66900
66925
  }, [S, b, e, I, o, E, g]), q = useMemo(
66901
66926
  () => [
66902
66927
  {
66903
- accessorKey: "Active",
66904
- header: "Status",
66905
- cell: ({ row: te }) => te.original.Active === !0 ? /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "border-green-500 bg-green-100 text-green-700 dark:border-green-600 dark:bg-green-900/50 dark:text-green-400 font-medium", children: "Active" }) : /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400 font-medium", children: "Inactive" }),
66906
- enableSorting: !0,
66907
- enableFiltering: !0
66908
- },
66909
- {
66910
- /* ... (other columns: ManufacturerId, BidNumber, opportunityDisplay, StartDate, EndDate, LastUpdate remain the same) ... */
66911
66928
  accessorKey: "ManufacturerId",
66912
- header: "Manufacturer ID",
66913
- cell: ({ row: te }) => te.original.ManufacturerId ?? "N/A",
66914
- enableSorting: !0,
66915
- enableFiltering: !0
66916
- },
66917
- {
66918
- accessorKey: "BidNumber",
66919
- header: "Bid Number",
66920
- cell: ({ row: te }) => te.original.BidNumber ?? "N/A",
66929
+ header: "Manuf. ID",
66930
+ cell: ({ row: te }) => /* @__PURE__ */ jsx("div", { className: "w-20 truncate", children: te.original.ManufacturerId ?? "N/A" }),
66921
66931
  enableSorting: !0,
66922
66932
  enableFiltering: !0
66923
66933
  },
@@ -66925,29 +66935,48 @@ const Opportunities = ({
66925
66935
  id: "opportunityDisplay",
66926
66936
  accessorFn: (te) => te.OpportunityName || te.Opportunity,
66927
66937
  header: "Opportunity",
66928
- cell: ({ getValue: te }) => te() ?? "N/A",
66938
+ cell: ({ getValue: te }) => /* @__PURE__ */ jsx("div", { className: "min-w-[150px]", children: te() ?? "N/A" }),
66929
66939
  enableSorting: !0,
66930
66940
  enableFiltering: !0
66931
66941
  },
66932
66942
  {
66933
- accessorKey: "StartDate",
66934
- header: "Start Date",
66935
- cell: ({ row: te }) => te.original.StartDate ? new Date(te.original.StartDate).toLocaleDateString() : "N/A",
66936
- enableSorting: !0,
66937
- enableFiltering: !1
66938
- },
66939
- {
66940
- accessorKey: "EndDate",
66941
- header: "End Date",
66942
- cell: ({ row: te }) => te.original.EndDate ? new Date(te.original.EndDate).toLocaleDateString() : "N/A",
66943
+ accessorKey: "BidNumber",
66944
+ header: "Bid Number",
66945
+ cell: ({ row: te }) => te.original.BidNumber ?? "N/A",
66943
66946
  enableSorting: !0,
66944
- enableFiltering: !1
66947
+ enableFiltering: !0
66945
66948
  },
66946
66949
  {
66947
- accessorKey: "LastUpdate",
66948
- header: "Last Update",
66949
- cell: ({ row: te }) => te.original.LastUpdate ? new Date(te.original.LastUpdate).toLocaleDateString() : "N/A",
66950
- enableSorting: !0,
66950
+ id: "statusInfo",
66951
+ header: "Status",
66952
+ cell: ({ row: te }) => {
66953
+ const ae = te.original, ie = ae.Active === !0, se = getEndDateStatus(ae.EndDate);
66954
+ let oe = "border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400";
66955
+ return se.variant === "destructive" ? oe = "border-red-500 bg-red-100 text-red-700 dark:border-red-600 dark:bg-red-900/50 dark:text-red-400" : se.variant === "warning" && (oe = "border-yellow-500 bg-yellow-100 text-yellow-700 dark:border-yellow-600 dark:bg-yellow-900/50 dark:text-yellow-400"), /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 min-w-[200px]", children: [
66956
+ /* @__PURE__ */ jsx(Badge, { variant: "outline", className: ie ? "border-green-500 bg-green-100 text-green-700 dark:border-green-600 dark:bg-green-900/50 dark:text-green-400 font-medium" : "border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400 font-medium", children: ie ? "Active" : "Inactive" }),
66957
+ ae.EndDate && /* @__PURE__ */ jsx(Badge, { variant: "outline", className: `${oe} font-medium`, children: se.text }),
66958
+ /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 100, children: /* @__PURE__ */ jsxs(Tooltip$1, { children: [
66959
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", className: "h-6 w-6 p-0 data-[state=delayed-open]:bg-accent data-[state=instant-open]:bg-accent", children: /* @__PURE__ */ jsx(Info, { className: "h-4 w-4 text-muted-foreground" }) }) }),
66960
+ /* @__PURE__ */ jsx(TooltipContent, { side: "top", align: "center", className: "bg-popover text-popover-foreground p-2 rounded shadow-lg", children: /* @__PURE__ */ jsxs("div", { className: "text-sm space-y-1", children: [
66961
+ /* @__PURE__ */ jsxs("p", { children: [
66962
+ /* @__PURE__ */ jsx("strong", { children: "Start:" }),
66963
+ " ",
66964
+ formatDate(ae.StartDate)
66965
+ ] }),
66966
+ /* @__PURE__ */ jsxs("p", { children: [
66967
+ /* @__PURE__ */ jsx("strong", { children: "End:" }),
66968
+ " ",
66969
+ formatDate(ae.EndDate)
66970
+ ] }),
66971
+ /* @__PURE__ */ jsxs("p", { children: [
66972
+ /* @__PURE__ */ jsx("strong", { children: "Updated:" }),
66973
+ " ",
66974
+ formatDate(ae.LastUpdate)
66975
+ ] })
66976
+ ] }) })
66977
+ ] }) })
66978
+ ] });
66979
+ },
66951
66980
  enableFiltering: !1
66952
66981
  },
66953
66982
  {
@@ -66960,65 +66989,39 @@ const Opportunities = ({
66960
66989
  return /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "Actions unavailable" });
66961
66990
  const ie = ae.BidNumber, se = (Ne = l[ie]) == null ? void 0 : Ne.isSettingDefault, oe = (S == null ? void 0 : S.BidNumber) === ie && ((Ve = l[ie]) == null ? void 0 : Ve.isSendingReport), ge = se || oe, Ae = ae.CanBeSetAsDefault === !0;
66962
66991
  return /* @__PURE__ */ jsxs("div", { className: "flex space-x-2", children: [
66963
- /* @__PURE__ */ jsxs(
66964
- Button,
66965
- {
66966
- variant: "outline",
66967
- size: "sm",
66968
- onClick: () => M(ae),
66969
- disabled: ge || !Ae,
66970
- title: Ae ? "Set as default" : "This opportunity cannot be set as default",
66971
- className: "flex items-center",
66972
- children: [
66973
- se ? /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Star, { className: "mr-2 h-4 w-4" }),
66974
- "Set Default"
66975
- ]
66976
- }
66977
- ),
66978
- /* @__PURE__ */ jsxs(
66979
- Button,
66980
- {
66981
- variant: "outline",
66982
- size: "sm",
66983
- onClick: () => A(ae),
66984
- disabled: ge,
66985
- title: "Send report by email",
66986
- className: "flex items-center",
66987
- children: [
66988
- oe ? (
66989
- // Show spinner on row button if dialog is processing for this row
66990
- /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" })
66991
- ) : /* @__PURE__ */ jsx(Send, { className: "mr-2 h-4 w-4" }),
66992
- "Send Report"
66993
- ]
66994
- }
66995
- )
66992
+ /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: () => M(ae), disabled: ge || !Ae, title: Ae ? "Set as default" : "This opportunity cannot be set as default", className: "flex items-center", children: [
66993
+ se ? /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Star, { className: "mr-2 h-4 w-4" }),
66994
+ " Set Default"
66995
+ ] }),
66996
+ /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: () => A(ae), disabled: ge, title: "Send report by email", className: "flex items-center", children: [
66997
+ oe ? /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Send, { className: "mr-2 h-4 w-4" }),
66998
+ " Send Report"
66999
+ ] })
66996
67000
  ] });
66997
67001
  }
66998
67002
  }
66999
67003
  ],
67000
67004
  [l, M, A, S]
67001
- // Added selectedOpportunityForEmail for isLoadingSendReportForThisRow logic
67002
67005
  ), z = useMemo(() => {
67003
67006
  const te = {};
67004
67007
  if (t) {
67005
67008
  const ae = Array.from(
67006
- new Set(t.map((oe) => oe.ManufacturerId).filter((oe) => oe != null))
67009
+ new Set(t.map((se) => se.ManufacturerId).filter((se) => se != null))
67007
67010
  );
67008
67011
  te.ManufacturerId = ae;
67009
67012
  const ie = Array.from(
67010
- new Set(t.map((oe) => oe.Active ? "Active" : "Inactive"))
67011
- );
67012
- te.Active = ie;
67013
- const se = Array.from(
67014
- new Set(t.map((oe) => oe.OpportunityName || oe.Opportunity).filter((oe) => oe != null))
67013
+ new Set(t.map((se) => se.OpportunityName || se.Opportunity).filter((se) => se != null))
67015
67014
  );
67016
- te.opportunityDisplay = se;
67015
+ te.opportunityDisplay = ie;
67017
67016
  }
67018
67017
  return te;
67019
67018
  }, [t]), Q = t || [], F = S != null && S.BidNumber ? (j = l[S.BidNumber]) == null ? void 0 : j.isSendingReport : !1;
67020
67019
  return n ? /* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
67021
- /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-48" }) }),
67020
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
67021
+ " ",
67022
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-48" }),
67023
+ " "
67024
+ ] }),
67022
67025
  /* @__PURE__ */ jsxs(CardContent, { className: "space-y-4", children: [
67023
67026
  /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full rounded-md border" }),
67024
67027
  /* @__PURE__ */ jsx(Skeleton, { className: "h-48 w-full rounded-md border" }),
@@ -67026,15 +67029,22 @@ const Opportunities = ({
67026
67029
  /* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-[130px]" }),
67027
67030
  /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
67028
67031
  /* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-20" }),
67032
+ " ",
67029
67033
  /* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-24" }),
67034
+ " ",
67030
67035
  /* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-9" }),
67036
+ " ",
67031
67037
  /* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-9" })
67032
67038
  ] })
67033
67039
  ] })
67034
67040
  ] })
67035
67041
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
67036
67042
  /* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
67037
- /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { className: "text-1xl font-bold", children: "Opportunities" }) }),
67043
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
67044
+ " ",
67045
+ /* @__PURE__ */ jsx(CardTitle, { className: "text-1xl font-bold", children: "Opportunities" }),
67046
+ " "
67047
+ ] }),
67038
67048
  /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(DataTable, { columns: q, data: Q, uniqueValues: z }) })
67039
67049
  ] }),
67040
67050
  /* @__PURE__ */ jsx(Dialog, { open: f, onOpenChange: (te) => {
@@ -67054,24 +67064,13 @@ const Opportunities = ({
67054
67064
  ] }),
67055
67065
  /* @__PURE__ */ jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-4 items-center gap-4", children: [
67056
67066
  /* @__PURE__ */ jsx(Label$2, { htmlFor: "email", className: "text-right", children: "Email" }),
67057
- /* @__PURE__ */ jsx(
67058
- Input,
67059
- {
67060
- id: "email",
67061
- type: "email",
67062
- value: b,
67063
- onChange: (te) => _(te.target.value),
67064
- placeholder: "recipient@example.com",
67065
- className: "col-span-3",
67066
- disabled: F
67067
- }
67068
- )
67067
+ /* @__PURE__ */ jsx(Input, { id: "email", type: "email", value: b, onChange: (te) => _(te.target.value), placeholder: "recipient@example.com", className: "col-span-3", disabled: F })
67069
67068
  ] }) }),
67070
67069
  /* @__PURE__ */ jsxs(DialogFooter, { children: [
67071
67070
  /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: () => g(!1), disabled: F, children: "Cancel" }),
67072
67071
  /* @__PURE__ */ jsxs(Button, { type: "submit", onClick: V, disabled: F, children: [
67073
67072
  F && /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }),
67074
- "Send Report"
67073
+ " Send Report"
67075
67074
  ] })
67076
67075
  ] })
67077
67076
  ] }) })
@@ -42,162 +42,167 @@
42
42
  *
43
43
  * This source code is licensed under the ISC license.
44
44
  * See the LICENSE file in the root directory of this source tree.
45
- */const __iconNode$Z=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ArrowDown=createLucideIcon("ArrowDown",__iconNode$Z);/**
45
+ */const __iconNode$_=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ArrowDown=createLucideIcon("ArrowDown",__iconNode$_);/**
46
46
  * @license lucide-react v0.479.0 - ISC
47
47
  *
48
48
  * This source code is licensed under the ISC license.
49
49
  * See the LICENSE file in the root directory of this source tree.
50
- */const __iconNode$Y=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],ArrowUpDown=createLucideIcon("ArrowUpDown",__iconNode$Y);/**
50
+ */const __iconNode$Z=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],ArrowUpDown=createLucideIcon("ArrowUpDown",__iconNode$Z);/**
51
51
  * @license lucide-react v0.479.0 - ISC
52
52
  *
53
53
  * This source code is licensed under the ISC license.
54
54
  * See the LICENSE file in the root directory of this source tree.
55
- */const __iconNode$X=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ArrowUp=createLucideIcon("ArrowUp",__iconNode$X);/**
55
+ */const __iconNode$Y=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ArrowUp=createLucideIcon("ArrowUp",__iconNode$Y);/**
56
56
  * @license lucide-react v0.479.0 - ISC
57
57
  *
58
58
  * This source code is licensed under the ISC license.
59
59
  * See the LICENSE file in the root directory of this source tree.
60
- */const __iconNode$W=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],BadgeCheck=createLucideIcon("BadgeCheck",__iconNode$W);/**
60
+ */const __iconNode$X=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],BadgeCheck=createLucideIcon("BadgeCheck",__iconNode$X);/**
61
61
  * @license lucide-react v0.479.0 - ISC
62
62
  *
63
63
  * This source code is licensed under the ISC license.
64
64
  * See the LICENSE file in the root directory of this source tree.
65
- */const __iconNode$V=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]],Banknote=createLucideIcon("Banknote",__iconNode$V);/**
65
+ */const __iconNode$W=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]],Banknote=createLucideIcon("Banknote",__iconNode$W);/**
66
66
  * @license lucide-react v0.479.0 - ISC
67
67
  *
68
68
  * This source code is licensed under the ISC license.
69
69
  * See the LICENSE file in the root directory of this source tree.
70
- */const __iconNode$U=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Bot=createLucideIcon("Bot",__iconNode$U);/**
70
+ */const __iconNode$V=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Bot=createLucideIcon("Bot",__iconNode$V);/**
71
71
  * @license lucide-react v0.479.0 - ISC
72
72
  *
73
73
  * This source code is licensed under the ISC license.
74
74
  * See the LICENSE file in the root directory of this source tree.
75
- */const __iconNode$T=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],CalendarDays=createLucideIcon("CalendarDays",__iconNode$T);/**
75
+ */const __iconNode$U=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],CalendarDays=createLucideIcon("CalendarDays",__iconNode$U);/**
76
76
  * @license lucide-react v0.479.0 - ISC
77
77
  *
78
78
  * This source code is licensed under the ISC license.
79
79
  * See the LICENSE file in the root directory of this source tree.
80
- */const __iconNode$S=[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]],CalendarRange=createLucideIcon("CalendarRange",__iconNode$S);/**
80
+ */const __iconNode$T=[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]],CalendarRange=createLucideIcon("CalendarRange",__iconNode$T);/**
81
81
  * @license lucide-react v0.479.0 - ISC
82
82
  *
83
83
  * This source code is licensed under the ISC license.
84
84
  * See the LICENSE file in the root directory of this source tree.
85
- */const __iconNode$R=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Calendar=createLucideIcon("Calendar",__iconNode$R);/**
85
+ */const __iconNode$S=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Calendar=createLucideIcon("Calendar",__iconNode$S);/**
86
86
  * @license lucide-react v0.479.0 - ISC
87
87
  *
88
88
  * This source code is licensed under the ISC license.
89
89
  * See the LICENSE file in the root directory of this source tree.
90
- */const __iconNode$Q=[["line",{x1:"12",x2:"12",y1:"20",y2:"10",key:"1vz5eb"}],["line",{x1:"18",x2:"18",y1:"20",y2:"4",key:"cun8e5"}],["line",{x1:"6",x2:"6",y1:"20",y2:"16",key:"hq0ia6"}]],ChartNoAxesColumnIncreasing=createLucideIcon("ChartNoAxesColumnIncreasing",__iconNode$Q);/**
90
+ */const __iconNode$R=[["line",{x1:"12",x2:"12",y1:"20",y2:"10",key:"1vz5eb"}],["line",{x1:"18",x2:"18",y1:"20",y2:"4",key:"cun8e5"}],["line",{x1:"6",x2:"6",y1:"20",y2:"16",key:"hq0ia6"}]],ChartNoAxesColumnIncreasing=createLucideIcon("ChartNoAxesColumnIncreasing",__iconNode$R);/**
91
91
  * @license lucide-react v0.479.0 - ISC
92
92
  *
93
93
  * This source code is licensed under the ISC license.
94
94
  * See the LICENSE file in the root directory of this source tree.
95
- */const __iconNode$P=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Check=createLucideIcon("Check",__iconNode$P);/**
95
+ */const __iconNode$Q=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Check=createLucideIcon("Check",__iconNode$Q);/**
96
96
  * @license lucide-react v0.479.0 - ISC
97
97
  *
98
98
  * This source code is licensed under the ISC license.
99
99
  * See the LICENSE file in the root directory of this source tree.
100
- */const __iconNode$O=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ChevronDown=createLucideIcon("ChevronDown",__iconNode$O);/**
100
+ */const __iconNode$P=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ChevronDown=createLucideIcon("ChevronDown",__iconNode$P);/**
101
101
  * @license lucide-react v0.479.0 - ISC
102
102
  *
103
103
  * This source code is licensed under the ISC license.
104
104
  * See the LICENSE file in the root directory of this source tree.
105
- */const __iconNode$N=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ChevronLeft=createLucideIcon("ChevronLeft",__iconNode$N);/**
105
+ */const __iconNode$O=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ChevronLeft=createLucideIcon("ChevronLeft",__iconNode$O);/**
106
106
  * @license lucide-react v0.479.0 - ISC
107
107
  *
108
108
  * This source code is licensed under the ISC license.
109
109
  * See the LICENSE file in the root directory of this source tree.
110
- */const __iconNode$M=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ChevronRight=createLucideIcon("ChevronRight",__iconNode$M);/**
110
+ */const __iconNode$N=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ChevronRight=createLucideIcon("ChevronRight",__iconNode$N);/**
111
111
  * @license lucide-react v0.479.0 - ISC
112
112
  *
113
113
  * This source code is licensed under the ISC license.
114
114
  * See the LICENSE file in the root directory of this source tree.
115
- */const __iconNode$L=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ChevronUp=createLucideIcon("ChevronUp",__iconNode$L);/**
115
+ */const __iconNode$M=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ChevronUp=createLucideIcon("ChevronUp",__iconNode$M);/**
116
116
  * @license lucide-react v0.479.0 - ISC
117
117
  *
118
118
  * This source code is licensed under the ISC license.
119
119
  * See the LICENSE file in the root directory of this source tree.
120
- */const __iconNode$K=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],ChevronsLeft=createLucideIcon("ChevronsLeft",__iconNode$K);/**
120
+ */const __iconNode$L=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],ChevronsLeft=createLucideIcon("ChevronsLeft",__iconNode$L);/**
121
121
  * @license lucide-react v0.479.0 - ISC
122
122
  *
123
123
  * This source code is licensed under the ISC license.
124
124
  * See the LICENSE file in the root directory of this source tree.
125
- */const __iconNode$J=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],ChevronsRight=createLucideIcon("ChevronsRight",__iconNode$J);/**
125
+ */const __iconNode$K=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],ChevronsRight=createLucideIcon("ChevronsRight",__iconNode$K);/**
126
126
  * @license lucide-react v0.479.0 - ISC
127
127
  *
128
128
  * This source code is licensed under the ISC license.
129
129
  * See the LICENSE file in the root directory of this source tree.
130
- */const __iconNode$I=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],ChevronsUpDown=createLucideIcon("ChevronsUpDown",__iconNode$I);/**
130
+ */const __iconNode$J=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],ChevronsUpDown=createLucideIcon("ChevronsUpDown",__iconNode$J);/**
131
131
  * @license lucide-react v0.479.0 - ISC
132
132
  *
133
133
  * This source code is licensed under the ISC license.
134
134
  * See the LICENSE file in the root directory of this source tree.
135
- */const __iconNode$H=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],CircleAlert=createLucideIcon("CircleAlert",__iconNode$H);/**
135
+ */const __iconNode$I=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],CircleAlert=createLucideIcon("CircleAlert",__iconNode$I);/**
136
136
  * @license lucide-react v0.479.0 - ISC
137
137
  *
138
138
  * This source code is licensed under the ISC license.
139
139
  * See the LICENSE file in the root directory of this source tree.
140
- */const __iconNode$G=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],CircleCheck=createLucideIcon("CircleCheck",__iconNode$G);/**
140
+ */const __iconNode$H=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],CircleCheck=createLucideIcon("CircleCheck",__iconNode$H);/**
141
141
  * @license lucide-react v0.479.0 - ISC
142
142
  *
143
143
  * This source code is licensed under the ISC license.
144
144
  * See the LICENSE file in the root directory of this source tree.
145
- */const __iconNode$F=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],CircleDashed=createLucideIcon("CircleDashed",__iconNode$F);/**
145
+ */const __iconNode$G=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],CircleDashed=createLucideIcon("CircleDashed",__iconNode$G);/**
146
146
  * @license lucide-react v0.479.0 - ISC
147
147
  *
148
148
  * This source code is licensed under the ISC license.
149
149
  * See the LICENSE file in the root directory of this source tree.
150
- */const __iconNode$E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Circle=createLucideIcon("Circle",__iconNode$E);/**
150
+ */const __iconNode$F=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Circle=createLucideIcon("Circle",__iconNode$F);/**
151
151
  * @license lucide-react v0.479.0 - ISC
152
152
  *
153
153
  * This source code is licensed under the ISC license.
154
154
  * See the LICENSE file in the root directory of this source tree.
155
- */const __iconNode$D=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Copy=createLucideIcon("Copy",__iconNode$D);/**
155
+ */const __iconNode$E=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Copy=createLucideIcon("Copy",__iconNode$E);/**
156
156
  * @license lucide-react v0.479.0 - ISC
157
157
  *
158
158
  * This source code is licensed under the ISC license.
159
159
  * See the LICENSE file in the root directory of this source tree.
160
- */const __iconNode$C=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],CreditCard=createLucideIcon("CreditCard",__iconNode$C);/**
160
+ */const __iconNode$D=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],CreditCard=createLucideIcon("CreditCard",__iconNode$D);/**
161
161
  * @license lucide-react v0.479.0 - ISC
162
162
  *
163
163
  * This source code is licensed under the ISC license.
164
164
  * See the LICENSE file in the root directory of this source tree.
165
- */const __iconNode$B=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],DollarSign=createLucideIcon("DollarSign",__iconNode$B);/**
165
+ */const __iconNode$C=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],DollarSign=createLucideIcon("DollarSign",__iconNode$C);/**
166
166
  * @license lucide-react v0.479.0 - ISC
167
167
  *
168
168
  * This source code is licensed under the ISC license.
169
169
  * See the LICENSE file in the root directory of this source tree.
170
- */const __iconNode$A=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Download=createLucideIcon("Download",__iconNode$A);/**
170
+ */const __iconNode$B=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Download=createLucideIcon("Download",__iconNode$B);/**
171
171
  * @license lucide-react v0.479.0 - ISC
172
172
  *
173
173
  * This source code is licensed under the ISC license.
174
174
  * See the LICENSE file in the root directory of this source tree.
175
- */const __iconNode$z=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ExternalLink=createLucideIcon("ExternalLink",__iconNode$z);/**
175
+ */const __iconNode$A=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ExternalLink=createLucideIcon("ExternalLink",__iconNode$A);/**
176
176
  * @license lucide-react v0.479.0 - ISC
177
177
  *
178
178
  * This source code is licensed under the ISC license.
179
179
  * See the LICENSE file in the root directory of this source tree.
180
- */const __iconNode$y=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Eye=createLucideIcon("Eye",__iconNode$y);/**
180
+ */const __iconNode$z=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Eye=createLucideIcon("Eye",__iconNode$z);/**
181
181
  * @license lucide-react v0.479.0 - ISC
182
182
  *
183
183
  * This source code is licensed under the ISC license.
184
184
  * See the LICENSE file in the root directory of this source tree.
185
- */const __iconNode$x=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]],Filter=createLucideIcon("Filter",__iconNode$x);/**
185
+ */const __iconNode$y=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]],Filter=createLucideIcon("Filter",__iconNode$y);/**
186
186
  * @license lucide-react v0.479.0 - ISC
187
187
  *
188
188
  * This source code is licensed under the ISC license.
189
189
  * See the LICENSE file in the root directory of this source tree.
190
- */const __iconNode$w=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Globe=createLucideIcon("Globe",__iconNode$w);/**
190
+ */const __iconNode$x=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Globe=createLucideIcon("Globe",__iconNode$x);/**
191
191
  * @license lucide-react v0.479.0 - ISC
192
192
  *
193
193
  * This source code is licensed under the ISC license.
194
194
  * See the LICENSE file in the root directory of this source tree.
195
- */const __iconNode$v=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],Handshake=createLucideIcon("Handshake",__iconNode$v);/**
195
+ */const __iconNode$w=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],Handshake=createLucideIcon("Handshake",__iconNode$w);/**
196
196
  * @license lucide-react v0.479.0 - ISC
197
197
  *
198
198
  * This source code is licensed under the ISC license.
199
199
  * See the LICENSE file in the root directory of this source tree.
200
- */const __iconNode$u=[["path",{d:"M10 10V5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v5",key:"1p9q5i"}],["path",{d:"M14 6a6 6 0 0 1 6 6v3",key:"1hnv84"}],["path",{d:"M4 15v-3a6 6 0 0 1 6-6",key:"9ciidu"}],["rect",{x:"2",y:"15",width:"20",height:"4",rx:"1",key:"g3x8cw"}]],HardHat=createLucideIcon("HardHat",__iconNode$u);/**
200
+ */const __iconNode$v=[["path",{d:"M10 10V5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v5",key:"1p9q5i"}],["path",{d:"M14 6a6 6 0 0 1 6 6v3",key:"1hnv84"}],["path",{d:"M4 15v-3a6 6 0 0 1 6-6",key:"9ciidu"}],["rect",{x:"2",y:"15",width:"20",height:"4",rx:"1",key:"g3x8cw"}]],HardHat=createLucideIcon("HardHat",__iconNode$v);/**
201
+ * @license lucide-react v0.479.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const __iconNode$u=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Info=createLucideIcon("Info",__iconNode$u);/**
201
206
  * @license lucide-react v0.479.0 - ISC
202
207
  *
203
208
  * This source code is licensed under the ISC license.
@@ -1004,7 +1009,7 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
1004
1009
  * LICENSE file in the root directory of this source tree.
1005
1010
  */var hasRequiredReactIs_development;function requireReactIs_development(){return hasRequiredReactIs_development||(hasRequiredReactIs_development=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,l=e?Symbol.for("react.strict_mode"):60108,d=e?Symbol.for("react.profiler"):60114,f=e?Symbol.for("react.provider"):60109,g=e?Symbol.for("react.context"):60110,b=e?Symbol.for("react.async_mode"):60111,_=e?Symbol.for("react.concurrent_mode"):60111,S=e?Symbol.for("react.forward_ref"):60112,R=e?Symbol.for("react.suspense"):60113,C=e?Symbol.for("react.suspense_list"):60120,E=e?Symbol.for("react.memo"):60115,M=e?Symbol.for("react.lazy"):60116,I=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,O=e?Symbol.for("react.responder"):60118,q=e?Symbol.for("react.scope"):60119;function z(qe){return typeof qe=="string"||typeof qe=="function"||qe===o||qe===_||qe===d||qe===l||qe===R||qe===C||typeof qe=="object"&&qe!==null&&(qe.$$typeof===M||qe.$$typeof===E||qe.$$typeof===f||qe.$$typeof===g||qe.$$typeof===S||qe.$$typeof===A||qe.$$typeof===O||qe.$$typeof===q||qe.$$typeof===I)}function Q(qe){if(typeof qe=="object"&&qe!==null){var ft=qe.$$typeof;switch(ft){case t:var Qe=qe.type;switch(Qe){case b:case _:case o:case d:case l:case R:return Qe;default:var nt=Qe&&Qe.$$typeof;switch(nt){case g:case S:case M:case E:case f:return nt;default:return ft}}case n:return ft}}}var F=b,V=_,te=g,ie=f,ae=t,oe=S,se=o,ge=M,Ae=E,Ne=n,Oe=d,Le=l,Ge=R,je=!1;function Be(qe){return je||(je=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),Fe(qe)||Q(qe)===b}function Fe(qe){return Q(qe)===_}function ze(qe){return Q(qe)===g}function He(qe){return Q(qe)===f}function Xe(qe){return typeof qe=="object"&&qe!==null&&qe.$$typeof===t}function Je(qe){return Q(qe)===S}function Ye(qe){return Q(qe)===o}function at(qe){return Q(qe)===M}function Ke(qe){return Q(qe)===E}function tt(qe){return Q(qe)===n}function Ze(qe){return Q(qe)===d}function et(qe){return Q(qe)===l}function st(qe){return Q(qe)===R}reactIs_development.AsyncMode=F,reactIs_development.ConcurrentMode=V,reactIs_development.ContextConsumer=te,reactIs_development.ContextProvider=ie,reactIs_development.Element=ae,reactIs_development.ForwardRef=oe,reactIs_development.Fragment=se,reactIs_development.Lazy=ge,reactIs_development.Memo=Ae,reactIs_development.Portal=Ne,reactIs_development.Profiler=Oe,reactIs_development.StrictMode=Le,reactIs_development.Suspense=Ge,reactIs_development.isAsyncMode=Be,reactIs_development.isConcurrentMode=Fe,reactIs_development.isContextConsumer=ze,reactIs_development.isContextProvider=He,reactIs_development.isElement=Xe,reactIs_development.isForwardRef=Je,reactIs_development.isFragment=Ye,reactIs_development.isLazy=at,reactIs_development.isMemo=Ke,reactIs_development.isPortal=tt,reactIs_development.isProfiler=Ze,reactIs_development.isStrictMode=et,reactIs_development.isSuspense=st,reactIs_development.isValidElementType=z,reactIs_development.typeOf=Q}()),reactIs_development}var hasRequiredReactIs;function requireReactIs(){return hasRequiredReactIs||(hasRequiredReactIs=1,process.env.NODE_ENV==="production"?reactIs.exports=requireReactIs_production_min():reactIs.exports=requireReactIs_development()),reactIs.exports}var hoistNonReactStatics_cjs,hasRequiredHoistNonReactStatics_cjs;function requireHoistNonReactStatics_cjs(){if(hasRequiredHoistNonReactStatics_cjs)return hoistNonReactStatics_cjs;hasRequiredHoistNonReactStatics_cjs=1;var e=requireReactIs(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},d={};d[e.ForwardRef]=o,d[e.Memo]=l;function f(M){return e.isMemo(M)?l:d[M.$$typeof]||t}var g=Object.defineProperty,b=Object.getOwnPropertyNames,_=Object.getOwnPropertySymbols,S=Object.getOwnPropertyDescriptor,R=Object.getPrototypeOf,C=Object.prototype;function E(M,I,A){if(typeof I!="string"){if(C){var O=R(I);O&&O!==C&&E(M,O,A)}var q=b(I);_&&(q=q.concat(_(I)));for(var z=f(M),Q=f(I),F=0;F<q.length;++F){var V=q[F];if(!n[V]&&!(A&&A[V])&&!(Q&&Q[V])&&!(z&&z[V])){var te=S(I,V);try{g(M,V,te)}catch{}}}}return M}return hoistNonReactStatics_cjs=E,hoistNonReactStatics_cjs}requireHoistNonReactStatics_cjs();var IntlContext=typeof window<"u"&&!window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__?window.__REACT_INTL_CONTEXT__||(window.__REACT_INTL_CONTEXT__=React__namespace.createContext(null)):React__namespace.createContext(null);IntlContext.Consumer,IntlContext.Provider;var Context=IntlContext;function useIntl(){var e=React__namespace.useContext(Context);return invariantIntlContext(e),e}var DisplayName;(function(e){e.formatDate="FormattedDate",e.formatTime="FormattedTime",e.formatNumber="FormattedNumber",e.formatList="FormattedList",e.formatDisplayName="FormattedDisplayName"})(DisplayName||(DisplayName={}));var DisplayNameParts;(function(e){e.formatDate="FormattedDateParts",e.formatTime="FormattedTimeParts",e.formatNumber="FormattedNumberParts",e.formatList="FormattedListParts"})(DisplayNameParts||(DisplayNameParts={}));function createFormattedDateTimePartsComponent(e){var t=function(n){var o=useIntl(),l=n.value,d=n.children,f=__rest(n,["value","children"]),g=typeof l=="string"?new Date(l||0):l,b=e==="formatDate"?o.formatDateToParts(g,f):o.formatTimeToParts(g,f);return d(b)};return t.displayName=DisplayNameParts[e],t}function createFormattedComponent(e){var t=function(n){var o=useIntl(),l=n.value,d=n.children,f=__rest(n,["value","children"]),g=o[e](l,f);if(typeof d=="function")return d(g);var b=o.textComponent||React__namespace.Fragment;return React__namespace.createElement(b,null,g)};return t.displayName=DisplayName[e],t}createFormattedComponent("formatDate"),createFormattedComponent("formatTime");var FormattedNumber=createFormattedComponent("formatNumber");createFormattedComponent("formatList"),createFormattedComponent("formatDisplayName"),createFormattedDateTimePartsComponent("formatDate"),createFormattedDateTimePartsComponent("formatTime");function BillingCard({appID:e,reseller:t,isLoading:n,withoutReports:o}){const{Statement:l,CreditLimit:d}=t,f=[{label:"0 - 30 Days",value:jsxRuntime.jsx(FormattedNumber,{value:(l==null?void 0:l.Over0)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:Calendar},{label:"31 - 45 Days",value:jsxRuntime.jsx(FormattedNumber,{value:(l==null?void 0:l.Over30)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:CalendarDays},{label:"45+ Days",value:jsxRuntime.jsx(FormattedNumber,{value:(l==null?void 0:l.Over45)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:CalendarRange},{label:"Total",value:jsxRuntime.jsx(FormattedNumber,{value:(l==null?void 0:l.Total)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:DollarSign},{label:"Credit Limit",value:jsxRuntime.jsx(FormattedNumber,{value:d||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:CreditCard}],g=()=>{const _=`https://dashboard.randmar.io/${e}/PayInvoice`;window.open(_,"_blank","noopener,noreferrer")};if(n)return jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{className:"border-b p-6 md:p-5",children:jsxRuntime.jsx(Skeleton,{className:"h-6 w-36"})}),jsxRuntime.jsxs(CardContent,{className:"p-6 md:p-5",children:[jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 sm:divide-x divide-border",children:[jsxRuntime.jsx("div",{className:"space-y-6 sm:pe-4",children:[1,2,3].map(_=>jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap gap-1.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 ms-auto"})]},_))}),jsxRuntime.jsx("div",{className:"space-y-6 sm:ps-4 pt-6 sm:pt-0 mt-6 sm:mt-0 border-t sm:border-t-0 border-border",children:[1,2].map(_=>jsxRuntime.jsx("div",{className:_===2?"pt-6 mt-6 border-t border-border":"",children:jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap gap-1.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 ms-auto"})]})},_))})]}),jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-28 mt-6"})})]})]});const b=!o;return jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{className:"border-b p-6 md:p-5",children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Billing Overview"})}),jsxRuntime.jsxs(CardContent,{className:"p-6 md:p-5",children:[jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 sm:divide-x divide-border",children:[jsxRuntime.jsx("div",{className:"space-y-6 sm:pe-4",children:f.slice(0,3).map((_,S)=>jsxRuntime.jsx(BillingItem,{icon:_.icon,label:_.label,value:_.value},S))}),jsxRuntime.jsx("div",{className:"space-y-6 sm:ps-4 pt-6 sm:pt-0 mt-6 sm:mt-0 border-t sm:border-t-0 border-border",children:f.slice(3).map((_,S)=>jsxRuntime.jsx("div",{className:S===1?"pt-6 mt-6 border-t border-border":"",children:jsxRuntime.jsx(BillingItem,{icon:_.icon,label:_.label,value:_.value})},S))})]}),b&&jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsx(Button,{className:"mt-6",onClick:g,children:"Pay Invoices"})})]})]})}function BillingItem({icon:e,label:t,value:n}){return jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap gap-1.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(e,{className:"size-4 text-muted-foreground"}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:t})]}),jsxRuntime.jsx("span",{className:"text-base font-semibold ms-auto",children:n})]})}function ChangePricingTierModal({open:e,setOpen:t,tier:n,onTierChange:o,isLoading:l}){const d=()=>{t(!1)};return jsxRuntime.jsx(Dialog,{open:e,onOpenChange:t,children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsx(DialogTitle,{children:"Change Pricing Tier"})}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 py-2",children:[jsxRuntime.jsxs("p",{className:"text-lg text-muted-foreground",children:["Requested Pricing Tier: ",jsxRuntime.jsx("span",{className:"font-bold",children:n})]}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"If your account qualifies, your pricing will update immediately."}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"If not, we'll review your request and notify you of the decision."})]}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:d,disabled:l,children:"Cancel"}),jsxRuntime.jsx(Button,{onClick:o,disabled:l,children:l?"Loading...":`Apply for ${n}`})]})]})})}const getPricingText=e=>e===1?"The Best":e===2?"Fixed 12.5% GP on all items":e===3?"Advantageous":e===4?"Buying Group":e===5?"Cost":e,getShippingText=e=>e==="A"?"Free or Custom":e==="B"?"Fixed $10 anywhere":e==="C"?`Free shipping on $150+ orders to your location,
1006
1011
  $15 for drop shipped orders under $1,500,
1007
- $10 with opportunities under $1,000`:e==="D"?"$15 under $1,500":e==="E"?"Full shipping charges":e,getTermsText=e=>e==="STRIPE"?"Credit card payment":e==="NET30"?"Net 30 days":e,AccountTier=({isSuperAdmin:e,readonly:t,reseller:n,appID:o,isLoading:l})=>{const{toast:d}=useToast(),[f,g]=React.useState(!1),[b,_]=React.useState(""),[S,{isLoading:R}]=usePostV4PartnerByApplicationIdAccountResellerAndFieldNameMutation(),C=Oe=>Oe&&{Starter:"starter","E-Commerce":"ecommerce",Commercial:"commercial",Basics:"cws",Novexco:"novexco","Jean Coutu":"jeancoutu",Exclusive:"exclusive"}[Oe]||"",E=Oe=>Oe&&{A:"free",B:"fixed",C:"dropshipped",D:"under1500",E:"fullcharges"}[Oe]||"",M=Oe=>Oe&&{1:"exclusive",2:"ecommerce",3:"commercial",4:"buyinggroup",5:"cost"}[Oe]||"",[I,A]=React.useState(C((n==null?void 0:n.Priority)??"")),[O,q]=React.useState(E((n==null?void 0:n.ShippingProfile)??"")),[z,Q]=React.useState(M(n==null?void 0:n.PriceProfile)),F=Oe=>({starter:"Starter",ecommerce:"E-Commerce",commercial:"Commercial",cws:"Basics",novexco:"Novexco",jeancoutu:"Jean Coutu",exclusive:"Exclusive"})[Oe]||Oe,V=Oe=>({free:"A",fixed:"B",dropshipped:"C",under1500:"D",fullcharges:"E"})[Oe]||Oe,te=Oe=>({exclusive:"1",ecommerce:"2",commercial:"3",buyinggroup:"4",cost:"5"})[Oe]||Oe;React.useEffect(()=>{A(C((n==null?void 0:n.Priority)??"")),q(E((n==null?void 0:n.ShippingProfile)??"")),Q(M(n==null?void 0:n.PriceProfile))},[n]);const ie=async(Oe,Le,Ge,je)=>{try{(await S({applicationId:o,fieldName:Oe,newValue:Le})).error?d({title:"Error",description:je,variant:"destructive"}):d({title:"Success",description:Ge,variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}},ae=async Oe=>{A(Oe);const Le=F(Oe);ie("Priority",Le,`Priority updated to ${Le}`,"Failed to update priority")},oe=async Oe=>{q(Oe);const Le=V(Oe);ie("ShippingProfile",Le,`Shipping profile updated to ${Le}`,"Failed to update shipping profile")},se=async Oe=>{Q(Oe);const Le=te(Oe);ie("PriceProfile",Le,`Pricing profile updated to ${Le}`,"Failed to update pricing profile")},ge=async()=>{try{const Oe=await S({applicationId:o,fieldName:"Tier",newValue:b});Oe.error?d({title:"Error",description:"Failed to update reseller",variant:"destructive"}):Oe.data?d({title:"Success",description:`Pricing Tier changed to ${b}`,variant:"success"}):d({title:"Considered",description:"Request being considered",variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}finally{g(!1),_("")}},Ae=[{name:"Terms",enabled:n.Priority==="Starter"},{name:"E-Commerce",enabled:n.Priority==="Commercial"},{name:"Commercial",enabled:n.Priority==="E-Commerce"},{name:"Exclusive",enabled:e}],Ne=Oe=>{_(Oe),g(!0)};return l?jsxRuntime.jsxs(Card,{className:"md:col-span-2 xl:col-span-1 md:max-w-xl xl:max-w-[unset]",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-28"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-16 rounded-full"})]})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-56"})]}),jsxRuntime.jsx("div",{className:"grid gap-3",children:[1,2,3].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full shrink-0"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]})]},Oe))}),jsxRuntime.jsxs("div",{className:"flex gap-2 mt-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"md:col-span-2 xl:col-span-1 md:max-w-xl xl:max-w-[unset]",children:[jsxRuntime.jsxs(CardHeader,{className:"pb-2 pt-4 px-4 flex flex-row items-center justify-between",children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Account Tier"}),jsxRuntime.jsx(Badge,{variant:"secondary",className:"bg-green-100 text-green-700 hover:bg-green-200 text-xs",children:"Active"})]}),jsxRuntime.jsxs(CardContent,{className:"pt-2 px-4 pb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 bg-primary/5 p-4 rounded-lg",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-lg font-bold text-primary",children:[(n==null?void 0:n.Priority)||""," Tier"]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Optimized for online retail"})]}),jsxRuntime.jsx(CircleCheck,{className:"h-6 w-6 text-green-600"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-2 mb-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Package2,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Pricing"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground truncate",children:getPricingText(n.PriceProfile||0)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Truck,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Shipping"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getShippingText(n.ShippingProfile||"").split(".")[0]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Calendar,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Payment terms"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getTermsText((n==null?void 0:n.Terms)||"")})]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[!t&&jsxRuntime.jsx(Button,{variant:"outline",className:"flex-1",asChild:!0,children:jsxRuntime.jsxs("a",{href:"https://www.randmar.io/docs/overview/pricingTiers",target:"_blank",rel:"noreferrer",children:[jsxRuntime.jsx(ExternalLink,{className:"h-4 w-4 mr-1"}),"Pricing Tiers"]})}),jsxRuntime.jsxs(Popover,{children:[jsxRuntime.jsx(PopoverTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button,{disabled:t,className:t?"hidden":"flex-1",children:["Upgrade Tier ",jsxRuntime.jsx(ChevronRight,{className:"h-3 w-3 ml-1"})]})}),jsxRuntime.jsx(PopoverContent,{className:"w-56 p-2",children:jsxRuntime.jsxs("div",{className:"grid gap-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-xs mb-1",children:"Select a tier"}),Ae.map(Oe=>jsxRuntime.jsx(Button,{variant:"ghost",size:"sm",className:"w-full justify-start h-8",disabled:!Oe.enabled,onClick:()=>Ne(Oe.name),children:Oe.name},Oe.name))]})})]})]})]})]}),jsxRuntime.jsx(ChangePricingTierModal,{isLoading:R,open:f,setOpen:g,tier:b,onTierChange:ge}),e&&!t&&jsxRuntime.jsxs(Card,{className:"mt-4",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2 pt-3 px-4",children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Admin Configuration"})}),jsxRuntime.jsx(CardContent,{className:"pt-2 px-4 pb-4",children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Priority"}),jsxRuntime.jsx(RadioGroup$1,{value:I,onValueChange:ae,className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-1",children:[{value:"starter",label:"Starter"},{value:"ecommerce",label:"E-Commerce"},{value:"commercial",label:"Commercial"},{value:"cws",label:"CWS (Basics)"},{value:"novexco",label:"Novexco"},{value:"jeancoutu",label:"Jean Coutu"},{value:"exclusive",label:"Exclusive"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`priority-${Oe.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`priority-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Shipping Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:O,onValueChange:oe,className:"grid grid-cols-1 md:grid-cols-2 gap-1",children:[{value:"free",label:"Free (A)"},{value:"fixed",label:"Fixed $10 Shipping (B)"},{value:"dropshipped",label:"$15 for drop shipped (C)"},{value:"under1500",label:"15$ under 1,500 (D)"},{value:"fullcharges",label:"Full shipping charges (E)"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`shipping-${Oe.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`shipping-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Pricing Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:z,onValueChange:se,className:"grid grid-cols-2 sm:grid-cols-3 gap-1",children:[{value:"exclusive",label:"Exclusive (1)"},{value:"ecommerce",label:"E-Commerce (2)"},{value:"commercial",label:"Commercial (3)"},{value:"buyinggroup",label:"Buying Group (4)"},{value:"cost",label:"Cost (5)"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`pricing-${Oe.value}`,className:"h-6 w-6 scale-50 antialiased"}),jsxRuntime.jsx(Label$2,{htmlFor:`pricing-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]})]})})]})]})};function OrderCategories({openOrders:e=[],isLoading:t=!1}){const n=(e==null?void 0:e.filter(I=>I.DocumentType==="Order"))||[],o=(e==null?void 0:e.filter(I=>I.DocumentType==="Shipment"))||[],l=n.filter(I=>I.WarehouseCode!=="3PLE"),d=l.reduce((I,A)=>I+(A.Quantity??0),0),f=l.reduce((I,A)=>I+(A.ExtendedPrice??0),0),g=n.filter(I=>I.WarehouseCode==="3PLE"),b=g.reduce((I,A)=>I+(A.Quantity??0),0),_=g.reduce((I,A)=>I+(A.ExtendedPrice??0),0),S=o.reduce((I,A)=>I+(A.Quantity??0),0),R=o.reduce((I,A)=>I+(A.ExtendedPrice??0),0),C=d+b+S,E=f+_+R,M=[{name:"All",icon:Package,color:"bg-blue-500",orders:C,amount:E},{name:"Processing",icon:RefreshCcw,color:"bg-yellow-500",orders:d,amount:f},{name:"Shipped",icon:Truck,color:"bg-green-500",orders:S,amount:R},{name:"Delayed",icon:CircleAlert,color:"bg-red-500",orders:b,amount:_}];return t?jsxRuntime.jsxs(Card,{className:"w-full md:col-span-2 xl:col-span-1",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-40"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3.5",children:[1,2,3,4].map(I=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:"bg-gray-200 h-[3px]"}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-12"})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]})]})]})},I))})})]}):jsxRuntime.jsxs(Card,{className:"w-full md:col-span-2 xl:col-span-1",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Order Categories"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3.5",children:M.map(I=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:`${I.color} bg-opacity-60 h-[3px]`}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-base",children:I.name}),jsxRuntime.jsx("div",{className:`${I.color} bg-opacity-90 p-2 rounded-full`,children:jsxRuntime.jsx(I.icon,{className:"size-4 shrink-0 text-white"})})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Orders"}),jsxRuntime.jsx("p",{className:"text-xl font-bold",children:I.orders})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base font-semibold",children:jsxRuntime.jsx(FormattedNumber,{value:I.amount,style:"currency",currency:"CAD",currencyDisplay:"symbol"})})]})]})]})]})},I.name))})})]})}function LongMonthName(e){if(!e)return;const t=["","January","February","March","April","May","June","July","August","September","October","November","December"];return e===void 0&&(e=new Date().getMonth()+1),e<1&&(e=12+e),t[e]}function SalesSummary({fiscalYearMonthStart:e,salesData:t,isLoading:n}){const o=(t==null?void 0:t.SalesLast30Days)??0,l=(t==null?void 0:t.SalesLast3Months)??0,d=(t==null?void 0:t.SalesYearToDay)??0,f=LongMonthName(e);return n?jsxRuntime.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 mb-4",children:[jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]})]}),jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-28"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]})]}),jsxRuntime.jsxs(Card,{className:"col-span-2 lg:col-span-1",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-36"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]})]})]}):jsxRuntime.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 mb-4",children:[jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(CardTitle,{className:"text-sm font-medium",children:"Last 30 Days"}),jsxRuntime.jsx("div",{className:"p-2 rounded-full bg-neutral-200",children:jsxRuntime.jsx(TrendingUp,{className:"size-4 shrink-0 text-muted-foreground"})})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx("div",{className:"text-2xl font-bold",children:jsxRuntime.jsx(FormattedNumber,{value:o,style:"currency",currency:"CAD",currencyDisplay:"symbol"})}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground"})]})]}),jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(CardTitle,{className:"text-sm font-medium",children:"Last 3 Months"}),jsxRuntime.jsx("div",{className:"p-2 rounded-full bg-neutral-200",children:jsxRuntime.jsx(Calendar,{className:"size-4 shrink-0 text-muted-foreground"})})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx("div",{className:"text-2xl font-bold",children:jsxRuntime.jsx(FormattedNumber,{value:l,style:"currency",currency:"CAD",currencyDisplay:"symbol"})}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground"})]})]}),f&&jsxRuntime.jsxs(Card,{className:"col-span-2 lg:col-span-1",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsxs(CardTitle,{className:"text-sm font-medium",children:["Year to Date (",f,")"]}),jsxRuntime.jsx("div",{className:"p-2 rounded-full bg-neutral-200",children:jsxRuntime.jsx(CalendarDays,{className:"size-4 shrink-0 text-muted-foreground"})})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx("div",{className:"text-2xl font-bold",children:jsxRuntime.jsx(FormattedNumber,{value:d,style:"currency",currency:"CAD",currencyDisplay:"symbol"})}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground"})]})]})]})}function ReportsSection({isLoading:e,userEmail:t,appID:n}){const{toast:o}=useToast(),[l,{isLoading:d}]=usePostV4ResellerByRouteResellerIdReportWalmartTrackingFileEmailMutation(),[f,{isLoading:g}]=usePostV4ResellerByRouteResellerIdReportAmazonTrackingFileEmailMutation(),[b,{isLoading:_}]=usePostV4ResellerByRouteResellerIdReportOpenOrdersEmailMutation(),[S,{isLoading:R}]=usePostV4ResellerByRouteResellerIdReportProductsEmailMutation(),[C,{isLoading:E}]=usePostV4ResellerByRouteResellerIdReportInvoicesEmailMutation(),[M,{isLoading:I}]=usePostV4ResellerByRouteResellerIdDocumentStatementEmailMutation(),[A,O]=React.useState(null),[q,z]=React.useState(t),[Q,F]=React.useState(!1),V=[{name:"Products",reports:[{id:"Products",title:"Universal Product List",description:"A comprehensive overview of your product list with detailed specifications and pricing information.",icon:Package}]},{name:"Operation Details",reports:[{id:"OpenOrders",title:"Order Details",description:"A detailed report of all your orders and shipments, including status, tracking information, and delivery estimates.",icon:ShoppingCart},{id:"Invoices",title:"Invoices and Credits Report",description:"Detailed overview of your invoices and credits within a specific date range. It also contains reports about additional charges, serial numbers, and other relevant information.",icon:ScrollText},{id:"Statement",title:"Statement and RMAs Report",description:"A detailed report of all unpaid invoices and active RMAs.",icon:Banknote}]},{name:"Tracking Files",reports:[{id:"AmazonTrackingFile",title:"Amazon Tracking File",description:"Track products sold on Amazon marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing},{id:"WalmartTrackingFile",title:"Walmart Tracking File",description:"Track products sold on Walmart marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing}]}],te=async oe=>{O(oe),F(!0)},ie=async()=>{if(!(!A||!n))try{switch(A.id){case"Products":await S({routeResellerId:n,emailAddress:q}).unwrap();break;case"AmazonTrackingFile":await f({routeResellerId:n,emailAddress:q}).unwrap();break;case"WalmartTrackingFile":await l({routeResellerId:n,emailAddress:q}).unwrap();break;case"OpenOrders":await b({routeResellerId:n,emailAddress:q}).unwrap();break;case"Invoices":await C({routeResellerId:n,emailAddress:q}).unwrap();break;case"Statement":await M({routeResellerId:n,emailAddress:q}).unwrap();break;default:throw new Error("invalid report id")}o({title:"Report requested",description:`The ${A.title} will be sent to ${q} shortly.`,variant:"success"}),F(!1)}catch(oe){console.error("Error requesting report:",oe),o({title:"Error",description:"Failed to request report. Please try again.",variant:"destructive"})}},ae=_||R||g||d||I||E;return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Reports"}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"Download essential business reports, from your Product List to your Order Details."})]}),jsxRuntime.jsx(CardContent,{className:"space-y-6",children:e?jsxRuntime.jsx(jsxRuntime.Fragment,{children:[1,2,3].map(oe=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-48"}),[1,2].map(se=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"})]},se))]},oe))}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:V.map(oe=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold",children:oe.name}),oe.reports.map(se=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg hover:bg-gray-100 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:jsxRuntime.jsx(se.icon,{className:"h-5 w-5 text-primary"})}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h4",{className:"font-semibold text-sm",children:se.title}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:se.description})]}),jsxRuntime.jsxs(Button,{variant:"outline",size:"sm",className:"flex items-center gap-1",onClick:()=>te(se),children:[jsxRuntime.jsx(Download,{className:"h-4 w-4"}),"Request"]})]},se.id))]},oe.name))})}),jsxRuntime.jsx(Dialog,{open:Q,onOpenChange:F,children:jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsxs(DialogTitle,{children:["Request ",A==null?void 0:A.title]}),jsxRuntime.jsx(DialogDescription,{children:"Enter the email address where you would like to receive the report."})]}),jsxRuntime.jsxs("div",{className:"py-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",value:q,onChange:oe=>z(oe.target.value),placeholder:"your@email.com",className:"mt-2"})]}),jsxRuntime.jsx(DialogDescription,{children:"The report will take around 5 minutes to generate."}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:()=>F(!1),children:"Cancel"}),jsxRuntime.jsx(Button,{onClick:ie,disabled:!q||ae,children:ae?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Send Report"})]})]})})]})}function MonthlySalesChart({salesData:e,chartHeight:t=300,units:n="$",unitsPosition:o="left",className:l,extrapolate:d=!0,isLoading:f=!1}){const[g,b]=React.useState([]);return React.useEffect(()=>{if(f||!e||e.length===0){b([]);return}const _=e.reduce((q,z)=>{const Q=z.Day??0,F=Math.floor(Q).toString();if(F.length!==8||isNaN(parseInt(F)))return console.warn(`Skipping invalid Day format: ${z.Day}`),q;const V=F.substring(0,4),te=F.substring(4,6),ie=`${V}-${te}`;return q[ie]=(q[ie]||0)+(z.ExtendedPrice??0),q},{}),S=Object.keys(_).sort(),R=new Date,C=R.getFullYear(),E=R.getMonth(),M=R.getDate(),I=`${C}-${(E+1).toString().padStart(2,"0")}`,A={..._};if(d&&S.length>0&&S[S.length-1]===I){const q=A[I],z=new Date(C,E+1,0).getDate();if(M<z&&M>0){const F=q/M*z;A[I]=F}}const O=S.map(q=>{const z=A[q],[Q,F]=q.split("-").map(Number);return{month:new Date(Q,F-1).toLocaleString("default",{month:"short",year:"numeric"}),sales:z}});b(O)},[e,d,f]),f?jsxRuntime.jsx(Skeleton,{style:{height:t},className:l}):g.length===0?jsxRuntime.jsx("div",{style:{height:t},className:l||"p-4 text-center text-muted-foreground flex items-center justify-center",children:"No monthly sales data to display."}):jsxRuntime.jsx(AreaChart,{data:g,units:n,unitsPosition:o,height:t,className:l})}function UnsavedChangesDialog({isOpen:e,onClose:t,onConfirm:n,title:o,description:l,confirmText:d="Confirm",cancelText:f="Cancel"}){return jsxRuntime.jsx(Dialog,{open:e,onOpenChange:t,children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:o}),jsxRuntime.jsx(DialogDescription,{children:l})]}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:t,children:f}),jsxRuntime.jsx(Button,{onClick:n,children:d})]})]})})}function useRouterNavigationGuard(e){const[t,n]=React.useState(!1),o=reactRouterDom.useBlocker(React.useCallback(({currentLocation:g,nextLocation:b})=>{const _=g.pathname!==b.pathname||g.search!==b.search||g.hash!==b.hash;return e()&&_},[e]));React.useEffect(()=>{o.state==="blocked"&&n(!0)},[o]),React.useEffect(()=>{const g=b=>{if(e())return b.preventDefault(),"You have unsaved changes. Are you sure you want to leave?"};return window.addEventListener("beforeunload",g),()=>{window.removeEventListener("beforeunload",g)}},[e]);const l=React.useCallback(()=>{n(!1),o.state==="blocked"&&o.proceed()},[o]),d=React.useCallback(()=>{n(!1),o.state==="blocked"&&o.reset()},[o]),f=React.useCallback(()=>jsxRuntime.jsx(UnsavedChangesDialog,{isOpen:t,onClose:d,onConfirm:l,title:"Unsaved Changes",description:"You have unsaved changes. Are you sure you want to leave? Your changes will be lost.",confirmText:"Discard Changes",cancelText:"Stay on Page"}),[t,d,l]);return{showDialog:t,handleConfirm:l,handleCancel:d,NavigationGuardDialog:f}}const Opportunities=({applicationId:e,opportunities:t=null,loading:n=!1})=>{var V;const{toast:o}=useToast(),[l,d]=React.useState({}),[f,g]=React.useState(!1),[b,_]=React.useState(""),[S,R]=React.useState(null),C=React.useCallback((te,ie,ae)=>{d(oe=>({...oe,[te]:{...oe[te],[ie]:ae}}))},[]),[E]=usePutV4ResellerByRouteResellerIdOpportunityAndManufacturerIdDefaultMutation(),M=React.useCallback(async te=>{if(!te.BidNumber){o({title:"Error",description:"Bid Number is missing, cannot set default.",variant:"destructive"});return}const ie=te.BidNumber;C(ie,"isSettingDefault",!0),E({routeResellerId:e,manufacturerId:te.ManufacturerId??"",opportunityNumber:ie}).unwrap().then(()=>{o({title:"Success",description:`Opportunity "${te.OpportunityName||te.Opportunity||ie}" was successfully set as default.`,variant:"success"})}).catch(ae=>{var oe;console.error("Set as default error:",ae),o({title:"Error",description:((oe=ae.data)==null?void 0:oe.message)||ae.message||"An error occurred while setting this opportunity as default.",variant:"destructive"})}).finally(()=>{C(ie,"isSettingDefault",!1)})},[e,E,o,C]),[I]=usePostV4ResellerByRouteResellerIdOpportunityAndManufacturerIdBidNumberEmailMutation(),A=React.useCallback(te=>{if(!te.BidNumber){o({title:"Error",description:"Bid Number is missing, cannot prepare report.",variant:"destructive"});return}R(te),_(""),g(!0)},[o]),O=React.useCallback(async()=>{if(!S||!S.BidNumber){o({title:"Error",description:"No opportunity selected or Bid Number is missing.",variant:"destructive"});return}if(!b.trim()||!/\S+@\S+\.\S+/.test(b)){o({title:"Validation Error",description:"Please enter a valid email address.",variant:"destructive"});return}const te=S.BidNumber;C(te,"isSendingReport",!0),I({routeResellerId:e,manufacturerId:S.ManufacturerId??"",bidNumber:te,emailAddress:b}).unwrap().then(()=>{o({title:"Success",description:`A report for "${S.OpportunityName||S.Opportunity||te}" was successfully sent to ${b}.`,variant:"success"}),g(!1)}).catch(ie=>{var ae;console.error("Send report by email error:",ie),o({title:"Error",description:((ae=ie.data)==null?void 0:ae.message)||ie.message||"An error occurred while sending the report by email.",variant:"destructive"})}).finally(()=>{C(te,"isSendingReport",!1),f||(R(null),_(""))})},[S,b,e,I,o,C,g]),q=React.useMemo(()=>[{accessorKey:"Active",header:"Status",cell:({row:te})=>te.original.Active===!0?jsxRuntime.jsx(Badge,{variant:"outline",className:"border-green-500 bg-green-100 text-green-700 dark:border-green-600 dark:bg-green-900/50 dark:text-green-400 font-medium",children:"Active"}):jsxRuntime.jsx(Badge,{variant:"outline",className:"border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400 font-medium",children:"Inactive"}),enableSorting:!0,enableFiltering:!0},{accessorKey:"ManufacturerId",header:"Manufacturer ID",cell:({row:te})=>te.original.ManufacturerId??"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"BidNumber",header:"Bid Number",cell:({row:te})=>te.original.BidNumber??"N/A",enableSorting:!0,enableFiltering:!0},{id:"opportunityDisplay",accessorFn:te=>te.OpportunityName||te.Opportunity,header:"Opportunity",cell:({getValue:te})=>te()??"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"StartDate",header:"Start Date",cell:({row:te})=>te.original.StartDate?new Date(te.original.StartDate).toLocaleDateString():"N/A",enableSorting:!0,enableFiltering:!1},{accessorKey:"EndDate",header:"End Date",cell:({row:te})=>te.original.EndDate?new Date(te.original.EndDate).toLocaleDateString():"N/A",enableSorting:!0,enableFiltering:!1},{accessorKey:"LastUpdate",header:"Last Update",cell:({row:te})=>te.original.LastUpdate?new Date(te.original.LastUpdate).toLocaleDateString():"N/A",enableSorting:!0,enableFiltering:!1},{id:"actions",header:"Actions",cell:({row:te})=>{var Ne,Oe;const ie=te.original;if(!ie.BidNumber)return jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"Actions unavailable"});const ae=ie.BidNumber,oe=(Ne=l[ae])==null?void 0:Ne.isSettingDefault,se=(S==null?void 0:S.BidNumber)===ae&&((Oe=l[ae])==null?void 0:Oe.isSendingReport),ge=oe||se,Ae=ie.CanBeSetAsDefault===!0;return jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsxs(Button,{variant:"outline",size:"sm",onClick:()=>M(ie),disabled:ge||!Ae,title:Ae?"Set as default":"This opportunity cannot be set as default",className:"flex items-center",children:[oe?jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}):jsxRuntime.jsx(Star,{className:"mr-2 h-4 w-4"}),"Set Default"]}),jsxRuntime.jsxs(Button,{variant:"outline",size:"sm",onClick:()=>A(ie),disabled:ge,title:"Send report by email",className:"flex items-center",children:[se?jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}):jsxRuntime.jsx(Send,{className:"mr-2 h-4 w-4"}),"Send Report"]})]})}}],[l,M,A,S]),z=React.useMemo(()=>{const te={};if(t){const ie=Array.from(new Set(t.map(se=>se.ManufacturerId).filter(se=>se!=null)));te.ManufacturerId=ie;const ae=Array.from(new Set(t.map(se=>se.Active?"Active":"Inactive")));te.Active=ae;const oe=Array.from(new Set(t.map(se=>se.OpportunityName||se.Opportunity).filter(se=>se!=null)));te.opportunityDisplay=oe}return te},[t]),Q=t||[],F=S!=null&&S.BidNumber?(V=l[S.BidNumber])==null?void 0:V.isSendingReport:!1;return n?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-48"})}),jsxRuntime.jsxs(CardContent,{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-48 w-full rounded-md border"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-[130px]"}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-20"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})]})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Opportunities"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(DataTable,{columns:q,data:Q,uniqueValues:z})})]}),jsxRuntime.jsx(Dialog,{open:f,onOpenChange:te=>{g(te),te||(R(null),_(""))},children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Send Opportunity Report"}),jsxRuntime.jsxs(DialogDescription,{children:["Enter the email address to send the report for opportunity: ",jsxRuntime.jsx("br",{}),jsxRuntime.jsx("span",{className:"font-semibold",children:(S==null?void 0:S.OpportunityName)||(S==null?void 0:S.Opportunity)||"N/A"}),(S==null?void 0:S.BidNumber)&&jsxRuntime.jsxs("span",{className:"block text-sm text-muted-foreground",children:["Bid Number: ",S.BidNumber]})]})]}),jsxRuntime.jsx("div",{className:"grid gap-4 py-4",children:jsxRuntime.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",className:"text-right",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",type:"email",value:b,onChange:te=>_(te.target.value),placeholder:"recipient@example.com",className:"col-span-3",disabled:F})]})}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:()=>g(!1),disabled:F,children:"Cancel"}),jsxRuntime.jsxs(Button,{type:"submit",onClick:O,disabled:F,children:[F&&jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Send Report"]})]})]})})]})};function ResellerOverview({appID:e,reseller:t,readonly:n,userEmail:o,isSuperAdmin:l,withoutReports:d=!1}){const{data:f,isLoading:g,isError:b}=useGetV4PartnerByApplicationIdAccountResellerQuery({applicationId:e??"",withSpecification:!0},{skip:!!t}),[_,S]=React.useState(!0),[R,C]=React.useState({publicInfo:{hasUnsavedChanges:!1}}),E=React.useCallback(()=>n?!1:R.publicInfo.hasUnsavedChanges,[n,R]),M=React.useCallback((F,V)=>{C(te=>{var ie;return((ie=te[F])==null?void 0:ie.hasUnsavedChanges)!==V.hasUnsavedChanges?{...te,[F]:V}:te})},[]),{NavigationGuardDialog:I}=useRouterNavigationGuard(E),A=t??f,O=!n||!!(A!=null&&A.Statement)&&(A.Statement.Total??0)>0,q=!g&&!!(A!=null&&A.SalesStatistics)&&A.SalesStatistics.length>0,z=(A==null?void 0:A.QualifiedManufacturers)??[],Q=(A==null?void 0:A.Qualifications)??[];return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[b?jsxRuntime.jsx(Card,{className:"p-6",children:jsxRuntime.jsxs(Alert,{variant:"destructive",children:[jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4"}),jsxRuntime.jsx(AlertTitle,{children:"Error"}),jsxRuntime.jsx(AlertDescription,{children:"There was an error loading your reseller information. Please try again later."})]})}):jsxRuntime.jsxs("div",{className:"space-y-6 mb-6",children:[jsxRuntime.jsx(SalesSummary,{fiscalYearMonthStart:(A==null?void 0:A.FiscalYearMonthStart)||1,salesData:A==null?void 0:A.SalesData,isLoading:g}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsx(OrderCategories,{openOrders:(A==null?void 0:A.ActiveOrderDetails)??[],isLoading:g}),O&&jsxRuntime.jsx(BillingCard,{appID:e,reseller:A||{},withoutReports:d,isLoading:g}),jsxRuntime.jsx(PublicInfo,{reseller:A||{},appID:e??"",isLoading:g,readonly:n,onUnsavedChanges:F=>M("publicInfo",{hasUnsavedChanges:F})})]}),jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Sales"})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(MonthlySalesChart,{salesData:(A==null?void 0:A.SalesStatistics)??[],extrapolate:_,isLoading:g}),q&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 my-1 pt-2",children:[jsxRuntime.jsx(Switch,{checked:_,onCheckedChange:S,id:"extrapolate-switch","aria-label":"Toggle sales extrapolation"}),jsxRuntime.jsx(Label$2,{htmlFor:"extrapolate-switch",children:"Extrapolate"})]}),_&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"* Sales for the current month are projected, not actual."})]})]})]}),jsxRuntime.jsx(AccountTier,{isSuperAdmin:l,readonly:n,reseller:A||{},appID:e??"",isLoading:g})]})]}),g||z.length>0?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Manufacturers you are qualified for"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:g?Array.from({length:2}).map((F,V)=>jsxRuntime.jsx(ManufacturerCard,{loading:!0},V)):z.map(F=>jsxRuntime.jsx(ManufacturerCard,{manufacturer:F,link:`https://dashboard.randmar.io/${e}/Partner/${F.ManufacturerId}`},F.ManufacturerId))})})]}):jsxRuntime.jsx(ResellerQualificationsCard,{qualifications:Q}),jsxRuntime.jsx(Opportunities,{applicationId:e,opportunities:A==null?void 0:A.Opportunities,loading:g}),!d&&jsxRuntime.jsx(ReportsSection,{appID:e,userEmail:o,isLoading:g})]}),jsxRuntime.jsx(I,{})]})}/**
1012
+ $10 with opportunities under $1,000`:e==="D"?"$15 under $1,500":e==="E"?"Full shipping charges":e,getTermsText=e=>e==="STRIPE"?"Credit card payment":e==="NET30"?"Net 30 days":e,AccountTier=({isSuperAdmin:e,readonly:t,reseller:n,appID:o,isLoading:l})=>{const{toast:d}=useToast(),[f,g]=React.useState(!1),[b,_]=React.useState(""),[S,{isLoading:R}]=usePostV4PartnerByApplicationIdAccountResellerAndFieldNameMutation(),C=Oe=>Oe&&{Starter:"starter","E-Commerce":"ecommerce",Commercial:"commercial",Basics:"cws",Novexco:"novexco","Jean Coutu":"jeancoutu",Exclusive:"exclusive"}[Oe]||"",E=Oe=>Oe&&{A:"free",B:"fixed",C:"dropshipped",D:"under1500",E:"fullcharges"}[Oe]||"",M=Oe=>Oe&&{1:"exclusive",2:"ecommerce",3:"commercial",4:"buyinggroup",5:"cost"}[Oe]||"",[I,A]=React.useState(C((n==null?void 0:n.Priority)??"")),[O,q]=React.useState(E((n==null?void 0:n.ShippingProfile)??"")),[z,Q]=React.useState(M(n==null?void 0:n.PriceProfile)),F=Oe=>({starter:"Starter",ecommerce:"E-Commerce",commercial:"Commercial",cws:"Basics",novexco:"Novexco",jeancoutu:"Jean Coutu",exclusive:"Exclusive"})[Oe]||Oe,V=Oe=>({free:"A",fixed:"B",dropshipped:"C",under1500:"D",fullcharges:"E"})[Oe]||Oe,te=Oe=>({exclusive:"1",ecommerce:"2",commercial:"3",buyinggroup:"4",cost:"5"})[Oe]||Oe;React.useEffect(()=>{A(C((n==null?void 0:n.Priority)??"")),q(E((n==null?void 0:n.ShippingProfile)??"")),Q(M(n==null?void 0:n.PriceProfile))},[n]);const ie=async(Oe,Le,Ge,je)=>{try{(await S({applicationId:o,fieldName:Oe,newValue:Le})).error?d({title:"Error",description:je,variant:"destructive"}):d({title:"Success",description:Ge,variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}},ae=async Oe=>{A(Oe);const Le=F(Oe);ie("Priority",Le,`Priority updated to ${Le}`,"Failed to update priority")},oe=async Oe=>{q(Oe);const Le=V(Oe);ie("ShippingProfile",Le,`Shipping profile updated to ${Le}`,"Failed to update shipping profile")},se=async Oe=>{Q(Oe);const Le=te(Oe);ie("PriceProfile",Le,`Pricing profile updated to ${Le}`,"Failed to update pricing profile")},ge=async()=>{try{const Oe=await S({applicationId:o,fieldName:"Tier",newValue:b});Oe.error?d({title:"Error",description:"Failed to update reseller",variant:"destructive"}):Oe.data?d({title:"Success",description:`Pricing Tier changed to ${b}`,variant:"success"}):d({title:"Considered",description:"Request being considered",variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}finally{g(!1),_("")}},Ae=[{name:"Terms",enabled:n.Priority==="Starter"},{name:"E-Commerce",enabled:n.Priority==="Commercial"},{name:"Commercial",enabled:n.Priority==="E-Commerce"},{name:"Exclusive",enabled:e}],Ne=Oe=>{_(Oe),g(!0)};return l?jsxRuntime.jsxs(Card,{className:"md:col-span-2 xl:col-span-1 md:max-w-xl xl:max-w-[unset]",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-28"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-16 rounded-full"})]})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-56"})]}),jsxRuntime.jsx("div",{className:"grid gap-3",children:[1,2,3].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full shrink-0"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]})]},Oe))}),jsxRuntime.jsxs("div",{className:"flex gap-2 mt-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"md:col-span-2 xl:col-span-1 md:max-w-xl xl:max-w-[unset]",children:[jsxRuntime.jsxs(CardHeader,{className:"pb-2 pt-4 px-4 flex flex-row items-center justify-between",children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Account Tier"}),jsxRuntime.jsx(Badge,{variant:"secondary",className:"bg-green-100 text-green-700 hover:bg-green-200 text-xs",children:"Active"})]}),jsxRuntime.jsxs(CardContent,{className:"pt-2 px-4 pb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 bg-primary/5 p-4 rounded-lg",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-lg font-bold text-primary",children:[(n==null?void 0:n.Priority)||""," Tier"]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Optimized for online retail"})]}),jsxRuntime.jsx(CircleCheck,{className:"h-6 w-6 text-green-600"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-2 mb-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Package2,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Pricing"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground truncate",children:getPricingText(n.PriceProfile||0)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Truck,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Shipping"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getShippingText(n.ShippingProfile||"").split(".")[0]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Calendar,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Payment terms"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getTermsText((n==null?void 0:n.Terms)||"")})]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[!t&&jsxRuntime.jsx(Button,{variant:"outline",className:"flex-1",asChild:!0,children:jsxRuntime.jsxs("a",{href:"https://www.randmar.io/docs/overview/pricingTiers",target:"_blank",rel:"noreferrer",children:[jsxRuntime.jsx(ExternalLink,{className:"h-4 w-4 mr-1"}),"Pricing Tiers"]})}),jsxRuntime.jsxs(Popover,{children:[jsxRuntime.jsx(PopoverTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button,{disabled:t,className:t?"hidden":"flex-1",children:["Upgrade Tier ",jsxRuntime.jsx(ChevronRight,{className:"h-3 w-3 ml-1"})]})}),jsxRuntime.jsx(PopoverContent,{className:"w-56 p-2",children:jsxRuntime.jsxs("div",{className:"grid gap-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-xs mb-1",children:"Select a tier"}),Ae.map(Oe=>jsxRuntime.jsx(Button,{variant:"ghost",size:"sm",className:"w-full justify-start h-8",disabled:!Oe.enabled,onClick:()=>Ne(Oe.name),children:Oe.name},Oe.name))]})})]})]})]})]}),jsxRuntime.jsx(ChangePricingTierModal,{isLoading:R,open:f,setOpen:g,tier:b,onTierChange:ge}),e&&!t&&jsxRuntime.jsxs(Card,{className:"mt-4",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2 pt-3 px-4",children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Admin Configuration"})}),jsxRuntime.jsx(CardContent,{className:"pt-2 px-4 pb-4",children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Priority"}),jsxRuntime.jsx(RadioGroup$1,{value:I,onValueChange:ae,className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-1",children:[{value:"starter",label:"Starter"},{value:"ecommerce",label:"E-Commerce"},{value:"commercial",label:"Commercial"},{value:"cws",label:"CWS (Basics)"},{value:"novexco",label:"Novexco"},{value:"jeancoutu",label:"Jean Coutu"},{value:"exclusive",label:"Exclusive"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`priority-${Oe.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`priority-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Shipping Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:O,onValueChange:oe,className:"grid grid-cols-1 md:grid-cols-2 gap-1",children:[{value:"free",label:"Free (A)"},{value:"fixed",label:"Fixed $10 Shipping (B)"},{value:"dropshipped",label:"$15 for drop shipped (C)"},{value:"under1500",label:"15$ under 1,500 (D)"},{value:"fullcharges",label:"Full shipping charges (E)"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`shipping-${Oe.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`shipping-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Pricing Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:z,onValueChange:se,className:"grid grid-cols-2 sm:grid-cols-3 gap-1",children:[{value:"exclusive",label:"Exclusive (1)"},{value:"ecommerce",label:"E-Commerce (2)"},{value:"commercial",label:"Commercial (3)"},{value:"buyinggroup",label:"Buying Group (4)"},{value:"cost",label:"Cost (5)"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`pricing-${Oe.value}`,className:"h-6 w-6 scale-50 antialiased"}),jsxRuntime.jsx(Label$2,{htmlFor:`pricing-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]})]})})]})]})};function OrderCategories({openOrders:e=[],isLoading:t=!1}){const n=(e==null?void 0:e.filter(I=>I.DocumentType==="Order"))||[],o=(e==null?void 0:e.filter(I=>I.DocumentType==="Shipment"))||[],l=n.filter(I=>I.WarehouseCode!=="3PLE"),d=l.reduce((I,A)=>I+(A.Quantity??0),0),f=l.reduce((I,A)=>I+(A.ExtendedPrice??0),0),g=n.filter(I=>I.WarehouseCode==="3PLE"),b=g.reduce((I,A)=>I+(A.Quantity??0),0),_=g.reduce((I,A)=>I+(A.ExtendedPrice??0),0),S=o.reduce((I,A)=>I+(A.Quantity??0),0),R=o.reduce((I,A)=>I+(A.ExtendedPrice??0),0),C=d+b+S,E=f+_+R,M=[{name:"All",icon:Package,color:"bg-blue-500",orders:C,amount:E},{name:"Processing",icon:RefreshCcw,color:"bg-yellow-500",orders:d,amount:f},{name:"Shipped",icon:Truck,color:"bg-green-500",orders:S,amount:R},{name:"Delayed",icon:CircleAlert,color:"bg-red-500",orders:b,amount:_}];return t?jsxRuntime.jsxs(Card,{className:"w-full md:col-span-2 xl:col-span-1",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-40"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3.5",children:[1,2,3,4].map(I=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:"bg-gray-200 h-[3px]"}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-12"})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]})]})]})},I))})})]}):jsxRuntime.jsxs(Card,{className:"w-full md:col-span-2 xl:col-span-1",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Order Categories"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3.5",children:M.map(I=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:`${I.color} bg-opacity-60 h-[3px]`}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-base",children:I.name}),jsxRuntime.jsx("div",{className:`${I.color} bg-opacity-90 p-2 rounded-full`,children:jsxRuntime.jsx(I.icon,{className:"size-4 shrink-0 text-white"})})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Orders"}),jsxRuntime.jsx("p",{className:"text-xl font-bold",children:I.orders})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base font-semibold",children:jsxRuntime.jsx(FormattedNumber,{value:I.amount,style:"currency",currency:"CAD",currencyDisplay:"symbol"})})]})]})]})]})},I.name))})})]})}function LongMonthName(e){if(!e)return;const t=["","January","February","March","April","May","June","July","August","September","October","November","December"];return e===void 0&&(e=new Date().getMonth()+1),e<1&&(e=12+e),t[e]}function SalesSummary({fiscalYearMonthStart:e,salesData:t,isLoading:n}){const o=(t==null?void 0:t.SalesLast30Days)??0,l=(t==null?void 0:t.SalesLast3Months)??0,d=(t==null?void 0:t.SalesYearToDay)??0,f=LongMonthName(e);return n?jsxRuntime.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 mb-4",children:[jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]})]}),jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-28"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]})]}),jsxRuntime.jsxs(Card,{className:"col-span-2 lg:col-span-1",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-36"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]})]})]}):jsxRuntime.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 mb-4",children:[jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(CardTitle,{className:"text-sm font-medium",children:"Last 30 Days"}),jsxRuntime.jsx("div",{className:"p-2 rounded-full bg-neutral-200",children:jsxRuntime.jsx(TrendingUp,{className:"size-4 shrink-0 text-muted-foreground"})})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx("div",{className:"text-2xl font-bold",children:jsxRuntime.jsx(FormattedNumber,{value:o,style:"currency",currency:"CAD",currencyDisplay:"symbol"})}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground"})]})]}),jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(CardTitle,{className:"text-sm font-medium",children:"Last 3 Months"}),jsxRuntime.jsx("div",{className:"p-2 rounded-full bg-neutral-200",children:jsxRuntime.jsx(Calendar,{className:"size-4 shrink-0 text-muted-foreground"})})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx("div",{className:"text-2xl font-bold",children:jsxRuntime.jsx(FormattedNumber,{value:l,style:"currency",currency:"CAD",currencyDisplay:"symbol"})}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground"})]})]}),f&&jsxRuntime.jsxs(Card,{className:"col-span-2 lg:col-span-1",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsxs(CardTitle,{className:"text-sm font-medium",children:["Year to Date (",f,")"]}),jsxRuntime.jsx("div",{className:"p-2 rounded-full bg-neutral-200",children:jsxRuntime.jsx(CalendarDays,{className:"size-4 shrink-0 text-muted-foreground"})})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx("div",{className:"text-2xl font-bold",children:jsxRuntime.jsx(FormattedNumber,{value:d,style:"currency",currency:"CAD",currencyDisplay:"symbol"})}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground"})]})]})]})}function ReportsSection({isLoading:e,userEmail:t,appID:n}){const{toast:o}=useToast(),[l,{isLoading:d}]=usePostV4ResellerByRouteResellerIdReportWalmartTrackingFileEmailMutation(),[f,{isLoading:g}]=usePostV4ResellerByRouteResellerIdReportAmazonTrackingFileEmailMutation(),[b,{isLoading:_}]=usePostV4ResellerByRouteResellerIdReportOpenOrdersEmailMutation(),[S,{isLoading:R}]=usePostV4ResellerByRouteResellerIdReportProductsEmailMutation(),[C,{isLoading:E}]=usePostV4ResellerByRouteResellerIdReportInvoicesEmailMutation(),[M,{isLoading:I}]=usePostV4ResellerByRouteResellerIdDocumentStatementEmailMutation(),[A,O]=React.useState(null),[q,z]=React.useState(t),[Q,F]=React.useState(!1),V=[{name:"Products",reports:[{id:"Products",title:"Universal Product List",description:"A comprehensive overview of your product list with detailed specifications and pricing information.",icon:Package}]},{name:"Operation Details",reports:[{id:"OpenOrders",title:"Order Details",description:"A detailed report of all your orders and shipments, including status, tracking information, and delivery estimates.",icon:ShoppingCart},{id:"Invoices",title:"Invoices and Credits Report",description:"Detailed overview of your invoices and credits within a specific date range. It also contains reports about additional charges, serial numbers, and other relevant information.",icon:ScrollText},{id:"Statement",title:"Statement and RMAs Report",description:"A detailed report of all unpaid invoices and active RMAs.",icon:Banknote}]},{name:"Tracking Files",reports:[{id:"AmazonTrackingFile",title:"Amazon Tracking File",description:"Track products sold on Amazon marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing},{id:"WalmartTrackingFile",title:"Walmart Tracking File",description:"Track products sold on Walmart marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing}]}],te=async oe=>{O(oe),F(!0)},ie=async()=>{if(!(!A||!n))try{switch(A.id){case"Products":await S({routeResellerId:n,emailAddress:q}).unwrap();break;case"AmazonTrackingFile":await f({routeResellerId:n,emailAddress:q}).unwrap();break;case"WalmartTrackingFile":await l({routeResellerId:n,emailAddress:q}).unwrap();break;case"OpenOrders":await b({routeResellerId:n,emailAddress:q}).unwrap();break;case"Invoices":await C({routeResellerId:n,emailAddress:q}).unwrap();break;case"Statement":await M({routeResellerId:n,emailAddress:q}).unwrap();break;default:throw new Error("invalid report id")}o({title:"Report requested",description:`The ${A.title} will be sent to ${q} shortly.`,variant:"success"}),F(!1)}catch(oe){console.error("Error requesting report:",oe),o({title:"Error",description:"Failed to request report. Please try again.",variant:"destructive"})}},ae=_||R||g||d||I||E;return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Reports"}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"Download essential business reports, from your Product List to your Order Details."})]}),jsxRuntime.jsx(CardContent,{className:"space-y-6",children:e?jsxRuntime.jsx(jsxRuntime.Fragment,{children:[1,2,3].map(oe=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-48"}),[1,2].map(se=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"})]},se))]},oe))}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:V.map(oe=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold",children:oe.name}),oe.reports.map(se=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg hover:bg-gray-100 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:jsxRuntime.jsx(se.icon,{className:"h-5 w-5 text-primary"})}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h4",{className:"font-semibold text-sm",children:se.title}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:se.description})]}),jsxRuntime.jsxs(Button,{variant:"outline",size:"sm",className:"flex items-center gap-1",onClick:()=>te(se),children:[jsxRuntime.jsx(Download,{className:"h-4 w-4"}),"Request"]})]},se.id))]},oe.name))})}),jsxRuntime.jsx(Dialog,{open:Q,onOpenChange:F,children:jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsxs(DialogTitle,{children:["Request ",A==null?void 0:A.title]}),jsxRuntime.jsx(DialogDescription,{children:"Enter the email address where you would like to receive the report."})]}),jsxRuntime.jsxs("div",{className:"py-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",value:q,onChange:oe=>z(oe.target.value),placeholder:"your@email.com",className:"mt-2"})]}),jsxRuntime.jsx(DialogDescription,{children:"The report will take around 5 minutes to generate."}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:()=>F(!1),children:"Cancel"}),jsxRuntime.jsx(Button,{onClick:ie,disabled:!q||ae,children:ae?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Send Report"})]})]})})]})}function MonthlySalesChart({salesData:e,chartHeight:t=300,units:n="$",unitsPosition:o="left",className:l,extrapolate:d=!0,isLoading:f=!1}){const[g,b]=React.useState([]);return React.useEffect(()=>{if(f||!e||e.length===0){b([]);return}const _=e.reduce((q,z)=>{const Q=z.Day??0,F=Math.floor(Q).toString();if(F.length!==8||isNaN(parseInt(F)))return console.warn(`Skipping invalid Day format: ${z.Day}`),q;const V=F.substring(0,4),te=F.substring(4,6),ie=`${V}-${te}`;return q[ie]=(q[ie]||0)+(z.ExtendedPrice??0),q},{}),S=Object.keys(_).sort(),R=new Date,C=R.getFullYear(),E=R.getMonth(),M=R.getDate(),I=`${C}-${(E+1).toString().padStart(2,"0")}`,A={..._};if(d&&S.length>0&&S[S.length-1]===I){const q=A[I],z=new Date(C,E+1,0).getDate();if(M<z&&M>0){const F=q/M*z;A[I]=F}}const O=S.map(q=>{const z=A[q],[Q,F]=q.split("-").map(Number);return{month:new Date(Q,F-1).toLocaleString("default",{month:"short",year:"numeric"}),sales:z}});b(O)},[e,d,f]),f?jsxRuntime.jsx(Skeleton,{style:{height:t},className:l}):g.length===0?jsxRuntime.jsx("div",{style:{height:t},className:l||"p-4 text-center text-muted-foreground flex items-center justify-center",children:"No monthly sales data to display."}):jsxRuntime.jsx(AreaChart,{data:g,units:n,unitsPosition:o,height:t,className:l})}function UnsavedChangesDialog({isOpen:e,onClose:t,onConfirm:n,title:o,description:l,confirmText:d="Confirm",cancelText:f="Cancel"}){return jsxRuntime.jsx(Dialog,{open:e,onOpenChange:t,children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:o}),jsxRuntime.jsx(DialogDescription,{children:l})]}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:t,children:f}),jsxRuntime.jsx(Button,{onClick:n,children:d})]})]})})}function useRouterNavigationGuard(e){const[t,n]=React.useState(!1),o=reactRouterDom.useBlocker(React.useCallback(({currentLocation:g,nextLocation:b})=>{const _=g.pathname!==b.pathname||g.search!==b.search||g.hash!==b.hash;return e()&&_},[e]));React.useEffect(()=>{o.state==="blocked"&&n(!0)},[o]),React.useEffect(()=>{const g=b=>{if(e())return b.preventDefault(),"You have unsaved changes. Are you sure you want to leave?"};return window.addEventListener("beforeunload",g),()=>{window.removeEventListener("beforeunload",g)}},[e]);const l=React.useCallback(()=>{n(!1),o.state==="blocked"&&o.proceed()},[o]),d=React.useCallback(()=>{n(!1),o.state==="blocked"&&o.reset()},[o]),f=React.useCallback(()=>jsxRuntime.jsx(UnsavedChangesDialog,{isOpen:t,onClose:d,onConfirm:l,title:"Unsaved Changes",description:"You have unsaved changes. Are you sure you want to leave? Your changes will be lost.",confirmText:"Discard Changes",cancelText:"Stay on Page"}),[t,d,l]);return{showDialog:t,handleConfirm:l,handleCancel:d,NavigationGuardDialog:f}}function getEndDateStatus(e){if(!e)return{text:"No End Date",variant:"neutral",daysRemaining:null};const t=new Date(e);if(isNaN(t.getTime()))return{text:"Invalid Date",variant:"neutral",daysRemaining:null};const n=new Date,o=new Date(t.getFullYear(),t.getMonth(),t.getDate()),l=new Date(n.getFullYear(),n.getMonth(),n.getDate()),d=o.getTime()-l.getTime(),f=Math.ceil(d/(1e3*60*60*24));return f<0?{text:`Ended ${Math.abs(f)}d ago`,variant:"destructive",daysRemaining:f}:f===0?{text:"Ends today",variant:"destructive",daysRemaining:f}:f<=7?{text:`Ends in ${f}d`,variant:"destructive",daysRemaining:f}:f<=30?{text:`Ends in ${f}d`,variant:"warning",daysRemaining:f}:{text:`Ends in ${f}d`,variant:"neutral",daysRemaining:f}}const formatDate=e=>{if(!e)return"N/A";try{const t=new Date(e);return isNaN(t.getTime())?"Invalid Date":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return"Invalid Date"}},Opportunities=({applicationId:e,opportunities:t=null,loading:n=!1})=>{var V;const{toast:o}=useToast(),[l,d]=React.useState({}),[f,g]=React.useState(!1),[b,_]=React.useState(""),[S,R]=React.useState(null),C=React.useCallback((te,ie,ae)=>{d(oe=>({...oe,[te]:{...oe[te],[ie]:ae}}))},[]),[E]=usePutV4ResellerByRouteResellerIdOpportunityAndManufacturerIdDefaultMutation(),M=React.useCallback(async te=>{if(!te.BidNumber){o({title:"Error",description:"Bid Number is missing, cannot set default.",variant:"destructive"});return}const ie=te.BidNumber;C(ie,"isSettingDefault",!0),E({routeResellerId:e,manufacturerId:te.ManufacturerId??"",opportunityNumber:ie}).unwrap().then(()=>{o({title:"Success",description:`Opportunity "${te.OpportunityName||te.Opportunity||ie}" was successfully set as default.`,variant:"success"})}).catch(ae=>{var oe;console.error("Set as default error:",ae),o({title:"Error",description:((oe=ae.data)==null?void 0:oe.message)||ae.message||"An error occurred while setting this opportunity as default.",variant:"destructive"})}).finally(()=>{C(ie,"isSettingDefault",!1)})},[e,E,o,C]),[I]=usePostV4ResellerByRouteResellerIdOpportunityAndManufacturerIdBidNumberEmailMutation(),A=React.useCallback(te=>{if(!te.BidNumber){o({title:"Error",description:"Bid Number is missing, cannot prepare report.",variant:"destructive"});return}R(te),_(""),g(!0)},[o]),O=React.useCallback(async()=>{if(!S||!S.BidNumber){o({title:"Error",description:"No opportunity selected or Bid Number is missing.",variant:"destructive"});return}if(!b.trim()||!/\S+@\S+\.\S+/.test(b)){o({title:"Validation Error",description:"Please enter a valid email address.",variant:"destructive"});return}const te=S.BidNumber;C(te,"isSendingReport",!0),I({routeResellerId:e,manufacturerId:S.ManufacturerId??"",bidNumber:te,emailAddress:b}).unwrap().then(()=>{o({title:"Success",description:`A report for "${S.OpportunityName||S.Opportunity||te}" was successfully sent to ${b}.`,variant:"success"}),g(!1)}).catch(ie=>{var ae;console.error("Send report by email error:",ie),o({title:"Error",description:((ae=ie.data)==null?void 0:ae.message)||ie.message||"An error occurred while sending the report by email.",variant:"destructive"})}).finally(()=>{C(te,"isSendingReport",!1),f||(R(null),_(""))})},[S,b,e,I,o,C,g]),q=React.useMemo(()=>[{accessorKey:"ManufacturerId",header:"Manuf. ID",cell:({row:te})=>jsxRuntime.jsx("div",{className:"w-20 truncate",children:te.original.ManufacturerId??"N/A"}),enableSorting:!0,enableFiltering:!0},{id:"opportunityDisplay",accessorFn:te=>te.OpportunityName||te.Opportunity,header:"Opportunity",cell:({getValue:te})=>jsxRuntime.jsx("div",{className:"min-w-[150px]",children:te()??"N/A"}),enableSorting:!0,enableFiltering:!0},{accessorKey:"BidNumber",header:"Bid Number",cell:({row:te})=>te.original.BidNumber??"N/A",enableSorting:!0,enableFiltering:!0},{id:"statusInfo",header:"Status",cell:({row:te})=>{const ie=te.original,ae=ie.Active===!0,oe=getEndDateStatus(ie.EndDate);let se="border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400";return oe.variant==="destructive"?se="border-red-500 bg-red-100 text-red-700 dark:border-red-600 dark:bg-red-900/50 dark:text-red-400":oe.variant==="warning"&&(se="border-yellow-500 bg-yellow-100 text-yellow-700 dark:border-yellow-600 dark:bg-yellow-900/50 dark:text-yellow-400"),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 min-w-[200px]",children:[jsxRuntime.jsx(Badge,{variant:"outline",className:ae?"border-green-500 bg-green-100 text-green-700 dark:border-green-600 dark:bg-green-900/50 dark:text-green-400 font-medium":"border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400 font-medium",children:ae?"Active":"Inactive"}),ie.EndDate&&jsxRuntime.jsx(Badge,{variant:"outline",className:`${se} font-medium`,children:oe.text}),jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Button,{variant:"ghost",size:"icon",className:"h-6 w-6 p-0 data-[state=delayed-open]:bg-accent data-[state=instant-open]:bg-accent",children:jsxRuntime.jsx(Info,{className:"h-4 w-4 text-muted-foreground"})})}),jsxRuntime.jsx(TooltipContent,{side:"top",align:"center",className:"bg-popover text-popover-foreground p-2 rounded shadow-lg",children:jsxRuntime.jsxs("div",{className:"text-sm space-y-1",children:[jsxRuntime.jsxs("p",{children:[jsxRuntime.jsx("strong",{children:"Start:"})," ",formatDate(ie.StartDate)]}),jsxRuntime.jsxs("p",{children:[jsxRuntime.jsx("strong",{children:"End:"})," ",formatDate(ie.EndDate)]}),jsxRuntime.jsxs("p",{children:[jsxRuntime.jsx("strong",{children:"Updated:"})," ",formatDate(ie.LastUpdate)]})]})})]})})]})},enableFiltering:!1},{id:"actions",header:"Actions",cell:({row:te})=>{var Ne,Oe;const ie=te.original;if(!ie.BidNumber)return jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"Actions unavailable"});const ae=ie.BidNumber,oe=(Ne=l[ae])==null?void 0:Ne.isSettingDefault,se=(S==null?void 0:S.BidNumber)===ae&&((Oe=l[ae])==null?void 0:Oe.isSendingReport),ge=oe||se,Ae=ie.CanBeSetAsDefault===!0;return jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsxs(Button,{variant:"outline",size:"sm",onClick:()=>M(ie),disabled:ge||!Ae,title:Ae?"Set as default":"This opportunity cannot be set as default",className:"flex items-center",children:[oe?jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}):jsxRuntime.jsx(Star,{className:"mr-2 h-4 w-4"})," Set Default"]}),jsxRuntime.jsxs(Button,{variant:"outline",size:"sm",onClick:()=>A(ie),disabled:ge,title:"Send report by email",className:"flex items-center",children:[se?jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}):jsxRuntime.jsx(Send,{className:"mr-2 h-4 w-4"})," Send Report"]})]})}}],[l,M,A,S]),z=React.useMemo(()=>{const te={};if(t){const ie=Array.from(new Set(t.map(oe=>oe.ManufacturerId).filter(oe=>oe!=null)));te.ManufacturerId=ie;const ae=Array.from(new Set(t.map(oe=>oe.OpportunityName||oe.Opportunity).filter(oe=>oe!=null)));te.opportunityDisplay=ae}return te},[t]),Q=t||[],F=S!=null&&S.BidNumber?(V=l[S.BidNumber])==null?void 0:V.isSendingReport:!1;return n?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(Skeleton,{className:"h-7 w-48"})," "]}),jsxRuntime.jsxs(CardContent,{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-48 w-full rounded-md border"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-[130px]"}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-20"})," ",jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"})," ",jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})," ",jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})]})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Opportunities"})," "]}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(DataTable,{columns:q,data:Q,uniqueValues:z})})]}),jsxRuntime.jsx(Dialog,{open:f,onOpenChange:te=>{g(te),te||(R(null),_(""))},children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Send Opportunity Report"}),jsxRuntime.jsxs(DialogDescription,{children:["Enter the email address to send the report for opportunity: ",jsxRuntime.jsx("br",{}),jsxRuntime.jsx("span",{className:"font-semibold",children:(S==null?void 0:S.OpportunityName)||(S==null?void 0:S.Opportunity)||"N/A"}),(S==null?void 0:S.BidNumber)&&jsxRuntime.jsxs("span",{className:"block text-sm text-muted-foreground",children:["Bid Number: ",S.BidNumber]})]})]}),jsxRuntime.jsx("div",{className:"grid gap-4 py-4",children:jsxRuntime.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",className:"text-right",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",type:"email",value:b,onChange:te=>_(te.target.value),placeholder:"recipient@example.com",className:"col-span-3",disabled:F})]})}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:()=>g(!1),disabled:F,children:"Cancel"}),jsxRuntime.jsxs(Button,{type:"submit",onClick:O,disabled:F,children:[F&&jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"})," Send Report"]})]})]})})]})};function ResellerOverview({appID:e,reseller:t,readonly:n,userEmail:o,isSuperAdmin:l,withoutReports:d=!1}){const{data:f,isLoading:g,isError:b}=useGetV4PartnerByApplicationIdAccountResellerQuery({applicationId:e??"",withSpecification:!0},{skip:!!t}),[_,S]=React.useState(!0),[R,C]=React.useState({publicInfo:{hasUnsavedChanges:!1}}),E=React.useCallback(()=>n?!1:R.publicInfo.hasUnsavedChanges,[n,R]),M=React.useCallback((F,V)=>{C(te=>{var ie;return((ie=te[F])==null?void 0:ie.hasUnsavedChanges)!==V.hasUnsavedChanges?{...te,[F]:V}:te})},[]),{NavigationGuardDialog:I}=useRouterNavigationGuard(E),A=t??f,O=!n||!!(A!=null&&A.Statement)&&(A.Statement.Total??0)>0,q=!g&&!!(A!=null&&A.SalesStatistics)&&A.SalesStatistics.length>0,z=(A==null?void 0:A.QualifiedManufacturers)??[],Q=(A==null?void 0:A.Qualifications)??[];return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[b?jsxRuntime.jsx(Card,{className:"p-6",children:jsxRuntime.jsxs(Alert,{variant:"destructive",children:[jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4"}),jsxRuntime.jsx(AlertTitle,{children:"Error"}),jsxRuntime.jsx(AlertDescription,{children:"There was an error loading your reseller information. Please try again later."})]})}):jsxRuntime.jsxs("div",{className:"space-y-6 mb-6",children:[jsxRuntime.jsx(SalesSummary,{fiscalYearMonthStart:(A==null?void 0:A.FiscalYearMonthStart)||1,salesData:A==null?void 0:A.SalesData,isLoading:g}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsx(OrderCategories,{openOrders:(A==null?void 0:A.ActiveOrderDetails)??[],isLoading:g}),O&&jsxRuntime.jsx(BillingCard,{appID:e,reseller:A||{},withoutReports:d,isLoading:g}),jsxRuntime.jsx(PublicInfo,{reseller:A||{},appID:e??"",isLoading:g,readonly:n,onUnsavedChanges:F=>M("publicInfo",{hasUnsavedChanges:F})})]}),jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Sales"})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(MonthlySalesChart,{salesData:(A==null?void 0:A.SalesStatistics)??[],extrapolate:_,isLoading:g}),q&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 my-1 pt-2",children:[jsxRuntime.jsx(Switch,{checked:_,onCheckedChange:S,id:"extrapolate-switch","aria-label":"Toggle sales extrapolation"}),jsxRuntime.jsx(Label$2,{htmlFor:"extrapolate-switch",children:"Extrapolate"})]}),_&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"* Sales for the current month are projected, not actual."})]})]})]}),jsxRuntime.jsx(AccountTier,{isSuperAdmin:l,readonly:n,reseller:A||{},appID:e??"",isLoading:g})]})]}),g||z.length>0?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Manufacturers you are qualified for"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:g?Array.from({length:2}).map((F,V)=>jsxRuntime.jsx(ManufacturerCard,{loading:!0},V)):z.map(F=>jsxRuntime.jsx(ManufacturerCard,{manufacturer:F,link:`https://dashboard.randmar.io/${e}/Partner/${F.ManufacturerId}`},F.ManufacturerId))})})]}):jsxRuntime.jsx(ResellerQualificationsCard,{qualifications:Q}),jsxRuntime.jsx(Opportunities,{applicationId:e,opportunities:A==null?void 0:A.Opportunities,loading:g}),!d&&jsxRuntime.jsx(ReportsSection,{appID:e,userEmail:o,isLoading:g})]}),jsxRuntime.jsx(I,{})]})}/**
1008
1013
  * table-core
1009
1014
  *
1010
1015
  * Copyright (c) TanStack
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "randmarcomps",
3
3
  "private": false,
4
- "version": "1.209.0",
4
+ "version": "1.210.0",
5
5
  "description": "The UI library enabling speed and consistency in Randmar frontends.",
6
6
  "type": "module",
7
7
  "files": [