@crystaldesign/planner-core 26.14.0-beta.20 → 26.14.0-beta.22

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.
@@ -247,9 +247,9 @@ function isDockingType(value) {
247
247
 
248
248
  /** Minimum x/y over all non-AV geometry of an SVG — the offset docking-point coordinates are corrected by. */
249
249
 
250
- function _createForOfIteratorHelper$7(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$7(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
251
- function _unsupportedIterableToArray$7(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$7(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$7(r, a) : void 0; } }
252
- function _arrayLikeToArray$7(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
250
+ function _createForOfIteratorHelper$8(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$8(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
251
+ function _unsupportedIterableToArray$8(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$8(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$8(r, a) : void 0; } }
252
+ function _arrayLikeToArray$8(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
253
253
  var COMMAND_PARAM_COUNT = {
254
254
  M: 2,
255
255
  L: 2,
@@ -458,7 +458,7 @@ function pathBoundingBox(d) {
458
458
  var previousQuadraticControl;
459
459
  var previousCommand = '';
460
460
  var hasGeometry = false;
461
- var _iterator = _createForOfIteratorHelper$7(commands),
461
+ var _iterator = _createForOfIteratorHelper$8(commands),
462
462
  _step;
463
463
  try {
464
464
  var _loop = function _loop() {
@@ -556,7 +556,7 @@ function pathBoundingBox(d) {
556
556
  }
557
557
  expand(current.x, current.y);
558
558
  expand(end.x, end.y);
559
- var _iterator2 = _createForOfIteratorHelper$7(cubicAxisExtrema(current.x, control1.x, control2.x, end.x)),
559
+ var _iterator2 = _createForOfIteratorHelper$8(cubicAxisExtrema(current.x, control1.x, control2.x, end.x)),
560
560
  _step2;
561
561
  try {
562
562
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -568,7 +568,7 @@ function pathBoundingBox(d) {
568
568
  } finally {
569
569
  _iterator2.f();
570
570
  }
571
- var _iterator3 = _createForOfIteratorHelper$7(cubicAxisExtrema(current.y, control1.y, control2.y, end.y)),
571
+ var _iterator3 = _createForOfIteratorHelper$8(cubicAxisExtrema(current.y, control1.y, control2.y, end.y)),
572
572
  _step3;
573
573
  try {
574
574
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -664,9 +664,9 @@ function pathBoundingBox(d) {
664
664
  };
665
665
  }
666
666
 
667
- function _createForOfIteratorHelper$6(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$6(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
668
- function _unsupportedIterableToArray$6(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$6(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$6(r, a) : void 0; } }
669
- function _arrayLikeToArray$6(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
667
+ function _createForOfIteratorHelper$7(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$7(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
668
+ function _unsupportedIterableToArray$7(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$7(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$7(r, a) : void 0; } }
669
+ function _arrayLikeToArray$7(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
670
670
  /** XPathResult.ORDERED_NODE_SNAPSHOT_TYPE — used numerically because XML documents do not always expose the constant. */
671
671
  var ORDERED_NODE_SNAPSHOT_TYPE = 7;
672
672
 
@@ -685,7 +685,7 @@ function snapshotByIdPrefix(xmlDocument, idPrefix) {
685
685
  function getDockingPointLines(content) {
686
686
  var dockingPointLines = [];
687
687
  var xmlDocument = parseXml(content);
688
- var _iterator = _createForOfIteratorHelper$6(snapshotByIdPrefix(xmlDocument, 'AV')),
688
+ var _iterator = _createForOfIteratorHelper$7(snapshotByIdPrefix(xmlDocument, 'AV')),
689
689
  _step;
690
690
  try {
691
691
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -729,7 +729,7 @@ function getPolygonPoints(content, idPrefix) {
729
729
  if (element.nodeName === 'polygon') {
730
730
  var pointsAsString = element.getAttribute('points');
731
731
  if (!pointsAsString) return undefined;
732
- var _iterator2 = _createForOfIteratorHelper$6(pointsAsString.split(' ')),
732
+ var _iterator2 = _createForOfIteratorHelper$7(pointsAsString.split(' ')),
733
733
  _step2;
734
734
  try {
735
735
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -774,7 +774,7 @@ function parsePointsAttribute(pointsAttribute) {
774
774
  }
775
775
  function geometryOfFirstShape(content, idPrefix) {
776
776
  var xmlDocument = parseXml(content);
777
- var _iterator3 = _createForOfIteratorHelper$6(snapshotByIdPrefix(xmlDocument, idPrefix)),
777
+ var _iterator3 = _createForOfIteratorHelper$7(snapshotByIdPrefix(xmlDocument, idPrefix)),
778
778
  _step3;
779
779
  try {
780
780
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -853,7 +853,7 @@ function removeMask(content) {
853
853
  if (content.toLowerCase().indexOf('<mask') < 0) return content;
854
854
  var xmlDocument = parseXml(content, 'image/svg+xml');
855
855
  var allElements = _toConsumableArray__default["default"](xmlDocument.getElementsByTagName('*'));
856
- var _iterator4 = _createForOfIteratorHelper$6(allElements),
856
+ var _iterator4 = _createForOfIteratorHelper$7(allElements),
857
857
  _step4;
858
858
  try {
859
859
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
@@ -1084,9 +1084,9 @@ function getRootSize(content) {
1084
1084
  };
1085
1085
  }
1086
1086
 
1087
- function _createForOfIteratorHelper$5(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$5(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
1088
- function _unsupportedIterableToArray$5(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$5(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$5(r, a) : void 0; } }
1089
- function _arrayLikeToArray$5(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1087
+ function _createForOfIteratorHelper$6(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$6(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
1088
+ function _unsupportedIterableToArray$6(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$6(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$6(r, a) : void 0; } }
1089
+ function _arrayLikeToArray$6(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1090
1090
  /**
1091
1091
  * Polygon `points` tokenizer: the pair separator is ',' when the string contains one, ' ' otherwise, so both
1092
1092
  * "x,y x,y" and "x y x y" parse. An all-comma list keeps the legacy misparse on purpose.
@@ -1098,7 +1098,7 @@ function parsePolygonPoints(pointsText) {
1098
1098
  var readingX = true;
1099
1099
  var x = '';
1100
1100
  var y = '';
1101
- var _iterator = _createForOfIteratorHelper$5(text),
1101
+ var _iterator = _createForOfIteratorHelper$6(text),
1102
1102
  _step;
1103
1103
  try {
1104
1104
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -1136,7 +1136,7 @@ function parsePolygonPoints(pointsText) {
1136
1136
  /** Legacy points format: "x,y " pairs with a trailing space. */
1137
1137
  function serializePolygonPoints(points) {
1138
1138
  var result = '';
1139
- var _iterator2 = _createForOfIteratorHelper$5(points),
1139
+ var _iterator2 = _createForOfIteratorHelper$6(points),
1140
1140
  _step2;
1141
1141
  try {
1142
1142
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -1161,9 +1161,9 @@ function round2(value) {
1161
1161
  return Math.round(value * 100) / 100;
1162
1162
  }
1163
1163
 
1164
- function _createForOfIteratorHelper$4(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$4(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
1165
- function _unsupportedIterableToArray$4(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$4(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$4(r, a) : void 0; } }
1166
- function _arrayLikeToArray$4(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1164
+ function _createForOfIteratorHelper$5(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$5(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
1165
+ function _unsupportedIterableToArray$5(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$5(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$5(r, a) : void 0; } }
1166
+ function _arrayLikeToArray$5(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1167
1167
 
1168
1168
  /** One stretch area projected onto the active axis; end is pre-rounded, as the legacy engine rounded it. */
1169
1169
 
@@ -1210,7 +1210,7 @@ function parsePathSafely(d, warn) {
1210
1210
  function stretchPathData(d, areas, axis, warn) {
1211
1211
  var commands = parsePathSafely(d, warn);
1212
1212
  if (!commands) return d;
1213
- var _iterator = _createForOfIteratorHelper$4(areas),
1213
+ var _iterator = _createForOfIteratorHelper$5(areas),
1214
1214
  _step;
1215
1215
  try {
1216
1216
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -1218,7 +1218,7 @@ function stretchPathData(d, areas, axis, warn) {
1218
1218
  var delta = area.end - area.begin;
1219
1219
  // NaN start reproduces the legacy undefined `last` (all comparisons false, arithmetic stays NaN until an absolute command).
1220
1220
  var last = Number.NaN;
1221
- var _iterator2 = _createForOfIteratorHelper$4(commands),
1221
+ var _iterator2 = _createForOfIteratorHelper$5(commands),
1222
1222
  _step2;
1223
1223
  try {
1224
1224
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -1229,7 +1229,7 @@ function stretchPathData(d, areas, axis, warn) {
1229
1229
  if (absolute) {
1230
1230
  var value = params[absolute.track];
1231
1231
  if (value > area.begin) {
1232
- var _iterator3 = _createForOfIteratorHelper$4(absolute.shift),
1232
+ var _iterator3 = _createForOfIteratorHelper$5(absolute.shift),
1233
1233
  _step3;
1234
1234
  try {
1235
1235
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -1249,7 +1249,7 @@ function stretchPathData(d, areas, axis, warn) {
1249
1249
  if (relative) {
1250
1250
  var help = params[relative.help];
1251
1251
  if ((!relative.requireNonNegativeForward || help >= 0) && last < area.begin && last + help > area.begin) {
1252
- var _iterator4 = _createForOfIteratorHelper$4(relative.shift),
1252
+ var _iterator4 = _createForOfIteratorHelper$5(relative.shift),
1253
1253
  _step4;
1254
1254
  try {
1255
1255
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
@@ -1262,7 +1262,7 @@ function stretchPathData(d, areas, axis, warn) {
1262
1262
  _iterator4.f();
1263
1263
  }
1264
1264
  } else if (help < 0 && last >= area.begin && last + params[relative.backwardProbe] < area.begin) {
1265
- var _iterator5 = _createForOfIteratorHelper$4(relative.shift),
1265
+ var _iterator5 = _createForOfIteratorHelper$5(relative.shift),
1266
1266
  _step5;
1267
1267
  try {
1268
1268
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
@@ -1297,7 +1297,7 @@ function stretchPathData(d, areas, axis, warn) {
1297
1297
  function scalePathData(d, widthFactor, heightFactor, roundResults, warn) {
1298
1298
  var commands = parsePathSafely(d, warn);
1299
1299
  if (!commands) return d;
1300
- var _iterator6 = _createForOfIteratorHelper$4(commands),
1300
+ var _iterator6 = _createForOfIteratorHelper$5(commands),
1301
1301
  _step6;
1302
1302
  try {
1303
1303
  for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
@@ -1373,9 +1373,9 @@ function currentSizes(state) {
1373
1373
  };
1374
1374
  }
1375
1375
 
1376
- function _createForOfIteratorHelper$3(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$3(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
1377
- function _unsupportedIterableToArray$3(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$3(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0; } }
1378
- function _arrayLikeToArray$3(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1376
+ function _createForOfIteratorHelper$4(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$4(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
1377
+ function _unsupportedIterableToArray$4(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$4(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$4(r, a) : void 0; } }
1378
+ function _arrayLikeToArray$4(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1379
1379
 
1380
1380
  /** ViewBox-to-attribute scale of the root element (1:1 for planner-conform articles). */
1381
1381
 
@@ -1448,7 +1448,7 @@ function scaleLineAttributes(line, scale) {
1448
1448
  function scalePolygonAttributes(polygon, scale) {
1449
1449
  var _polygon$getAttribute;
1450
1450
  var points = parsePolygonPoints((_polygon$getAttribute = polygon.getAttribute('points')) !== null && _polygon$getAttribute !== void 0 ? _polygon$getAttribute : '');
1451
- var _iterator = _createForOfIteratorHelper$3(points),
1451
+ var _iterator = _createForOfIteratorHelper$4(points),
1452
1452
  _step;
1453
1453
  try {
1454
1454
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -1536,7 +1536,7 @@ function applyViewBoxScale(state, scale) {
1536
1536
  function ensureTeDisplayNone(document) {
1537
1537
  var teElements = snapshotByIdPrefix(document, 'TE');
1538
1538
  if (teElements.length === 0) {
1539
- var _iterator2 = _createForOfIteratorHelper$3(snapshotByIdPrefix(document, 'OLT')),
1539
+ var _iterator2 = _createForOfIteratorHelper$4(snapshotByIdPrefix(document, 'OLT')),
1540
1540
  _step2;
1541
1541
  try {
1542
1542
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -1552,7 +1552,7 @@ function ensureTeDisplayNone(document) {
1552
1552
  }
1553
1553
  teElements = snapshotByIdPrefix(document, 'TE');
1554
1554
  }
1555
- var _iterator3 = _createForOfIteratorHelper$3(teElements),
1555
+ var _iterator3 = _createForOfIteratorHelper$4(teElements),
1556
1556
  _step3;
1557
1557
  try {
1558
1558
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -1774,9 +1774,9 @@ var VERTICAL_AXIS = {
1774
1774
  }
1775
1775
  };
1776
1776
 
1777
- function _createForOfIteratorHelper$2(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$2(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
1778
- function _unsupportedIterableToArray$2(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$2(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; } }
1779
- function _arrayLikeToArray$2(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1777
+ function _createForOfIteratorHelper$3(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$3(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
1778
+ function _unsupportedIterableToArray$3(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$3(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0; } }
1779
+ function _arrayLikeToArray$3(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1780
1780
  /** Elements that carry coordinates but have no transformer — they keep their position, which is worth a warning. */
1781
1781
  var UNTRANSFORMED_COORDINATE_ELEMENTS = ['circle', 'ellipse', 'text', 'tspan', 'use'];
1782
1782
 
@@ -1793,7 +1793,7 @@ function areaRanges(state, axis) {
1793
1793
  });
1794
1794
  }
1795
1795
  function stretchRect(rect, ranges, axis) {
1796
- var _iterator = _createForOfIteratorHelper$2(ranges),
1796
+ var _iterator = _createForOfIteratorHelper$3(ranges),
1797
1797
  _step;
1798
1798
  try {
1799
1799
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -1825,7 +1825,7 @@ function scaleRect(rect, state) {
1825
1825
  rect.setAttribute('height', String(round3(height * state.globalScaleFactorHeight)));
1826
1826
  }
1827
1827
  function stretchLine(line, ranges, axis) {
1828
- var _iterator2 = _createForOfIteratorHelper$2(ranges),
1828
+ var _iterator2 = _createForOfIteratorHelper$3(ranges),
1829
1829
  _step2;
1830
1830
  try {
1831
1831
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -1861,7 +1861,7 @@ function transformPoints(element, mode, state) {
1861
1861
  var _element$getAttribute;
1862
1862
  var points = parsePolygonPoints((_element$getAttribute = element.getAttribute('points')) !== null && _element$getAttribute !== void 0 ? _element$getAttribute : '');
1863
1863
  if (mode === 'GLOBAL_SCALE') {
1864
- var _iterator3 = _createForOfIteratorHelper$2(points),
1864
+ var _iterator3 = _createForOfIteratorHelper$3(points),
1865
1865
  _step3;
1866
1866
  try {
1867
1867
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -1876,12 +1876,12 @@ function transformPoints(element, mode, state) {
1876
1876
  }
1877
1877
  } else {
1878
1878
  var axis = mode === 'SAH' ? HORIZONTAL_AXIS : VERTICAL_AXIS;
1879
- var _iterator4 = _createForOfIteratorHelper$2(areaRanges(state, axis)),
1879
+ var _iterator4 = _createForOfIteratorHelper$3(areaRanges(state, axis)),
1880
1880
  _step4;
1881
1881
  try {
1882
1882
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
1883
1883
  var range = _step4.value;
1884
- var _iterator5 = _createForOfIteratorHelper$2(points),
1884
+ var _iterator5 = _createForOfIteratorHelper$3(points),
1885
1885
  _step5;
1886
1886
  try {
1887
1887
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
@@ -2050,6 +2050,363 @@ function resizeOutline(state, newWidth, newHeight, outline) {
2050
2050
  if (scale) applyStretchPass(state, 'GLOBAL_SCALE', outline);
2051
2051
  }
2052
2052
 
2053
+ function _createForOfIteratorHelper$2(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$2(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
2054
+ function _unsupportedIterableToArray$2(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$2(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; } }
2055
+ function _arrayLikeToArray$2(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2056
+
2057
+ /**
2058
+ * Profile drawings: an article drawn as a stack of plates around one spine curve (e.g. the arches of a pool
2059
+ * enclosure). Stretching moves only the spine; every plate edge is rebuilt as a parallel offset of it, so plates
2060
+ * keep their thickness and gaps at any size, where the SAH/SAV areas would squeeze them.
2061
+ *
2062
+ * Opt-in through a `<g id="PROFILE…">` (usually inside TE, so viewers without this engine never show it), holding
2063
+ * the spine as one `<path>` of absolute M/L commands from foot to foot (feet on the OLT's bottom edge):
2064
+ * - `data-plates`: `in,out;in,out;…` — each plate's inner and outer edge as its distance outward from the spine.
2065
+ * - `data-k` (optional, default 1): heights are multiplied by k for the offsets, so a plate steps `d` sideways but
2066
+ * `d / k` upwards (box profiles whose top plates are thicker than their legs).
2067
+ * - `data-parts` (optional): `in,out,from,to;…` — plates over part of the spine only (e.g. a sliding door), from/to
2068
+ * as fractional spine vertex indices; their ends stay square to the spine.
2069
+ * The drawing in VIT stays as the fallback for other viewers; this engine replaces it with the rebuilt plates.
2070
+ *
2071
+ * Not IDM compatible: a DIVA-only extension of the article SVG, implemented for the Polyfaser pool enclosure roofs
2072
+ * (ART_SIDE_DACH_*). IDM and every other SVG consumer ignore the group and show the VIT drawing.
2073
+ */
2074
+
2075
+ var PROFILE_PREFIX = 'PROFILE';
2076
+ /** A knee sharper than this keeps a bevel instead of a miter point (miter length / offset). */
2077
+ var MITER_LIMIT = 8;
2078
+ function parsePairs(text, size) {
2079
+ if (!text) return [];
2080
+ return text.split(';').map(function (group) {
2081
+ return group.split(',');
2082
+ })
2083
+ // an empty field would read as 0 (`Number('')`)
2084
+ .filter(function (fields) {
2085
+ return fields.length === size && fields.every(function (field) {
2086
+ return field.trim() !== '' && Number.isFinite(Number(field));
2087
+ });
2088
+ }).map(function (fields) {
2089
+ return fields.map(Number);
2090
+ });
2091
+ }
2092
+ var COPIED_ATTRIBUTES = ['class', 'fill', 'stroke', 'stroke-width'];
2093
+
2094
+ /** The path's `class` and presentation attributes (`fill`, `stroke`, `stroke-width`) that it sets. */
2095
+ function presentationAttributes(path) {
2096
+ return COPIED_ATTRIBUTES.flatMap(function (name) {
2097
+ var value = path === null || path === void 0 ? void 0 : path.getAttribute(name);
2098
+ return value != null ? [[name, value]] : [];
2099
+ });
2100
+ }
2101
+
2102
+ /** Absolute M/L points of a path `d`; any other command makes the spine unusable. */
2103
+ function parseSpine(d) {
2104
+ var _d$trim$match;
2105
+ var tokens = (_d$trim$match = d.trim().match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/g)) !== null && _d$trim$match !== void 0 ? _d$trim$match : [];
2106
+ var points = [];
2107
+ var i = 0;
2108
+ while (i < tokens.length) {
2109
+ var token = tokens[i];
2110
+ if (token === 'M' || token === 'L') {
2111
+ var x = Number(tokens[i + 1]);
2112
+ var y = Number(tokens[i + 2]);
2113
+ if (!Number.isFinite(x) || !Number.isFinite(y)) return undefined;
2114
+ points.push({
2115
+ x: x,
2116
+ y: y
2117
+ });
2118
+ i += 3;
2119
+ } else if (/^-?\d/.test(token) || token.startsWith('.') || token.startsWith('-.')) {
2120
+ // implicit L after an M/L pair
2121
+ var _x = Number(token);
2122
+ var _y = Number(tokens[i + 1]);
2123
+ if (!Number.isFinite(_x) || !Number.isFinite(_y)) return undefined;
2124
+ points.push({
2125
+ x: _x,
2126
+ y: _y
2127
+ });
2128
+ i += 2;
2129
+ } else if (token === 'Z' || token === 'z') {
2130
+ i += 1;
2131
+ } else {
2132
+ return undefined;
2133
+ }
2134
+ }
2135
+ return points.length >= 2 ? points : undefined;
2136
+ }
2137
+
2138
+ /**
2139
+ * Takes the profile groups out of the document (before any stretch pass touches them) and returns their specs.
2140
+ * A group without a usable spine or plates is dropped with a warning: the article then shows its VIT drawing.
2141
+ */
2142
+ function takeProfiles(document, warn) {
2143
+ var _snapshotByIdPrefix$;
2144
+ var specs = [];
2145
+ var firstVitPath = (_snapshotByIdPrefix$ = snapshotByIdPrefix(document, 'VIT')[0]) === null || _snapshotByIdPrefix$ === void 0 ? void 0 : _snapshotByIdPrefix$.getElementsByTagName('path')[0];
2146
+ var _iterator = _createForOfIteratorHelper$2(snapshotByIdPrefix(document, PROFILE_PREFIX)),
2147
+ _step;
2148
+ try {
2149
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
2150
+ var _spinePath$getAttribu, _group$getAttribute, _group$parentNode, _firstVitPath$getAttr;
2151
+ var group = _step.value;
2152
+ var spinePath = group.getElementsByTagName('path')[0];
2153
+ var spine = spinePath ? parseSpine((_spinePath$getAttribu = spinePath.getAttribute('d')) !== null && _spinePath$getAttribu !== void 0 ? _spinePath$getAttribu : '') : undefined;
2154
+ var plates = parsePairs(group.getAttribute('data-plates'), 2);
2155
+ var parts = parsePairs(group.getAttribute('data-parts'), 4);
2156
+ var k = Number((_group$getAttribute = group.getAttribute('data-k')) !== null && _group$getAttribute !== void 0 ? _group$getAttribute : '1');
2157
+ (_group$parentNode = group.parentNode) === null || _group$parentNode === void 0 || _group$parentNode.removeChild(group);
2158
+ if (!spine || plates.length === 0 || !(Number.isFinite(k) && k > 0)) {
2159
+ var _group$getAttribute2;
2160
+ warn("stretch: profile '".concat((_group$getAttribute2 = group.getAttribute('id')) !== null && _group$getAttribute2 !== void 0 ? _group$getAttribute2 : '', "' has no usable spine or plates and is ignored"));
2161
+ continue;
2162
+ }
2163
+ specs.push({
2164
+ spine: spine,
2165
+ plates: plates,
2166
+ parts: parts,
2167
+ k: k,
2168
+ style: (_firstVitPath$getAttr = firstVitPath === null || firstVitPath === void 0 ? void 0 : firstVitPath.getAttribute('style')) !== null && _firstVitPath$getAttr !== void 0 ? _firstVitPath$getAttr : null,
2169
+ attributes: presentationAttributes(firstVitPath)
2170
+ });
2171
+ }
2172
+ } catch (err) {
2173
+ _iterator.e(err);
2174
+ } finally {
2175
+ _iterator.f();
2176
+ }
2177
+ return specs;
2178
+ }
2179
+
2180
+ /** Outward unit normal of segment a→b; with the spine running from the left foot over the top to the right foot, outward is away from the enclosed space. */
2181
+ function normal(a, b) {
2182
+ var dx = b.x - a.x;
2183
+ var dy = b.y - a.y;
2184
+ var length = Math.hypot(dx, dy) || 1;
2185
+ return {
2186
+ x: dy / length,
2187
+ y: -dx / length
2188
+ };
2189
+ }
2190
+
2191
+ /** The polyline moved `d` along its outward normals, with mitered joins (beveled past MITER_LIMIT). */
2192
+ function offsetPolyline(points, d) {
2193
+ var normals = points.slice(1).map(function (p, i) {
2194
+ return normal(points[i], p);
2195
+ });
2196
+ var out = [];
2197
+ points.forEach(function (p, i) {
2198
+ if (i === 0 || i === points.length - 1) {
2199
+ var n = normals[Math.min(i, normals.length - 1)];
2200
+ out.push({
2201
+ x: p.x + n.x * d,
2202
+ y: p.y + n.y * d
2203
+ });
2204
+ return;
2205
+ }
2206
+ var n1 = normals[i - 1];
2207
+ var n2 = normals[i];
2208
+ var dot = n1.x * n2.x + n1.y * n2.y;
2209
+ var scale = 1 + dot > 2 / (MITER_LIMIT * MITER_LIMIT) ? d / (1 + dot) : undefined;
2210
+ if (scale === undefined) {
2211
+ out.push({
2212
+ x: p.x + n1.x * d,
2213
+ y: p.y + n1.y * d
2214
+ }, {
2215
+ x: p.x + n2.x * d,
2216
+ y: p.y + n2.y * d
2217
+ });
2218
+ } else {
2219
+ out.push({
2220
+ x: p.x + (n1.x + n2.x) * scale,
2221
+ y: p.y + (n1.y + n2.y) * scale
2222
+ });
2223
+ }
2224
+ });
2225
+ return out;
2226
+ }
2227
+
2228
+ /** Moves an end point along its end segment onto the ground line (y = ground), up or down. */
2229
+ function toGround(end, next, ground) {
2230
+ if (Math.abs(end.y - next.y) < 1e-9) return end;
2231
+ var t = (ground - end.y) / (end.y - next.y);
2232
+ return {
2233
+ x: end.x + (end.x - next.x) * t,
2234
+ y: ground
2235
+ };
2236
+ }
2237
+
2238
+ /** The spine between two fractional vertex indices. */
2239
+ function subSpine(points, from, to) {
2240
+ var at = function at(index) {
2241
+ var i = Math.min(Math.max(Math.floor(index), 0), points.length - 2);
2242
+ var t = Math.min(Math.max(index - i, 0), 1);
2243
+ return {
2244
+ x: points[i].x + (points[i + 1].x - points[i].x) * t,
2245
+ y: points[i].y + (points[i + 1].y - points[i].y) * t
2246
+ };
2247
+ };
2248
+ var _ref = from <= to ? [from, to] : [to, from],
2249
+ _ref2 = _slicedToArray__default["default"](_ref, 2),
2250
+ a = _ref2[0],
2251
+ b = _ref2[1];
2252
+ var inner = points.filter(function (_, i) {
2253
+ return i > a && i < b;
2254
+ });
2255
+ return [at(a)].concat(_toConsumableArray__default["default"](inner), [at(b)]);
2256
+ }
2257
+
2258
+ /** The outlines' stroke width: the inline style wins over the presentation attribute, as in the CSS cascade. */
2259
+ function strokeWidth(spec) {
2260
+ var _spec$style, _spec$attributes$find;
2261
+ var match = (_spec$style = spec.style) === null || _spec$style === void 0 ? void 0 : _spec$style.match(/stroke-width:\s*([\d.]+)/);
2262
+ var attribute = (_spec$attributes$find = spec.attributes.find(function (_ref3) {
2263
+ var _ref4 = _slicedToArray__default["default"](_ref3, 1),
2264
+ name = _ref4[0];
2265
+ return name === 'stroke-width';
2266
+ })) === null || _spec$attributes$find === void 0 ? void 0 : _spec$attributes$find[1];
2267
+ var width = match ? Number(match[1]) : Number.parseFloat(attribute !== null && attribute !== void 0 ? attribute : '');
2268
+ return Number.isFinite(width) ? width : 0;
2269
+ }
2270
+
2271
+ /**
2272
+ * Maps x linearly so the outermost plate's feet stand on the OLT's bottom corners, its stroke inside the OLT like the
2273
+ * drawn feet: the offsets land the feet wherever the plate thicknesses put them, not on the rails.
2274
+ */
2275
+ function standOnOlt(outlines, outermost, ground, left, right) {
2276
+ var feet = outermost.filter(function (p) {
2277
+ return Math.abs(p.y - ground) < 1e-6;
2278
+ }).map(function (p) {
2279
+ return p.x;
2280
+ });
2281
+ var from = Math.min.apply(Math, _toConsumableArray__default["default"](feet));
2282
+ var to = Math.max.apply(Math, _toConsumableArray__default["default"](feet));
2283
+ if (!(to > from)) return outlines;
2284
+ var scale = (right - left) / (to - from);
2285
+ return outlines.map(function (outline) {
2286
+ return outline.map(function (p) {
2287
+ return {
2288
+ x: left + (p.x - from) * scale,
2289
+ y: p.y
2290
+ };
2291
+ });
2292
+ });
2293
+ }
2294
+ function pathData(points) {
2295
+ return 'M' + points.map(function (p) {
2296
+ return "".concat(round3(p.x), ",").concat(round3(p.y));
2297
+ }).join(' L') + ' Z';
2298
+ }
2299
+
2300
+ /**
2301
+ * Rebuilds the profiles for the stretched size and replaces the VIT drawing with them. The spine's left foot stays,
2302
+ * its right foot moves with the OLT's right edge, everything between is spread evenly; heights follow the OLT height.
2303
+ * The outermost plate's feet then stand on the OLT's bottom corners.
2304
+ */
2305
+ function renderProfiles(state, specs) {
2306
+ if (specs.length === 0) return;
2307
+ var vit = snapshotByIdPrefix(state.document, 'VIT')[0];
2308
+ if (!vit) return;
2309
+ var widthDelta = state.widthOlt - state.origOltWidth;
2310
+ var top = state.startHeightOlt;
2311
+ var heightScale = state.origOltHeight > 0 ? state.heightOlt / state.origOltHeight : 1;
2312
+ var ground = top + state.heightOlt;
2313
+ while (vit.firstChild) vit.removeChild(vit.firstChild);
2314
+ var _iterator2 = _createForOfIteratorHelper$2(specs),
2315
+ _step2;
2316
+ try {
2317
+ var _loop = function _loop() {
2318
+ var spec = _step2.value;
2319
+ var left = spec.spine[0].x;
2320
+ var right = spec.spine[spec.spine.length - 1].x;
2321
+ var spread = right - left !== 0 ? (right + widthDelta - left) / (right - left) : 1;
2322
+ // stretched spine, in the offset space (heights times k)
2323
+ var spine = spec.spine.map(function (p) {
2324
+ return {
2325
+ x: left + (p.x - left) * spread,
2326
+ y: (top + (p.y - top) * heightScale) * spec.k
2327
+ };
2328
+ });
2329
+ var back = function back(points) {
2330
+ return points.map(function (p) {
2331
+ return {
2332
+ x: p.x,
2333
+ y: p.y / spec.k
2334
+ };
2335
+ });
2336
+ };
2337
+ var plate = function plate(inner, outer, points, grounded) {
2338
+ var a = back(offsetPolyline(points, inner));
2339
+ var b = back(offsetPolyline(points, outer));
2340
+ if (grounded) {
2341
+ var ends = function ends(line) {
2342
+ return [toGround(line[0], line[1], ground)].concat(_toConsumableArray__default["default"](line.slice(1, -1)), [toGround(line[line.length - 1], line[line.length - 2], ground)]);
2343
+ };
2344
+ a = ends(a);
2345
+ b = ends(b);
2346
+ }
2347
+ return [].concat(_toConsumableArray__default["default"](a), _toConsumableArray__default["default"](b.reverse()));
2348
+ };
2349
+ var plates = spec.plates.map(function (_ref5) {
2350
+ var _ref6 = _slicedToArray__default["default"](_ref5, 2),
2351
+ inner = _ref6[0],
2352
+ outer = _ref6[1];
2353
+ return plate(inner, outer, spine, true);
2354
+ });
2355
+ var parts = spec.parts.map(function (_ref7) {
2356
+ var _ref8 = _slicedToArray__default["default"](_ref7, 4),
2357
+ inner = _ref8[0],
2358
+ outer = _ref8[1],
2359
+ from = _ref8[2],
2360
+ to = _ref8[3];
2361
+ return plate(inner, outer, subSpine(spine, from, to), false);
2362
+ });
2363
+ var outermost = plates[spec.plates.reduce(function (best, _ref9, i) {
2364
+ var _ref10 = _slicedToArray__default["default"](_ref9, 2),
2365
+ outer = _ref10[1];
2366
+ return outer > spec.plates[best][1] ? i : best;
2367
+ }, 0)];
2368
+ var half = strokeWidth(spec) / 2;
2369
+ var outlines = standOnOlt([].concat(_toConsumableArray__default["default"](plates), _toConsumableArray__default["default"](parts)), outermost, ground, state.startWidthOlt + half, state.startWidthOlt + state.widthOlt - half);
2370
+ var _iterator3 = _createForOfIteratorHelper$2(outlines),
2371
+ _step3;
2372
+ try {
2373
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
2374
+ var outline = _step3.value;
2375
+ var path = state.document.createElementNS(vit.namespaceURI, 'path');
2376
+ var _iterator4 = _createForOfIteratorHelper$2(spec.attributes),
2377
+ _step4;
2378
+ try {
2379
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
2380
+ var _step4$value = _slicedToArray__default["default"](_step4.value, 2),
2381
+ name = _step4$value[0],
2382
+ value = _step4$value[1];
2383
+ path.setAttribute(name, value);
2384
+ }
2385
+ } catch (err) {
2386
+ _iterator4.e(err);
2387
+ } finally {
2388
+ _iterator4.f();
2389
+ }
2390
+ if (spec.style) path.setAttribute('style', spec.style);
2391
+ path.setAttribute('d', pathData(outline));
2392
+ vit.appendChild(path);
2393
+ }
2394
+ } catch (err) {
2395
+ _iterator3.e(err);
2396
+ } finally {
2397
+ _iterator3.f();
2398
+ }
2399
+ };
2400
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
2401
+ _loop();
2402
+ }
2403
+ } catch (err) {
2404
+ _iterator2.e(err);
2405
+ } finally {
2406
+ _iterator2.f();
2407
+ }
2408
+ }
2409
+
2053
2410
  function _createForOfIteratorHelper$1(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
2054
2411
  function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; } }
2055
2412
  function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
@@ -2395,6 +2752,11 @@ function stretchArticleSvg(svg, targetWidthCm, targetDepthCm) {
2395
2752
  if (state.targetWidthOlt === 0) origWidthCm = parseFloat((_root$getAttribute3 = root.getAttribute('width')) !== null && _root$getAttribute3 !== void 0 ? _root$getAttribute3 : '');
2396
2753
  if (state.targetHeightOlt === 0) state.targetHeightOlt = parseFloat((_root$getAttribute4 = root.getAttribute('height')) !== null && _root$getAttribute4 !== void 0 ? _root$getAttribute4 : '');
2397
2754
  ensureTeDisplayNone(xmlDocument);
2755
+ // profile drawings rebuild their plates from the spine instead of stretching them (not in global-scale mode);
2756
+ // DIVA-only, not IDM compatible (Polyfaser roofs), see profile.ts
2757
+ var profiles = options.useGlobalScale ? [] : takeProfiles(xmlDocument, function (message) {
2758
+ return addWarning(state, message);
2759
+ });
2398
2760
  prepareStretchGeometry(state);
2399
2761
  // a kept axis targets its measured OLT, so resizeOutline leaves it alone; a global scale gets factor 1 instead of NaN
2400
2762
  if (options.keepWidth) {
@@ -2412,6 +2774,7 @@ function stretchArticleSvg(svg, targetWidthCm, targetDepthCm) {
2412
2774
 
2413
2775
  // the early exit keeps the canvas origin, which only matches a caller that measured no minBorder
2414
2776
  if (!options.keepWidth && !options.keepDepth && targetWidthCm === origWidthCm && targetDepthCm === origDepthCm) {
2777
+ renderProfiles(state, profiles);
2415
2778
  return {
2416
2779
  svg: serializeXml(xmlDocument),
2417
2780
  sizes: currentSizes(state),
@@ -2420,6 +2783,7 @@ function stretchArticleSvg(svg, targetWidthCm, targetDepthCm) {
2420
2783
  }
2421
2784
  resizeOutline(state, state.targetWidthOlt, state.targetHeightOlt, 'OLT');
2422
2785
  if (state.hasOlf) resizeOutline(state, state.targetWidthOlt + state.deltaOlfWidth, state.targetHeightOlt + state.deltaOlfHeight, 'OLF');
2786
+ renderProfiles(state, profiles);
2423
2787
  fixViewBox(state, (_options$minBorderX = options.minBorderX) !== null && _options$minBorderX !== void 0 ? _options$minBorderX : 0, (_options$minBorderY = options.minBorderY) !== null && _options$minBorderY !== void 0 ? _options$minBorderY : 0);
2424
2788
  return {
2425
2789
  svg: serializeXml(xmlDocument),