@lucablockltd/ultimate-packaging 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1088,6 +1088,203 @@ async function exportDimensionPdf(params) {
1088
1088
  const arrayBuffer = doc.output("arraybuffer");
1089
1089
  return new Blob([arrayBuffer], { type: "application/pdf" });
1090
1090
  }
1091
+
1092
+ // src/utils/readyToPrint.ts
1093
+ var DIM_PADDING2 = 15;
1094
+ var FOOTER_H2 = 40;
1095
+ var MARGIN2 = 5;
1096
+ function camelToCapitalize2(str) {
1097
+ return str.replace(/([A-Z])/g, " $1").replace(/^./, (s) => s.toUpperCase());
1098
+ }
1099
+ function hexToRgb2(hex) {
1100
+ return {
1101
+ r: parseInt(hex.slice(1, 3), 16),
1102
+ g: parseInt(hex.slice(3, 5), 16),
1103
+ b: parseInt(hex.slice(5, 7), 16)
1104
+ };
1105
+ }
1106
+ function drawPath(doc, d, ox, oy) {
1107
+ const commands = parseSvgPath(d);
1108
+ let startX = 0;
1109
+ let startY = 0;
1110
+ let curX = 0;
1111
+ let curY = 0;
1112
+ for (const cmd of commands) {
1113
+ switch (cmd.type) {
1114
+ case "M":
1115
+ curX = cmd.x + ox;
1116
+ curY = cmd.y + oy;
1117
+ startX = curX;
1118
+ startY = curY;
1119
+ break;
1120
+ case "L": {
1121
+ const nx = cmd.x + ox;
1122
+ const ny = cmd.y + oy;
1123
+ doc.line(curX, curY, nx, ny);
1124
+ curX = nx;
1125
+ curY = ny;
1126
+ break;
1127
+ }
1128
+ case "C": {
1129
+ const x0 = curX;
1130
+ const y0 = curY;
1131
+ const x1 = cmd.x1 + ox;
1132
+ const y1 = cmd.y1 + oy;
1133
+ const x2 = cmd.x2 + ox;
1134
+ const y2 = cmd.y2 + oy;
1135
+ const x3 = cmd.x + ox;
1136
+ const y3 = cmd.y + oy;
1137
+ const steps = 20;
1138
+ let prevX = x0;
1139
+ let prevY = y0;
1140
+ for (let si = 1; si <= steps; si++) {
1141
+ const t = si / steps;
1142
+ const mt = 1 - t;
1143
+ const nx = mt * mt * mt * x0 + 3 * mt * mt * t * x1 + 3 * mt * t * t * x2 + t * t * t * x3;
1144
+ const ny = mt * mt * mt * y0 + 3 * mt * mt * t * y1 + 3 * mt * t * t * y2 + t * t * t * y3;
1145
+ doc.line(prevX, prevY, nx, ny);
1146
+ prevX = nx;
1147
+ prevY = ny;
1148
+ }
1149
+ curX = x3;
1150
+ curY = y3;
1151
+ break;
1152
+ }
1153
+ case "Q": {
1154
+ const qx0 = curX;
1155
+ const qy0 = curY;
1156
+ const qx1 = cmd.x1 + ox;
1157
+ const qy1 = cmd.y1 + oy;
1158
+ const qx2 = cmd.x + ox;
1159
+ const qy2 = cmd.y + oy;
1160
+ const qSteps = 16;
1161
+ let qPrevX = qx0;
1162
+ let qPrevY = qy0;
1163
+ for (let si = 1; si <= qSteps; si++) {
1164
+ const t = si / qSteps;
1165
+ const mt = 1 - t;
1166
+ const nx = mt * mt * qx0 + 2 * mt * t * qx1 + t * t * qx2;
1167
+ const ny = mt * mt * qy0 + 2 * mt * t * qy1 + t * t * qy2;
1168
+ doc.line(qPrevX, qPrevY, nx, ny);
1169
+ qPrevX = nx;
1170
+ qPrevY = ny;
1171
+ }
1172
+ curX = qx2;
1173
+ curY = qy2;
1174
+ break;
1175
+ }
1176
+ case "Z":
1177
+ doc.line(curX, curY, startX, startY);
1178
+ curX = startX;
1179
+ curY = startY;
1180
+ break;
1181
+ }
1182
+ }
1183
+ }
1184
+ async function readyToPrintPdf(params) {
1185
+ const { modelId, dieline, dimensions, attributes, unit, factor, theme } = params;
1186
+ const { width: vw, height: vh } = dieline.viewBox;
1187
+ const contentW = vw + DIM_PADDING2 * 2;
1188
+ const contentH = vh + DIM_PADDING2 * 2;
1189
+ const pageW = contentW + MARGIN2 * 2;
1190
+ const pageH = contentH + MARGIN2 * 2 + FOOTER_H2;
1191
+ const { jsPDF } = await import('jspdf');
1192
+ const doc = new jsPDF({
1193
+ orientation: pageW > pageH ? "landscape" : "portrait",
1194
+ unit: "mm",
1195
+ format: [pageW, pageH]
1196
+ });
1197
+ const ox = MARGIN2 + DIM_PADDING2;
1198
+ const oy = MARGIN2 + DIM_PADDING2;
1199
+ const creaseRgb = hexToRgb2(theme.colorFoldLine);
1200
+ doc.setDrawColor(creaseRgb.r, creaseRgb.g, creaseRgb.b);
1201
+ doc.setLineWidth(0.3);
1202
+ for (const d of dieline.crease) {
1203
+ drawPath(doc, d, ox, oy);
1204
+ }
1205
+ const cutRgb = hexToRgb2(theme.colorDieLine);
1206
+ doc.setDrawColor(cutRgb.r, cutRgb.g, cutRgb.b);
1207
+ doc.setLineWidth(0.3);
1208
+ for (const d of dieline.cut) {
1209
+ drawPath(doc, d, ox, oy);
1210
+ }
1211
+ const tick = 1.5;
1212
+ for (const dim of dimensions) {
1213
+ if (dim.orientation === "horizontal") {
1214
+ const y = dim.y1 + dim.offset + oy;
1215
+ const x1 = dim.x1 + ox;
1216
+ const x2 = dim.x2 + ox;
1217
+ doc.setDrawColor(0, 0, 0);
1218
+ doc.setLineWidth(0.2);
1219
+ doc.line(x1, y, x2, y);
1220
+ doc.setLineWidth(0.3);
1221
+ doc.line(x1, y - tick, x1, y + tick);
1222
+ doc.line(x2, y - tick, x2, y + tick);
1223
+ const midX = (x1 + x2) / 2;
1224
+ doc.setFontSize(3.5 * 2.83);
1225
+ doc.setTextColor(0, 0, 0);
1226
+ doc.text(dim.label, midX, y - 1.5, { align: "center" });
1227
+ } else {
1228
+ const x = dim.x1 + dim.offset + ox;
1229
+ const y1 = dim.y1 + oy;
1230
+ const y2 = dim.y2 + oy;
1231
+ doc.setDrawColor(0, 0, 0);
1232
+ doc.setLineWidth(0.2);
1233
+ doc.line(x, y1, x, y2);
1234
+ doc.setLineWidth(0.3);
1235
+ doc.line(x - tick, y1, x + tick, y1);
1236
+ doc.line(x - tick, y2, x + tick, y2);
1237
+ const midY = (y1 + y2) / 2;
1238
+ doc.setFontSize(3.5 * 2.83);
1239
+ doc.setTextColor(0, 0, 0);
1240
+ const textX = x - 1.5;
1241
+ const tw = doc.getTextWidth(dim.label);
1242
+ doc.text(dim.label, textX, midY + tw / 2, { angle: 90 });
1243
+ }
1244
+ }
1245
+ const footerY = pageH - FOOTER_H2;
1246
+ const halfW = (pageW - MARGIN2 * 2) / 2;
1247
+ const centerX = MARGIN2 + halfW;
1248
+ doc.setDrawColor(180, 180, 180);
1249
+ doc.setLineWidth(0.3);
1250
+ doc.line(MARGIN2, footerY, pageW - MARGIN2, footerY);
1251
+ doc.line(centerX, footerY, centerX, pageH - MARGIN2);
1252
+ doc.setTextColor(0, 0, 0);
1253
+ doc.setFontSize(9);
1254
+ doc.text("Luca Block Co.,Ltd.", MARGIN2 + 3, footerY + 6);
1255
+ doc.text(
1256
+ `Cartons-Tuck end boxes-${modelId}`,
1257
+ pageW - MARGIN2 - 3,
1258
+ footerY + 6,
1259
+ { align: "right" }
1260
+ );
1261
+ const attrEntries = Object.entries(attributes);
1262
+ const col1X = MARGIN2 + 3;
1263
+ const col2X = MARGIN2 + 3 + halfW / 2;
1264
+ const attrStartY = footerY + 14;
1265
+ const lineH = 5;
1266
+ doc.setFontSize(7);
1267
+ const half = Math.ceil(attrEntries.length / 2);
1268
+ for (let i = 0; i < half; i++) {
1269
+ const [key, val] = attrEntries[i];
1270
+ doc.text(
1271
+ `${camelToCapitalize2(key)}: ${(val * factor).toFixed(1)} ${unit}`,
1272
+ col1X,
1273
+ attrStartY + i * lineH
1274
+ );
1275
+ const j = i + half;
1276
+ if (j < attrEntries.length) {
1277
+ const [key2, val2] = attrEntries[j];
1278
+ doc.text(
1279
+ `${camelToCapitalize2(key2)}: ${(val2 * factor).toFixed(1)} ${unit}`,
1280
+ col2X,
1281
+ attrStartY + i * lineH
1282
+ );
1283
+ }
1284
+ }
1285
+ const arrayBuffer = doc.output("arraybuffer");
1286
+ return new Blob([arrayBuffer], { type: "application/pdf" });
1287
+ }
1091
1288
  function DebugOverlay({ data, fontSize }) {
1092
1289
  const ptR = fontSize * 0.3;
1093
1290
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -1303,6 +1500,18 @@ var DIE_LINE_BECF_1010A = react.forwardRef(
1303
1500
  factor,
1304
1501
  theme
1305
1502
  });
1503
+ },
1504
+ readyToPrint: async () => {
1505
+ const dimData = generateDimensions(attributes, unit);
1506
+ return readyToPrintPdf({
1507
+ modelId: MODEL_ID,
1508
+ dieline,
1509
+ dimensions: dimData,
1510
+ attributes,
1511
+ unit,
1512
+ factor,
1513
+ theme
1514
+ });
1306
1515
  }
1307
1516
  }),
1308
1517
  [attributes, dieline, factor, unit, serializeSvg, theme]
@@ -1403,6 +1612,7 @@ var CANVAS_BECF_1010A = react.forwardRef(
1403
1612
  });
1404
1613
  },
1405
1614
  exportDimension: () => dieLineRef.current.exportDimension(),
1615
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
1406
1616
  resetView: () => canvasRef.current?.resetView(),
1407
1617
  fitView: () => canvasRef.current?.fitView()
1408
1618
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -1996,6 +2206,18 @@ var DIE_LINE_BECF_1030A = react.forwardRef(
1996
2206
  factor,
1997
2207
  theme
1998
2208
  });
2209
+ },
2210
+ readyToPrint: async () => {
2211
+ const dimData = generateDimensions2(attributes, unit);
2212
+ return readyToPrintPdf({
2213
+ modelId: MODEL_ID2,
2214
+ dieline,
2215
+ dimensions: dimData,
2216
+ attributes,
2217
+ unit,
2218
+ factor,
2219
+ theme
2220
+ });
1999
2221
  }
2000
2222
  }),
2001
2223
  [attributes, dieline, factor, unit, serializeSvg, theme]
@@ -2096,6 +2318,7 @@ var CANVAS_BECF_1030A = react.forwardRef(
2096
2318
  });
2097
2319
  },
2098
2320
  exportDimension: () => dieLineRef.current.exportDimension(),
2321
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
2099
2322
  resetView: () => canvasRef.current?.resetView(),
2100
2323
  fitView: () => canvasRef.current?.fitView()
2101
2324
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -2691,6 +2914,18 @@ var DIE_LINE_BECF_1040A = react.forwardRef(
2691
2914
  factor,
2692
2915
  theme
2693
2916
  });
2917
+ },
2918
+ readyToPrint: async () => {
2919
+ const dimData = generateDimensions3(attributes, unit);
2920
+ return readyToPrintPdf({
2921
+ modelId: MODEL_ID3,
2922
+ dieline,
2923
+ dimensions: dimData,
2924
+ attributes,
2925
+ unit,
2926
+ factor,
2927
+ theme
2928
+ });
2694
2929
  }
2695
2930
  }),
2696
2931
  [attributes, dieline, factor, unit, serializeSvg, theme]
@@ -2791,6 +3026,7 @@ var CANVAS_BECF_1040A = react.forwardRef(
2791
3026
  });
2792
3027
  },
2793
3028
  exportDimension: () => dieLineRef.current.exportDimension(),
3029
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
2794
3030
  resetView: () => canvasRef.current?.resetView(),
2795
3031
  fitView: () => canvasRef.current?.fitView()
2796
3032
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -3406,6 +3642,18 @@ var DIE_LINE_BECF_11D01 = react.forwardRef(
3406
3642
  factor,
3407
3643
  theme
3408
3644
  });
3645
+ },
3646
+ readyToPrint: async () => {
3647
+ const dimData = generateDimensions4(attributes, unit);
3648
+ return readyToPrintPdf({
3649
+ modelId: MODEL_ID4,
3650
+ dieline,
3651
+ dimensions: dimData,
3652
+ attributes,
3653
+ unit,
3654
+ factor,
3655
+ theme
3656
+ });
3409
3657
  }
3410
3658
  }),
3411
3659
  [attributes, dieline, factor, unit, serializeSvg, theme]
@@ -3502,6 +3750,7 @@ var CANVAS_BECF_11D01 = react.forwardRef(
3502
3750
  });
3503
3751
  },
3504
3752
  exportDimension: () => dieLineRef.current.exportDimension(),
3753
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
3505
3754
  resetView: () => canvasRef.current?.resetView(),
3506
3755
  fitView: () => canvasRef.current?.fitView()
3507
3756
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -3537,9 +3786,10 @@ var MODEL_BECF_11D01 = react.forwardRef(
3537
3786
  var DIP = 15;
3538
3787
  var ROPE_R = 3;
3539
3788
  var ROPE_Y = 20;
3540
- var D_MAX = 40;
3541
- function calcD(c, b) {
3542
- return Math.min(c - 2 - b / 2, D_MAX);
3789
+ var D_SMALL = 30;
3790
+ var D_LARGE = 40;
3791
+ function calcD(c) {
3792
+ return c < 300 ? D_SMALL : D_LARGE;
3543
3793
  }
3544
3794
  function calcKulak(b) {
3545
3795
  if (b <= 13) return b - 1;
@@ -3553,7 +3803,7 @@ function calcX(a) {
3553
3803
  }
3554
3804
  function getAutoCalcValues(attr) {
3555
3805
  const { length: A, width: B, height: C, glueArea } = attr;
3556
- const D = calcD(C, B);
3806
+ const D = calcD(C);
3557
3807
  const kulak = glueArea ?? calcKulak(B);
3558
3808
  const X = calcX(A);
3559
3809
  return { d: D, kulak, dip: DIP, ropeR: ROPE_R, ropeY: ROPE_Y, ropeX: X };
@@ -3566,7 +3816,7 @@ function circlePath(cx, cy, r) {
3566
3816
  }
3567
3817
  function generateBecf12101(attr) {
3568
3818
  const { length: A, width: B, height: C, glueArea } = attr;
3569
- const D = calcD(C, B);
3819
+ const D = calcD(C);
3570
3820
  const kulak = glueArea ?? calcKulak(B);
3571
3821
  const X = calcX(A);
3572
3822
  const xFront = kulak;
@@ -3623,7 +3873,7 @@ function generateBecf12101(attr) {
3623
3873
  }
3624
3874
  function generateBecf12101DebugSections(attr) {
3625
3875
  const { length: A, width: B, height: C, glueArea } = attr;
3626
- const D = calcD(C, B);
3876
+ const D = calcD(C);
3627
3877
  const kulak = glueArea ?? calcKulak(B);
3628
3878
  const X = calcX(A);
3629
3879
  const xFront = kulak;
@@ -3706,7 +3956,7 @@ function generateBecf12101DebugSections(attr) {
3706
3956
  }
3707
3957
  function generateOuterContour5(attr) {
3708
3958
  const { length: A, width: B, height: C, glueArea } = attr;
3709
- const D = calcD(C, B);
3959
+ const D = calcD(C);
3710
3960
  const kulak = glueArea ?? calcKulak(B);
3711
3961
  const totalWidth = kulak + 2 * A + 2 * B - 2;
3712
3962
  const totalHeight = D + C + B / 2 + DIP;
@@ -3764,7 +4014,7 @@ function contourToPath5(points) {
3764
4014
  }
3765
4015
  function generateDimensions5(attr, unit) {
3766
4016
  const { length: A, width: B, height: C, glueArea } = attr;
3767
- const D = calcD(C, B);
4017
+ const D = calcD(C);
3768
4018
  const kulak = glueArea ?? calcKulak(B);
3769
4019
  const factor = unit === "cm" ? 0.1 : unit === "in" ? 1 / 25.4 : 1;
3770
4020
  const suffix = unit;
@@ -3773,11 +4023,12 @@ function generateDimensions5(attr, unit) {
3773
4023
  const xSide1 = kulak + A;
3774
4024
  const xBack = kulak + A + B;
3775
4025
  const yFoldTop = D;
4026
+ const yFoldBottomStart = D + C - B / 2;
3776
4027
  const yFoldBottom = D + C;
4028
+ const yBottomFlap = D + C + B / 2;
3777
4029
  const yEnd = D + C + B / 2 + DIP;
3778
4030
  const totalWidth = kulak + 2 * A + 2 * B - 2;
3779
4031
  const totalHeight = yEnd;
3780
- const bottomSection = B / 2 + DIP;
3781
4032
  return [
3782
4033
  // Overall dimensions (outside)
3783
4034
  {
@@ -3798,7 +4049,17 @@ function generateDimensions5(attr, unit) {
3798
4049
  orientation: "vertical",
3799
4050
  offset: -12
3800
4051
  },
3801
- // Height (C) — body area (centered on back panel)
4052
+ // Top flap (D)
4053
+ {
4054
+ x1: xBack + A * 0.6,
4055
+ y1: 0,
4056
+ x2: xBack + A * 0.6,
4057
+ y2: yFoldTop,
4058
+ label: fmt(D),
4059
+ orientation: "vertical",
4060
+ offset: -10
4061
+ },
4062
+ // Body height (h = C)
3802
4063
  {
3803
4064
  x1: xBack + A * 0.6,
3804
4065
  y1: yFoldTop,
@@ -3808,23 +4069,33 @@ function generateDimensions5(attr, unit) {
3808
4069
  orientation: "vertical",
3809
4070
  offset: -10
3810
4071
  },
3811
- // Top flap (D) (centered on back panel)
4072
+ // W-fold upper (B/2) yFoldBottomStart to yFoldBottom
3812
4073
  {
3813
4074
  x1: xBack + A * 0.6,
3814
- y1: 0,
4075
+ y1: yFoldBottomStart,
3815
4076
  x2: xBack + A * 0.6,
3816
- y2: yFoldTop,
3817
- label: fmt(D),
4077
+ y2: yFoldBottom,
4078
+ label: fmt(B / 2),
3818
4079
  orientation: "vertical",
3819
4080
  offset: -10
3820
4081
  },
3821
- // Bottom section (B/2 + _dip) (centered on back panel)
4082
+ // W-fold lower (B/2) yFoldBottom to yBottomFlap
3822
4083
  {
3823
4084
  x1: xBack + A * 0.6,
3824
4085
  y1: yFoldBottom,
3825
4086
  x2: xBack + A * 0.6,
4087
+ y2: yBottomFlap,
4088
+ label: fmt(B / 2),
4089
+ orientation: "vertical",
4090
+ offset: -10
4091
+ },
4092
+ // DIP — bottom glue tab
4093
+ {
4094
+ x1: xBack + A * 0.6,
4095
+ y1: yBottomFlap,
4096
+ x2: xBack + A * 0.6,
3826
4097
  y2: yEnd,
3827
- label: fmt(bottomSection),
4098
+ label: fmt(DIP),
3828
4099
  orientation: "vertical",
3829
4100
  offset: -10
3830
4101
  },
@@ -4012,6 +4283,18 @@ var DIE_LINE_BECF_12101 = react.forwardRef(
4012
4283
  factor,
4013
4284
  theme
4014
4285
  });
4286
+ },
4287
+ readyToPrint: async () => {
4288
+ const dimData = generateDimensions5(attributes, unit);
4289
+ return readyToPrintPdf({
4290
+ modelId: MODEL_ID5,
4291
+ dieline,
4292
+ dimensions: dimData,
4293
+ attributes,
4294
+ unit,
4295
+ factor,
4296
+ theme
4297
+ });
4015
4298
  }
4016
4299
  };
4017
4300
  },
@@ -4109,6 +4392,7 @@ var CANVAS_BECF_12101 = react.forwardRef(
4109
4392
  });
4110
4393
  },
4111
4394
  exportDimension: () => dieLineRef.current.exportDimension(),
4395
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
4112
4396
  resetView: () => canvasRef.current?.resetView(),
4113
4397
  fitView: () => canvasRef.current?.fitView()
4114
4398
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -4141,14 +4425,15 @@ var MODEL_BECF_12101 = react.forwardRef(
4141
4425
  );
4142
4426
 
4143
4427
  // src/components/dieline/bags-pillows/becf-12109/generate.ts
4144
- var DIP2 = 13;
4428
+ var DIP2 = 15;
4145
4429
  var ROPE_R2 = 3;
4146
4430
  var ROPE_Y2 = 20;
4147
- var D_MAX2 = 40;
4431
+ var D_SMALL2 = 30;
4432
+ var D_LARGE2 = 40;
4148
4433
  var NOTCH_X = 3;
4149
4434
  var NOTCH_Y = 5;
4150
- function calcD2(c, b) {
4151
- return Math.min(c - 2 - b / 2, D_MAX2);
4435
+ function calcD2(c) {
4436
+ return c < 300 ? D_SMALL2 : D_LARGE2;
4152
4437
  }
4153
4438
  function calcKulak2(b) {
4154
4439
  if (b <= 13) return b - 1;
@@ -4162,7 +4447,7 @@ function calcX2(a) {
4162
4447
  }
4163
4448
  function getAutoCalcValues2(attr) {
4164
4449
  const { length: A, width: B, height: C, glueArea } = attr;
4165
- const D = calcD2(C, B);
4450
+ const D = calcD2(C);
4166
4451
  const kulak = glueArea ?? calcKulak2(B);
4167
4452
  const X = calcX2(A);
4168
4453
  return { d: D, kulak, dip: DIP2, ropeR: ROPE_R2, ropeY: ROPE_Y2, ropeX: X };
@@ -4175,7 +4460,7 @@ function circlePath2(cx, cy, r) {
4175
4460
  }
4176
4461
  function generateBecf12109(attr) {
4177
4462
  const { length: A, width: B, height: C, glueArea } = attr;
4178
- const D = calcD2(C, B);
4463
+ const D = calcD2(C);
4179
4464
  const kulak = glueArea ?? calcKulak2(B);
4180
4465
  const X = calcX2(A);
4181
4466
  const xFront = kulak;
@@ -4245,7 +4530,7 @@ function generateBecf12109(attr) {
4245
4530
  }
4246
4531
  function generateBecf12109DebugSections(attr) {
4247
4532
  const { length: A, width: B, height: C, glueArea } = attr;
4248
- const D = calcD2(C, B);
4533
+ const D = calcD2(C);
4249
4534
  const kulak = glueArea ?? calcKulak2(B);
4250
4535
  const X = calcX2(A);
4251
4536
  const xFront = kulak;
@@ -4353,7 +4638,7 @@ function generateBecf12109DebugSections(attr) {
4353
4638
  }
4354
4639
  function generateOuterContour6(attr) {
4355
4640
  const { length: A, width: B, height: C, glueArea } = attr;
4356
- const D = calcD2(C, B);
4641
+ const D = calcD2(C);
4357
4642
  const kulak = glueArea ?? calcKulak2(B);
4358
4643
  const xFront = kulak;
4359
4644
  const xSide1 = kulak + A;
@@ -4446,7 +4731,7 @@ function contourToPath6(points) {
4446
4731
  }
4447
4732
  function generateDimensions6(attr, unit) {
4448
4733
  const { length: A, width: B, height: C, glueArea } = attr;
4449
- const D = calcD2(C, B);
4734
+ const D = calcD2(C);
4450
4735
  const kulak = glueArea ?? calcKulak2(B);
4451
4736
  const factor = unit === "cm" ? 0.1 : unit === "in" ? 1 / 25.4 : 1;
4452
4737
  const suffix = unit;
@@ -4455,11 +4740,12 @@ function generateDimensions6(attr, unit) {
4455
4740
  const xSide1 = kulak + A;
4456
4741
  const xBack = kulak + A + B;
4457
4742
  const yFoldTop = D;
4743
+ const yFoldBottomStart = D + C - B / 2;
4458
4744
  const yFoldBottom = D + C;
4745
+ const yBottomFlap = D + C + B / 2;
4459
4746
  const yEnd = D + C + B / 2 + DIP2;
4460
4747
  const totalWidth = kulak + 2 * A + 2 * B - 2;
4461
4748
  const totalHeight = yEnd;
4462
- const bottomSection = B / 2 + DIP2;
4463
4749
  return [
4464
4750
  // Overall dimensions (outside)
4465
4751
  {
@@ -4480,7 +4766,17 @@ function generateDimensions6(attr, unit) {
4480
4766
  orientation: "vertical",
4481
4767
  offset: -12
4482
4768
  },
4483
- // Height (C) — body area (centered on back panel)
4769
+ // Top flap (D)
4770
+ {
4771
+ x1: xBack + A * 0.6,
4772
+ y1: 0,
4773
+ x2: xBack + A * 0.6,
4774
+ y2: yFoldTop,
4775
+ label: fmt(D),
4776
+ orientation: "vertical",
4777
+ offset: -10
4778
+ },
4779
+ // Body height (h = C)
4484
4780
  {
4485
4781
  x1: xBack + A * 0.6,
4486
4782
  y1: yFoldTop,
@@ -4490,23 +4786,33 @@ function generateDimensions6(attr, unit) {
4490
4786
  orientation: "vertical",
4491
4787
  offset: -10
4492
4788
  },
4493
- // Top flap (D) (centered on back panel)
4789
+ // W-fold upper (B/2) yFoldBottomStart to yFoldBottom
4494
4790
  {
4495
4791
  x1: xBack + A * 0.6,
4496
- y1: 0,
4792
+ y1: yFoldBottomStart,
4497
4793
  x2: xBack + A * 0.6,
4498
- y2: yFoldTop,
4499
- label: fmt(D),
4794
+ y2: yFoldBottom,
4795
+ label: fmt(B / 2),
4500
4796
  orientation: "vertical",
4501
4797
  offset: -10
4502
4798
  },
4503
- // Bottom section (B/2 + _dip) (centered on back panel)
4799
+ // W-fold lower (B/2) yFoldBottom to yBottomFlap
4504
4800
  {
4505
4801
  x1: xBack + A * 0.6,
4506
4802
  y1: yFoldBottom,
4507
4803
  x2: xBack + A * 0.6,
4804
+ y2: yBottomFlap,
4805
+ label: fmt(B / 2),
4806
+ orientation: "vertical",
4807
+ offset: -10
4808
+ },
4809
+ // DIP — bottom glue tab
4810
+ {
4811
+ x1: xBack + A * 0.6,
4812
+ y1: yBottomFlap,
4813
+ x2: xBack + A * 0.6,
4508
4814
  y2: yEnd,
4509
- label: fmt(bottomSection),
4815
+ label: fmt(DIP2),
4510
4816
  orientation: "vertical",
4511
4817
  offset: -10
4512
4818
  },
@@ -4694,6 +5000,18 @@ var DIE_LINE_BECF_12109 = react.forwardRef(
4694
5000
  factor,
4695
5001
  theme
4696
5002
  });
5003
+ },
5004
+ readyToPrint: async () => {
5005
+ const dimData = generateDimensions6(attributes, unit);
5006
+ return readyToPrintPdf({
5007
+ modelId: MODEL_ID6,
5008
+ dieline,
5009
+ dimensions: dimData,
5010
+ attributes,
5011
+ unit,
5012
+ factor,
5013
+ theme
5014
+ });
4697
5015
  }
4698
5016
  };
4699
5017
  },
@@ -4791,6 +5109,7 @@ var CANVAS_BECF_12109 = react.forwardRef(
4791
5109
  });
4792
5110
  },
4793
5111
  exportDimension: () => dieLineRef.current.exportDimension(),
5112
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
4794
5113
  resetView: () => canvasRef.current?.resetView(),
4795
5114
  fitView: () => canvasRef.current?.fitView()
4796
5115
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -4827,9 +5146,9 @@ var DIP3 = 15;
4827
5146
  var RIBBON_HALF_W = 9;
4828
5147
  var RIBBON_DX = 2;
4829
5148
  var RIBBON_DY = 2;
4830
- var D_MAX3 = 40;
5149
+ var D_MAX = 40;
4831
5150
  function calcD3(c, b) {
4832
- return Math.min(c - 2 - b / 2, D_MAX3);
5151
+ return Math.min(c - 2 - b / 2, D_MAX);
4833
5152
  }
4834
5153
  function calcKulak3(b) {
4835
5154
  if (b <= 13) return b - 1;
@@ -5304,6 +5623,18 @@ var DIE_LINE_BECF_C_12101 = react.forwardRef(
5304
5623
  factor,
5305
5624
  theme
5306
5625
  });
5626
+ },
5627
+ readyToPrint: async () => {
5628
+ const dimData = generateDimensions7(attributes, unit);
5629
+ return readyToPrintPdf({
5630
+ modelId: MODEL_ID7,
5631
+ dieline,
5632
+ dimensions: dimData,
5633
+ attributes,
5634
+ unit,
5635
+ factor,
5636
+ theme
5637
+ });
5307
5638
  }
5308
5639
  };
5309
5640
  },
@@ -5401,6 +5732,7 @@ var CANVAS_BECF_C_12101 = react.forwardRef(
5401
5732
  });
5402
5733
  },
5403
5734
  exportDimension: () => dieLineRef.current.exportDimension(),
5735
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
5404
5736
  resetView: () => canvasRef.current?.resetView(),
5405
5737
  fitView: () => canvasRef.current?.fitView()
5406
5738
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -5437,11 +5769,11 @@ var DIP4 = 13;
5437
5769
  var RIBBON_HALF_W2 = 9;
5438
5770
  var RIBBON_DX2 = 2;
5439
5771
  var RIBBON_DY2 = 2;
5440
- var D_MAX4 = 40;
5772
+ var D_MAX2 = 40;
5441
5773
  var NOTCH_X2 = 3;
5442
5774
  var NOTCH_Y2 = 5;
5443
5775
  function calcD4(c, b) {
5444
- return Math.min(c - 2 - b / 2, D_MAX4);
5776
+ return Math.min(c - 2 - b / 2, D_MAX2);
5445
5777
  }
5446
5778
  function calcKulak4(b) {
5447
5779
  if (b <= 13) return b - 1;
@@ -6004,6 +6336,18 @@ var DIE_LINE_BECF_C_12109 = react.forwardRef(
6004
6336
  factor,
6005
6337
  theme
6006
6338
  });
6339
+ },
6340
+ readyToPrint: async () => {
6341
+ const dimData = generateDimensions8(attributes, unit);
6342
+ return readyToPrintPdf({
6343
+ modelId: MODEL_ID8,
6344
+ dieline,
6345
+ dimensions: dimData,
6346
+ attributes,
6347
+ unit,
6348
+ factor,
6349
+ theme
6350
+ });
6007
6351
  }
6008
6352
  };
6009
6353
  },
@@ -6101,6 +6445,7 @@ var CANVAS_BECF_C_12109 = react.forwardRef(
6101
6445
  });
6102
6446
  },
6103
6447
  exportDimension: () => dieLineRef.current.exportDimension(),
6448
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
6104
6449
  resetView: () => canvasRef.current?.resetView(),
6105
6450
  fitView: () => canvasRef.current?.fitView()
6106
6451
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -6480,6 +6825,10 @@ var DIE_LINE_BECF_B_12101 = react.forwardRef(
6480
6825
  exportDimension: async () => {
6481
6826
  const dimData = generateDimensions9(attributes, unit);
6482
6827
  return exportDimensionPdf({ modelId: MODEL_ID9, dieline, dimensions: dimData, attributes, unit, factor, theme });
6828
+ },
6829
+ readyToPrint: async () => {
6830
+ const dimData = generateDimensions9(attributes, unit);
6831
+ return readyToPrintPdf({ modelId: MODEL_ID9, dieline, dimensions: dimData, attributes, unit, factor, theme });
6483
6832
  }
6484
6833
  };
6485
6834
  }, [attributes, dieline, factor, unit, serializeSvg, theme]);
@@ -6546,6 +6895,7 @@ var CANVAS_BECF_B_12101 = react.forwardRef(
6546
6895
  });
6547
6896
  },
6548
6897
  exportDimension: () => dieLineRef.current.exportDimension(),
6898
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
6549
6899
  resetView: () => canvasRef.current?.resetView(),
6550
6900
  fitView: () => canvasRef.current?.fitView()
6551
6901
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -7005,6 +7355,10 @@ var DIE_LINE_BECF_B_12109 = react.forwardRef(
7005
7355
  exportDimension: async () => {
7006
7356
  const dimData = generateDimensions10(attributes, unit);
7007
7357
  return exportDimensionPdf({ modelId: MODEL_ID10, dieline, dimensions: dimData, attributes, unit, factor, theme });
7358
+ },
7359
+ readyToPrint: async () => {
7360
+ const dimData = generateDimensions10(attributes, unit);
7361
+ return readyToPrintPdf({ modelId: MODEL_ID10, dieline, dimensions: dimData, attributes, unit, factor, theme });
7008
7362
  }
7009
7363
  };
7010
7364
  }, [attributes, dieline, factor, unit, serializeSvg, theme]);
@@ -7071,6 +7425,7 @@ var CANVAS_BECF_B_12109 = react.forwardRef(
7071
7425
  });
7072
7426
  },
7073
7427
  exportDimension: () => dieLineRef.current.exportDimension(),
7428
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
7074
7429
  resetView: () => canvasRef.current?.resetView(),
7075
7430
  fitView: () => canvasRef.current?.fitView()
7076
7431
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -7753,6 +8108,18 @@ var DIE_LINE_BECF_10A0A = react.forwardRef(
7753
8108
  factor,
7754
8109
  theme
7755
8110
  });
8111
+ },
8112
+ readyToPrint: async () => {
8113
+ const dimData = generateDimensions11(attributes, unit);
8114
+ return readyToPrintPdf({
8115
+ modelId: MODEL_ID11,
8116
+ dieline,
8117
+ dimensions: dimData,
8118
+ attributes,
8119
+ unit,
8120
+ factor,
8121
+ theme
8122
+ });
7756
8123
  }
7757
8124
  };
7758
8125
  }, [attributes, dieline, factor, unit, serializeSvg, theme]);
@@ -7921,6 +8288,7 @@ var CANVAS_BECF_10A0A = react.forwardRef((props, ref) => {
7921
8288
  });
7922
8289
  },
7923
8290
  exportDimension: () => dieLineRef.current.exportDimension(),
8291
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
7924
8292
  resetView: () => canvasRef.current?.resetView(),
7925
8293
  fitView: () => canvasRef.current?.fitView()
7926
8294
  }),
@@ -11275,12 +11643,12 @@ var AUTO_LAYOUT = react.forwardRef(
11275
11643
  });
11276
11644
  }
11277
11645
  if (pdfGriper > 0) {
11278
- const hexToRgb2 = (hex) => ({
11646
+ const hexToRgb3 = (hex) => ({
11279
11647
  r: parseInt(hex.slice(1, 3), 16),
11280
11648
  g: parseInt(hex.slice(3, 5), 16),
11281
11649
  b: parseInt(hex.slice(5, 7), 16)
11282
11650
  });
11283
- const gc = hexToRgb2(theme.colorGriper);
11651
+ const gc = hexToRgb3(theme.colorGriper);
11284
11652
  doc.setFillColor(gc.r, gc.g, gc.b);
11285
11653
  const depth = pdfGriper;
11286
11654
  switch (gripperSide) {
@@ -11303,7 +11671,7 @@ var AUTO_LAYOUT = react.forwardRef(
11303
11671
  const totalMarks = (ARROW_COLORS_HEX.length - 1) * ARROW_SPACING2;
11304
11672
  const isHoriz = gripperSide === "top" || gripperSide === "bottom";
11305
11673
  ARROW_COLORS_HEX.forEach((hex, idx) => {
11306
- const ac = hexToRgb2(hex);
11674
+ const ac = hexToRgb3(hex);
11307
11675
  doc.setFillColor(ac.r, ac.g, ac.b);
11308
11676
  if (isHoriz) {
11309
11677
  const cx = (pw - totalMarks) / 2 + idx * ARROW_SPACING2;
@@ -11771,7 +12139,7 @@ var BECF_12101_DEFAULT_ATTRIBUTES = {
11771
12139
  length: 100,
11772
12140
  width: 50,
11773
12141
  height: 150,
11774
- glueArea: 13
12142
+ glueArea: 15
11775
12143
  };
11776
12144
 
11777
12145
  // src/statics/bags-pillows/becf-12109/DEFAULT_ATTRIBUTES.ts
@@ -11779,7 +12147,7 @@ var BECF_12109_DEFAULT_ATTRIBUTES = {
11779
12147
  length: 100,
11780
12148
  width: 50,
11781
12149
  height: 150,
11782
- glueArea: 13
12150
+ glueArea: 15
11783
12151
  };
11784
12152
 
11785
12153
  // src/statics/bags-pillows/becf-c-12101/DEFAULT_ATTRIBUTES.ts
@@ -11787,7 +12155,7 @@ var BECF_C_12101_DEFAULT_ATTRIBUTES = {
11787
12155
  length: 100,
11788
12156
  width: 50,
11789
12157
  height: 150,
11790
- glueArea: 13
12158
+ glueArea: 15
11791
12159
  };
11792
12160
 
11793
12161
  // src/statics/bags-pillows/becf-c-12109/DEFAULT_ATTRIBUTES.ts
@@ -11795,7 +12163,7 @@ var BECF_C_12109_DEFAULT_ATTRIBUTES = {
11795
12163
  length: 100,
11796
12164
  width: 50,
11797
12165
  height: 150,
11798
- glueArea: 13
12166
+ glueArea: 15
11799
12167
  };
11800
12168
 
11801
12169
  // src/statics/bags-pillows/becf-b-12101/DEFAULT_ATTRIBUTES.ts
@@ -11803,7 +12171,7 @@ var BECF_B_12101_DEFAULT_ATTRIBUTES = {
11803
12171
  length: 100,
11804
12172
  width: 50,
11805
12173
  height: 150,
11806
- glueArea: 13
12174
+ glueArea: 15
11807
12175
  };
11808
12176
 
11809
12177
  // src/statics/bags-pillows/becf-b-12109/DEFAULT_ATTRIBUTES.ts
@@ -11811,7 +12179,7 @@ var BECF_B_12109_DEFAULT_ATTRIBUTES = {
11811
12179
  length: 100,
11812
12180
  width: 50,
11813
12181
  height: 150,
11814
- glueArea: 13
12182
+ glueArea: 15
11815
12183
  };
11816
12184
 
11817
12185
  // src/statics/snap-lock-boxes/becf-10a0a/DEFAULT_ATTRIBUTES.ts
@@ -11819,7 +12187,7 @@ var BECF_10A0A_DEFAULT_ATTRIBUTES = {
11819
12187
  length: 100,
11820
12188
  width: 50,
11821
12189
  height: 150,
11822
- glueArea: 13
12190
+ glueArea: 15
11823
12191
  };
11824
12192
 
11825
12193
  // src/statics/modelList.ts