tickera-angular-components 0.0.1-dev.33 → 0.0.1-dev.34
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.
|
@@ -515,110 +515,6 @@ const TICKET_STATUS_LABELS = {
|
|
|
515
515
|
const TICKET_MAP_GRID_SIZE = 30;
|
|
516
516
|
const TICKET_MAP_TITLE_HEIGHT = 30;
|
|
517
517
|
|
|
518
|
-
var OrderItemType;
|
|
519
|
-
(function (OrderItemType) {
|
|
520
|
-
OrderItemType["TICKET"] = "TICKET";
|
|
521
|
-
OrderItemType["PRODUCT"] = "PRODUCT";
|
|
522
|
-
})(OrderItemType || (OrderItemType = {}));
|
|
523
|
-
|
|
524
|
-
var OrderStatus;
|
|
525
|
-
(function (OrderStatus) {
|
|
526
|
-
OrderStatus["ON_HOLD"] = "on-hold";
|
|
527
|
-
OrderStatus["PENDING_PAYMENT"] = "pending-payment";
|
|
528
|
-
OrderStatus["PROCESSING"] = "processing";
|
|
529
|
-
OrderStatus["COMPLETED"] = "completed";
|
|
530
|
-
OrderStatus["FAILED"] = "failed";
|
|
531
|
-
OrderStatus["CANCELLED"] = "cancelled";
|
|
532
|
-
OrderStatus["REFUNDED"] = "refunded";
|
|
533
|
-
})(OrderStatus || (OrderStatus = {}));
|
|
534
|
-
|
|
535
|
-
var SelectedDiscountCardType;
|
|
536
|
-
(function (SelectedDiscountCardType) {
|
|
537
|
-
SelectedDiscountCardType["COUPON"] = "COUPON";
|
|
538
|
-
SelectedDiscountCardType["CORPORATE_BOND"] = "CORPORATE_BOND";
|
|
539
|
-
SelectedDiscountCardType["GIFT_BOND"] = "GIFT_BOND";
|
|
540
|
-
})(SelectedDiscountCardType || (SelectedDiscountCardType = {}));
|
|
541
|
-
|
|
542
|
-
const getCustomerFullname = (customer) => {
|
|
543
|
-
return `${customer.first_name || ''} ${customer.last_name || ''}`.trim();
|
|
544
|
-
};
|
|
545
|
-
|
|
546
|
-
function parseJsonToFormDataAdvanced(imageGallery) {
|
|
547
|
-
const formData = new FormData();
|
|
548
|
-
if (!Array.isArray(imageGallery)) {
|
|
549
|
-
throw new Error('imageGallery debe ser un array');
|
|
550
|
-
}
|
|
551
|
-
if (imageGallery.length === 0) {
|
|
552
|
-
throw new Error('No hay imágenes para procesar');
|
|
553
|
-
}
|
|
554
|
-
if (imageGallery.length > 10) {
|
|
555
|
-
throw new Error('El backend acepta máximo 10 archivos por petición');
|
|
556
|
-
}
|
|
557
|
-
const processedFiles = [];
|
|
558
|
-
imageGallery.forEach((image, index) => {
|
|
559
|
-
try {
|
|
560
|
-
if (!image.name) {
|
|
561
|
-
throw new Error(`La imagen ${index + 1} no tiene nombre`);
|
|
562
|
-
}
|
|
563
|
-
if (!image.type || !image.type.startsWith('image/')) {
|
|
564
|
-
throw new Error(`La imagen ${index + 1} no tiene un tipo MIME válido`);
|
|
565
|
-
}
|
|
566
|
-
if (!image.preview) {
|
|
567
|
-
throw new Error(`La imagen ${index + 1} no tiene datos de preview`);
|
|
568
|
-
}
|
|
569
|
-
if (!image.preview.includes('data:image/') || !image.preview.includes('base64,')) {
|
|
570
|
-
throw new Error(`La imagen ${index + 1} no tiene un formato base64 válido`);
|
|
571
|
-
}
|
|
572
|
-
const base64Data = image.preview.split(',')[1];
|
|
573
|
-
const byteCharacters = atob(base64Data);
|
|
574
|
-
const byteNumbers = new Array(byteCharacters.length);
|
|
575
|
-
for (let i = 0; i < byteCharacters.length; i++) {
|
|
576
|
-
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
|
577
|
-
}
|
|
578
|
-
const byteArray = new Uint8Array(byteNumbers);
|
|
579
|
-
const blob = new Blob([byteArray], { type: image.type });
|
|
580
|
-
const file = new File([blob], image.name, {
|
|
581
|
-
type: image.type,
|
|
582
|
-
lastModified: Date.now(),
|
|
583
|
-
});
|
|
584
|
-
if (file.size === 0) {
|
|
585
|
-
throw new Error(`El archivo ${image.name} está vacío`);
|
|
586
|
-
}
|
|
587
|
-
formData.append('files', file);
|
|
588
|
-
processedFiles.push({
|
|
589
|
-
name: image.name,
|
|
590
|
-
size: file.size,
|
|
591
|
-
type: file.type,
|
|
592
|
-
});
|
|
593
|
-
}
|
|
594
|
-
catch (error) {
|
|
595
|
-
console.error(`Error procesando imagen ${index + 1}:`, error);
|
|
596
|
-
throw new Error(`Error procesando ${image.name || 'imagen ' + (index + 1)}: ${error?.message}`);
|
|
597
|
-
}
|
|
598
|
-
});
|
|
599
|
-
return formData;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
const transformImageToFile = (image) => {
|
|
603
|
-
return {
|
|
604
|
-
preview: image.full_url,
|
|
605
|
-
name: image.original_name,
|
|
606
|
-
size: image.size,
|
|
607
|
-
type: image.mime_type,
|
|
608
|
-
extension: image.extension,
|
|
609
|
-
};
|
|
610
|
-
};
|
|
611
|
-
|
|
612
|
-
const formatCitiesResponseToSelect = (res) => {
|
|
613
|
-
if (!res.data.cities || res.data.cities.length < 1) {
|
|
614
|
-
return [];
|
|
615
|
-
}
|
|
616
|
-
return res.data.cities?.map(({ id, name, search_text }) => ({
|
|
617
|
-
value: id,
|
|
618
|
-
label: search_text ?? name,
|
|
619
|
-
}));
|
|
620
|
-
};
|
|
621
|
-
|
|
622
518
|
function drawRoundedRect(con, shape, x, y, width, height, cornerRadius) {
|
|
623
519
|
con.beginPath();
|
|
624
520
|
con.moveTo(x + cornerRadius, y);
|
|
@@ -1028,129 +924,6 @@ const generateTableTicketScene = (con, shape, chairTicketStatuses, tableSeats) =
|
|
|
1028
924
|
con.restore();
|
|
1029
925
|
};
|
|
1030
926
|
|
|
1031
|
-
const KONVA_SHAPE_MAPPINGS = {
|
|
1032
|
-
[RoomMapElementType.STAGE]: {
|
|
1033
|
-
config: {
|
|
1034
|
-
width: TICKET_MAP_GRID_SIZE * 10,
|
|
1035
|
-
height: TICKET_MAP_GRID_SIZE * 2,
|
|
1036
|
-
fill: '#9C27B0',
|
|
1037
|
-
stroke: '#731d82',
|
|
1038
|
-
strokeWidth: 1,
|
|
1039
|
-
draggable: true,
|
|
1040
|
-
perfectDrawEnabled: false,
|
|
1041
|
-
sceneFunc: generateStageScene,
|
|
1042
|
-
},
|
|
1043
|
-
layer: 'background',
|
|
1044
|
-
},
|
|
1045
|
-
[RoomMapElementType.SEAT_BLOCK]: {
|
|
1046
|
-
config: {
|
|
1047
|
-
width: TICKET_MAP_GRID_SIZE * 5,
|
|
1048
|
-
height: TICKET_MAP_GRID_SIZE,
|
|
1049
|
-
fill: '#ffffff',
|
|
1050
|
-
stroke: '#909090',
|
|
1051
|
-
strokeWidth: 1,
|
|
1052
|
-
draggable: true,
|
|
1053
|
-
perfectDrawEnabled: false,
|
|
1054
|
-
sceneFunc: generateSeatBlockScene,
|
|
1055
|
-
},
|
|
1056
|
-
layer: 'elements',
|
|
1057
|
-
},
|
|
1058
|
-
[RoomMapElementType.TABLE]: {
|
|
1059
|
-
config: {
|
|
1060
|
-
width: TICKET_MAP_GRID_SIZE * 3,
|
|
1061
|
-
height: TICKET_MAP_GRID_SIZE * 2,
|
|
1062
|
-
fill: '#ffffff',
|
|
1063
|
-
stroke: '#909090',
|
|
1064
|
-
strokeWidth: 2,
|
|
1065
|
-
cornerRadius: 5,
|
|
1066
|
-
draggable: true,
|
|
1067
|
-
perfectDrawEnabled: false,
|
|
1068
|
-
sceneFunc: generateTableScene,
|
|
1069
|
-
},
|
|
1070
|
-
layer: 'elements',
|
|
1071
|
-
},
|
|
1072
|
-
[RoomMapElementType.ZONE]: {
|
|
1073
|
-
config: {
|
|
1074
|
-
width: TICKET_MAP_GRID_SIZE * 10,
|
|
1075
|
-
height: TICKET_MAP_GRID_SIZE * 3,
|
|
1076
|
-
fill: '#ffffff',
|
|
1077
|
-
stroke: '#909090',
|
|
1078
|
-
strokeWidth: 1,
|
|
1079
|
-
cornerRadius: 2,
|
|
1080
|
-
draggable: true,
|
|
1081
|
-
opacity: 1,
|
|
1082
|
-
perfectDrawEnabled: false,
|
|
1083
|
-
sceneFunc: generateZoneScene,
|
|
1084
|
-
},
|
|
1085
|
-
layer: 'background',
|
|
1086
|
-
},
|
|
1087
|
-
[RoomMapElementType.EXIT]: {
|
|
1088
|
-
config: {
|
|
1089
|
-
width: TICKET_MAP_GRID_SIZE * 3,
|
|
1090
|
-
height: TICKET_MAP_GRID_SIZE,
|
|
1091
|
-
fill: '#efefef',
|
|
1092
|
-
stroke: '#aaaaaa',
|
|
1093
|
-
strokeWidth: 1,
|
|
1094
|
-
draggable: true,
|
|
1095
|
-
perfectDrawEnabled: false,
|
|
1096
|
-
sceneFunc: generateExitScene,
|
|
1097
|
-
},
|
|
1098
|
-
layer: 'foreground',
|
|
1099
|
-
},
|
|
1100
|
-
[RoomMapElementType.PRODUCTION_AREA]: {
|
|
1101
|
-
config: {
|
|
1102
|
-
width: TICKET_MAP_GRID_SIZE * 4,
|
|
1103
|
-
height: TICKET_MAP_GRID_SIZE,
|
|
1104
|
-
fill: '#efefef',
|
|
1105
|
-
stroke: '#aaaaaa',
|
|
1106
|
-
strokeWidth: 1,
|
|
1107
|
-
draggable: true,
|
|
1108
|
-
perfectDrawEnabled: false,
|
|
1109
|
-
sceneFunc: generateProductionAreaScene,
|
|
1110
|
-
},
|
|
1111
|
-
layer: 'background',
|
|
1112
|
-
},
|
|
1113
|
-
[RoomMapElementType.UNAVAILABLE_SPACE]: {
|
|
1114
|
-
config: {
|
|
1115
|
-
width: TICKET_MAP_GRID_SIZE * 4,
|
|
1116
|
-
height: TICKET_MAP_GRID_SIZE,
|
|
1117
|
-
fill: '#efefef',
|
|
1118
|
-
stroke: '#aaaaaa',
|
|
1119
|
-
strokeWidth: 1,
|
|
1120
|
-
draggable: true,
|
|
1121
|
-
perfectDrawEnabled: false,
|
|
1122
|
-
sceneFunc: generateUnavailableSpaceScene,
|
|
1123
|
-
},
|
|
1124
|
-
layer: 'background',
|
|
1125
|
-
},
|
|
1126
|
-
[RoomMapElementType.STAIR]: {
|
|
1127
|
-
config: {
|
|
1128
|
-
width: TICKET_MAP_GRID_SIZE * 3,
|
|
1129
|
-
height: TICKET_MAP_GRID_SIZE,
|
|
1130
|
-
fill: '#efefef',
|
|
1131
|
-
stroke: '#aaaaaa',
|
|
1132
|
-
strokeWidth: 1,
|
|
1133
|
-
draggable: true,
|
|
1134
|
-
perfectDrawEnabled: false,
|
|
1135
|
-
sceneFunc: generateStairScene,
|
|
1136
|
-
},
|
|
1137
|
-
layer: 'background',
|
|
1138
|
-
},
|
|
1139
|
-
[RoomMapElementType.HALLWAY]: {
|
|
1140
|
-
config: {
|
|
1141
|
-
width: TICKET_MAP_GRID_SIZE * 3,
|
|
1142
|
-
height: TICKET_MAP_GRID_SIZE,
|
|
1143
|
-
fill: '#efefef',
|
|
1144
|
-
stroke: '#aaaaaa',
|
|
1145
|
-
strokeWidth: 1,
|
|
1146
|
-
draggable: true,
|
|
1147
|
-
perfectDrawEnabled: false,
|
|
1148
|
-
sceneFunc: generateHallwayScene,
|
|
1149
|
-
},
|
|
1150
|
-
layer: 'background',
|
|
1151
|
-
},
|
|
1152
|
-
};
|
|
1153
|
-
|
|
1154
927
|
function buildSeatLabel(rowIndex, colIndex, rows, cols, config) {
|
|
1155
928
|
let actualRowIndex = rowIndex;
|
|
1156
929
|
if (config.row_order === 'BOTTOM_TO_TOP') {
|
|
@@ -1758,6 +1531,233 @@ const generateZoneScene = (con, shape) => {
|
|
|
1758
1531
|
con.restore();
|
|
1759
1532
|
};
|
|
1760
1533
|
|
|
1534
|
+
const KONVA_SHAPE_MAPPINGS = {
|
|
1535
|
+
[RoomMapElementType.STAGE]: {
|
|
1536
|
+
config: {
|
|
1537
|
+
width: TICKET_MAP_GRID_SIZE * 10,
|
|
1538
|
+
height: TICKET_MAP_GRID_SIZE * 2,
|
|
1539
|
+
fill: '#9C27B0',
|
|
1540
|
+
stroke: '#731d82',
|
|
1541
|
+
strokeWidth: 1,
|
|
1542
|
+
draggable: true,
|
|
1543
|
+
perfectDrawEnabled: false,
|
|
1544
|
+
sceneFunc: generateStageScene,
|
|
1545
|
+
},
|
|
1546
|
+
layer: 'background',
|
|
1547
|
+
},
|
|
1548
|
+
[RoomMapElementType.SEAT_BLOCK]: {
|
|
1549
|
+
config: {
|
|
1550
|
+
width: TICKET_MAP_GRID_SIZE * 5,
|
|
1551
|
+
height: TICKET_MAP_GRID_SIZE,
|
|
1552
|
+
fill: '#ffffff',
|
|
1553
|
+
stroke: '#909090',
|
|
1554
|
+
strokeWidth: 1,
|
|
1555
|
+
draggable: true,
|
|
1556
|
+
perfectDrawEnabled: false,
|
|
1557
|
+
sceneFunc: generateSeatBlockScene,
|
|
1558
|
+
},
|
|
1559
|
+
layer: 'elements',
|
|
1560
|
+
},
|
|
1561
|
+
[RoomMapElementType.TABLE]: {
|
|
1562
|
+
config: {
|
|
1563
|
+
width: TICKET_MAP_GRID_SIZE * 3,
|
|
1564
|
+
height: TICKET_MAP_GRID_SIZE * 2,
|
|
1565
|
+
fill: '#ffffff',
|
|
1566
|
+
stroke: '#909090',
|
|
1567
|
+
strokeWidth: 2,
|
|
1568
|
+
cornerRadius: 5,
|
|
1569
|
+
draggable: true,
|
|
1570
|
+
perfectDrawEnabled: false,
|
|
1571
|
+
sceneFunc: generateTableScene,
|
|
1572
|
+
},
|
|
1573
|
+
layer: 'elements',
|
|
1574
|
+
},
|
|
1575
|
+
[RoomMapElementType.ZONE]: {
|
|
1576
|
+
config: {
|
|
1577
|
+
width: TICKET_MAP_GRID_SIZE * 10,
|
|
1578
|
+
height: TICKET_MAP_GRID_SIZE * 3,
|
|
1579
|
+
fill: '#ffffff',
|
|
1580
|
+
stroke: '#909090',
|
|
1581
|
+
strokeWidth: 1,
|
|
1582
|
+
cornerRadius: 2,
|
|
1583
|
+
draggable: true,
|
|
1584
|
+
opacity: 1,
|
|
1585
|
+
perfectDrawEnabled: false,
|
|
1586
|
+
sceneFunc: generateZoneScene,
|
|
1587
|
+
},
|
|
1588
|
+
layer: 'background',
|
|
1589
|
+
},
|
|
1590
|
+
[RoomMapElementType.EXIT]: {
|
|
1591
|
+
config: {
|
|
1592
|
+
width: TICKET_MAP_GRID_SIZE * 3,
|
|
1593
|
+
height: TICKET_MAP_GRID_SIZE,
|
|
1594
|
+
fill: '#efefef',
|
|
1595
|
+
stroke: '#aaaaaa',
|
|
1596
|
+
strokeWidth: 1,
|
|
1597
|
+
draggable: true,
|
|
1598
|
+
perfectDrawEnabled: false,
|
|
1599
|
+
sceneFunc: generateExitScene,
|
|
1600
|
+
},
|
|
1601
|
+
layer: 'foreground',
|
|
1602
|
+
},
|
|
1603
|
+
[RoomMapElementType.PRODUCTION_AREA]: {
|
|
1604
|
+
config: {
|
|
1605
|
+
width: TICKET_MAP_GRID_SIZE * 4,
|
|
1606
|
+
height: TICKET_MAP_GRID_SIZE,
|
|
1607
|
+
fill: '#efefef',
|
|
1608
|
+
stroke: '#aaaaaa',
|
|
1609
|
+
strokeWidth: 1,
|
|
1610
|
+
draggable: true,
|
|
1611
|
+
perfectDrawEnabled: false,
|
|
1612
|
+
sceneFunc: generateProductionAreaScene,
|
|
1613
|
+
},
|
|
1614
|
+
layer: 'background',
|
|
1615
|
+
},
|
|
1616
|
+
[RoomMapElementType.UNAVAILABLE_SPACE]: {
|
|
1617
|
+
config: {
|
|
1618
|
+
width: TICKET_MAP_GRID_SIZE * 4,
|
|
1619
|
+
height: TICKET_MAP_GRID_SIZE,
|
|
1620
|
+
fill: '#efefef',
|
|
1621
|
+
stroke: '#aaaaaa',
|
|
1622
|
+
strokeWidth: 1,
|
|
1623
|
+
draggable: true,
|
|
1624
|
+
perfectDrawEnabled: false,
|
|
1625
|
+
sceneFunc: generateUnavailableSpaceScene,
|
|
1626
|
+
},
|
|
1627
|
+
layer: 'background',
|
|
1628
|
+
},
|
|
1629
|
+
[RoomMapElementType.STAIR]: {
|
|
1630
|
+
config: {
|
|
1631
|
+
width: TICKET_MAP_GRID_SIZE * 3,
|
|
1632
|
+
height: TICKET_MAP_GRID_SIZE,
|
|
1633
|
+
fill: '#efefef',
|
|
1634
|
+
stroke: '#aaaaaa',
|
|
1635
|
+
strokeWidth: 1,
|
|
1636
|
+
draggable: true,
|
|
1637
|
+
perfectDrawEnabled: false,
|
|
1638
|
+
sceneFunc: generateStairScene,
|
|
1639
|
+
},
|
|
1640
|
+
layer: 'background',
|
|
1641
|
+
},
|
|
1642
|
+
[RoomMapElementType.HALLWAY]: {
|
|
1643
|
+
config: {
|
|
1644
|
+
width: TICKET_MAP_GRID_SIZE * 3,
|
|
1645
|
+
height: TICKET_MAP_GRID_SIZE,
|
|
1646
|
+
fill: '#efefef',
|
|
1647
|
+
stroke: '#aaaaaa',
|
|
1648
|
+
strokeWidth: 1,
|
|
1649
|
+
draggable: true,
|
|
1650
|
+
perfectDrawEnabled: false,
|
|
1651
|
+
sceneFunc: generateHallwayScene,
|
|
1652
|
+
},
|
|
1653
|
+
layer: 'background',
|
|
1654
|
+
},
|
|
1655
|
+
};
|
|
1656
|
+
|
|
1657
|
+
var OrderItemType;
|
|
1658
|
+
(function (OrderItemType) {
|
|
1659
|
+
OrderItemType["TICKET"] = "TICKET";
|
|
1660
|
+
OrderItemType["PRODUCT"] = "PRODUCT";
|
|
1661
|
+
})(OrderItemType || (OrderItemType = {}));
|
|
1662
|
+
|
|
1663
|
+
var OrderStatus;
|
|
1664
|
+
(function (OrderStatus) {
|
|
1665
|
+
OrderStatus["ON_HOLD"] = "on-hold";
|
|
1666
|
+
OrderStatus["PENDING_PAYMENT"] = "pending-payment";
|
|
1667
|
+
OrderStatus["PROCESSING"] = "processing";
|
|
1668
|
+
OrderStatus["COMPLETED"] = "completed";
|
|
1669
|
+
OrderStatus["FAILED"] = "failed";
|
|
1670
|
+
OrderStatus["CANCELLED"] = "cancelled";
|
|
1671
|
+
OrderStatus["REFUNDED"] = "refunded";
|
|
1672
|
+
})(OrderStatus || (OrderStatus = {}));
|
|
1673
|
+
|
|
1674
|
+
var SelectedDiscountCardType;
|
|
1675
|
+
(function (SelectedDiscountCardType) {
|
|
1676
|
+
SelectedDiscountCardType["COUPON"] = "COUPON";
|
|
1677
|
+
SelectedDiscountCardType["CORPORATE_BOND"] = "CORPORATE_BOND";
|
|
1678
|
+
SelectedDiscountCardType["GIFT_BOND"] = "GIFT_BOND";
|
|
1679
|
+
})(SelectedDiscountCardType || (SelectedDiscountCardType = {}));
|
|
1680
|
+
|
|
1681
|
+
const getCustomerFullname = (customer) => {
|
|
1682
|
+
return `${customer.first_name || ''} ${customer.last_name || ''}`.trim();
|
|
1683
|
+
};
|
|
1684
|
+
|
|
1685
|
+
function parseJsonToFormDataAdvanced(imageGallery) {
|
|
1686
|
+
const formData = new FormData();
|
|
1687
|
+
if (!Array.isArray(imageGallery)) {
|
|
1688
|
+
throw new Error('imageGallery debe ser un array');
|
|
1689
|
+
}
|
|
1690
|
+
if (imageGallery.length === 0) {
|
|
1691
|
+
throw new Error('No hay imágenes para procesar');
|
|
1692
|
+
}
|
|
1693
|
+
if (imageGallery.length > 10) {
|
|
1694
|
+
throw new Error('El backend acepta máximo 10 archivos por petición');
|
|
1695
|
+
}
|
|
1696
|
+
const processedFiles = [];
|
|
1697
|
+
imageGallery.forEach((image, index) => {
|
|
1698
|
+
try {
|
|
1699
|
+
if (!image.name) {
|
|
1700
|
+
throw new Error(`La imagen ${index + 1} no tiene nombre`);
|
|
1701
|
+
}
|
|
1702
|
+
if (!image.type || !image.type.startsWith('image/')) {
|
|
1703
|
+
throw new Error(`La imagen ${index + 1} no tiene un tipo MIME válido`);
|
|
1704
|
+
}
|
|
1705
|
+
if (!image.preview) {
|
|
1706
|
+
throw new Error(`La imagen ${index + 1} no tiene datos de preview`);
|
|
1707
|
+
}
|
|
1708
|
+
if (!image.preview.includes('data:image/') || !image.preview.includes('base64,')) {
|
|
1709
|
+
throw new Error(`La imagen ${index + 1} no tiene un formato base64 válido`);
|
|
1710
|
+
}
|
|
1711
|
+
const base64Data = image.preview.split(',')[1];
|
|
1712
|
+
const byteCharacters = atob(base64Data);
|
|
1713
|
+
const byteNumbers = new Array(byteCharacters.length);
|
|
1714
|
+
for (let i = 0; i < byteCharacters.length; i++) {
|
|
1715
|
+
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
|
1716
|
+
}
|
|
1717
|
+
const byteArray = new Uint8Array(byteNumbers);
|
|
1718
|
+
const blob = new Blob([byteArray], { type: image.type });
|
|
1719
|
+
const file = new File([blob], image.name, {
|
|
1720
|
+
type: image.type,
|
|
1721
|
+
lastModified: Date.now(),
|
|
1722
|
+
});
|
|
1723
|
+
if (file.size === 0) {
|
|
1724
|
+
throw new Error(`El archivo ${image.name} está vacío`);
|
|
1725
|
+
}
|
|
1726
|
+
formData.append('files', file);
|
|
1727
|
+
processedFiles.push({
|
|
1728
|
+
name: image.name,
|
|
1729
|
+
size: file.size,
|
|
1730
|
+
type: file.type,
|
|
1731
|
+
});
|
|
1732
|
+
}
|
|
1733
|
+
catch (error) {
|
|
1734
|
+
console.error(`Error procesando imagen ${index + 1}:`, error);
|
|
1735
|
+
throw new Error(`Error procesando ${image.name || 'imagen ' + (index + 1)}: ${error?.message}`);
|
|
1736
|
+
}
|
|
1737
|
+
});
|
|
1738
|
+
return formData;
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
const transformImageToFile = (image) => {
|
|
1742
|
+
return {
|
|
1743
|
+
preview: image.full_url,
|
|
1744
|
+
name: image.original_name,
|
|
1745
|
+
size: image.size,
|
|
1746
|
+
type: image.mime_type,
|
|
1747
|
+
extension: image.extension,
|
|
1748
|
+
};
|
|
1749
|
+
};
|
|
1750
|
+
|
|
1751
|
+
const formatCitiesResponseToSelect = (res) => {
|
|
1752
|
+
if (!res.data.cities || res.data.cities.length < 1) {
|
|
1753
|
+
return [];
|
|
1754
|
+
}
|
|
1755
|
+
return res.data.cities?.map(({ id, name, search_text }) => ({
|
|
1756
|
+
value: id,
|
|
1757
|
+
label: search_text ?? name,
|
|
1758
|
+
}));
|
|
1759
|
+
};
|
|
1760
|
+
|
|
1761
1761
|
function MinTodayValidator(controlName) {
|
|
1762
1762
|
return (formGroup) => {
|
|
1763
1763
|
const group = formGroup;
|
|
@@ -6409,5 +6409,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
6409
6409
|
* Generated bundle index. Do not edit.
|
|
6410
6410
|
*/
|
|
6411
6411
|
|
|
6412
|
-
export { ADMIN_API_ROUTES, ALERT_ICONS, AdminSelectComponent, AdminService, ApiService, AppAlertComponent, AppButtonComponent, AppLinkButtonComponent, AppModalComponent, AsyncSelectComponent, AuditInformationComponent, BASE_BUTTON_CLASSES, BASE_INPUT_CLASSES, BUTTON_SIZES_CLASSES, BUTTON_VARIANT_CLASSES, BaseModalService, CITY_API_ENDPOINTS, COUNTRY_API_ENDPOINTS, CUSTOMERS_API_ROUTES, ChangePasswordFormComponent, ChangePasswordFormService, CitiesService, CitySelectComponent, ColorPickerComponent, CorporateBondStatus, CountrySelectComponent, CountryService, CouponApplicability, CouponDiscountType, CouponStatus, CustomerSelectComponent, CustomerService, DEFAULT_STAGE_CONFIG, DOCUMENT_TYPES_OPTIONS, DateInputComponent, DateService, DaySelectorGridComponent, DeleteConfirmationComponent, DeleteConfirmationService, DynamicTableComponent, ERROR_INPUT_CLASSES, EndDateGreaterThanStartValidator, FORM_ERROR_MESSAGES, FeedbackModalComponent, FeedbackModalService, FileType, FileUploadComponent, FileUploadPreviewComponent, FormEditorComponent, FormInputComponent, FormSelectComponent, FormTextareaComponent, GiftBondStatus, LanguageSwitcherComponent, MinTodayValidator, MustMatchValidator, OrderItemType, OrderStatus, PAYMENT_METHODS_OPTIONS, PERFORMANCES_API_ROUTES, PRICE_ZONES_API_ROUTES, PRODUCTS_API_ROUTES, PRODUCT_CATEGORIES_API_ROUTES, PRODUCT_TAGS_API_ROUTES, PRODUCT_TYPES_API_ROUTES, PerformanceCardComponent, PerformanceCardListComponent, PerformanceMultiSelectComponent, PerformanceSelectComponent, PerformanceService, PerformanceStatus, PerformanceStepperComponent, PerformanceTicketStatus, PerformancesListEventsService, PriceZoneEventService, PriceZoneFormModalService, PriceZoneSelectComponent, PriceZoneService, ProductCategoryService, ProductMultiSelectComponent, ProductSelectComponent, ProductService, ProductTagService, ProductTypeService, RoomMapElementOrientation, RoomMapElementType, SHOWS_API_ROUTES, STATE_API_ENDPOINTS, SelectedDiscountCardType, ShowMultiSelectComponent, ShowSelectComponent, ShowService, ShowsFilterComponent, StateSelectComponent, StatesService, TICKERA_COMPONENTS_CONFIG, TICKET_ELEMENT_TYPES, TICKET_MAP_GRID_SIZE, TICKET_MAP_TITLE_HEIGHT, TICKET_STATUS_COLORS, TICKET_STATUS_FILLS, TICKET_STATUS_LABELS, TickeraTranslocoLoader, ToastService, ToggleSwitchComponent, VENUES_API_ROUTES, ZonePriceItemComponent, ZonePriceListComponent, authInterceptor, drawChairIcon$1 as drawChairIcon, drawHappyFace, drawRoundedRect, drawWheelchairIcon, findElementAtPosition, findTicketAtPosition, formatCitiesResponseToSelect, generateExitScene, generateHallwayScene, generateProductionAreaScene, generateSeatBlockScene, generateSeatBlockTicketScene, generateStageScene, generateStairScene, generateTableScene, generateTableTicketScene, generateUnavailableSpaceScene, generateZoneScene, getBrowserLanguage, getCustomerFullname, getItemTypeIcon, getStoredLanguage, numberToLetter$1 as numberToLetter, parseJsonToFormDataAdvanced, processElementsToRenderData, provideTickeraComponents, resolveLanguage, setStoredLanguage, tintColor, transformImageToFile };
|
|
6412
|
+
export { ADMIN_API_ROUTES, ALERT_ICONS, AdminSelectComponent, AdminService, ApiService, AppAlertComponent, AppButtonComponent, AppLinkButtonComponent, AppModalComponent, AsyncSelectComponent, AuditInformationComponent, BASE_BUTTON_CLASSES, BASE_INPUT_CLASSES, BUTTON_SIZES_CLASSES, BUTTON_VARIANT_CLASSES, BaseModalService, CITY_API_ENDPOINTS, COUNTRY_API_ENDPOINTS, CUSTOMERS_API_ROUTES, ChangePasswordFormComponent, ChangePasswordFormService, CitiesService, CitySelectComponent, ColorPickerComponent, CorporateBondStatus, CountrySelectComponent, CountryService, CouponApplicability, CouponDiscountType, CouponStatus, CustomerSelectComponent, CustomerService, DEFAULT_STAGE_CONFIG, DOCUMENT_TYPES_OPTIONS, DateInputComponent, DateService, DaySelectorGridComponent, DeleteConfirmationComponent, DeleteConfirmationService, DynamicTableComponent, ERROR_INPUT_CLASSES, EndDateGreaterThanStartValidator, FORM_ERROR_MESSAGES, FeedbackModalComponent, FeedbackModalService, FileType, FileUploadComponent, FileUploadPreviewComponent, FormEditorComponent, FormInputComponent, FormSelectComponent, FormTextareaComponent, GiftBondStatus, KONVA_SHAPE_MAPPINGS, LanguageSwitcherComponent, MinTodayValidator, MustMatchValidator, OrderItemType, OrderStatus, PAYMENT_METHODS_OPTIONS, PERFORMANCES_API_ROUTES, PRICE_ZONES_API_ROUTES, PRODUCTS_API_ROUTES, PRODUCT_CATEGORIES_API_ROUTES, PRODUCT_TAGS_API_ROUTES, PRODUCT_TYPES_API_ROUTES, PerformanceCardComponent, PerformanceCardListComponent, PerformanceMultiSelectComponent, PerformanceSelectComponent, PerformanceService, PerformanceStatus, PerformanceStepperComponent, PerformanceTicketStatus, PerformancesListEventsService, PriceZoneEventService, PriceZoneFormModalService, PriceZoneSelectComponent, PriceZoneService, ProductCategoryService, ProductMultiSelectComponent, ProductSelectComponent, ProductService, ProductTagService, ProductTypeService, RoomMapElementOrientation, RoomMapElementType, SHOWS_API_ROUTES, STATE_API_ENDPOINTS, SelectedDiscountCardType, ShowMultiSelectComponent, ShowSelectComponent, ShowService, ShowsFilterComponent, StateSelectComponent, StatesService, TICKERA_COMPONENTS_CONFIG, TICKET_ELEMENT_TYPES, TICKET_MAP_GRID_SIZE, TICKET_MAP_TITLE_HEIGHT, TICKET_STATUS_COLORS, TICKET_STATUS_FILLS, TICKET_STATUS_LABELS, TickeraTranslocoLoader, ToastService, ToggleSwitchComponent, VENUES_API_ROUTES, ZonePriceItemComponent, ZonePriceListComponent, authInterceptor, drawChairIcon$1 as drawChairIcon, drawHappyFace, drawRoundedRect, drawWheelchairIcon, findElementAtPosition, findTicketAtPosition, formatCitiesResponseToSelect, generateExitScene, generateHallwayScene, generateProductionAreaScene, generateSeatBlockScene, generateSeatBlockTicketScene, generateStageScene, generateStairScene, generateTableScene, generateTableTicketScene, generateUnavailableSpaceScene, generateZoneScene, getBrowserLanguage, getCustomerFullname, getItemTypeIcon, getStoredLanguage, numberToLetter$1 as numberToLetter, parseJsonToFormDataAdvanced, processElementsToRenderData, provideTickeraComponents, resolveLanguage, setStoredLanguage, tintColor, transformImageToFile };
|
|
6413
6413
|
//# sourceMappingURL=tickera-angular-components.mjs.map
|