diff --git a/CHANGES.md b/CHANGES.md
index 844b2a43..7e031445 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -32,6 +32,8 @@
approve storage (and set locale to English) before each test
- Testing: Avoid reporting meta-viewport (have own zooming
controls and difficult to fix)
+- Testing: Skip js errors in Testcafe; we're getting some uncaught
+ error despite not replicating manually; should file a Testcafe issue
- Docs: Some JSDoc descriptions, JSDoc spacing, fix svgIcons param
def; add todo
- npm: Update devDeps; update nested deps for security audit; remove
diff --git a/dist/canvg.js b/dist/canvg.js
index 59c48112..c4fecc37 100644
--- a/dist/canvg.js
+++ b/dist/canvg.js
@@ -3910,7 +3910,7 @@ var canvg = (function (exports) {
// eslint-disable-line promise/prefer-await-to-then, promise/always-return
_this20.img = img;
_this20.loaded = true;
- }).catch(function (err) {
+ })["catch"](function (err) {
// eslint-disable-line promise/prefer-await-to-callbacks
_this20.erred = true;
console.error('Ajax error for canvg', err); // eslint-disable-line no-console
diff --git a/dist/extensions/ext-placemark.js b/dist/extensions/ext-placemark.js
index 9f3013d0..7640b90d 100644
--- a/dist/extensions/ext-placemark.js
+++ b/dist/extensions/ext-placemark.js
@@ -137,7 +137,7 @@ var svgEditorExtension_placemark = (function () {
var markerName = 'marker-start';
var marker = getLinked(el, markerName);
- if (!marker || !marker.attributes.class) {
+ if (!marker || !marker.attributes["class"]) {
return;
} // not created by this extension
@@ -165,7 +165,7 @@ var svgEditorExtension_placemark = (function () {
return;
}
- if (!marker.attributes.class) {
+ if (!marker.attributes["class"]) {
return;
} // not created by this extension
@@ -252,7 +252,7 @@ var svgEditorExtension_placemark = (function () {
markerUnits: 'strokeWidth',
orient: 'auto',
style: 'pointer-events:none',
- class: seType
+ "class": seType
}
});
var mel = addElem(markerTypes[seType]);
@@ -557,7 +557,7 @@ var svgEditorExtension_placemark = (function () {
element: 'g',
attr: {
id: id,
- class: 'placemark',
+ "class": 'placemark',
fontSize: fontSize,
maxlen: maxlen,
lines: items.length,
diff --git a/dist/extensions/ext-server_moinsave.js b/dist/extensions/ext-server_moinsave.js
index cce444ee..f9ea2407 100644
--- a/dist/extensions/ext-server_moinsave.js
+++ b/dist/extensions/ext-server_moinsave.js
@@ -3910,7 +3910,7 @@ var svgEditorExtension_server_moinsave = (function () {
// eslint-disable-line promise/prefer-await-to-then, promise/always-return
_this20.img = img;
_this20.loaded = true;
- }).catch(function (err) {
+ })["catch"](function (err) {
// eslint-disable-line promise/prefer-await-to-callbacks
_this20.erred = true;
console.error('Ajax error for canvg', err); // eslint-disable-line no-console
diff --git a/dist/extensions/ext-server_opensave.js b/dist/extensions/ext-server_opensave.js
index 22955692..33486c78 100644
--- a/dist/extensions/ext-server_opensave.js
+++ b/dist/extensions/ext-server_opensave.js
@@ -3910,7 +3910,7 @@ var svgEditorExtension_server_opensave = (function () {
// eslint-disable-line promise/prefer-await-to-then, promise/always-return
_this20.img = img;
_this20.loaded = true;
- }).catch(function (err) {
+ })["catch"](function (err) {
// eslint-disable-line promise/prefer-await-to-callbacks
_this20.erred = true;
console.error('Ajax error for canvg', err); // eslint-disable-line no-console
diff --git a/dist/extensions/imagelib/openclipart.js b/dist/extensions/imagelib/openclipart.js
index 6f49990a..87caffa8 100644
--- a/dist/extensions/imagelib/openclipart.js
+++ b/dist/extensions/imagelib/openclipart.js
@@ -962,7 +962,7 @@
}
var getConstructor = function getConstructor(cb) {
- var baseClass = options && options.extends ? doc.createElement(options.extends).constructor : customizedBuiltIn ? doc.createElement(localName).constructor : HTMLElement;
+ var baseClass = options && options["extends"] ? doc.createElement(options["extends"]).constructor : customizedBuiltIn ? doc.createElement(localName).constructor : HTMLElement;
return cb ?
/*#__PURE__*/
function (_baseClass) {
@@ -1007,7 +1007,7 @@
if (typeof options === 'string') {
options = {
- extends: options
+ "extends": options
};
} else if (!options.hasOwnProperty('extends')) {
prototype = options;
@@ -1026,7 +1026,7 @@
if (typeof options === 'string') {
options = {
- extends: options
+ "extends": options
};
}
}
@@ -1043,7 +1043,7 @@
if (!options && customizedBuiltIn) {
options = {
- extends: localName
+ "extends": localName
};
}
@@ -1068,7 +1068,7 @@
var funcBound = func.bind(elem);
if (typeof symbol === 'string') {
- elem[Symbol.for(symbol)] = funcBound;
+ elem[Symbol["for"](symbol)] = funcBound;
} else {
elem[symbol] = funcBound;
}
@@ -1077,7 +1077,7 @@
obj.elem = elem;
if (typeof symbol === 'string') {
- elem[Symbol.for(symbol)] = obj;
+ elem[Symbol["for"](symbol)] = obj;
} else {
elem[symbol] = obj;
}
@@ -2212,9 +2212,9 @@
return [map, elem];
};
- jml.symbol = jml.sym = jml.for = function (elem, sym) {
+ jml.symbol = jml.sym = jml["for"] = function (elem, sym) {
elem = typeof elem === 'string' ? $(elem) : elem;
- return elem[_typeof$1(sym) === 'symbol' ? sym : Symbol.for(sym)];
+ return elem[_typeof$1(sym) === 'symbol' ? sym : Symbol["for"](sym)];
};
jml.command = function (elem, symOrMap, methodName) {
@@ -3271,7 +3271,7 @@
}
}, [// Todo: i18nize
['fieldset', [['legend', ['Search terms']], ['div', {
- class: 'control'
+ "class": 'control'
}, [['label', ['Query (Title, description, uploader, or tag): ', ['input', {
id: 'query',
name: 'query',
@@ -3288,7 +3288,7 @@
}
}
}]]]]], ['br'], ' OR ', ['br'], ['div', {
- class: 'control'
+ "class": 'control'
}, [['label', ['IDs (single or comma-separated): ', ['input', {
id: 'byids',
name: 'ids',
@@ -3305,7 +3305,7 @@
}
}
}]]]]]]], ['fieldset', [['legend', ['Configuring results']], ['div', {
- class: 'control'
+ "class": 'control'
}, [['label', ['Sort by: ', ['select', {
id: 'sort'
}, [// Todo: i18nize first values
@@ -3319,7 +3319,7 @@
value: value
}, [text]];
})]]]]], ['div', {
- class: 'control'
+ "class": 'control'
}, [['label', ['Results per page: ', ['input', {
id: 'amount',
name: 'amount',
@@ -3330,7 +3330,7 @@
step: 1,
pattern: '\\d+'
}]]]]], ['div', {
- class: 'control'
+ "class": 'control'
}, [['label', ['Page number: ', ['input', {
// max: 1, // We'll change this based on available results
id: 'page',
@@ -3342,7 +3342,7 @@
step: 1,
pattern: '\\d+'
}]]]]]]], ['div', {
- class: 'control'
+ "class": 'control'
}, [['input', {
type: 'submit'
}]]]]], ['div', {
diff --git a/dist/index-es.js b/dist/index-es.js
index 9dd8148d..a2fe471c 100644
--- a/dist/index-es.js
+++ b/dist/index-es.js
@@ -2966,12 +2966,10 @@ function jQueryPluginSVG($) {
if (_typeof(key) === 'object') {
// Setting attributes from object
- var _arr = Object.entries(key);
-
- for (var _i = 0; _i < _arr.length; _i++) {
- var _arr$_i = _slicedToArray(_arr[_i], 2),
- name = _arr$_i[0],
- val = _arr$_i[1];
+ for (var _i = 0, _Object$entries = Object.entries(key); _i < _Object$entries.length; _i++) {
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
+ name = _Object$entries$_i[0],
+ val = _Object$entries$_i[1];
elem.setAttribute(name, val);
} // Getting attribute
@@ -3546,7 +3544,7 @@ var init = function init(elementContainer) {
typeMap_ = {
em: bb.width,
ex: bb.height,
- in: inch,
+ "in": inch,
cm: inch / 2.54,
mm: inch / 25.4,
pt: inch / 72,
@@ -9113,12 +9111,10 @@ var getElem = supportsSelectors() ? function (id) {
*/
var assignAttributes = function assignAttributes(elem, attrs, suspendLength, unitCheck) {
- var _arr = Object.entries(attrs);
-
- for (var _i = 0; _i < _arr.length; _i++) {
- var _arr$_i = _slicedToArray(_arr[_i], 2),
- key = _arr$_i[0],
- value = _arr$_i[1];
+ for (var _i = 0, _Object$entries = Object.entries(attrs); _i < _Object$entries.length; _i++) {
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
+ key = _Object$entries$_i[0],
+ value = _Object$entries$_i[1];
var ns = key.substr(0, 4) === 'xml:' ? NS.XML : key.substr(0, 6) === 'xlink:' ? NS.XLINK : null;
@@ -11419,7 +11415,7 @@ var svgWhiteList_ = {
rect: ['class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'height', 'id', 'mask', 'opacity', 'requiredFeatures', 'rx', 'ry', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'width', 'x', 'y'],
stop: ['class', 'id', 'offset', 'requiredFeatures', 'stop-color', 'stop-opacity', 'style', 'systemLanguage'],
svg: ['class', 'clip-path', 'clip-rule', 'filter', 'id', 'height', 'mask', 'preserveAspectRatio', 'requiredFeatures', 'style', 'systemLanguage', 'viewBox', 'width', 'x', 'xmlns', 'xmlns:se', 'xmlns:xlink', 'y'],
- switch: ['class', 'id', 'requiredFeatures', 'systemLanguage'],
+ "switch": ['class', 'id', 'requiredFeatures', 'systemLanguage'],
symbol: ['class', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'opacity', 'preserveAspectRatio', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'viewBox'],
text: ['class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'text-anchor', 'transform', 'x', 'xml:space', 'y'],
textPath: ['class', 'id', 'method', 'requiredFeatures', 'spacing', 'startOffset', 'style', 'systemLanguage', 'transform', 'xlink:href'],
@@ -18754,8 +18750,8 @@ function SvgCanvas(container, config) {
_iteratorError = err;
} finally {
try {
- if (!_iteratorNormalCompletion && _iterator.return != null) {
- _iterator.return();
+ if (!_iteratorNormalCompletion && _iterator["return"] != null) {
+ _iterator["return"]();
}
} finally {
if (_didIteratorError) {
@@ -19939,7 +19935,7 @@ function SvgCanvas(container, config) {
var newblur = addSVGElementFromJson({
element: 'feGaussianBlur',
attr: {
- in: 'SourceGraphic',
+ "in": 'SourceGraphic',
stdDeviation: val
}
});
@@ -22559,7 +22555,7 @@ function jQueryPluginSVGIcons($) {
}
var icon = $(new Image()).attr({
- class: 'svg_icon',
+ "class": 'svg_icon',
src: path + imgsrc,
width: iconW,
height: iconH,
@@ -22613,7 +22609,7 @@ function jQueryPluginSVGIcons($) {
}
icon = $(new Image()).attr({
- class: 'svg_icon',
+ "class": 'svg_icon',
src: str,
alt: alt
});
@@ -23282,7 +23278,7 @@ function jQueryPluginJGraduate($) {
}, svg); // stop visuals created here
var beginCoord = $('
').attr({
- class: 'grad_coord jGraduate_lg_field',
+ "class": 'grad_coord jGraduate_lg_field',
title: 'Begin Stop'
}).text(1).css({
top: y1 * MAX,
@@ -23293,7 +23289,7 @@ function jQueryPluginJGraduate($) {
left: x2 * MAX
}).attr('title', 'End stop').data('coord', 'end').appendTo(container);
var centerCoord = $('').attr({
- class: 'grad_coord jGraduate_rg_field',
+ "class": 'grad_coord jGraduate_rg_field',
title: 'Center stop'
}).text('C').css({
top: cy * MAX,
@@ -28323,7 +28319,7 @@ function () {
image_width: properties.image_width,
layer_delete: layers.del,
layer_down: layers.move_down,
- layer_new: layers.new,
+ layer_new: layers["new"],
layer_rename: layers.rename,
layer_moreopts: common.more_opts,
layer_up: layers.move_up,
@@ -30005,16 +30001,16 @@ editor.init = function () {
opacity: 'opacity.png',
new_image: 'clear.png',
save: 'save.png',
- export: 'export.png',
+ "export": 'export.png',
open: 'open.png',
- import: 'import.png',
+ "import": 'import.png',
docprops: 'document-properties.png',
source: 'source.png',
wireframe: 'wireframe.png',
undo: 'undo.png',
redo: 'redo.png',
clone: 'clone.png',
- delete: 'delete.png',
+ "delete": 'delete.png',
go_up: 'go-up.png',
go_down: 'go-down.png',
context_menu: 'context_menu.png',
@@ -31888,7 +31884,7 @@ editor.init = function () {
var makeFlyoutHolder = function makeFlyoutHolder(id, child) {
var div = $$b('', {
- class: 'tools_flyout',
+ "class": 'tools_flyout',
id: id
}).appendTo('#svg_editor').append(child);
return div;
@@ -32295,7 +32291,7 @@ editor.init = function () {
// Create flyout placeholder
tlsId = refBtn[0].id.replace('tool_', 'tools_');
showBtn = refBtn.clone().attr('id', tlsId + '_show').append($$b('
', {
- class: 'flyout_arrow_horiz'
+ "class": 'flyout_arrow_horiz'
}));
refBtn.before(showBtn); // Create a flyout div
@@ -32358,7 +32354,7 @@ editor.init = function () {
// Create flyout placeholder
_tlsId = refBtn[0].id.replace('tool_', 'tools_');
showBtn = refBtn.clone().attr('id', _tlsId + '_show').append($$b('
', {
- class: 'flyout_arrow_horiz'
+ "class": 'flyout_arrow_horiz'
}));
refBtn.before(showBtn); // Create a flyout div
diff --git a/dist/index-es.min.js b/dist/index-es.min.js
index 7cc633ff..5c0d53c7 100644
--- a/dist/index-es.min.js
+++ b/dist/index-es.min.js
@@ -1,2 +1,2 @@
-function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function n(e){return function(){var n=this,r=arguments;return new Promise(function(a,i){var o=e.apply(n,r);function s(e){t(o,a,i,s,l,"next",e)}function l(e){t(o,a,i,s,l,"throw",e)}s(void 0)})}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n
t.getTotalLength())break;n--}while(n>0);return n}),window.SVGPathSeg=e,window.SVGPathSegClosePath=t,window.SVGPathSegMovetoAbs=n,window.SVGPathSegMovetoRel=a,window.SVGPathSegLinetoAbs=o,window.SVGPathSegLinetoRel=c,window.SVGPathSegCurvetoCubicAbs=d,window.SVGPathSegCurvetoCubicRel=h,window.SVGPathSegCurvetoQuadraticAbs=p,window.SVGPathSegCurvetoQuadraticRel=f,window.SVGPathSegArcAbs=g,window.SVGPathSegArcRel=m,window.SVGPathSegLinetoHorizontalAbs=v,window.SVGPathSegLinetoHorizontalRel=_,window.SVGPathSegLinetoVerticalAbs=y,window.SVGPathSegLinetoVerticalRel=b,window.SVGPathSegCurvetoCubicSmoothAbs=x,window.SVGPathSegCurvetoCubicSmoothRel=w,window.SVGPathSegCurvetoQuadraticSmoothAbs=S,window.SVGPathSegCurvetoQuadraticSmoothRel=k}if(!("SVGPathSegList"in window&&"appendItem"in window.SVGPathSegList.prototype)){var C=function(){function e(t){r(this,e),this._pathElement=t,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)}return i(e,[{key:"_checkPathSynchronizedToList",value:function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())}},{key:"_updateListFromPathMutations",value:function(e){if(this._pathElement){var t=!1;e.forEach(function(e){"d"===e.attributeName&&(t=!0)}),t&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))}}},{key:"_writeListToPath",value:function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",e._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)}},{key:"segmentChanged",value:function(e){this._writeListToPath()}},{key:"clear",value:function(){this._checkPathSynchronizedToList(),this._list.forEach(function(e){e._owningPathSegList=null}),this._list=[],this._writeListToPath()}},{key:"initialize",value:function(e){return this._checkPathSynchronizedToList(),this._list=[e],e._owningPathSegList=this,this._writeListToPath(),e}},{key:"_checkValidIndex",value:function(e){if(isNaN(e)||e<0||e>=this.numberOfItems)throw new Error("INDEX_SIZE_ERR")}},{key:"getItem",value:function(e){return this._checkPathSynchronizedToList(),this._checkValidIndex(e),this._list[e]}},{key:"insertItemBefore",value:function(e,t){return this._checkPathSynchronizedToList(),t>this.numberOfItems&&(t=this.numberOfItems),e._owningPathSegList&&(e=e.clone()),this._list.splice(t,0,e),e._owningPathSegList=this,this._writeListToPath(),e}},{key:"replaceItem",value:function(e,t){return this._checkPathSynchronizedToList(),e._owningPathSegList&&(e=e.clone()),this._checkValidIndex(t),this._list[t]=e,e._owningPathSegList=this,this._writeListToPath(),e}},{key:"removeItem",value:function(e){this._checkPathSynchronizedToList(),this._checkValidIndex(e);var t=this._list[e];return this._list.splice(e,1),this._writeListToPath(),t}},{key:"appendItem",value:function(e){return this._checkPathSynchronizedToList(),e._owningPathSegList&&(e=e.clone()),this._list.push(e),e._owningPathSegList=this,this._writeListToPath(),e}},{key:"_parsePath",value:function(e){if(!e||!e.length)return[];var t=this,n=function(){function e(){r(this,e),this.pathSegList=[]}return i(e,[{key:"appendSegment",value:function(e){this.pathSegList.push(e)}}]),e}(),a=function(){function e(t){r(this,e),this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()}return i(e,[{key:"_isCurrentSpace",value:function(){var e=this._string[this._currentIndex];return e<=" "&&(" "===e||"\n"===e||"\t"===e||"\r"===e||"\f"===e)}},{key:"_skipOptionalSpaces",value:function(){for(;this._currentIndex="0"&&e<="9")&&t!==SVGPathSeg.PATHSEG_CLOSEPATH?t===SVGPathSeg.PATHSEG_MOVETO_ABS?SVGPathSeg.PATHSEG_LINETO_ABS:t===SVGPathSeg.PATHSEG_MOVETO_REL?SVGPathSeg.PATHSEG_LINETO_REL:t:SVGPathSeg.PATHSEG_UNKNOWN}},{key:"initialCommandIsMoveTo",value:function(){if(!this.hasMoreData())return!0;var e=this.peekSegmentType();return e===SVGPathSeg.PATHSEG_MOVETO_ABS||e===SVGPathSeg.PATHSEG_MOVETO_REL}},{key:"_parseNumber",value:function(){var e=0,t=0,n=1,r=0,a=1,i=1,o=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex"9")&&"."!==this._string.charAt(this._currentIndex))){for(var s=this._currentIndex;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!==s)for(var l=this._currentIndex-1,c=1;l>=s;)t+=c*(this._string.charAt(l--)-"0"),c*=10;if(this._currentIndex=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)n*=10,r+=(this._string.charAt(this._currentIndex)-"0")/n,this._currentIndex+=1}if(this._currentIndex!==o&&this._currentIndex+1=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)e*=10,e+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var u=t+r;if(u*=a,e&&(u*=Math.pow(10,i*e)),o!==this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),u}}},{key:"_parseArcFlag",value:function(){if(!(this._currentIndex>=this._endIndex)){var e=!1,t=this._string.charAt(this._currentIndex++);if("0"===t)e=!1;else{if("1"!==t)return;e=!0}return this._skipOptionalSpacesOrDelimiter(),e}}},{key:"parseSegment",value:function(){var e=this._string[this._currentIndex],n=this._pathSegTypeFromChar(e);if(n===SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand===SVGPathSeg.PATHSEG_UNKNOWN)return null;if((n=this._nextCommandHelper(e,this._previousCommand))===SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=n,n){case SVGPathSeg.PATHSEG_MOVETO_REL:return new SVGPathSegMovetoRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_MOVETO_ABS:return new SVGPathSegMovetoAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_REL:return new SVGPathSegLinetoRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_ABS:return new SVGPathSegLinetoAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new SVGPathSegLinetoHorizontalRel(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new SVGPathSegLinetoHorizontalAbs(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new SVGPathSegLinetoVerticalRel(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new SVGPathSegLinetoVerticalAbs(t,this._parseNumber());case SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new SVGPathSegClosePath(t);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var r={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicRel(t,r.x,r.y,r.x1,r.y1,r.x2,r.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:var a={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicAbs(t,a.x,a.y,a.x1,a.y1,a.x2,a.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:var i={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothRel(t,i.x,i.y,i.x2,i.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:var o={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothAbs(t,o.x,o.y,o.x2,o.y2);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:var s={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticRel(t,s.x,s.y,s.x1,s.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:var l={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticAbs(t,l.x,l.y,l.x1,l.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new SVGPathSegCurvetoQuadraticSmoothRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new SVGPathSegCurvetoQuadraticSmoothAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_ARC_REL:var c={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcRel(t,c.x,c.y,c.x1,c.y1,c.arcAngle,c.arcLarge,c.arcSweep);case SVGPathSeg.PATHSEG_ARC_ABS:var u={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcAbs(t,u.x,u.y,u.x1,u.y1,u.arcAngle,u.arcLarge,u.arcSweep);default:throw new Error("Unknown path seg type.")}}}]),e}(),o=new n,s=new a(e);if(!s.initialCommandIsMoveTo())return[];for(;s.hasMoreData();){var l=s.parseSegment();if(!l)return[];o.appendSegment(l)}return o.pathSegList}}]),e}();C.prototype.classname="SVGPathSegList",Object.defineProperty(C.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),C._pathSegArrayAsString=function(e){var t="",n=!0;return e.forEach(function(e){n?(n=!1,t+=e._asPathString()):t+=" "+e._asPathString()}),t},Object.defineProperties(SVGPathElement.prototype,{pathSegList:{get:function(){return this._pathSegList||(this._pathSegList=new C(this)),this._pathSegList},enumerable:!0},normalizedPathSegList:{get:function(){return this.pathSegList},enumerable:!0},animatedPathSegList:{get:function(){return this.pathSegList},enumerable:!0},animatedNormalizedPathSegList:{get:function(){return this.pathSegList},enumerable:!0}}),window.SVGPathSegList=C}}();var m,v=jQuery,_=(Boolean(document.createElementNS&&document.createElementNS(f.SVG,"svg").createSVGRect),navigator.userAgent),y=document.createElementNS(f.SVG,"svg"),b=Boolean(window.opera),x=_.includes("AppleWebKit"),w=_.includes("Gecko/"),S=_.includes("MSIE"),k=_.includes("Chrome/"),C=(_.includes("Windows"),_.includes("Macintosh")),A="ontouchstart"in window,E=Boolean(y.querySelector),G=Boolean(document.evaluate),P=function(){var e=document.createElementNS(f.SVG,"path");e.setAttribute("d","M0,0 10,10");var t=e.pathSegList,n=e.createSVGPathSegLinetoAbs(5,5);try{return t.replaceItem(n,1),!0}catch(e){}return!1}(),I=function(){var e=document.createElementNS(f.SVG,"path");e.setAttribute("d","M0,0 10,10");var t=e.pathSegList,n=e.createSVGPathSegLinetoAbs(5,5);try{return t.insertItemBefore(n,1),!0}catch(e){}return!1}(),N=function(){var e=document.createElementNS(f.SVG,"svg"),t=document.createElementNS(f.SVG,"svg");document.documentElement.append(e),t.setAttribute("x",5),e.append(t);var n=document.createElementNS(f.SVG,"text");n.textContent="a",t.append(n);try{return 0===n.getStartPositionOfChar(0).x}catch(e){return!1}finally{e.remove()}}(),T=function(){var e=document.createElementNS(f.SVG,"svg");document.documentElement.append(e);var t=document.createElementNS(f.SVG,"path");t.setAttribute("d","M0,0 C0,0 10,10 10,0"),e.append(t);var n=t.getBBox();return e.remove(),n.height>4&&n.height<5}(),L=function(){var e=document.createElementNS(f.SVG,"svg");document.documentElement.append(e);var t=document.createElementNS(f.SVG,"path");t.setAttribute("d","M0,0 10,0");var n=document.createElementNS(f.SVG,"path");n.setAttribute("d","M5,0 15,0");var r=document.createElementNS(f.SVG,"g");r.append(t,n),e.append(r);var a=r.getBBox();return e.remove(),15===a.width}(),M=(function(){var e=document.createElementNS(f.SVG,"rect");e.setAttribute("x",.1);var t=!e.cloneNode(!1).getAttribute("x").includes(",");t||v.alert('NOTE: This version of Opera is known to contain bugs in SVG-edit.\nPlease upgrade to the latest version in which the problems have been fixed.')}(),(m=document.createElementNS(f.SVG,"rect")).setAttribute("style","vector-effect:non-scaling-stroke"),"non-scaling-stroke"===m.style.vectorEffect),O=function(){var t=document.createElementNS(f.SVG,"rect").transform.baseVal,n=y.createSVGTransform();t.appendItem(n);var r=t.getItem(0),a=function(t){return t&&"object"===e(t)&&"function"==typeof t.setMatrix&&"angle"in t};return a(r)&&a(n)&&r.type===n.type&&r.angle===n.angle&&r.matrix.a===n.matrix.a&&r.matrix.b===n.matrix.b&&r.matrix.c===n.matrix.c&&r.matrix.d===n.matrix.d&&r.matrix.e===n.matrix.e&&r.matrix.f===n.matrix.f}(),j=function(){return b},V=function(){return x},R=function(){return w},B=function(){return S},D=function(){return k},U=function(){return C},F=function(){return A},H=function(){return L},z=function(){return M};function q(t){var n=t.fn.attr;return t.fn.attr=function(t,r){var a=this.length;if(!a)return n.call(this,t,r);for(var i=0;i=0)return this._xforms[e];var t=new Error("DOMException with code=INDEX_SIZE_ERR");throw t.code=1,t}},{key:"insertItemBefore",value:function(e,t){var n=null;if(t>=0)if(t=0&&(this._removeFromOtherLists(e),this._xforms[t]=e,n=e,this._list._update()),n}},{key:"removeItem",value:function(e){if(e=0){var t,n=this._xforms[e],r=new Array(this.numberOfItems-1);for(t=0;t=0;t--)this.stack[t].unapply(e);e&&e.handleHistoryEvent(ce.AFTER_UNAPPLY,this)}},{key:"elements",value:function(){for(var e=[],t=this.stack.length;t--;)for(var n=this.stack[t].elements(),r=n.length;r--;)e.includes(n[r])||e.push(n[r]);return e}},{key:"addSubCommand",value:function(e){this.stack.push(e)}},{key:"isEmpty",value:function(){return!this.stack.length}}]),t}();ge.type=ge.prototype.type;var me=function(){function e(t){r(this,e),this.handler_=t||null,this.undoStackPointer=0,this.undoStack=[],this.undoChangeStackPointer=-1,this.undoableChangeStack=[]}return i(e,[{key:"resetUndoStack",value:function(){this.undoStack=[],this.undoStackPointer=0}},{key:"getUndoStackSize",value:function(){return this.undoStackPointer}},{key:"getRedoStackSize",value:function(){return this.undoStack.length-this.undoStackPointer}},{key:"getNextUndoCommandText",value:function(){return this.undoStackPointer>0?this.undoStack[this.undoStackPointer-1].getText():""}},{key:"getNextRedoCommandText",value:function(){return this.undoStackPointer0&&this.undoStack[--this.undoStackPointer].unapply(this.handler_)}},{key:"redo",value:function(){this.undoStackPointer0&&this.undoStack[this.undoStackPointer++].apply(this.handler_)}},{key:"addCommandToHistory",value:function(e){this.undoStackPointer0&&(this.undoStack=this.undoStack.splice(0,this.undoStackPointer)),this.undoStack.push(e),this.undoStackPointer=this.undoStack.length}},{key:"beginUndoableChange",value:function(e,t){for(var n=++this.undoChangeStackPointer,r=t.length,a=new Array(r),i=new Array(r);r--;){var o=t[r];an(o)||(i[r]=o,a[r]=o.getAttribute(e))}this.undoableChangeStack[n]={attrName:e,oldValues:a,elements:i}}},{key:"finishUndoableChange",value:function(){for(var e=this.undoChangeStackPointer--,t=this.undoableChangeStack[e],n=t.attrName,r=new ge("Change "+n),a=t.elements.length;a--;){var i=t.elements[a];if(!an(i)){var o={};o[n]=t.oldValues[a],o[n]!==i.getAttribute(n)&&r.addSubCommand(new fe(i,o,n))}}return this.undoableChangeStack[e]=null,r}}]),e}(),ve=Object.freeze({HistoryEventTypes:ce,MoveElementCommand:de,InsertElementCommand:he,RemoveElementCommand:pe,ChangeElementCommand:fe,BatchCommand:ge,UndoManager:me}),_e=document.createElementNS(f.SVG,"svg"),ye=function(e,t,n){return{x:n.a*e+n.c*t+n.e,y:n.b*e+n.d*t+n.f}},be=function(e){return 1===e.a&&0===e.b&&0===e.c&&1===e.d&&0===e.e&&0===e.f},xe=function(){for(var e=arguments.length,t=new Array(e),n=0;n(n=parseInt(n))){var r=n;n=t,t=r}for(var a=_e.createSVGMatrix(),i=t;i<=n;++i){var o=i>=0&&ie.x&&t.ye.y},Ge=jQuery,Pe={2:["x","y"],4:["x","y"],6:["x","y","x1","y1","x2","y2"],8:["x","y","x1","y1"],10:["x","y","r1","r2","angle","largeArcFlag","sweepFlag"],12:["x"],14:["y"],16:["x","y","x2","y2"],18:["x","y"]},Ie={},Ne=function(e){Object.assign(Ie,e.ui)},Te=[],Le=!0,Me={},Oe=null,je=null,Ve=function(e){je=e,Te=[0,"ClosePath"];Ge.each(["Moveto","Lineto","CurvetoCubic","CurvetoQuadratic","Arc","LinetoHorizontal","LinetoVertical","CurvetoCubicSmooth","CurvetoQuadraticSmooth"],function(e,t){Te.push(t+"Abs"),Te.push(t+"Rel")})},Re=function(e,t,n){var r=e.pathSegList;if(I)r.insertItemBefore(t,n);else{for(var a=r.numberOfItems,i=[],o=0;o0?(p=g element");this.elem=t,this.segs=[],this.selected_pts=[],Oe=this,this.init()}return i(e,[{key:"init",value:function(){Ge(He()).find("*").each(function(){Ge(this).attr("display","none")});var e=this.elem.pathSegList,t=e.numberOfItems;this.segs=[],this.selected_pts=[],this.first_seg=null;for(var n=0;n=t?null:i[s+1],u=s-1<0?null:i[s-1];if(2===l.type){if(u&&1!==u.type){var d=i[o];d.next=i[o+1],d.next.prev=d,d.addGrip()}o=s}else if(c&&1===c.type)l.next=i[o+1],l.next.prev=l,l.mate=i[o],l.addGrip(),an(this.first_seg)&&(this.first_seg=l);else if(c)1!==l.type&&(l.addGrip(),c&&2!==c.type&&(l.next=c,l.next.prev=l));else if(1!==l.type){var h=i[o];h.next=i[o+1],h.next.prev=h,h.addGrip(),l.addGrip(),this.first_seg||(this.first_seg=i[o])}}return this}},{key:"eachSeg",value:function(e){for(var t=this.segs.length,n=0;n=0&&n.selected_pts.push(e)}),this.selected_pts.sort();var r=this.selected_pts.length,a=[];for(a.length=r;r--;){var i=this.selected_pts[r],o=this.segs[i];o.select(!0),a[r]=o.ptgrip}var s=e.subpathIsClosed(this.selected_pts[0]);je.addPtsToSelection({grips:a,closedSubpath:s})}}]),e}();Ze.subpathIsClosed=function(e){var t=!1;return Oe.eachSeg(function(n){return n<=e||2!==this.type&&(1!==this.type||(t=!0,!1))}),t};var $e,Je,et,tt,nt,rt=function(e){var t=Me[e.id];return t||(t=Me[e.id]=new Ze(e)),t},at=function(e){e in Me&&delete Me[e]},it=function(e,t){var n=e-et,r=t-tt,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n)+nt;return n=a*Math.cos(i)+et,r=a*Math.sin(i)+tt,n-=$e,r-=Je,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n)-nt,{x:a*Math.cos(i)+$e,y:a*Math.sin(i)+Je}},ot=function(){var e=Oe.elem;if(nt=Zt(e,!0)){var t=Oe.oldbbox;et=t.x+t.width/2,tt=t.y+t.height/2;var n=Dt(e);$e=n.x+n.width/2,Je=n.y+n.height/2;var r=$e-et,a=Je-tt,i=Math.sqrt(r*r+a*a),o=Math.atan2(a,r)+nt;$e=i*Math.cos(o)+et,Je=i*Math.sin(o)+tt;for(var s=e.pathSegList,l=s.numberOfItems;l;){l-=1;var c=s.getItem(l),u=c.pathSegType;if(1!==u){var d=it(c.x,c.y),h=[d.x,d.y];if(!an(c.x1)&&!an(c.x2)){var p=it(c.x1,c.y1),f=it(c.x2,c.y2);h.splice(h.length,0,p.x,p.y,f.x,f.y)}We(u,l,h)}}Dt(e);var g=je.getSVGRoot().createSVGTransform(),m=$(e);g.setRotate(180*nt/Math.PI,$e,Je),m.replaceItem(g,0)}},st=[0,"z","M","m","L","l","C","c","Q","q","A","a","H","h","V","v","S","s","T","t"],lt=function(e,t){for(var n=e.pathSegList,r=n.numberOfItems,a=0,i=0,o="",s=null,l=0;l=C-w&&g<=C+w&&m>=A-w&&m<=A+w){S=!0;break}}a=je.getId(),at(a);var E,G,P=Jt(a),I=b.numberOfItems;if(S){if(x<=1&&I>=2){var N=b.getItem(0).x,T=b.getItem(0).y;E=4===(G=v.pathSegList.getItem(1)).pathSegType?y.createSVGPathSegLinetoAbs(N,T):y.createSVGPathSegCurvetoCubicAbs(N,T,G.x1/p,G.y1/p,N,T);var L=y.createSVGPathSegClosePath();b.appendItem(E),b.appendItem(L)}else if(I<3)return!1;if(Ge(v).remove(),je.setDrawnPath(null),je.setStarted(!1),ht){Oe.matrix&&je.remapElement(P,{},Oe.matrix.inverse());var M=P.getAttribute("d"),O=Ge(Oe.elem).attr("d");return Ge(Oe.elem).attr("d",O+M),Ge(P).remove(),Oe.matrix&&ot(),Ve(),gt.toEditMode(Oe.elem),Oe.selectPt(),!1}}else{if(!Ge.contains(je.getContainer(),je.getMouseTarget(e)))return!1;var j=y.pathSegList.numberOfItems,V=y.pathSegList.getItem(j-1),R=V.x,B=V.y;if(e.shiftKey){var D=Ae(R,B,g,m);g=D.x,m=D.y}E=4===(G=v.pathSegList.getItem(1)).pathSegType?y.createSVGPathSegLinetoAbs(je.round(g),je.round(m)):y.createSVGPathSegCurvetoCubicAbs(je.round(g),je.round(m),G.x1/p,G.y1/p,G.x2/p,G.y2/p),y.pathSegList.appendItem(E),g*=p,m*=p,v.setAttribute("d",["M",g,m,g,m].join(" ")),_=j,ht&&(_+=Oe.segs.length),Fe(_,g,m)}}else{var U="M"+g+","+m+" ";je.setDrawnPath(je.addSVGElementFromJson({element:"path",curStyles:!0,attr:{d:U,id:je.getNextId(),opacity:je.getOpacity()/2}})),v.setAttribute("d",["M",d,h,d,h].join(" ")),_=ht?Oe.segs.length:0,Fe(_,d,h)}}},mouseMove:function(e,t){var n=je.getCurrentZoom();ft=!0;var r=je.getDrawnPath();if("path"!==je.getCurrentMode())if(Oe.dragging){var a=Ue({x:Oe.dragging[0],y:Oe.dragging[1]},Oe),i=Ue({x:e,y:t},Oe),o=i.x-a.x,s=i.y-a.y;Oe.dragging=[e,t],Oe.dragctrl?Oe.moveCtrl(o,s):Oe.movePts(o,s)}else Oe.selected_pts=[],Oe.eachSeg(function(e){if(this.next||this.prev){var t=je.getRubberBox().getBBox(),n=De(this),r={x:n.x,y:n.y,width:0,height:0},a=Ee(t,r);this.select(a),a&&Oe.selected_pts.push(this.index)}});else{if(!r)return;var l=r.pathSegList,c=l.numberOfItems-1;if(ut){var u=ze("1c1"),d=ze("0c2");u.setAttribute("cx",e),u.setAttribute("cy",t),u.setAttribute("display","inline");var h=ut[0],p=ut[1],f=h+(h-e/n),g=p+(p-t/n);d.setAttribute("cx",f*n),d.setAttribute("cy",g*n),d.setAttribute("display","inline");var m=qe(1);if(en(m,{x1:e,y1:t,x2:f*n,y2:g*n,display:"inline"}),0===c)dt=[e,t];else{var v=l.getItem(c-1),_=v.x,y=v.y;6===v.pathSegType?(_+=_-v.x2,y+=y-v.y2):dt&&(_=dt[0]/n,y=dt[1]/n),We(6,c,[h,p,_,y,f,g],r)}}else{var b=Jt("path_stretch_line");if(b){var x=l.getItem(c);if(6===x.pathSegType){var w=x.x+(x.x-x.x2),S=x.y+(x.y-x.y2);We(6,1,[e,t,w*n,S*n,e,t],b)}else dt?We(6,1,[e,t,dt[0],dt[1],e,t],b):We(4,1,[e,t],b)}}}},mouseUp:function(e,t,n,r){var a=je.getDrawnPath();if("path"===je.getCurrentMode())return ut=null,a||(t=Jt(je.getId()),je.setStarted(!1),dt=null),{keep:!0,element:t};var i=je.getRubberBox();if(Oe.dragging){var o=Oe.cur_pt;Oe.dragging=!1,Oe.dragctrl=!1,Oe.update(),ft&&Oe.endChanges("Move path point(s)"),e.shiftKey||ft||Oe.selectPt(o)}else i&&"none"!==i.getAttribute("display")?(i.setAttribute("display","none"),i.getAttribute("width")<=2&&i.getAttribute("height")<=2&>.toSelectMode(e.target)):gt.toSelectMode(e.target);ft=!1},toEditMode:function(e){Oe=rt(e),je.setCurrentMode("pathedit"),je.clearSelection(),Oe.show(!0).update(),Oe.oldbbox=Dt(Oe.elem),ht=!1},toSelectMode:function(e){var t=e===Oe.elem;je.setCurrentMode("select"),Oe.show(!1),pt=!1,je.clearSelection(),Oe.matrix&&ot(),t&&(je.call("selected",[e]),je.addToSelection([e],!0))},addSubPath:function(e){e?(je.setCurrentMode("path"),ht=!0):(gt.clear(!0),gt.toEditMode(Oe.elem))},select:function(e){pt===e?(gt.toEditMode(e),je.setCurrentMode("pathedit")):pt=e},reorient:function(){var e=je.getSelectedElements()[0];if(e&&0!==Zt(e)){var t=new ge("Reorient path"),n={d:e.getAttribute("d"),transform:e.getAttribute("transform")};t.addSubCommand(new fe(e,n)),je.clearSelection(),this.resetOrientation(e),je.addCommandToHistory(t),rt(e).show(!1).matrix=null,this.clear(),je.addToSelection([e],!0),je.call("changed",je.getSelectedElements())}},clear:function(e){var t=je.getDrawnPath();if(pt=null,t){var n=Jt(je.getId());Ge(Jt("path_stretch_line")).remove(),Ge(n).remove(),Ge(Jt("pathpointgrip_container")).find("*").attr("display","none"),dt=null,je.setDrawnPath(null),je.setStarted(!1)}else"pathedit"===je.getCurrentMode()&&this.toSelectMode();Oe&&Oe.init().show(!1)},resetOrientation:function(e){if(an(e)||"path"!==e.nodeName)return!1;var t=$(e),n=ke(t).matrix;t.clear(),e.removeAttribute("transform");for(var r=e.pathSegList,a=r.numberOfItems,i=function(t){var a=r.getItem(t),i=a.pathSegType;if(1===i)return"continue";var o=[];Ge.each(["",1,2],function(e,t){var r=a["x"+t],i=a["y"+t];if(void 0!==r&&void 0!==i){var s=ye(r,i,n);o.splice(o.length,0,s.x,s.y)}}),We(i,t,o,e)},o=0;o0){var s=t.getItem(n-1).pathSegType;if(2===s){r(n-1,1),e();break}if(1===s&&t.numberOfItems-1===n){r(n,1),e();break}}}return!1}(),Oe.elem.pathSegList.numberOfItems<=1)return gt.toSelectMode(Oe.elem),void je.canvas.deleteSelectedElements();if(Oe.init(),Oe.clearSelection(),window.opera){var r=Ge(Oe.elem);r.attr("d",r.attr("d"))}Oe.endChanges("Delete path node(s)")}},smoothPolylineIntoPath:function(e){var t,n=e.points,r=n.numberOfItems;if(r>=4){var a=n.getItem(0),i=null,o=[];for(o.push(["M",a.x,",",a.y," C"].join("")),t=1;t<=r-4;t+=3){var s=n.getItem(t),l=n.getItem(t+1),c=n.getItem(t+2);if(i){var u=Qe(i,s,a);if(u&&2===u.length){var d=o[o.length-1].split(",");d[2]=u[0].x,d[3]=u[0].y,o[o.length-1]=d.join(","),s=u[1]}}o.push([s.x,s.y,l.x,l.y,c.x,c.y].join(",")),a=c,i=l}for(o.push("L");t)/,"$1$2")},kt=function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")};function Ct(e){if(e=Gt(e),window.btoa)return window.btoa(e);var t=new Array(4*Math.floor((e.length+2)/3)),n=0,r=0;do{var a=e.charCodeAt(n++),i=e.charCodeAt(n++),o=e.charCodeAt(n++),s=a>>2,l=(3&a)<<4|i>>4,c=(15&i)<<2|o>>6,u=63&o;isNaN(i)?(c=64,u=64):isNaN(o)&&(u=64),t[r++]=vt.charAt(s),t[r++]=vt.charAt(l),t[r++]=vt.charAt(c),t[r++]=vt.charAt(u)}while(n>4,l=(15&a)<<4|i>>2,c=(3&i)<<6|o;t+=String.fromCharCode(s),64!==i&&(t+=String.fromCharCode(l)),64!==o&&(t+=String.fromCharCode(c))}while(nSVG-edit