').append(btn.title);
+ }
+ } else if (btn.list) {
+ // Add button to list
+ button.addClass('push_button');
+ $$c('#' + btn.list + '_opts').append(button);
+
+ if (btn.isDefault) {
+ $$c('#cur_' + btn.list).append(button.children().clone());
+
+ var _svgicon = btn.svgicon || btn.id;
+
+ placementObj['#cur_' + btn.list] = _svgicon;
+ }
+ } else if (btn.includeWith) {
+ // Add to flyout menu / make flyout menu
+ var opts = btn.includeWith; // opts.button, default, position
+
+ refBtn = $$c(opts.button);
+ flyoutHolder = refBtn.parent(); // Create a flyout menu if there isn't one already
+
+ var _tlsId;
+
+ if (!refBtn.parent().hasClass('tools_flyout')) {
+ // Create flyout placeholder
+ _tlsId = refBtn[0].id.replace('tool_', 'tools_');
+ showBtn = refBtn.clone().attr('id', _tlsId + '_show').append($$c('
', {
+ "class": 'flyout_arrow_horiz'
+ }));
+ refBtn.before(showBtn); // Create a flyout div
+
+ flyoutHolder = makeFlyoutHolder(_tlsId, refBtn);
+ }
+
+ refData = Actions.getButtonData(opts.button);
+
+ if (opts.isDefault) {
+ placementObj['#' + _tlsId + '_show'] = btn.id;
+ } // TODO: Find way to set the current icon using the iconloader if this is not default
+ // Include data for extension button as well as ref button
+
+
+ var curH = holders['#' + flyoutHolder[0].id] = [{
+ sel: '#' + id,
+ fn: btn.events.click,
+ icon: btn.id,
+ key: btn.key,
+ isDefault: Boolean(btn.includeWith && btn.includeWith.isDefault)
+ }, refData]; // {sel:'#tool_rect', fn: clickRect, evt: 'mouseup', key: 4, parent: '#tools_rect', icon: 'rect'}
+
+ var pos = 'position' in opts ? opts.position : 'last';
+ var len = flyoutHolder.children().length; // Add at given position or end
+
+ if (!isNaN(pos) && pos >= 0 && pos < len) {
+ flyoutHolder.children().eq(pos).before(button);
+ } else {
+ flyoutHolder.append(button);
+ curH.reverse();
+ }
+ }
+
+ if (!svgicons) {
+ button.append(icon);
+ }
+
+ if (!btn.list) {
+ // Add given events to button
+ $$c.each(btn.events, function (name, func) {
+ if (name === 'click' && btn.type === 'mode') {
+ // `touch.js` changes `touchstart` to `mousedown`,
+ // so we must map extension click events as well
+ if (isTouch() && name === 'click') {
+ name = 'mousedown';
+ }
+
+ if (btn.includeWith) {
+ button.bind(name, func);
+ } else {
+ button.bind(name, function () {
+ if (toolButtonClick(button)) {
+ func();
+ }
+ });
+ }
+
+ if (btn.key) {
+ $$c(document).bind('keydown', btn.key, func);
+
+ if (btn.title) {
+ button.attr('title', btn.title + ' [' + btn.key + ']');
+ }
+ }
+ } else {
+ button.bind(name, func);
+ }
+ });
+ }
+
+ setupFlyouts(holders);
+ });
+ $$c.each(btnSelects, function () {
+ addAltDropDown(this.elem, this.list, this.callback, {
+ seticon: true
+ });
+ });
+
+ if (!svgicons) {
+ _context6.next = 24;
+ break;
+ }
+
+ return _context6.abrupt("return", new Promise(function (resolve, reject) {
+ // eslint-disable-line promise/avoid-new
+ $$c.svgIcons(svgicons, {
+ w: 24,
+ h: 24,
+ id_match: false,
+ no_img: !isWebkit(),
+ fallback: fallbackObj,
+ placement: placementObj,
+ callback: function callback(icons) {
+ // Non-ideal hack to make the icon match the current size
+ // if (curPrefs.iconsize && curPrefs.iconsize !== 'm') {
+ if (editor.pref('iconsize') !== 'm') {
+ prepResize();
+ }
+
+ runCallback();
+ resolve();
+ }
+ });
+ }));
+
+ case 24:
+ return _context6.abrupt("return", runCallback());
+
+ case 25:
+ case "end":
+ return _context6.stop();
+ }
+ }
+ }, _callee6);
+ }));
+
+ return function extAdded(_x4, _x5) {
+ return _ref11.apply(this, arguments);
+ };
+ }();
+ /**
+ * @param {string} color
+ * @param {Float} opac
+ * @param {string} type
+ * @returns {module:jGraduate~Paint}
+ */
+
+
+ var getPaint = function getPaint(color, opac, type) {
+ // update the editor's fill paint
+ var opts = {
+ alpha: opac
+ };
+
+ if (color.startsWith('url(#')) {
+ var refElem = svgCanvas.getRefElem(color);
+
+ if (refElem) {
+ refElem = refElem.cloneNode(true);
+ } else {
+ refElem = $$c('#' + type + '_color defs *')[0];
+ }
+
+ opts[refElem.tagName] = refElem;
+ } else if (color.startsWith('#')) {
+ opts.solidColor = color.substr(1);
+ } else {
+ opts.solidColor = 'none';
+ }
+
+ return new $$c.jGraduate.Paint(opts);
+ }; // $('#text').focus(function () { textBeingEntered = true; });
+ // $('#text').blur(function () { textBeingEntered = false; });
+ // bind the selected event to our function that handles updates to the UI
+
+
+ svgCanvas.bind('selected', selectedChanged);
+ svgCanvas.bind('transition', elementTransition);
+ svgCanvas.bind('changed', elementChanged);
+ svgCanvas.bind('saved', saveHandler);
+ svgCanvas.bind('exported', exportHandler);
+ svgCanvas.bind('exportedPDF', function (win, data) {
+ if (!data.output) {
+ // Ignore Chrome
+ return;
+ }
+
+ var exportWindowName = data.exportWindowName;
+
+ if (exportWindowName) {
+ exportWindow = window.open('', exportWindowName); // A hack to get the window via JSON-able name without opening a new one
+ }
+
+ if (!exportWindow || exportWindow.closed) {
+ /* await */
+ $$c.alert(uiStrings$1.notification.popupWindowBlocked);
+ return;
+ }
+
+ exportWindow.location.href = data.output;
+ });
+ svgCanvas.bind('zoomed', zoomChanged);
+ svgCanvas.bind('zoomDone', zoomDone);
+ svgCanvas.bind('updateCanvas',
+ /**
+ * @param {external:Window} win
+ * @param {PlainObject} centerInfo
+ * @param {false} centerInfo.center
+ * @param {module:math.XYObject} centerInfo.newCtr
+ * @listens module:svgcanvas.SvgCanvas#event:updateCanvas
+ * @returns {void}
+ */
+ function (win, _ref12) {
+ var center = _ref12.center,
+ newCtr = _ref12.newCtr;
+ updateCanvas(center, newCtr);
+ });
+ svgCanvas.bind('contextset', contextChanged);
+ svgCanvas.bind('extension_added', extAdded);
+ svgCanvas.textActions.setInputElem($$c('#text')[0]);
+ var str = '
';
+ $$c.each(palette, function (i, item) {
+ str += '
';
+ });
+ $$c('#palette').append(str); // Set up editor background functionality
+
+ var colorBlocks = ['#FFF', '#888', '#000', 'chessboard'];
+ str = '';
+ $$c.each(colorBlocks, function (i, e) {
+ if (e === 'chessboard') {
+ str += '
';
+ } else {
+ str += '
';
+ }
+ });
+ $$c('#bg_blocks').append(str);
+ var blocks = $$c('#bg_blocks div');
+ var curBg = 'cur_background';
+ blocks.each(function () {
+ var blk = $$c(this);
+ blk.click(function () {
+ blocks.removeClass(curBg);
+ $$c(this).addClass(curBg);
+ });
+ });
+ setBackground(editor.pref('bkgd_color'), editor.pref('bkgd_url'));
+ $$c('#image_save_opts input').val([editor.pref('img_save')]);
+ /**
+ * @type {module:jQuerySpinButton.ValueCallback}
+ */
+
+ var changeRectRadius = function changeRectRadius(ctl) {
+ svgCanvas.setRectRadius(ctl.value);
+ };
+ /**
+ * @type {module:jQuerySpinButton.ValueCallback}
+ */
+
+
+ var changeFontSize = function changeFontSize(ctl) {
+ svgCanvas.setFontSize(ctl.value);
+ };
+ /**
+ * @type {module:jQuerySpinButton.ValueCallback}
+ */
+
+
+ var changeStrokeWidth = function changeStrokeWidth(ctl) {
+ var val = ctl.value;
+
+ if (val === 0 && selectedElement && ['line', 'polyline'].includes(selectedElement.nodeName)) {
+ val = ctl.value = 1;
+ }
+
+ svgCanvas.setStrokeWidth(val);
+ };
+ /**
+ * @type {module:jQuerySpinButton.ValueCallback}
+ */
+
+
+ var changeRotationAngle = function changeRotationAngle(ctl) {
+ svgCanvas.setRotationAngle(ctl.value);
+ $$c('#tool_reorient').toggleClass('disabled', Number.parseInt(ctl.value) === 0);
+ };
+ /**
+ * @param {external:jQuery.fn.SpinButton} ctl Spin Button
+ * @param {string} [val=ctl.value]
+ * @returns {void}
+ */
+
+
+ var changeOpacity = function changeOpacity(ctl, val) {
+ if (isNullish(val)) {
+ val = ctl.value;
+ }
+
+ $$c('#group_opacity').val(val);
+
+ if (!ctl || !ctl.handle) {
+ $$c('#opac_slider').slider('option', 'value', val);
+ }
+
+ svgCanvas.setOpacity(val / 100);
+ };
+ /**
+ * @param {external:jQuery.fn.SpinButton} ctl Spin Button
+ * @param {string} [val=ctl.value]
+ * @param {boolean} noUndo
+ * @returns {void}
+ */
+
+
+ var changeBlur = function changeBlur(ctl, val, noUndo) {
+ if (isNullish(val)) {
+ val = ctl.value;
+ }
+
+ $$c('#blur').val(val);
+ var complete = false;
+
+ if (!ctl || !ctl.handle) {
+ $$c('#blur_slider').slider('option', 'value', val);
+ complete = true;
+ }
+
+ if (noUndo) {
+ svgCanvas.setBlurNoUndo(val);
+ } else {
+ svgCanvas.setBlur(val, complete);
+ }
+ };
+
+ $$c('#stroke_style').change(function () {
+ svgCanvas.setStrokeAttr('stroke-dasharray', $$c(this).val());
+ operaRepaint();
+ });
+ $$c('#stroke_linejoin').change(function () {
+ svgCanvas.setStrokeAttr('stroke-linejoin', $$c(this).val());
+ operaRepaint();
+ }); // Lose focus for select elements when changed (Allows keyboard shortcuts to work better)
+
+ $$c('select').change(function () {
+ $$c(this).blur();
+ }); // fired when user wants to move elements to another layer
+
+ var promptMoveLayerOnce = false;
+ $$c('#selLayerNames').change( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
+ var destLayer, confirmStr, moveToLayer, ok;
+ return regeneratorRuntime.wrap(function _callee7$(_context7) {
+ while (1) {
+ switch (_context7.prev = _context7.next) {
+ case 0:
+ destLayer = this.options[this.selectedIndex].value;
+ confirmStr = uiStrings$1.notification.QmoveElemsToLayer.replace('%s', destLayer);
+ /**
+ * @param {boolean} ok
+ * @returns {void}
+ */
+
+ moveToLayer = function moveToLayer(ok) {
+ if (!ok) {
+ return;
+ }
+
+ promptMoveLayerOnce = true;
+ svgCanvas.moveSelectedToLayer(destLayer);
+ svgCanvas.clearSelection();
+ populateLayers();
+ };
+
+ if (!destLayer) {
+ _context7.next = 14;
+ break;
+ }
+
+ if (!promptMoveLayerOnce) {
+ _context7.next = 8;
+ break;
+ }
+
+ moveToLayer(true);
+ _context7.next = 14;
+ break;
+
+ case 8:
+ _context7.next = 10;
+ return $$c.confirm(confirmStr);
+
+ case 10:
+ ok = _context7.sent;
+
+ if (ok) {
+ _context7.next = 13;
+ break;
+ }
+
+ return _context7.abrupt("return");
+
+ case 13:
+ moveToLayer(true);
+
+ case 14:
+ case "end":
+ return _context7.stop();
+ }
+ }
+ }, _callee7, this);
+ })));
+ $$c('#font_family').change(function () {
+ svgCanvas.setFontFamily(this.value);
+ });
+ $$c('#seg_type').change(function () {
+ svgCanvas.setSegType($$c(this).val());
+ });
+ $$c('#text').bind('keyup input', function () {
+ svgCanvas.setTextContent(this.value);
+ });
+ $$c('#image_url').change(function () {
+ setImageURL(this.value);
+ });
+ $$c('#link_url').change(function () {
+ if (this.value.length) {
+ svgCanvas.setLinkURL(this.value);
+ } else {
+ svgCanvas.removeHyperlink();
+ }
+ });
+ $$c('#g_title').change(function () {
+ svgCanvas.setGroupTitle(this.value);
+ });
+ $$c('.attr_changer').change(function () {
+ var attr = this.getAttribute('data-attr');
+ var val = this.value;
+ var valid = isValidUnit(attr, val, selectedElement);
+
+ if (!valid) {
+ this.value = selectedElement.getAttribute(attr);
+ /* await */
+
+ $$c.alert(uiStrings$1.notification.invalidAttrValGiven);
+ return false;
+ }
+
+ if (attr !== 'id' && attr !== 'class') {
+ if (isNaN(val)) {
+ val = svgCanvas.convertToNum(attr, val);
+ } else if (curConfig.baseUnit !== 'px') {
+ // Convert unitless value to one with given unit
+ var unitData = getTypeMap();
+
+ if (selectedElement[attr] || svgCanvas.getMode() === 'pathedit' || attr === 'x' || attr === 'y') {
+ val *= unitData[curConfig.baseUnit];
+ }
+ }
+ } // if the user is changing the id, then de-select the element first
+ // change the ID, then re-select it with the new ID
+
+
+ if (attr === 'id') {
+ var elem = selectedElement;
+ svgCanvas.clearSelection();
+ elem.id = val;
+ svgCanvas.addToSelection([elem], true);
+ } else {
+ svgCanvas.changeSelectedAttribute(attr, val);
+ }
+
+ this.blur();
+ return true;
+ }); // Prevent selection of elements when shift-clicking
+
+ $$c('#palette').mouseover(function () {
+ var inp = $$c('
');
+ $$c(this).append(inp);
+ inp.focus().remove();
+ });
+ $$c('.palette_item').mousedown(function (evt) {
+ // shift key or right click for stroke
+ var picker = evt.shiftKey || evt.button === 2 ? 'stroke' : 'fill';
+ var color = $$c(this).data('rgb');
+ var paint; // Webkit-based browsers returned 'initial' here for no stroke
+
+ if (color === 'none' || color === 'transparent' || color === 'initial') {
+ color = 'none';
+ paint = new $$c.jGraduate.Paint();
+ } else {
+ paint = new $$c.jGraduate.Paint({
+ alpha: 100,
+ solidColor: color.substr(1)
+ });
+ }
+
+ paintBox[picker].setPaint(paint);
+ svgCanvas.setColor(picker, color);
+
+ if (color !== 'none' && svgCanvas.getPaintOpacity(picker) !== 1) {
+ svgCanvas.setPaintOpacity(picker, 1.0);
+ }
+
+ updateToolButtonState();
+ }).bind('contextmenu', function (e) {
+ e.preventDefault();
+ });
+ $$c('#toggle_stroke_tools').on('click', function () {
+ $$c('#tools_bottom').toggleClass('expanded');
+ });
+
+ (function () {
+ var wArea = workarea[0];
+ var lastX = null,
+ lastY = null,
+ panning = false,
+ keypan = false;
+ $$c('#svgcanvas').bind('mousemove mouseup', function (evt) {
+ if (panning === false) {
+ return true;
+ }
+
+ wArea.scrollLeft -= evt.clientX - lastX;
+ wArea.scrollTop -= evt.clientY - lastY;
+ lastX = evt.clientX;
+ lastY = evt.clientY;
+
+ if (evt.type === 'mouseup') {
+ panning = false;
+ }
+
+ return false;
+ }).mousedown(function (evt) {
+ if (evt.button === 1 || keypan === true) {
+ panning = true;
+ lastX = evt.clientX;
+ lastY = evt.clientY;
+ return false;
+ }
+
+ return true;
+ });
+ $$c(window).mouseup(function () {
+ panning = false;
+ });
+ $$c(document).bind('keydown', 'space', function (evt) {
+ svgCanvas.spaceKey = keypan = true;
+ evt.preventDefault();
+ }).bind('keyup', 'space', function (evt) {
+ evt.preventDefault();
+ svgCanvas.spaceKey = keypan = false;
+ }).bind('keydown', 'shift', function (evt) {
+ if (svgCanvas.getMode() === 'zoom') {
+ workarea.css('cursor', zoomOutIcon);
+ }
+ }).bind('keyup', 'shift', function (evt) {
+ if (svgCanvas.getMode() === 'zoom') {
+ workarea.css('cursor', zoomInIcon);
+ }
+ });
+ /**
+ * @function module:SVGEditor.setPanning
+ * @param {boolean} active
+ * @returns {void}
+ */
+
+ editor.setPanning = function (active) {
+ svgCanvas.spaceKey = keypan = active;
+ };
+ })();
+
+ (function () {
+ var button = $$c('#main_icon');
+ var overlay = $$c('#main_icon span');
+ var list = $$c('#main_menu');
+ var onButton = false;
+ var height = 0;
+ var jsHover = true;
+ var setClick = false;
+ /*
+ // Currently unused
+ const hideMenu = function () {
+ list.fadeOut(200);
+ };
+ */
+
+ $$c(window).mouseup(function (evt) {
+ if (!onButton) {
+ button.removeClass('buttondown'); // do not hide if it was the file input as that input needs to be visible
+ // for its change event to fire
+
+ if (evt.target.tagName !== 'INPUT') {
+ list.fadeOut(200);
+ } else if (!setClick) {
+ setClick = true;
+ $$c(evt.target).click(function () {
+ list.css('margin-left', '-9999px').show();
+ });
+ }
+ }
+
+ onButton = false;
+ }).mousedown(function (evt) {
+ // $('.contextMenu').hide();
+ var islib = $$c(evt.target).closest('div.tools_flyout, .contextMenu').length;
+
+ if (!islib) {
+ $$c('.tools_flyout:visible,.contextMenu').fadeOut(250);
+ }
+ });
+ overlay.bind('mousedown', function () {
+ if (!button.hasClass('buttondown')) {
+ // Margin must be reset in case it was changed before;
+ list.css('margin-left', 0).show();
+
+ if (!height) {
+ height = list.height();
+ } // Using custom animation as slideDown has annoying 'bounce effect'
+
+
+ list.css('height', 0).animate({
+ height: height
+ }, 200);
+ onButton = true;
+ } else {
+ list.fadeOut(200);
+ }
+
+ button.toggleClass('buttondown buttonup');
+ }).hover(function () {
+ onButton = true;
+ }).mouseout(function () {
+ onButton = false;
+ });
+ var listItems = $$c('#main_menu li'); // Check if JS method of hovering needs to be used (Webkit bug)
+
+ listItems.mouseover(function () {
+ jsHover = $$c(this).css('background-color') === 'rgba(0, 0, 0, 0)';
+ listItems.unbind('mouseover');
+
+ if (jsHover) {
+ listItems.mouseover(function () {
+ this.style.backgroundColor = '#FFC';
+ }).mouseout(function () {
+ this.style.backgroundColor = 'transparent';
+ return true;
+ });
+ }
+ });
+ })(); // Made public for UI customization.
+ // TODO: Group UI functions into a public editor.ui interface.
+
+ /**
+ * See {@link http://api.jquery.com/bind/#bind-eventType-eventData-handler}.
+ * @callback module:SVGEditor.DropDownCallback
+ * @param {external:jQuery.Event} ev See {@link http://api.jquery.com/Types/#Event}
+ * @listens external:jQuery.Event
+ * @returns {void|boolean} Calls `preventDefault()` and `stopPropagation()`
+ */
+
+ /**
+ * @function module:SVGEditor.addDropDown
+ * @param {Element|string} elem DOM Element or selector
+ * @param {module:SVGEditor.DropDownCallback} callback Mouseup callback
+ * @param {boolean} dropUp
+ * @returns {void}
+ */
+
+
+ editor.addDropDown = function (elem, callback, dropUp) {
+ if (!$$c(elem).length) {
+ return;
+ } // Quit if called on non-existent element
+
+
+ var button = $$c(elem).find('button');
+ var list = $$c(elem).find('ul').attr('id', $$c(elem)[0].id + '-list');
+
+ if (dropUp) {
+ $$c(elem).addClass('dropup');
+ } else {
+ // Move list to place where it can overflow container
+ $$c('#option_lists').append(list);
+ }
+
+ list.find('li').bind('mouseup', callback);
+ var onButton = false;
+ $$c(window).mouseup(function (evt) {
+ if (!onButton) {
+ button.removeClass('down');
+ list.hide();
+ }
+
+ onButton = false;
+ });
+ button.bind('mousedown', function () {
+ if (!button.hasClass('down')) {
+ if (!dropUp) {
+ var pos = $$c(elem).position();
+ list.css({
+ top: pos.top + 24,
+ left: pos.left - 10
+ });
+ }
+
+ list.show();
+ onButton = true;
+ } else {
+ list.hide();
+ }
+
+ button.toggleClass('down');
+ }).hover(function () {
+ onButton = true;
+ }).mouseout(function () {
+ onButton = false;
+ });
+ };
+
+ editor.addDropDown('#font_family_dropdown', function () {
+ $$c('#font_family').val($$c(this).text()).change();
+ });
+ editor.addDropDown('#opacity_dropdown', function () {
+ if ($$c(this).find('div').length) {
+ return;
+ }
+
+ var perc = Number.parseInt($$c(this).text().split('%')[0]);
+ changeOpacity(false, perc);
+ }, true); // For slider usage, see: http://jqueryui.com/demos/slider/
+
+ $$c('#opac_slider').slider({
+ start: function start() {
+ $$c('#opacity_dropdown li:not(.special)').hide();
+ },
+ stop: function stop() {
+ $$c('#opacity_dropdown li').show();
+ $$c(window).mouseup();
+ },
+ slide: function slide(evt, ui) {
+ changeOpacity(ui);
+ }
+ });
+ editor.addDropDown('#blur_dropdown', $$c.noop);
+ var slideStart = false;
+ $$c('#blur_slider').slider({
+ max: 10,
+ step: 0.1,
+ stop: function stop(evt, ui) {
+ slideStart = false;
+ changeBlur(ui);
+ $$c('#blur_dropdown li').show();
+ $$c(window).mouseup();
+ },
+ start: function start() {
+ slideStart = true;
+ },
+ slide: function slide(evt, ui) {
+ changeBlur(ui, null, slideStart);
+ }
+ });
+ editor.addDropDown('#zoom_dropdown', function () {
+ var item = $$c(this);
+ var val = item.data('val');
+
+ if (val) {
+ zoomChanged(window, val);
+ } else {
+ changeZoom({
+ value: Number.parseFloat(item.text())
+ });
+ }
+ }, true);
+ addAltDropDown('#stroke_linecap', '#linecap_opts', function () {
+ setStrokeOpt(this, true);
+ }, {
+ dropUp: true
+ });
+ addAltDropDown('#stroke_linejoin', '#linejoin_opts', function () {
+ setStrokeOpt(this, true);
+ }, {
+ dropUp: true
+ });
+ addAltDropDown('#tool_position', '#position_opts', function () {
+ var letter = this.id.replace('tool_pos', '').charAt(0);
+ svgCanvas.alignSelectedElements(letter, 'page');
+ }, {
+ multiclick: true
+ });
+ /*
+ When a flyout icon is selected
+ (if flyout) {
+ - Change the icon
+ - Make pressing the button run its stuff
+ }
+ - Run its stuff
+ When its shortcut key is pressed
+ - If not current in list, do as above
+ , else:
+ - Just run its stuff
+ */
+ // Unfocus text input when workarea is mousedowned.
+
+ (function () {
+ var inp;
+ /**
+ *
+ * @returns {void}
+ */
+
+ var unfocus = function unfocus() {
+ $$c(inp).blur();
+ };
+
+ $$c('#svg_editor').find('button, select, input:not(#text)').focus(function () {
+ inp = this;
+ uiContext = 'toolbars';
+ workarea.mousedown(unfocus);
+ }).blur(function () {
+ uiContext = 'canvas';
+ workarea.unbind('mousedown', unfocus); // Go back to selecting text if in textedit mode
+
+ if (svgCanvas.getMode() === 'textedit') {
+ $$c('#text').focus();
+ }
+ });
+ })();
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickFHPath = function clickFHPath() {
+ if (toolButtonClick('#tool_fhpath')) {
+ svgCanvas.setMode('fhpath');
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickLine = function clickLine() {
+ if (toolButtonClick('#tool_line')) {
+ svgCanvas.setMode('line');
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickSquare = function clickSquare() {
+ if (toolButtonClick('#tool_square')) {
+ svgCanvas.setMode('square');
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickRect = function clickRect() {
+ if (toolButtonClick('#tool_rect')) {
+ svgCanvas.setMode('rect');
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickFHRect = function clickFHRect() {
+ if (toolButtonClick('#tool_fhrect')) {
+ svgCanvas.setMode('fhrect');
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickCircle = function clickCircle() {
+ if (toolButtonClick('#tool_circle')) {
+ svgCanvas.setMode('circle');
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickEllipse = function clickEllipse() {
+ if (toolButtonClick('#tool_ellipse')) {
+ svgCanvas.setMode('ellipse');
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickFHEllipse = function clickFHEllipse() {
+ if (toolButtonClick('#tool_fhellipse')) {
+ svgCanvas.setMode('fhellipse');
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickImage = function clickImage() {
+ if (toolButtonClick('#tool_image')) {
+ svgCanvas.setMode('image');
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickZoom = function clickZoom() {
+ if (toolButtonClick('#tool_zoom')) {
+ svgCanvas.setMode('zoom');
+ workarea.css('cursor', zoomInIcon);
+ }
+ };
+ /**
+ * @param {Float} multiplier
+ * @returns {void}
+ */
+
+
+ var zoomImage = function zoomImage(multiplier) {
+ var res = svgCanvas.getResolution();
+ multiplier = multiplier ? res.zoom * multiplier : 1; // setResolution(res.w * multiplier, res.h * multiplier, true);
+
+ $$c('#zoom').val(multiplier * 100);
+ svgCanvas.setZoom(multiplier);
+ zoomDone();
+ updateCanvas(true);
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var dblclickZoom = function dblclickZoom() {
+ if (toolButtonClick('#tool_zoom')) {
+ zoomImage();
+ setSelectMode();
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickText = function clickText() {
+ if (toolButtonClick('#tool_text')) {
+ svgCanvas.setMode('text');
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickPath = function clickPath() {
+ if (toolButtonClick('#tool_path')) {
+ svgCanvas.setMode('path');
+ }
+ };
+ /**
+ * Delete is a contextual tool that only appears in the ribbon if
+ * an element has been selected.
+ * @returns {void}
+ */
+
+
+ var deleteSelected = function deleteSelected() {
+ if (!isNullish(selectedElement) || multiselected) {
+ svgCanvas.deleteSelectedElements();
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var cutSelected = function cutSelected() {
+ if (!isNullish(selectedElement) || multiselected) {
+ svgCanvas.cutSelectedElements();
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var copySelected = function copySelected() {
+ if (!isNullish(selectedElement) || multiselected) {
+ svgCanvas.copySelectedElements();
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var pasteInCenter = function pasteInCenter() {
+ var zoom = svgCanvas.getZoom();
+ var x = (workarea[0].scrollLeft + workarea.width() / 2) / zoom - svgCanvas.contentW;
+ var y = (workarea[0].scrollTop + workarea.height() / 2) / zoom - svgCanvas.contentH;
+ svgCanvas.pasteElements('point', x, y);
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var moveToTopSelected = function moveToTopSelected() {
+ if (!isNullish(selectedElement)) {
+ svgCanvas.moveToTopSelectedElement();
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var moveToBottomSelected = function moveToBottomSelected() {
+ if (!isNullish(selectedElement)) {
+ svgCanvas.moveToBottomSelectedElement();
+ }
+ };
+ /**
+ * @param {"Up"|"Down"} dir
+ * @returns {void}
+ */
+
+
+ var moveUpDownSelected = function moveUpDownSelected(dir) {
+ if (!isNullish(selectedElement)) {
+ svgCanvas.moveUpDownSelected(dir);
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var convertToPath = function convertToPath() {
+ if (!isNullish(selectedElement)) {
+ svgCanvas.convertToPath();
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var reorientPath = function reorientPath() {
+ if (!isNullish(selectedElement)) {
+ path.reorient();
+ }
+ };
+ /**
+ *
+ * @returns {Promise
} Resolves to `undefined`
+ */
+
+
+ var makeHyperlink = /*#__PURE__*/function () {
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
+ var url;
+ return regeneratorRuntime.wrap(function _callee8$(_context8) {
+ while (1) {
+ switch (_context8.prev = _context8.next) {
+ case 0:
+ if (!(!isNullish(selectedElement) || multiselected)) {
+ _context8.next = 5;
+ break;
+ }
+
+ _context8.next = 3;
+ return $$c.prompt(uiStrings$1.notification.enterNewLinkURL, 'http://');
+
+ case 3:
+ url = _context8.sent;
+
+ if (url) {
+ svgCanvas.makeHyperlink(url);
+ }
+
+ case 5:
+ case "end":
+ return _context8.stop();
+ }
+ }
+ }, _callee8);
+ }));
+
+ return function makeHyperlink() {
+ return _ref14.apply(this, arguments);
+ };
+ }();
+ /**
+ * @param {Float} dx
+ * @param {Float} dy
+ * @returns {void}
+ */
+
+
+ var moveSelected = function moveSelected(dx, dy) {
+ if (!isNullish(selectedElement) || multiselected) {
+ if (curConfig.gridSnapping) {
+ // Use grid snap value regardless of zoom level
+ var multi = svgCanvas.getZoom() * curConfig.snappingStep;
+ dx *= multi;
+ dy *= multi;
+ }
+
+ svgCanvas.moveSelectedElements(dx, dy);
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var linkControlPoints = function linkControlPoints() {
+ $$c('#tool_node_link').toggleClass('push_button_pressed tool_button');
+ var linked = $$c('#tool_node_link').hasClass('push_button_pressed');
+ path.linkControlPoints(linked);
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clonePathNode = function clonePathNode() {
+ if (path.getNodePoint()) {
+ path.clonePathNode();
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var deletePathNode = function deletePathNode() {
+ if (path.getNodePoint()) {
+ path.deletePathNode();
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var addSubPath = function addSubPath() {
+ var button = $$c('#tool_add_subpath');
+ var sp = !button.hasClass('push_button_pressed');
+ button.toggleClass('push_button_pressed tool_button');
+ path.addSubPath(sp);
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var opencloseSubPath = function opencloseSubPath() {
+ path.opencloseSubPath();
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var selectNext = function selectNext() {
+ svgCanvas.cycleElement(1);
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var selectPrev = function selectPrev() {
+ svgCanvas.cycleElement(0);
+ };
+ /**
+ * @param {0|1} cw
+ * @param {Integer} step
+ * @returns {void}
+ */
+
+
+ var rotateSelected = function rotateSelected(cw, step) {
+ if (isNullish(selectedElement) || multiselected) {
+ return;
+ }
+
+ if (!cw) {
+ step *= -1;
+ }
+
+ var angle = Number.parseFloat($$c('#angle').val()) + step;
+ svgCanvas.setRotationAngle(angle);
+ updateContextPanel();
+ };
+ /**
+ * @fires module:svgcanvas.SvgCanvas#event:ext_onNewDocument
+ * @returns {Promise} Resolves to `undefined`
+ */
+
+
+ var clickClear = /*#__PURE__*/function () {
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
+ var _curConfig$dimensions, x, y, ok;
+
+ return regeneratorRuntime.wrap(function _callee9$(_context9) {
+ while (1) {
+ switch (_context9.prev = _context9.next) {
+ case 0:
+ _curConfig$dimensions = _slicedToArray(curConfig.dimensions, 2), x = _curConfig$dimensions[0], y = _curConfig$dimensions[1];
+ _context9.next = 3;
+ return $$c.confirm(uiStrings$1.notification.QwantToClear);
+
+ case 3:
+ ok = _context9.sent;
+
+ if (ok) {
+ _context9.next = 6;
+ break;
+ }
+
+ return _context9.abrupt("return");
+
+ case 6:
+ setSelectMode();
+ svgCanvas.clear();
+ svgCanvas.setResolution(x, y);
+ updateCanvas(true);
+ zoomImage();
+ populateLayers();
+ updateContextPanel();
+ prepPaints();
+ svgCanvas.runExtensions('onNewDocument');
+
+ case 15:
+ case "end":
+ return _context9.stop();
+ }
+ }
+ }, _callee9);
+ }));
+
+ return function clickClear() {
+ return _ref15.apply(this, arguments);
+ };
+ }();
+ /**
+ *
+ * @returns {false}
+ */
+
+
+ var clickBold = function clickBold() {
+ svgCanvas.setBold(!svgCanvas.getBold());
+ updateContextPanel();
+ return false;
+ };
+ /**
+ *
+ * @returns {false}
+ */
+
+
+ var clickItalic = function clickItalic() {
+ svgCanvas.setItalic(!svgCanvas.getItalic());
+ updateContextPanel();
+ return false;
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickSave = function clickSave() {
+ // In the future, more options can be provided here
+ var saveOpts = {
+ images: editor.pref('img_save'),
+ round_digits: 6
+ };
+ svgCanvas.save(saveOpts);
+ };
+
+ var loadingURL;
+ /**
+ *
+ * @returns {Promise} Resolves to `undefined`
+ */
+
+ var clickExport = /*#__PURE__*/function () {
+ var _ref16 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
+ var imgType, exportWindowName, openExportWindow, chrome, quality;
+ return regeneratorRuntime.wrap(function _callee10$(_context10) {
+ while (1) {
+ switch (_context10.prev = _context10.next) {
+ case 0:
+ openExportWindow = function _openExportWindow() {
+ var loadingImage = uiStrings$1.notification.loadingImage;
+
+ if (curConfig.exportWindowType === 'new') {
+ editor.exportWindowCt++;
+ }
+
+ exportWindowName = curConfig.canvasName + editor.exportWindowCt;
+ var popHTML, popURL;
+
+ if (loadingURL) {
+ popURL = loadingURL;
+ } else {
+ popHTML = "\n \n \n ".concat(loadingImage, "\n \n ").concat(loadingImage, "
\n ");
+
+ if (typeof URL !== 'undefined' && URL.createObjectURL) {
+ var blob = new Blob([popHTML], {
+ type: 'text/html'
+ });
+ popURL = URL.createObjectURL(blob);
+ } else {
+ popURL = 'data:text/html;base64;charset=utf-8,' + encode64(popHTML);
+ }
+
+ loadingURL = popURL;
+ }
+
+ exportWindow = window.open(popURL, exportWindowName);
+ };
+
+ _context10.next = 3;
+ return $$c.select('Select an image type for export: ', [// See http://kangax.github.io/jstests/toDataUrl_mime_type_test/ for a useful list of MIME types and browser support
+ // 'ICO', // Todo: Find a way to preserve transparency in SVG-Edit if not working presently and do full packaging for x-icon; then switch back to position after 'PNG'
+ 'PNG', 'JPEG', 'BMP', 'WEBP', 'PDF'], function () {
+ var sel = $$c(this);
+
+ if (sel.val() === 'JPEG' || sel.val() === 'WEBP') {
+ if (!$$c('#image-slider').length) {
+ $$c("")).appendTo(sel.parent());
+ }
+ } else {
+ $$c('#image-slider').parent().remove();
+ }
+ });
+
+ case 3:
+ imgType = _context10.sent;
+
+ if (imgType) {
+ _context10.next = 6;
+ break;
+ }
+
+ return _context10.abrupt("return");
+
+ case 6:
+ chrome = isChrome();
+
+ if (!(imgType === 'PDF')) {
+ _context10.next = 12;
+ break;
+ }
+
+ if (!customExportPDF && !chrome) {
+ openExportWindow();
+ }
+
+ svgCanvas.exportPDF(exportWindowName);
+ _context10.next = 16;
+ break;
+
+ case 12:
+ if (!customExportImage) {
+ openExportWindow();
+ }
+
+ quality = Number.parseInt($$c('#image-slider').val()) / 100;
+ /* const results = */
+
+ _context10.next = 16;
+ return svgCanvas.rasterExport(imgType, quality, exportWindowName);
+
+ case 16:
+ case "end":
+ return _context10.stop();
+ }
+ }
+ }, _callee10);
+ }));
+
+ return function clickExport() {
+ return _ref16.apply(this, arguments);
+ };
+ }();
+ /**
+ * By default, svgCanvas.open() is a no-op. It is up to an extension
+ * mechanism (opera widget, etc.) to call `setCustomHandlers()` which
+ * will make it do something.
+ * @returns {void}
+ */
+
+
+ var clickOpen = function clickOpen() {
+ svgCanvas.open();
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickImport = function clickImport() {
+ /* */
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickUndo = function clickUndo() {
+ if (undoMgr.getUndoStackSize() > 0) {
+ undoMgr.undo();
+ populateLayers();
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickRedo = function clickRedo() {
+ if (undoMgr.getRedoStackSize() > 0) {
+ undoMgr.redo();
+ populateLayers();
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickGroup = function clickGroup() {
+ // group
+ if (multiselected) {
+ svgCanvas.groupSelectedElements(); // ungroup
+ } else if (selectedElement) {
+ svgCanvas.ungroupSelectedElement();
+ }
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickClone = function clickClone() {
+ svgCanvas.cloneSelectedElements(20, 20);
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickAlign = function clickAlign() {
+ var letter = this.id.replace('tool_align', '').charAt(0);
+ svgCanvas.alignSelectedElements(letter, $$c('#align_relative_to').val());
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var clickWireframe = function clickWireframe() {
+ $$c('#tool_wireframe').toggleClass('push_button_pressed tool_button');
+ workarea.toggleClass('wireframe');
+
+ if (supportsNonSS) {
+ return;
+ }
+
+ var wfRules = $$c('#wireframe_rules');
+
+ if (!wfRules.length) {
+ /* wfRules = */
+ $$c('').appendTo('head');
+ } else {
+ wfRules.empty();
+ }
+
+ updateWireFrame();
+ };
+
+ $$c('#svg_docprops_container, #svg_prefs_container').draggable({
+ cancel: 'button,fieldset',
+ containment: 'window'
+ }).css('position', 'absolute');
+ var docprops = false;
+ var preferences = false;
+ /**
+ *
+ * @returns {void}
+ */
+
+ var showDocProperties = function showDocProperties() {
+ if (docprops) {
+ return;
+ }
+
+ docprops = true; // This selects the correct radio button by using the array notation
+
+ $$c('#image_save_opts input').val([editor.pref('img_save')]); // update resolution option with actual resolution
+
+ var res = svgCanvas.getResolution();
+
+ if (curConfig.baseUnit !== 'px') {
+ res.w = convertUnit(res.w) + curConfig.baseUnit;
+ res.h = convertUnit(res.h) + curConfig.baseUnit;
+ }
+
+ $$c('#canvas_width').val(res.w);
+ $$c('#canvas_height').val(res.h);
+ $$c('#canvas_title').val(svgCanvas.getDocumentTitle());
+ $$c('#svg_docprops').show();
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var showPreferences = function showPreferences() {
+ if (preferences) {
+ return;
+ }
+
+ preferences = true;
+ $$c('#main_menu').hide(); // Update background color with current one
+
+ var canvasBg = curPrefs.bkgd_color;
+ var url = editor.pref('bkgd_url');
+ blocks.each(function () {
+ var blk = $$c(this);
+ var isBg = blk.data('bgcolor') === canvasBg;
+ blk.toggleClass(curBg, isBg);
+ });
+
+ if (!canvasBg) {
+ blocks.eq(0).addClass(curBg);
+ }
+
+ if (url) {
+ $$c('#canvas_bg_url').val(url);
+ }
+
+ $$c('#grid_snapping_on').prop('checked', curConfig.gridSnapping);
+ $$c('#grid_snapping_step').attr('value', curConfig.snappingStep);
+ $$c('#grid_color').attr('value', curConfig.gridColor);
+ $$c('#svg_prefs').show();
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var openHomePage = function openHomePage() {
+ window.open(homePage, '_blank');
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var hideSourceEditor = function hideSourceEditor() {
+ $$c('#svg_source_editor').hide();
+ editingsource = false;
+ $$c('#svg_source_textarea').blur();
+ };
+ /**
+ *
+ * @returns {Promise} Resolves to `undefined`
+ */
+
+
+ var saveSourceEditor = /*#__PURE__*/function () {
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
+ var saveChanges, ok;
+ return regeneratorRuntime.wrap(function _callee11$(_context11) {
+ while (1) {
+ switch (_context11.prev = _context11.next) {
+ case 0:
+ if (editingsource) {
+ _context11.next = 2;
+ break;
+ }
+
+ return _context11.abrupt("return");
+
+ case 2:
+ saveChanges = function saveChanges() {
+ svgCanvas.clearSelection();
+ hideSourceEditor();
+ zoomImage();
+ populateLayers();
+ updateTitle();
+ prepPaints();
+ };
+
+ if (svgCanvas.setSvgString($$c('#svg_source_textarea').val())) {
+ _context11.next = 11;
+ break;
+ }
+
+ _context11.next = 6;
+ return $$c.confirm(uiStrings$1.notification.QerrorsRevertToSource);
+
+ case 6:
+ ok = _context11.sent;
+
+ if (ok) {
+ _context11.next = 9;
+ break;
+ }
+
+ return _context11.abrupt("return");
+
+ case 9:
+ saveChanges();
+ return _context11.abrupt("return");
+
+ case 11:
+ saveChanges();
+ setSelectMode();
+
+ case 13:
+ case "end":
+ return _context11.stop();
+ }
+ }
+ }, _callee11);
+ }));
+
+ return function saveSourceEditor() {
+ return _ref17.apply(this, arguments);
+ };
+ }();
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var hideDocProperties = function hideDocProperties() {
+ $$c('#svg_docprops').hide();
+ $$c('#canvas_width,#canvas_height').removeAttr('disabled');
+ $$c('#resolution')[0].selectedIndex = 0;
+ $$c('#image_save_opts input').val([editor.pref('img_save')]);
+ docprops = false;
+ };
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ var hidePreferences = function hidePreferences() {
+ $$c('#svg_prefs').hide();
+ preferences = false;
+ };
+ /**
+ *
+ * @returns {boolean} Whether there were problems saving the document properties
+ */
+
+
+ var saveDocProperties = function saveDocProperties() {
+ // set title
+ var newTitle = $$c('#canvas_title').val();
+ updateTitle(newTitle);
+ svgCanvas.setDocumentTitle(newTitle); // update resolution
+
+ var width = $$c('#canvas_width'),
+ w = width.val();
+ var height = $$c('#canvas_height'),
+ h = height.val();
+
+ if (w !== 'fit' && !isValidUnit('width', w)) {
+ width.parent().addClass('error');
+ /* await */
+
+ $$c.alert(uiStrings$1.notification.invalidAttrValGiven);
+ return false;
+ }
+
+ width.parent().removeClass('error');
+
+ if (h !== 'fit' && !isValidUnit('height', h)) {
+ height.parent().addClass('error');
+ /* await */
+
+ $$c.alert(uiStrings$1.notification.invalidAttrValGiven);
+ return false;
+ }
+
+ height.parent().removeClass('error');
+
+ if (!svgCanvas.setResolution(w, h)) {
+ /* await */
+ $$c.alert(uiStrings$1.notification.noContentToFitTo);
+ return false;
+ } // Set image save option
+
+
+ editor.pref('img_save', $$c('#image_save_opts :checked').val());
+ updateCanvas();
+ hideDocProperties();
+ return true;
+ };
+ /**
+ * Save user preferences based on current values in the UI.
+ * @function module:SVGEditor.savePreferences
+ * @returns {Promise}
+ */
+
+
+ var savePreferences = editor.savePreferences = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() {
+ var color, lang, _yield$editor$putLoca2, langParam, langData;
+
+ return regeneratorRuntime.wrap(function _callee12$(_context12) {
+ while (1) {
+ switch (_context12.prev = _context12.next) {
+ case 0:
+ // Set background
+ color = $$c('#bg_blocks div.cur_background').data('bgcolor') || '#FFF';
+ setBackground(color, $$c('#canvas_bg_url').val()); // set language
+
+ lang = $$c('#lang_select').val();
+
+ if (!(lang && lang !== editor.pref('lang'))) {
+ _context12.next = 11;
+ break;
+ }
+
+ _context12.next = 6;
+ return editor.putLocale(lang, goodLangs, curConfig);
+
+ case 6:
+ _yield$editor$putLoca2 = _context12.sent;
+ langParam = _yield$editor$putLoca2.langParam;
+ langData = _yield$editor$putLoca2.langData;
+ _context12.next = 11;
+ return setLang(langParam, langData);
+
+ case 11:
+ // set icon size
+ setIconSize($$c('#iconsize').val()); // set grid setting
+
+ curConfig.gridSnapping = $$c('#grid_snapping_on')[0].checked;
+ curConfig.snappingStep = $$c('#grid_snapping_step').val();
+ curConfig.gridColor = $$c('#grid_color').val();
+ curConfig.showRulers = $$c('#show_rulers')[0].checked;
+ $$c('#rulers').toggle(curConfig.showRulers);
+
+ if (curConfig.showRulers) {
+ updateRulers();
+ }
+
+ curConfig.baseUnit = $$c('#base_unit').val();
+ svgCanvas.setConfig(curConfig);
+ updateCanvas();
+ hidePreferences();
+
+ case 22:
+ case "end":
+ return _context12.stop();
+ }
+ }
+ }, _callee12);
+ }));
+
+ var resetScrollPos = $$c.noop;
+ /**
+ *
+ * @returns {Promise} Resolves to `undefined`
+ */
+
+ var cancelOverlays = /*#__PURE__*/function () {
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {
+ var ok;
+ return regeneratorRuntime.wrap(function _callee13$(_context13) {
+ while (1) {
+ switch (_context13.prev = _context13.next) {
+ case 0:
+ $$c('#dialog_box').hide();
+
+ if (!(!editingsource && !docprops && !preferences)) {
+ _context13.next = 4;
+ break;
+ }
+
+ if (curContext) {
+ svgCanvas.leaveContext();
+ }
+
+ return _context13.abrupt("return");
+
+ case 4:
+ if (!editingsource) {
+ _context13.next = 15;
+ break;
+ }
+
+ if (!(origSource !== $$c('#svg_source_textarea').val())) {
+ _context13.next = 12;
+ break;
+ }
+
+ _context13.next = 8;
+ return $$c.confirm(uiStrings$1.notification.QignoreSourceChanges);
+
+ case 8:
+ ok = _context13.sent;
+
+ if (ok) {
+ hideSourceEditor();
+ }
+
+ _context13.next = 13;
+ break;
+
+ case 12:
+ hideSourceEditor();
+
+ case 13:
+ _context13.next = 16;
+ break;
+
+ case 15:
+ if (docprops) {
+ hideDocProperties();
+ } else if (preferences) {
+ hidePreferences();
+ }
+
+ case 16:
+ resetScrollPos();
+
+ case 17:
+ case "end":
+ return _context13.stop();
+ }
+ }
+ }, _callee13);
+ }));
+
+ return function cancelOverlays() {
+ return _ref19.apply(this, arguments);
+ };
+ }();
+
+ var winWh = {
+ width: $$c(window).width(),
+ height: $$c(window).height()
+ }; // Fix for Issue 781: Drawing area jumps to top-left corner on window resize (IE9)
+
+ if (isIE()) {
+ resetScrollPos = function resetScrollPos() {
+ if (workarea[0].scrollLeft === 0 && workarea[0].scrollTop === 0) {
+ workarea[0].scrollLeft = curScrollPos.left;
+ workarea[0].scrollTop = curScrollPos.top;
+ }
+ };
+
+ curScrollPos = {
+ left: workarea[0].scrollLeft,
+ top: workarea[0].scrollTop
+ };
+ $$c(window).resize(resetScrollPos);
+ editor.ready(function () {
+ // TODO: Find better way to detect when to do this to minimize
+ // flickering effect
+ return new Promise(function (resolve, reject) {
+ // eslint-disable-line promise/avoid-new
+ setTimeout(function () {
+ resetScrollPos();
+ resolve();
+ }, 500);
+ });
+ });
+ workarea.scroll(function () {
+ curScrollPos = {
+ left: workarea[0].scrollLeft,
+ top: workarea[0].scrollTop
+ };
+ });
+ }
+
+ $$c(window).resize(function (evt) {
+ $$c.each(winWh, function (type, val) {
+ var curval = $$c(window)[type]();
+ workarea[0]['scroll' + (type === 'width' ? 'Left' : 'Top')] -= (curval - val) / 2;
+ winWh[type] = curval;
+ });
+ setFlyoutPositions();
+ });
+ workarea.scroll(function () {
+ // TODO: jQuery's scrollLeft/Top() wouldn't require a null check
+ if ($$c('#ruler_x').length) {
+ $$c('#ruler_x')[0].scrollLeft = workarea[0].scrollLeft;
+ }
+
+ if ($$c('#ruler_y').length) {
+ $$c('#ruler_y')[0].scrollTop = workarea[0].scrollTop;
+ }
+ });
+ $$c('#url_notice').click(function () {
+ /* await */
+ $$c.alert(this.title);
+ });
+ $$c('#change_image_url').click(promptImgURL); // added these event handlers for all the push buttons so they
+ // behave more like buttons being pressed-in and not images
+
+ (function () {
+ var toolnames = ['clear', 'open', 'save', 'source', 'delete', 'delete_multi', 'paste', 'clone', 'clone_multi', 'move_top', 'move_bottom'];
+ var curClass = 'tool_button_current';
+ var allTools = '';
+ $$c.each(toolnames, function (i, item) {
+ allTools += (i ? ',' : '') + '#tool_' + item;
+ });
+ $$c(allTools).mousedown(function () {
+ $$c(this).addClass(curClass);
+ }).bind('mousedown mouseout', function () {
+ $$c(this).removeClass(curClass);
+ });
+ $$c('#tool_undo, #tool_redo').mousedown(function () {
+ if (!$$c(this).hasClass('disabled')) {
+ $$c(this).addClass(curClass);
+ }
+ }).bind('mousedown mouseout', function () {
+ $$c(this).removeClass(curClass);
+ });
+ })(); // switch modifier key in tooltips if mac
+ // NOTE: This code is not used yet until I can figure out how to successfully bind ctrl/meta
+ // in Opera and Chrome
+
+
+ if (isMac() && !window.opera) {
+ var shortcutButtons = ['tool_clear', 'tool_save', 'tool_source', 'tool_undo', 'tool_redo', 'tool_clone'];
+ var _i = shortcutButtons.length;
+
+ while (_i--) {
+ var button = document.getElementById(shortcutButtons[_i]);
+
+ if (button) {
+ var title = button.title;
+ var index = title.indexOf('Ctrl+');
+ button.title = [title.substr(0, index), 'Cmd+', title.substr(index + 5)].join('');
+ }
+ }
+ }
+ /**
+ * @param {external:jQuery} elem
+ * @todo Go back to the color boxes having white background-color and then setting
+ * background-image to none.png (otherwise partially transparent gradients look weird)
+ * @returns {void}
+ */
+
+
+ var colorPicker = function colorPicker(elem) {
+ var picker = elem.attr('id') === 'stroke_color' ? 'stroke' : 'fill'; // const opacity = (picker == 'stroke' ? $('#stroke_opacity') : $('#fill_opacity'));
+
+ var title = picker === 'stroke' ? uiStrings$1.ui.pick_stroke_paint_opacity : uiStrings$1.ui.pick_fill_paint_opacity; // let wasNone = false; // Currently unused
+
+ var pos = elem.offset();
+ var paint = paintBox[picker].paint;
+ $$c('#color_picker').draggable({
+ cancel: '.jGraduate_tabs, .jGraduate_colPick, .jGraduate_gradPick, .jPicker',
+ containment: 'window'
+ }).css(curConfig.colorPickerCSS || {
+ left: pos.left - 140,
+ bottom: 40
+ }).jGraduate({
+ paint: paint,
+ window: {
+ pickerTitle: title
+ },
+ images: {
+ clientPath: curConfig.jGraduatePath
+ },
+ newstop: 'inverse'
+ }, function (p) {
+ paint = new $$c.jGraduate.Paint(p);
+ paintBox[picker].setPaint(paint);
+ svgCanvas.setPaint(picker, paint);
+ $$c('#color_picker').hide();
+ }, function () {
+ $$c('#color_picker').hide();
+ });
+ };
+ /**
+ * Paint box class.
+ */
+
+
+ var PaintBox = /*#__PURE__*/function () {
+ /**
+ * @param {string|Element|external:jQuery} container
+ * @param {"fill"} type
+ */
+ function PaintBox(container, type) {
+ _classCallCheck(this, PaintBox);
+
+ var cur = curConfig[type === 'fill' ? 'initFill' : 'initStroke']; // set up gradients to be used for the buttons
+
+ var svgdocbox = new DOMParser().parseFromString(""), 'text/xml');
+ var docElem = svgdocbox.documentElement;
+ docElem = $$c(container)[0].appendChild(document.importNode(docElem, true));
+ docElem.setAttribute('width', 16.5);
+ this.rect = docElem.firstElementChild;
+ this.defs = docElem.getElementsByTagName('defs')[0];
+ this.grad = this.defs.firstElementChild;
+ this.paint = new $$c.jGraduate.Paint({
+ solidColor: cur.color
+ });
+ this.type = type;
+ }
+ /**
+ * @param {module:jGraduate~Paint} paint
+ * @param {boolean} apply
+ * @returns {void}
+ */
+
+
+ _createClass(PaintBox, [{
+ key: "setPaint",
+ value: function setPaint(paint, apply) {
+ this.paint = paint;
+ var ptype = paint.type;
+ var opac = paint.alpha / 100;
+ var fillAttr = 'none';
+
+ switch (ptype) {
+ case 'solidColor':
+ fillAttr = paint[ptype] !== 'none' ? '#' + paint[ptype] : paint[ptype];
+ break;
+
+ case 'linearGradient':
+ case 'radialGradient':
+ {
+ this.grad.remove();
+ this.grad = this.defs.appendChild(paint[ptype]);
+ var id = this.grad.id = 'gradbox_' + this.type;
+ fillAttr = 'url(#' + id + ')';
+ break;
+ }
+ }
+
+ this.rect.setAttribute('fill', fillAttr);
+ this.rect.setAttribute('opacity', opac);
+
+ if (apply) {
+ svgCanvas.setColor(this.type, this._paintColor, true);
+ svgCanvas.setPaintOpacity(this.type, this._paintOpacity, true);
+ }
+ }
+ /**
+ * @param {boolean} apply
+ * @returns {void}
+ */
+
+ }, {
+ key: "update",
+ value: function update(apply) {
+ if (!selectedElement) {
+ return;
+ }
+
+ var type = this.type;
+
+ switch (selectedElement.tagName) {
+ case 'use':
+ case 'image':
+ case 'foreignObject':
+ // These elements don't have fill or stroke, so don't change
+ // the current value
+ return;
+
+ case 'g':
+ case 'a':
+ {
+ var childs = selectedElement.getElementsByTagName('*');
+ var gPaint = null;
+
+ for (var _i2 = 0, len = childs.length; _i2 < len; _i2++) {
+ var elem = childs[_i2];
+ var p = elem.getAttribute(type);
+
+ if (_i2 === 0) {
+ gPaint = p;
+ } else if (gPaint !== p) {
+ gPaint = null;
+ break;
+ }
+ }
+
+ if (gPaint === null) {
+ // No common color, don't update anything
+ this._paintColor = null;
+ return;
+ }
+
+ this._paintColor = gPaint;
+ this._paintOpacity = 1;
+ break;
+ }
+
+ default:
+ {
+ this._paintOpacity = Number.parseFloat(selectedElement.getAttribute(type + '-opacity'));
+
+ if (Number.isNaN(this._paintOpacity)) {
+ this._paintOpacity = 1.0;
+ }
+
+ var defColor = type === 'fill' ? 'black' : 'none';
+ this._paintColor = selectedElement.getAttribute(type) || defColor;
+ }
+ }
+
+ if (apply) {
+ svgCanvas.setColor(type, this._paintColor, true);
+ svgCanvas.setPaintOpacity(type, this._paintOpacity, true);
+ }
+
+ this._paintOpacity *= 100;
+ var paint = getPaint(this._paintColor, this._paintOpacity, type); // update the rect inside #fill_color/#stroke_color
+
+ this.setPaint(paint);
+ }
+ /**
+ * @returns {void}
+ */
+
+ }, {
+ key: "prep",
+ value: function prep() {
+ var ptype = this.paint.type;
+
+ switch (ptype) {
+ case 'linearGradient':
+ case 'radialGradient':
+ {
+ var paint = new $$c.jGraduate.Paint({
+ copy: this.paint
+ });
+ svgCanvas.setPaint(this.type, paint);
+ break;
+ }
+ }
+ }
+ }]);
+
+ return PaintBox;
+ }();
+
+ PaintBox.ctr = 0;
+ paintBox.fill = new PaintBox('#fill_color', 'fill');
+ paintBox.stroke = new PaintBox('#stroke_color', 'stroke');
+ $$c('#stroke_width').val(curConfig.initStroke.width);
+ $$c('#group_opacity').val(curConfig.initOpacity * 100); // Use this SVG elem to test vectorEffect support
+
+ var testEl = paintBox.fill.rect.cloneNode(false);
+ testEl.setAttribute('style', 'vector-effect:non-scaling-stroke');
+ var supportsNonSS = testEl.style.vectorEffect === 'non-scaling-stroke';
+ testEl.removeAttribute('style');
+ var svgdocbox = paintBox.fill.rect.ownerDocument; // Use this to test support for blur element. Seems to work to test support in Webkit
+
+ var blurTest = svgdocbox.createElementNS(NS.SVG, 'feGaussianBlur');
+
+ if (blurTest.stdDeviationX === undefined) {
+ $$c('#tool_blur').hide();
+ }
+
+ $$c(blurTest).remove(); // Test for zoom icon support
+
+ (function () {
+ var pre = '-' + uaPrefix.toLowerCase() + '-zoom-';
+ var zoom = pre + 'in';
+ workarea.css('cursor', zoom);
+
+ if (workarea.css('cursor') === zoom) {
+ zoomInIcon = zoom;
+ zoomOutIcon = pre + 'out';
+ }
+
+ workarea.css('cursor', 'auto');
+ })(); // Test for embedImage support (use timeout to not interfere with page load)
+
+
+ setTimeout(function () {
+ svgCanvas.embedImage('images/logo.png', function (datauri) {
+ if (!datauri) {
+ // Disable option
+ $$c('#image_save_opts [value=embed]').attr('disabled', 'disabled');
+ $$c('#image_save_opts input').val(['ref']);
+ editor.pref('img_save', 'ref');
+ $$c('#image_opt_embed').css('color', '#666').attr('title', uiStrings$1.notification.featNotSupported);
+ }
+ });
+ }, 1000);
+ $$c('#fill_color, #tool_fill .icon_label').click(function () {
+ colorPicker($$c('#fill_color'));
+ updateToolButtonState();
+ });
+ $$c('#stroke_color, #tool_stroke .icon_label').click(function () {
+ colorPicker($$c('#stroke_color'));
+ updateToolButtonState();
+ });
+ $$c('#group_opacityLabel').click(function () {
+ $$c('#opacity_dropdown button').mousedown();
+ $$c(window).mouseup();
+ });
+ $$c('#zoomLabel').click(function () {
+ $$c('#zoom_dropdown button').mousedown();
+ $$c(window).mouseup();
+ });
+ $$c('#tool_move_top').mousedown(function (evt) {
+ $$c('#tools_stacking').show();
+ evt.preventDefault();
+ });
+ $$c('.layer_button').mousedown(function () {
+ $$c(this).addClass('layer_buttonpressed');
+ }).mouseout(function () {
+ $$c(this).removeClass('layer_buttonpressed');
+ }).mouseup(function () {
+ $$c(this).removeClass('layer_buttonpressed');
+ });
+ $$c('.push_button').mousedown(function () {
+ if (!$$c(this).hasClass('disabled')) {
+ $$c(this).addClass('push_button_pressed').removeClass('push_button');
+ }
+ }).mouseout(function () {
+ $$c(this).removeClass('push_button_pressed').addClass('push_button');
+ }).mouseup(function () {
+ $$c(this).removeClass('push_button_pressed').addClass('push_button');
+ }); // ask for a layer name
+
+ $$c('#layer_new').click( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14() {
+ var uniqName, i, newName;
+ return regeneratorRuntime.wrap(function _callee14$(_context14) {
+ while (1) {
+ switch (_context14.prev = _context14.next) {
+ case 0:
+ i = svgCanvas.getCurrentDrawing().getNumLayers();
+
+ do {
+ uniqName = uiStrings$1.layers.layer + ' ' + ++i;
+ } while (svgCanvas.getCurrentDrawing().hasLayer(uniqName));
+
+ _context14.next = 4;
+ return $$c.prompt(uiStrings$1.notification.enterUniqueLayerName, uniqName);
+
+ case 4:
+ newName = _context14.sent;
+
+ if (newName) {
+ _context14.next = 7;
+ break;
+ }
+
+ return _context14.abrupt("return");
+
+ case 7:
+ if (!svgCanvas.getCurrentDrawing().hasLayer(newName)) {
+ _context14.next = 10;
+ break;
+ }
+
+ /* await */
+ $$c.alert(uiStrings$1.notification.dupeLayerName);
+ return _context14.abrupt("return");
+
+ case 10:
+ svgCanvas.createLayer(newName);
+ updateContextPanel();
+ populateLayers();
+
+ case 13:
+ case "end":
+ return _context14.stop();
+ }
+ }
+ }, _callee14);
+ })));
+ /**
+ *
+ * @returns {void}
+ */
+
+ function deleteLayer() {
+ if (svgCanvas.deleteCurrentLayer()) {
+ updateContextPanel();
+ populateLayers(); // This matches what SvgCanvas does
+ // TODO: make this behavior less brittle (svg-editor should get which
+ // layer is selected from the canvas and then select that one in the UI)
+
+ $$c('#layerlist tr.layer').removeClass('layersel');
+ $$c('#layerlist tr.layer:first').addClass('layersel');
+ }
+ }
+ /**
+ *
+ * @returns {Promise}
+ */
+
+
+ function cloneLayer() {
+ return _cloneLayer.apply(this, arguments);
+ }
+ /**
+ *
+ * @returns {void}
+ */
+
+
+ function _cloneLayer() {
+ _cloneLayer = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee20() {
+ var name, newName;
+ return regeneratorRuntime.wrap(function _callee20$(_context20) {
+ while (1) {
+ switch (_context20.prev = _context20.next) {
+ case 0:
+ name = svgCanvas.getCurrentDrawing().getCurrentLayerName() + ' copy';
+ _context20.next = 3;
+ return $$c.prompt(uiStrings$1.notification.enterUniqueLayerName, name);
+
+ case 3:
+ newName = _context20.sent;
+
+ if (newName) {
+ _context20.next = 6;
+ break;
+ }
+
+ return _context20.abrupt("return");
+
+ case 6:
+ if (!svgCanvas.getCurrentDrawing().hasLayer(newName)) {
+ _context20.next = 9;
+ break;
+ }
+
+ /* await */
+ $$c.alert(uiStrings$1.notification.dupeLayerName);
+ return _context20.abrupt("return");
+
+ case 9:
+ svgCanvas.cloneLayer(newName);
+ updateContextPanel();
+ populateLayers();
+
+ case 12:
+ case "end":
+ return _context20.stop();
+ }
+ }
+ }, _callee20);
+ }));
+ return _cloneLayer.apply(this, arguments);
+ }
+
+ function mergeLayer() {
+ if ($$c('#layerlist tr.layersel').index() === svgCanvas.getCurrentDrawing().getNumLayers() - 1) {
+ return;
+ }
+
+ svgCanvas.mergeLayer();
+ updateContextPanel();
+ populateLayers();
+ }
+ /**
+ * @param {Integer} pos
+ * @returns {void}
+ */
+
+
+ function moveLayer(pos) {
+ var total = svgCanvas.getCurrentDrawing().getNumLayers();
+ var curIndex = $$c('#layerlist tr.layersel').index();
+
+ if (curIndex > 0 || curIndex < total - 1) {
+ curIndex += pos;
+ svgCanvas.setCurrentLayerPosition(total - curIndex - 1);
+ populateLayers();
+ }
+ }
+
+ $$c('#layer_delete').click(deleteLayer);
+ $$c('#layer_up').click(function () {
+ moveLayer(-1);
+ });
+ $$c('#layer_down').click(function () {
+ moveLayer(1);
+ });
+ $$c('#layer_rename').click( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15() {
+ var oldName, newName;
+ return regeneratorRuntime.wrap(function _callee15$(_context15) {
+ while (1) {
+ switch (_context15.prev = _context15.next) {
+ case 0:
+ // const curIndex = $('#layerlist tr.layersel').prevAll().length; // Currently unused
+ oldName = $$c('#layerlist tr.layersel td.layername').text();
+ _context15.next = 3;
+ return $$c.prompt(uiStrings$1.notification.enterNewLayerName, '');
+
+ case 3:
+ newName = _context15.sent;
+
+ if (newName) {
+ _context15.next = 6;
+ break;
+ }
+
+ return _context15.abrupt("return");
+
+ case 6:
+ if (!(oldName === newName || svgCanvas.getCurrentDrawing().hasLayer(newName))) {
+ _context15.next = 9;
+ break;
+ }
+
+ /* await */
+ $$c.alert(uiStrings$1.notification.layerHasThatName);
+ return _context15.abrupt("return");
+
+ case 9:
+ svgCanvas.renameCurrentLayer(newName);
+ populateLayers();
+
+ case 11:
+ case "end":
+ return _context15.stop();
+ }
+ }
+ }, _callee15);
+ })));
+ var SIDEPANEL_MAXWIDTH = 300;
+ var SIDEPANEL_OPENWIDTH = 150;
+ var sidedrag = -1,
+ sidedragging = false,
+ allowmove = false;
+ /**
+ * @param {Float} delta
+ * @fires module:svgcanvas.SvgCanvas#event:ext_workareaResized
+ * @returns {void}
+ */
+
+ var changeSidePanelWidth = function changeSidePanelWidth(delta) {
+ var rulerX = $$c('#ruler_x');
+ $$c('#sidepanels').width('+=' + delta);
+ $$c('#layerpanel').width('+=' + delta);
+ rulerX.css('right', Number.parseInt(rulerX.css('right')) + delta);
+ workarea.css('right', Number.parseInt(workarea.css('right')) + delta);
+ svgCanvas.runExtensions('workareaResized');
+ };
+ /**
+ * @param {Event} evt
+ * @returns {void}
+ */
+
+
+ var resizeSidePanel = function resizeSidePanel(evt) {
+ if (!allowmove) {
+ return;
+ }
+
+ if (sidedrag === -1) {
+ return;
+ }
+
+ sidedragging = true;
+ var deltaX = sidedrag - evt.pageX;
+ var sideWidth = $$c('#sidepanels').width();
+
+ if (sideWidth + deltaX > SIDEPANEL_MAXWIDTH) {
+ deltaX = SIDEPANEL_MAXWIDTH - sideWidth; // sideWidth = SIDEPANEL_MAXWIDTH;
+ } else if (sideWidth + deltaX < 2) {
+ deltaX = 2 - sideWidth; // sideWidth = 2;
+ }
+
+ if (deltaX === 0) {
+ return;
+ }
+
+ sidedrag -= deltaX;
+ changeSidePanelWidth(deltaX);
+ };
+ /**
+ * If width is non-zero, then fully close it; otherwise fully open it.
+ * @param {boolean} close Forces the side panel closed
+ * @returns {void}
+ */
+
+
+ var toggleSidePanel = function toggleSidePanel(close) {
+ var dpr = window.devicePixelRatio || 1;
+ var w = $$c('#sidepanels').width();
+ var isOpened = (dpr < 1 ? w : w / dpr) > 2;
+ var zoomAdjustedSidepanelWidth = (dpr < 1 ? 1 : dpr) * SIDEPANEL_OPENWIDTH;
+ var deltaX = (isOpened || close ? 0 : zoomAdjustedSidepanelWidth) - w;
+ changeSidePanelWidth(deltaX);
+ };
+
+ $$c('#sidepanel_handle').mousedown(function (evt) {
+ sidedrag = evt.pageX;
+ $$c(window).mousemove(resizeSidePanel);
+ allowmove = false; // Silly hack for Chrome, which always runs mousemove right after mousedown
+
+ setTimeout(function () {
+ allowmove = true;
+ }, 20);
+ }).mouseup(function (evt) {
+ if (!sidedragging) {
+ toggleSidePanel();
+ }
+
+ sidedrag = -1;
+ sidedragging = false;
+ });
+ $$c(window).mouseup(function () {
+ sidedrag = -1;
+ sidedragging = false;
+ $$c('#svg_editor').unbind('mousemove', resizeSidePanel);
+ });
+ populateLayers(); // function changeResolution (x,y) {
+ // const {zoom} = svgCanvas.getResolution();
+ // setResolution(x * zoom, y * zoom);
+ // }
+
+ var centerCanvas = function centerCanvas() {
+ // this centers the canvas vertically in the workarea (horizontal handled in CSS)
+ workarea.css('line-height', workarea.height() + 'px');
+ };
+
+ $$c(window).bind('load resize', centerCanvas);
+ /**
+ * @type {module:jQuerySpinButton.StepCallback}
+ */
+
+ function stepFontSize(elem, step) {
+ var origVal = Number(elem.value);
+ var sugVal = origVal + step;
+ var increasing = sugVal >= origVal;
+
+ if (step === 0) {
+ return origVal;
+ }
+
+ if (origVal >= 24) {
+ if (increasing) {
+ return Math.round(origVal * 1.1);
+ }
+
+ return Math.round(origVal / 1.1);
+ }
+
+ if (origVal <= 1) {
+ if (increasing) {
+ return origVal * 2;
+ }
+
+ return origVal / 2;
+ }
+
+ return sugVal;
+ }
+ /**
+ * @type {module:jQuerySpinButton.StepCallback}
+ */
+
+
+ function stepZoom(elem, step) {
+ var origVal = Number(elem.value);
+
+ if (origVal === 0) {
+ return 100;
+ }
+
+ var sugVal = origVal + step;
+
+ if (step === 0) {
+ return origVal;
+ }
+
+ if (origVal >= 100) {
+ return sugVal;
+ }
+
+ if (sugVal >= origVal) {
+ return origVal * 2;
+ }
+
+ return origVal / 2;
+ } // function setResolution (w, h, center) {
+ // updateCanvas();
+ // // w -= 0; h -= 0;
+ // // $('#svgcanvas').css({width: w, height: h});
+ // // $('#canvas_width').val(w);
+ // // $('#canvas_height').val(h);
+ // //
+ // // if (center) {
+ // // const wArea = workarea;
+ // // const scrollY = h/2 - wArea.height()/2;
+ // // const scrollX = w/2 - wArea.width()/2;
+ // // wArea[0].scrollTop = scrollY;
+ // // wArea[0].scrollLeft = scrollX;
+ // // }
+ // }
+
+
+ $$c('#resolution').change(function () {
+ var wh = $$c('#canvas_width,#canvas_height');
+
+ if (!this.selectedIndex) {
+ if ($$c('#canvas_width').val() === 'fit') {
+ wh.removeAttr('disabled').val(100);
+ }
+ } else if (this.value === 'content') {
+ wh.val('fit').attr('disabled', 'disabled');
+ } else {
+ var dims = this.value.split('x');
+ $$c('#canvas_width').val(dims[0]);
+ $$c('#canvas_height').val(dims[1]);
+ wh.removeAttr('disabled');
+ }
+ }); // Prevent browser from erroneously repopulating fields
+
+ $$c('input,select').attr('autocomplete', 'off');
+ var dialogSelectors = ['#tool_source_cancel', '#tool_docprops_cancel', '#tool_prefs_cancel', '.overlay'];
+ /* eslint-disable jsdoc/require-property */
+
+ /**
+ * Associate all button actions as well as non-button keyboard shortcuts.
+ * @namespace {PlainObject} module:SVGEditor~Actions
+ */
+
+ var Actions = function () {
+ /* eslint-enable jsdoc/require-property */
+
+ /**
+ * @typedef {PlainObject} module:SVGEditor.ToolButton
+ * @property {string} sel The CSS selector for the tool
+ * @property {external:jQuery.Function} fn A handler to be attached to the `evt`
+ * @property {string} evt The event for which the `fn` listener will be added
+ * @property {module:SVGEditor.Key} [key] [key, preventDefault, NoDisableInInput]
+ * @property {string} [parent] Selector
+ * @property {boolean} [hidekey] Whether to show key value in title
+ * @property {string} [icon] The button ID
+ * @property {boolean} isDefault For flyout holders
+ */
+
+ /**
+ *
+ * @name module:SVGEditor~ToolButtons
+ * @type {module:SVGEditor.ToolButton[]}
+ */
+ var toolButtons = [{
+ sel: '#tool_select',
+ fn: clickSelect,
+ evt: 'click',
+ key: ['V', true]
+ }, {
+ sel: '#tool_fhpath',
+ fn: clickFHPath,
+ evt: 'click',
+ key: ['Q', true]
+ }, {
+ sel: '#tool_line',
+ fn: clickLine,
+ evt: 'click',
+ key: ['L', true],
+ parent: '#tools_line',
+ prepend: true
+ }, {
+ sel: '#tool_rect',
+ fn: clickRect,
+ evt: 'mouseup',
+ key: ['R', true],
+ parent: '#tools_rect',
+ icon: 'rect'
+ }, {
+ sel: '#tool_square',
+ fn: clickSquare,
+ evt: 'mouseup',
+ parent: '#tools_rect',
+ icon: 'square'
+ }, {
+ sel: '#tool_fhrect',
+ fn: clickFHRect,
+ evt: 'mouseup',
+ parent: '#tools_rect',
+ icon: 'fh_rect'
+ }, {
+ sel: '#tool_ellipse',
+ fn: clickEllipse,
+ evt: 'mouseup',
+ key: ['E', true],
+ parent: '#tools_ellipse',
+ icon: 'ellipse'
+ }, {
+ sel: '#tool_circle',
+ fn: clickCircle,
+ evt: 'mouseup',
+ parent: '#tools_ellipse',
+ icon: 'circle'
+ }, {
+ sel: '#tool_fhellipse',
+ fn: clickFHEllipse,
+ evt: 'mouseup',
+ parent: '#tools_ellipse',
+ icon: 'fh_ellipse'
+ }, {
+ sel: '#tool_path',
+ fn: clickPath,
+ evt: 'click',
+ key: ['P', true]
+ }, {
+ sel: '#tool_text',
+ fn: clickText,
+ evt: 'click',
+ key: ['T', true]
+ }, {
+ sel: '#tool_image',
+ fn: clickImage,
+ evt: 'mouseup'
+ }, {
+ sel: '#tool_zoom',
+ fn: clickZoom,
+ evt: 'mouseup',
+ key: ['Z', true]
+ }, {
+ sel: '#tool_clear',
+ fn: clickClear,
+ evt: 'mouseup',
+ key: ['N', true]
+ }, {
+ sel: '#tool_save',
+ fn: function fn() {
+ if (editingsource) {
+ saveSourceEditor();
+ } else {
+ clickSave();
+ }
+ },
+ evt: 'mouseup',
+ key: ['S', true]
+ }, {
+ sel: '#tool_export',
+ fn: clickExport,
+ evt: 'mouseup'
+ }, {
+ sel: '#tool_open',
+ fn: clickOpen,
+ evt: 'mouseup',
+ key: ['O', true]
+ }, {
+ sel: '#tool_import',
+ fn: clickImport,
+ evt: 'mouseup'
+ }, {
+ sel: '#tool_source',
+ fn: showSourceEditor,
+ evt: 'click',
+ key: ['U', true]
+ }, {
+ sel: '#tool_wireframe',
+ fn: clickWireframe,
+ evt: 'click',
+ key: ['F', true]
+ }, {
+ key: ['esc', false, false],
+ fn: function fn() {
+ if (dialogSelectors.every(function (sel) {
+ return $$c(sel + ':hidden').length;
+ })) {
+ svgCanvas.clearSelection();
+ }
+ },
+ hidekey: true
+ }, {
+ sel: dialogSelectors.join(','),
+ fn: cancelOverlays,
+ evt: 'click',
+ key: ['esc', false, false],
+ hidekey: true
+ }, {
+ sel: '#tool_source_save',
+ fn: saveSourceEditor,
+ evt: 'click'
+ }, {
+ sel: '#tool_docprops_save',
+ fn: saveDocProperties,
+ evt: 'click'
+ }, {
+ sel: '#tool_docprops',
+ fn: showDocProperties,
+ evt: 'click'
+ }, {
+ sel: '#tool_prefs_save',
+ fn: savePreferences,
+ evt: 'click'
+ }, {
+ sel: '#tool_editor_prefs',
+ fn: showPreferences,
+ evt: 'click'
+ }, {
+ sel: '#tool_editor_homepage',
+ fn: openHomePage,
+ evt: 'click'
+ }, {
+ sel: '#tool_open',
+ fn: function fn() {
+ window.dispatchEvent(new CustomEvent('openImage'));
+ },
+ evt: 'click'
+ }, {
+ sel: '#tool_import',
+ fn: function fn() {
+ window.dispatchEvent(new CustomEvent('importImage'));
+ },
+ evt: 'click'
+ }, {
+ sel: '#tool_delete,#tool_delete_multi',
+ fn: deleteSelected,
+ evt: 'click',
+ key: ['del/backspace', true]
+ }, {
+ sel: '#tool_reorient',
+ fn: reorientPath,
+ evt: 'click'
+ }, {
+ sel: '#tool_node_link',
+ fn: linkControlPoints,
+ evt: 'click'
+ }, {
+ sel: '#tool_node_clone',
+ fn: clonePathNode,
+ evt: 'click'
+ }, {
+ sel: '#tool_node_delete',
+ fn: deletePathNode,
+ evt: 'click'
+ }, {
+ sel: '#tool_openclose_path',
+ fn: opencloseSubPath,
+ evt: 'click'
+ }, {
+ sel: '#tool_add_subpath',
+ fn: addSubPath,
+ evt: 'click'
+ }, {
+ sel: '#tool_move_top',
+ fn: moveToTopSelected,
+ evt: 'click',
+ key: 'ctrl+shift+]'
+ }, {
+ sel: '#tool_move_bottom',
+ fn: moveToBottomSelected,
+ evt: 'click',
+ key: 'ctrl+shift+['
+ }, {
+ sel: '#tool_topath',
+ fn: convertToPath,
+ evt: 'click'
+ }, {
+ sel: '#tool_make_link,#tool_make_link_multi',
+ fn: makeHyperlink,
+ evt: 'click'
+ }, {
+ sel: '#tool_undo',
+ fn: clickUndo,
+ evt: 'click'
+ }, {
+ sel: '#tool_redo',
+ fn: clickRedo,
+ evt: 'click'
+ }, {
+ sel: '#tool_clone,#tool_clone_multi',
+ fn: clickClone,
+ evt: 'click',
+ key: ['D', true]
+ }, {
+ sel: '#tool_group_elements',
+ fn: clickGroup,
+ evt: 'click',
+ key: ['G', true]
+ }, {
+ sel: '#tool_ungroup',
+ fn: clickGroup,
+ evt: 'click'
+ }, {
+ sel: '#tool_unlink_use',
+ fn: clickGroup,
+ evt: 'click'
+ }, {
+ sel: '[id^=tool_align]',
+ fn: clickAlign,
+ evt: 'click'
+ }, // these two lines are required to make Opera work properly with the flyout mechanism
+ // {sel: '#tools_rect_show', fn: clickRect, evt: 'click'},
+ // {sel: '#tools_ellipse_show', fn: clickEllipse, evt: 'click'},
+ {
+ sel: '#tool_bold',
+ fn: clickBold,
+ evt: 'mousedown'
+ }, {
+ sel: '#tool_italic',
+ fn: clickItalic,
+ evt: 'mousedown'
+ }, {
+ sel: '#sidepanel_handle',
+ fn: toggleSidePanel,
+ key: ['X']
+ }, {
+ sel: '#copy_save_done',
+ fn: cancelOverlays,
+ evt: 'click'
+ }, // Shortcuts not associated with buttons
+ {
+ key: 'ctrl+left',
+ fn: function fn() {
+ rotateSelected(0, 1);
+ }
+ }, {
+ key: 'ctrl+right',
+ fn: function fn() {
+ rotateSelected(1, 1);
+ }
+ }, {
+ key: 'ctrl+shift+left',
+ fn: function fn() {
+ rotateSelected(0, 5);
+ }
+ }, {
+ key: 'ctrl+shift+right',
+ fn: function fn() {
+ rotateSelected(1, 5);
+ }
+ }, {
+ key: 'shift+O',
+ fn: selectPrev
+ }, {
+ key: 'shift+P',
+ fn: selectNext
+ }, {
+ key: [modKey + 'up', true],
+ fn: function fn() {
+ zoomImage(2);
+ }
+ }, {
+ key: [modKey + 'down', true],
+ fn: function fn() {
+ zoomImage(0.5);
+ }
+ }, {
+ key: [modKey + ']', true],
+ fn: function fn() {
+ moveUpDownSelected('Up');
+ }
+ }, {
+ key: [modKey + '[', true],
+ fn: function fn() {
+ moveUpDownSelected('Down');
+ }
+ }, {
+ key: ['up', true],
+ fn: function fn() {
+ moveSelected(0, -1);
+ }
+ }, {
+ key: ['down', true],
+ fn: function fn() {
+ moveSelected(0, 1);
+ }
+ }, {
+ key: ['left', true],
+ fn: function fn() {
+ moveSelected(-1, 0);
+ }
+ }, {
+ key: ['right', true],
+ fn: function fn() {
+ moveSelected(1, 0);
+ }
+ }, {
+ key: 'shift+up',
+ fn: function fn() {
+ moveSelected(0, -10);
+ }
+ }, {
+ key: 'shift+down',
+ fn: function fn() {
+ moveSelected(0, 10);
+ }
+ }, {
+ key: 'shift+left',
+ fn: function fn() {
+ moveSelected(-10, 0);
+ }
+ }, {
+ key: 'shift+right',
+ fn: function fn() {
+ moveSelected(10, 0);
+ }
+ }, {
+ key: ['alt+up', true],
+ fn: function fn() {
+ svgCanvas.cloneSelectedElements(0, -1);
+ }
+ }, {
+ key: ['alt+down', true],
+ fn: function fn() {
+ svgCanvas.cloneSelectedElements(0, 1);
+ }
+ }, {
+ key: ['alt+left', true],
+ fn: function fn() {
+ svgCanvas.cloneSelectedElements(-1, 0);
+ }
+ }, {
+ key: ['alt+right', true],
+ fn: function fn() {
+ svgCanvas.cloneSelectedElements(1, 0);
+ }
+ }, {
+ key: ['alt+shift+up', true],
+ fn: function fn() {
+ svgCanvas.cloneSelectedElements(0, -10);
+ }
+ }, {
+ key: ['alt+shift+down', true],
+ fn: function fn() {
+ svgCanvas.cloneSelectedElements(0, 10);
+ }
+ }, {
+ key: ['alt+shift+left', true],
+ fn: function fn() {
+ svgCanvas.cloneSelectedElements(-10, 0);
+ }
+ }, {
+ key: ['alt+shift+right', true],
+ fn: function fn() {
+ svgCanvas.cloneSelectedElements(10, 0);
+ }
+ }, {
+ key: 'a',
+ fn: function fn() {
+ svgCanvas.selectAllInCurrentLayer();
+ }
+ }, {
+ key: modKey + 'a',
+ fn: function fn() {
+ svgCanvas.selectAllInCurrentLayer();
+ }
+ }, // Standard shortcuts
+ {
+ key: modKey + 'z',
+ fn: clickUndo
+ }, {
+ key: modKey + 'shift+z',
+ fn: clickRedo
+ }, {
+ key: modKey + 'y',
+ fn: clickRedo
+ }, {
+ key: modKey + 'x',
+ fn: cutSelected
+ }, {
+ key: modKey + 'c',
+ fn: copySelected
+ }, {
+ key: modKey + 'v',
+ fn: pasteInCenter
+ }]; // Tooltips not directly associated with a single function
+
+ var keyAssocs = {
+ '4/Shift+4': '#tools_rect_show',
+ '5/Shift+5': '#tools_ellipse_show'
+ };
+ return {
+ /** @lends module:SVGEditor~Actions */
+
+ /**
+ * @returns {void}
+ */
+ setAll: function setAll() {
+ var flyouts = {};
+ var keyHandler = {}; // will contain the action for each pressed key
+
+ toolButtons.forEach(function (opts) {
+ // Bind function to button
+ var btn;
+
+ if (opts.sel) {
+ btn = $q$1(opts.sel);
+
+ if (btn === null) {
+ return true;
+ } // Skip if markup does not exist
+
+
+ if (opts.evt) {
+ // `touch.js` changes `touchstart` to `mousedown`,
+ // so we must map tool button click events as well
+ if (isTouch() && opts.evt === 'click') {
+ opts.evt = 'mousedown';
+ }
+
+ btn.addEventListener(opts.evt, opts.fn);
+ } // Add to parent flyout menu, if able to be displayed
+
+
+ if (opts.parent && $$c(opts.parent + '_show').length) {
+ var fH = $$c(opts.parent);
+
+ if (!fH.length) {
+ fH = makeFlyoutHolder(opts.parent.substr(1));
+ }
+
+ if (opts.prepend) {
+ btn.style.margin = 'initial';
+ }
+
+ fH[opts.prepend ? 'prepend' : 'append'](btn);
+
+ if (!Array.isArray(flyouts[opts.parent])) {
+ flyouts[opts.parent] = [];
+ }
+
+ flyouts[opts.parent].push(opts);
+ }
+ } // Bind function to shortcut key
+
+
+ if (opts.key) {
+ // Set shortcut based on options
+ var keyval = opts.key;
+ var pd = false;
+
+ if (Array.isArray(opts.key)) {
+ keyval = opts.key[0];
+
+ if (opts.key.length > 1) {
+ pd = opts.key[1];
+ }
+ }
+
+ keyval = String(keyval);
+ var fn = opts.fn;
+ keyval.split('/').forEach(function (key) {
+ keyHandler[key] = {
+ fn: fn,
+ pd: pd
+ };
+ }); // Put shortcut in title
+
+ if (opts.sel && !opts.hidekey && btn.title) {
+ var newTitle = "".concat(btn.title.split('[')[0], " (").concat(keyval, ")");
+ keyAssocs[keyval] = opts.sel; // Disregard for menu items
+
+ if (btn.closest('#main_menu') === null) {
+ btn.title = newTitle;
+ }
+ }
+ }
+
+ return true;
+ }); // register the keydown event
+
+ document.addEventListener('keydown', function (e) {
+ // only track keyboard shortcuts for the body containing the SVG-Editor
+ if (e.target.nodeName !== 'BODY') return; // normalize key
+
+ var key = "".concat(e.metaKey ? 'meta+' : '').concat(e.ctrlKey ? 'ctrl+' : '').concat(e.key.toLowerCase()); // return if no shortcut defined for this key
+
+ if (!keyHandler[key]) return; // launch associated handler and preventDefault if necessary
+
+ keyHandler[key].fn();
+
+ if (keyHandler[key].pd) {
+ e.preventDefault();
+ }
+ }); // Setup flyouts
+
+ setupFlyouts(flyouts); // Misc additional actions
+ // Make 'return' keypress trigger the change event
+
+ $$c('.attr_changer, #image_url').bind('keydown', 'return', function (evt) {
+ $$c(this).change();
+ evt.preventDefault();
+ });
+ $$c(window).bind('keydown', 'tab', function (e) {
+ if (uiContext === 'canvas') {
+ e.preventDefault();
+ selectNext();
+ }
+ }).bind('keydown', 'shift+tab', function (e) {
+ if (uiContext === 'canvas') {
+ e.preventDefault();
+ selectPrev();
+ }
+ });
+ $$c('#tool_zoom').dblclick(dblclickZoom);
+ },
+
+ /**
+ * @returns {void}
+ */
+ setTitles: function setTitles() {
+ $$c.each(keyAssocs, function (keyval, sel) {
+ var menu = $$c(sel).parents('#main_menu').length;
+ $$c(sel).each(function () {
+ var t;
+
+ if (menu) {
+ t = $$c(this).text().split(' [')[0];
+ } else {
+ t = this.title.split(' [')[0];
+ }
+
+ var keyStr = ''; // Shift+Up
+
+ $$c.each(keyval.split('/'), function (i, key) {
+ var modBits = key.split('+');
+ var mod = '';
+
+ if (modBits.length > 1) {
+ mod = modBits[0] + '+';
+ key = modBits[1];
+ }
+
+ keyStr += (i ? '/' : '') + mod + (uiStrings$1['key_' + key] || key);
+ });
+
+ if (menu) {
+ this.lastChild.textContent = t + ' [' + keyStr + ']';
+ } else {
+ this.title = t + ' [' + keyStr + ']';
+ }
+ });
+ });
+ },
+
+ /**
+ * @param {string} sel Selector to match
+ * @returns {module:SVGEditor.ToolButton}
+ */
+ getButtonData: function getButtonData(sel) {
+ return Object.values(toolButtons).find(function (btn) {
+ return btn.sel === sel;
+ });
+ }
+ };
+ }(); // Select given tool
+
+
+ editor.ready(function () {
+ var tool;
+ var itool = curConfig.initTool,
+ container = $$c('#tools_left, #svg_editor .tools_flyout'),
+ preTool = container.find('#tool_' + itool),
+ regTool = container.find('#' + itool);
+
+ if (preTool.length) {
+ tool = preTool;
+ } else if (regTool.length) {
+ tool = regTool;
+ } else {
+ tool = $$c('#tool_select');
+ }
+
+ tool.click().mouseup();
+
+ if (curConfig.wireframe) {
+ $$c('#tool_wireframe').click();
+ }
+
+ if (curConfig.showlayers) {
+ toggleSidePanel();
+ }
+
+ $$c('#rulers').toggle(Boolean(curConfig.showRulers));
+
+ if (curConfig.showRulers) {
+ $$c('#show_rulers')[0].checked = true;
+ }
+
+ if (curConfig.baseUnit) {
+ $$c('#base_unit').val(curConfig.baseUnit);
+ }
+
+ if (curConfig.gridSnapping) {
+ $$c('#grid_snapping_on')[0].checked = true;
+ }
+
+ if (curConfig.snappingStep) {
+ $$c('#grid_snapping_step').val(curConfig.snappingStep);
+ }
+
+ if (curConfig.gridColor) {
+ $$c('#grid_color').val(curConfig.gridColor);
+ }
+ }); // init SpinButtons
+
+ $$c('#rect_rx').SpinButton({
+ min: 0,
+ max: 1000,
+ stateObj: stateObj,
+ callback: changeRectRadius
+ });
+ $$c('#stroke_width').SpinButton({
+ min: 0,
+ max: 99,
+ smallStep: 0.1,
+ stateObj: stateObj,
+ callback: changeStrokeWidth
+ });
+ $$c('#angle').SpinButton({
+ min: -180,
+ max: 180,
+ step: 5,
+ stateObj: stateObj,
+ callback: changeRotationAngle
+ });
+ $$c('#font_size').SpinButton({
+ min: 0.001,
+ stepfunc: stepFontSize,
+ stateObj: stateObj,
+ callback: changeFontSize
+ });
+ $$c('#group_opacity').SpinButton({
+ min: 0,
+ max: 100,
+ step: 5,
+ stateObj: stateObj,
+ callback: changeOpacity
+ });
+ $$c('#blur').SpinButton({
+ min: 0,
+ max: 10,
+ step: 0.1,
+ stateObj: stateObj,
+ callback: changeBlur
+ });
+ $$c('#zoom').SpinButton({
+ min: 0.001,
+ max: 10000,
+ step: 50,
+ stepfunc: stepZoom,
+ stateObj: stateObj,
+ callback: changeZoom // Set default zoom
+
+ }).val(svgCanvas.getZoom() * 100);
+ $$c('#workarea').contextMenu({
+ menu: 'cmenu_canvas',
+ inSpeed: 0
+ }, function (action, el, pos) {
+ switch (action) {
+ case 'delete':
+ deleteSelected();
+ break;
+
+ case 'cut':
+ cutSelected();
+ break;
+
+ case 'copy':
+ copySelected();
+ break;
+
+ case 'paste':
+ svgCanvas.pasteElements();
+ break;
+
+ case 'paste_in_place':
+ svgCanvas.pasteElements('in_place');
+ break;
+
+ case 'group':
+ case 'group_elements':
+ svgCanvas.groupSelectedElements();
+ break;
+
+ case 'ungroup':
+ svgCanvas.ungroupSelectedElement();
+ break;
+
+ case 'move_front':
+ moveToTopSelected();
+ break;
+
+ case 'move_up':
+ moveUpDownSelected('Up');
+ break;
+
+ case 'move_down':
+ moveUpDownSelected('Down');
+ break;
+
+ case 'move_back':
+ moveToBottomSelected();
+ break;
+
+ default:
+ if (hasCustomHandler(action)) {
+ getCustomHandler(action).call();
+ }
+
+ break;
+ }
+ });
+ /**
+ * Implements {@see module:jQueryContextMenu.jQueryContextMenuListener}.
+ * @param {"dupe"|"delete"|"merge_down"|"merge_all"} action
+ * @param {external:jQuery} el
+ * @param {{x: Float, y: Float, docX: Float, docY: Float}} pos
+ * @returns {void}
+ */
+
+ var lmenuFunc = function lmenuFunc(action, el, pos) {
+ switch (action) {
+ case 'dupe':
+ /* await */
+ cloneLayer();
+ break;
+
+ case 'delete':
+ deleteLayer();
+ break;
+
+ case 'merge_down':
+ mergeLayer();
+ break;
+
+ case 'merge_all':
+ svgCanvas.mergeAllLayers();
+ updateContextPanel();
+ populateLayers();
+ break;
+ }
+ };
+
+ $$c('#layerlist').contextMenu({
+ menu: 'cmenu_layers',
+ inSpeed: 0
+ }, lmenuFunc);
+ $$c('#layer_moreopts').contextMenu({
+ menu: 'cmenu_layers',
+ inSpeed: 0,
+ allowLeft: true
+ }, lmenuFunc);
+ $$c('.contextMenu li').mousedown(function (ev) {
+ ev.preventDefault();
+ });
+ $$c('#cmenu_canvas li').disableContextMenu();
+ canvMenu.enableContextMenuItems('#delete,#cut,#copy');
+ /**
+ * @returns {void}
+ */
+
+ function enableOrDisableClipboard() {
+ var svgeditClipboard;
+
+ try {
+ svgeditClipboard = localStorage.getItem('svgedit_clipboard');
+ } catch (err) {}
+
+ canvMenu[(svgeditClipboard ? 'en' : 'dis') + 'ableContextMenuItems']('#paste,#paste_in_place');
+ }
+
+ enableOrDisableClipboard();
+ window.addEventListener('storage', function (e) {
+ if (e.key !== 'svgedit_clipboard') {
+ return;
+ }
+
+ enableOrDisableClipboard();
+ });
+ window.addEventListener('beforeunload', function (e) {
+ // Suppress warning if page is empty
+ if (undoMgr.getUndoStackSize() === 0) {
+ editor.showSaveWarning = false;
+ } // showSaveWarning is set to 'false' when the page is saved.
+
+
+ if (!curConfig.no_save_warning && editor.showSaveWarning) {
+ // Browser already asks question about closing the page
+ e.returnValue = uiStrings$1.notification.unsavedChanges; // Firefox needs this when beforeunload set by addEventListener (even though message is not used)
+
+ return uiStrings$1.notification.unsavedChanges;
+ }
+
+ return true;
+ });
+ /**
+ * Expose the `uiStrings`.
+ * @function module:SVGEditor.canvas.getUIStrings
+ * @returns {module:SVGEditor.uiStrings}
+ */
+
+ editor.canvas.getUIStrings = function () {
+ return uiStrings$1;
+ };
+ /**
+ * @function module:SVGEditor.openPrep
+ * @returns {boolean|Promise} Resolves to boolean indicating `true` if there were no changes
+ * and `false` after the user confirms.
+ */
+
+
+ editor.openPrep = function () {
+ $$c('#main_menu').hide();
+
+ if (undoMgr.getUndoStackSize() === 0) {
+ return true;
+ }
+
+ return $$c.confirm(uiStrings$1.notification.QwantToOpen);
+ };
+ /**
+ *
+ * @param {Event} e
+ * @returns {void}
+ */
+
+
+ function onDragEnter(e) {
+ e.stopPropagation();
+ e.preventDefault(); // and indicator should be displayed here, such as "drop files here"
+ }
+ /**
+ *
+ * @param {Event} e
+ * @returns {void}
+ */
+
+
+ function onDragOver(e) {
+ e.stopPropagation();
+ e.preventDefault();
+ }
+ /**
+ *
+ * @param {Event} e
+ * @returns {void}
+ */
+
+
+ function onDragLeave(e) {
+ e.stopPropagation();
+ e.preventDefault(); // hypothetical indicator should be removed here
+ } // Use HTML5 File API: http://www.w3.org/TR/FileAPI/
+ // if browser has HTML5 File API support, then we will show the open menu item
+ // and provide a file input to click. When that change event fires, it will
+ // get the text contents of the file and send it to the canvas
+
+
+ if (window.FileReader) {
+ /**
+ * @param {Event} e
+ * @returns {void}
+ */
+ var importImage = function importImage(e) {
+ $$c.process_cancel(uiStrings$1.notification.loadingImage);
+ e.stopPropagation();
+ e.preventDefault();
+ $$c('#workarea').removeAttr('style');
+ $$c('#main_menu').hide();
+ var file = e.type === 'drop' ? e.dataTransfer.files[0] : this.files[0];
+
+ if (!file) {
+ $$c('#dialog_box').hide();
+ return;
+ }
+ /* if (file.type === 'application/pdf') { // Todo: Handle PDF imports
+ }
+ else */
+
+
+ if (!file.type.includes('image')) {
+ return;
+ } // Detected an image
+ // svg handling
+
+
+ var reader;
+
+ if (file.type.includes('svg')) {
+ reader = new FileReader();
+
+ reader.onloadend = function (ev) {
+ var newElement = svgCanvas.importSvgString(ev.target.result, true);
+ svgCanvas.ungroupSelectedElement();
+ svgCanvas.ungroupSelectedElement();
+ svgCanvas.groupSelectedElements();
+ svgCanvas.alignSelectedElements('m', 'page');
+ svgCanvas.alignSelectedElements('c', 'page'); // highlight imported element, otherwise we get strange empty selectbox
+
+ svgCanvas.selectOnly([newElement]);
+ $$c('#dialog_box').hide();
+ };
+
+ reader.readAsText(file);
+ } else {
+ // bitmap handling
+ reader = new FileReader();
+
+ reader.onloadend = function (_ref22) {
+ var result = _ref22.target.result;
+
+ /**
+ * Insert the new image until we know its dimensions.
+ * @param {Float} width
+ * @param {Float} height
+ * @returns {void}
+ */
+ var insertNewImage = function insertNewImage(width, height) {
+ var newImage = svgCanvas.addSVGElementFromJson({
+ element: 'image',
+ attr: {
+ x: 0,
+ y: 0,
+ width: width,
+ height: height,
+ id: svgCanvas.getNextId(),
+ style: 'pointer-events:inherit'
+ }
+ });
+ svgCanvas.setHref(newImage, result);
+ svgCanvas.selectOnly([newImage]);
+ svgCanvas.alignSelectedElements('m', 'page');
+ svgCanvas.alignSelectedElements('c', 'page');
+ updateContextPanel();
+ $$c('#dialog_box').hide();
+ }; // create dummy img so we know the default dimensions
+
+
+ var imgWidth = 100;
+ var imgHeight = 100;
+ var img = new Image();
+ img.style.opacity = 0;
+ img.addEventListener('load', function () {
+ imgWidth = img.offsetWidth || img.naturalWidth || img.width;
+ imgHeight = img.offsetHeight || img.naturalHeight || img.height;
+ insertNewImage(imgWidth, imgHeight);
+ });
+ img.src = result;
+ };
+
+ reader.readAsDataURL(file);
+ }
+ };
+
+ workarea[0].addEventListener('dragenter', onDragEnter);
+ workarea[0].addEventListener('dragover', onDragOver);
+ workarea[0].addEventListener('dragleave', onDragLeave);
+ workarea[0].addEventListener('drop', importImage);
+ var open = $$c('').change( /*#__PURE__*/function () {
+ var _ref23 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17(e) {
+ var ok, reader;
+ return regeneratorRuntime.wrap(function _callee17$(_context17) {
+ while (1) {
+ switch (_context17.prev = _context17.next) {
+ case 0:
+ _context17.next = 2;
+ return editor.openPrep();
+
+ case 2:
+ ok = _context17.sent;
+
+ if (ok) {
+ _context17.next = 5;
+ break;
+ }
+
+ return _context17.abrupt("return");
+
+ case 5:
+ svgCanvas.clear();
+
+ if (this.files.length === 1) {
+ $$c.process_cancel(uiStrings$1.notification.loadingImage);
+ reader = new FileReader();
+
+ reader.onloadend = /*#__PURE__*/function () {
+ var _ref25 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16(_ref24) {
+ var target;
+ return regeneratorRuntime.wrap(function _callee16$(_context16) {
+ while (1) {
+ switch (_context16.prev = _context16.next) {
+ case 0:
+ target = _ref24.target;
+ _context16.next = 3;
+ return loadSvgString(target.result);
+
+ case 3:
+ updateCanvas();
+
+ case 4:
+ case "end":
+ return _context16.stop();
+ }
+ }
+ }, _callee16);
+ }));
+
+ return function (_x7) {
+ return _ref25.apply(this, arguments);
+ };
+ }();
+
+ reader.readAsText(this.files[0]);
+ }
+
+ case 7:
+ case "end":
+ return _context17.stop();
+ }
+ }
+ }, _callee17, this);
+ }));
+
+ return function (_x6) {
+ return _ref23.apply(this, arguments);
+ };
+ }());
+ $$c('#tool_open').show();
+ $$c(window).on('openImage', function () {
+ return open.click();
+ });
+ var imgImport = $$c('').change(importImage);
+ $$c('#tool_import').show();
+ $$c(window).on('importImage', function () {
+ return imgImport.click();
+ });
+ }
+
+ updateCanvas(true); // const revnums = 'svg-editor.js ($Rev$) ';
+ // revnums += svgCanvas.getVersion();
+ // $('#copyright')[0].setAttribute('title', revnums);
+
+ var loadedExtensionNames = [];
+ /**
+ * @function module:SVGEditor.setLang
+ * @param {string} lang The language code
+ * @param {module:locale.LocaleStrings} allStrings See {@tutorial LocaleDocs}
+ * @fires module:svgcanvas.SvgCanvas#event:ext_langReady
+ * @fires module:svgcanvas.SvgCanvas#event:ext_langChanged
+ * @returns {Promise} A Promise which resolves to `undefined`
+ */
+
+ var setLang = editor.setLang = /*#__PURE__*/function () {
+ var _ref26 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee18(lang, allStrings) {
+ var oldLayerName, renameLayer, elems;
+ return regeneratorRuntime.wrap(function _callee18$(_context18) {
+ while (1) {
+ switch (_context18.prev = _context18.next) {
+ case 0:
+ editor.langChanged = true;
+ editor.pref('lang', lang);
+ $$c('#lang_select').val(lang);
+
+ if (allStrings) {
+ _context18.next = 5;
+ break;
+ }
+
+ return _context18.abrupt("return");
+
+ case 5:
+ // Todo: Remove `allStrings.lang` property in locale in
+ // favor of just `lang`?
+ document.documentElement.lang = allStrings.lang; // lang;
+ // Todo: Add proper RTL Support!
+ // Todo: Use RTL detection instead and take out of locales?
+ // document.documentElement.dir = allStrings.dir;
+
+ $$c.extend(uiStrings$1, allStrings); // const notif = allStrings.notification; // Currently unused
+ // $.extend will only replace the given strings
+
+ oldLayerName = $$c('#layerlist tr.layersel td.layername').text();
+ renameLayer = oldLayerName === uiStrings$1.common.layer + ' 1';
+ svgCanvas.setUiStrings(allStrings);
+ Actions.setTitles();
+
+ if (renameLayer) {
+ svgCanvas.renameCurrentLayer(uiStrings$1.common.layer + ' 1');
+ populateLayers();
+ } // In case extensions loaded before the locale, now we execute a callback on them
+
+
+ if (!extsPreLang.length) {
+ _context18.next = 18;
+ break;
+ }
+
+ _context18.next = 15;
+ return Promise.all(extsPreLang.map(function (ext) {
+ loadedExtensionNames.push(ext.name);
+ return ext.langReady({
+ lang: lang,
+ uiStrings: uiStrings$1,
+ importLocale: getImportLocale({
+ defaultLang: lang,
+ defaultName: ext.name
+ })
+ });
+ }));
+
+ case 15:
+ extsPreLang.length = 0;
+ _context18.next = 19;
+ break;
+
+ case 18:
+ loadedExtensionNames.forEach(function (loadedExtensionName) {
+ svgCanvas.runExtension(loadedExtensionName, 'langReady',
+ /** @type {module:svgcanvas.SvgCanvas#event:ext_langReady} */
+ {
+ lang: lang,
+ uiStrings: uiStrings$1,
+ importLocale: getImportLocale({
+ defaultLang: lang,
+ defaultName: loadedExtensionName
+ })
+ });
+ });
+
+ case 19:
+ svgCanvas.runExtensions('langChanged',
+ /** @type {module:svgcanvas.SvgCanvas#event:ext_langChanged} */
+ lang); // Update flyout tooltips
+
+ setFlyoutTitles(); // Copy title for certain tool elements
+
+ elems = {
+ '#stroke_color': '#tool_stroke .icon_label, #tool_stroke .color_block',
+ '#fill_color': '#tool_fill label, #tool_fill .color_block',
+ '#linejoin_miter': '#cur_linejoin',
+ '#linecap_butt': '#cur_linecap'
+ };
+ $$c.each(elems, function (source, dest) {
+ $$c(dest).attr('title', $$c(source)[0].title);
+ }); // Copy alignment titles
+
+ $$c('#multiselected_panel div[id^=tool_align]').each(function () {
+ $$c('#tool_pos' + this.id.substr(10))[0].title = this.title;
+ });
+
+ case 24:
+ case "end":
+ return _context18.stop();
+ }
+ }
+ }, _callee18);
+ }));
+
+ return function (_x8, _x9) {
+ return _ref26.apply(this, arguments);
+ };
+ }();
+
+ init$7(
+ /**
+ * @implements {module:locale.LocaleEditorInit}
+ */
+ {
+ /**
+ * Gets an array of results from extensions with a `addLangData` method,
+ * returning an object with a `data` property set to its locales (to be
+ * merged with regular locales).
+ * @param {string} langParam
+ * @fires module:svgcanvas.SvgCanvas#event:ext_addLangData
+ * @todo Can we forego this in favor of `langReady` (or forego `langReady`)?
+ * @returns {module:locale.AddLangExtensionLocaleData[]}
+ */
+ addLangData: function addLangData(langParam) {
+ return svgCanvas.runExtensions('addLangData',
+ /**
+ * @function
+ * @type {module:svgcanvas.ExtensionVarBuilder}
+ * @param {string} name
+ * @returns {module:svgcanvas.SvgCanvas#event:ext_addLangData}
+ */
+ function (name) {
+ // We pass in a function as we don't know the extension name here when defining this `addLangData` method
+ return {
+ lang: langParam,
+ importLocale: getImportLocale({
+ defaultLang: langParam,
+ defaultName: name
+ })
+ };
+ }, true);
+ },
+ curConfig: curConfig
+ }); // Load extensions
+ // Bit of a hack to run extensions in local Opera/IE9
+
+ if (document.location.protocol === 'file:') {
+ setTimeout(extAndLocaleFunc, 100);
+ } else {
+ // Returns a promise (if we wanted to fire 'extensions-loaded' event,
+ // potentially useful to hide interface as some extension locales
+ // are only available after this)
+ extAndLocaleFunc();
+ }
+ };
+ /**
+ * @callback module:SVGEditor.ReadyCallback
+ * @returns {Promise|void}
+ */
+
+ /**
+ * Queues a callback to be invoked when the editor is ready (or
+ * to be invoked immediately if it is already ready--i.e.,
+ * if `runCallbacks` has been run).
+ * @function module:SVGEditor.ready
+ * @param {module:SVGEditor.ReadyCallback} cb Callback to be queued to invoke
+ * @returns {Promise} Resolves when all callbacks, including the supplied have resolved
+ */
+
+
+ editor.ready = function (cb) {
+ // eslint-disable-line promise/prefer-await-to-callbacks
+ return new Promise(function (resolve, reject) {
+ // eslint-disable-line promise/avoid-new
+ if (isReady) {
+ resolve(cb()); // eslint-disable-line node/callback-return, promise/prefer-await-to-callbacks
+
+ return;
+ }
+
+ callbacks.push([cb, resolve, reject]);
+ });
+ };
+ /**
+ * Invokes the callbacks previous set by `svgEditor.ready`
+ * @function module:SVGEditor.runCallbacks
+ * @returns {Promise} Resolves to `undefined` if all callbacks succeeded and rejects otherwise
+ */
+
+
+ editor.runCallbacks = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee21() {
+ return regeneratorRuntime.wrap(function _callee21$(_context21) {
+ while (1) {
+ switch (_context21.prev = _context21.next) {
+ case 0:
+ _context21.prev = 0;
+ _context21.next = 3;
+ return Promise.all(callbacks.map(function (_ref29) {
+ var _ref30 = _slicedToArray(_ref29, 1),
+ cb = _ref30[0];
+
+ return cb(); // eslint-disable-line promise/prefer-await-to-callbacks
+ }));
+
+ case 3:
+ _context21.next = 9;
+ break;
+
+ case 5:
+ _context21.prev = 5;
+ _context21.t0 = _context21["catch"](0);
+ callbacks.forEach(function (_ref31) {
+ var _ref32 = _slicedToArray(_ref31, 3),
+ reject = _ref32[2];
+
+ reject();
+ });
+ throw _context21.t0;
+
+ case 9:
+ callbacks.forEach(function (_ref33) {
+ var _ref34 = _slicedToArray(_ref33, 2),
+ resolve = _ref34[1];
+
+ resolve();
+ });
+ isReady = true;
+
+ case 11:
+ case "end":
+ return _context21.stop();
+ }
+ }
+ }, _callee21, null, [[0, 5]]);
+ }));
+ /**
+ * @function module:SVGEditor.loadFromString
+ * @param {string} str The SVG string to load
+ * @param {PlainObject} [opts={}]
+ * @param {boolean} [opts.noAlert=false] Option to avoid alert to user and instead get rejected promise
+ * @returns {Promise}
+ */
+
+ editor.loadFromString = function (str) {
+ var _ref35 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ noAlert = _ref35.noAlert;
+
+ return editor.ready( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee22() {
+ return regeneratorRuntime.wrap(function _callee22$(_context22) {
+ while (1) {
+ switch (_context22.prev = _context22.next) {
+ case 0:
+ _context22.prev = 0;
+ _context22.next = 3;
+ return loadSvgString(str, {
+ noAlert: noAlert
+ });
+
+ case 3:
+ _context22.next = 9;
+ break;
+
+ case 5:
+ _context22.prev = 5;
+ _context22.t0 = _context22["catch"](0);
+
+ if (!noAlert) {
+ _context22.next = 9;
+ break;
+ }
+
+ throw _context22.t0;
+
+ case 9:
+ case "end":
+ return _context22.stop();
+ }
+ }
+ }, _callee22, null, [[0, 5]]);
+ })));
+ };
+ /**
+ * Not presently in use.
+ * @function module:SVGEditor.disableUI
+ * @param {PlainObject} featList
+ * @returns {void}
+ */
+
+
+ editor.disableUI = function (featList) {// $(function () {
+ // $('#tool_wireframe, #tool_image, #main_button, #tool_source, #sidepanels').remove();
+ // $('#tools_top').css('left', 5);
+ // });
+ };
+ /**
+ * @callback module:SVGEditor.URLLoadCallback
+ * @param {boolean} success
+ * @returns {void}
+ */
+
+ /**
+ * @function module:SVGEditor.loadFromURL
+ * @param {string} url URL from which to load an SVG string via Ajax
+ * @param {PlainObject} [opts={}] May contain properties: `cache`, `callback`
+ * @param {boolean} [opts.cache]
+ * @param {boolean} [opts.noAlert]
+ * @returns {Promise} Resolves to `undefined` or rejects upon bad loading of
+ * the SVG (or upon failure to parse the loaded string) when `noAlert` is
+ * enabled
+ */
+
+
+ editor.loadFromURL = function (url) {
+ var _ref37 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ cache = _ref37.cache,
+ noAlert = _ref37.noAlert;
+
+ return editor.ready(function () {
+ return new Promise(function (resolve, reject) {
+ // eslint-disable-line promise/avoid-new
+ $$c.ajax({
+ url: url,
+ dataType: 'text',
+ cache: Boolean(cache),
+ beforeSend: function beforeSend() {
+ $$c.process_cancel(uiStrings$1.notification.loadingImage);
+ },
+ success: function success(str) {
+ resolve(loadSvgString(str, {
+ noAlert: noAlert
+ }));
+ },
+ error: function error(xhr, stat, err) {
+ if (xhr.status !== 404 && xhr.responseText) {
+ resolve(loadSvgString(xhr.responseText, {
+ noAlert: noAlert
+ }));
+ return;
+ }
+
+ if (noAlert) {
+ reject(new Error('URLLoadFail'));
+ return;
+ }
+
+ $$c.alert(uiStrings$1.notification.URLLoadFail + ': \n' + err);
+ resolve();
+ },
+ complete: function complete() {
+ $$c('#dialog_box').hide();
+ }
+ });
+ });
+ });
+ };
+ /**
+ * @function module:SVGEditor.loadFromDataURI
+ * @param {string} str The Data URI to base64-decode (if relevant) and load
+ * @param {PlainObject} [opts={}]
+ * @param {boolean} [opts.noAlert]
+ * @returns {Promise} Resolves to `undefined` and rejects if loading SVG string fails and `noAlert` is enabled
+ */
+
+
+ editor.loadFromDataURI = function (str) {
+ var _ref38 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ noAlert = _ref38.noAlert;
+
+ return editor.ready(function () {
+ var base64 = false;
+ var pre = str.match(/^data:image\/svg\+xml;base64,/);
+
+ if (pre) {
+ base64 = true;
+ } else {
+ pre = str.match(/^data:image\/svg\+xml(?:;|;utf8)?,/);
+ }
+
+ if (pre) {
+ pre = pre[0];
+ }
+
+ var src = str.slice(pre.length);
+ return loadSvgString(base64 ? decode64(src) : decodeURIComponent(src), {
+ noAlert: noAlert
+ });
+ });
+ };
+ /**
+ * @function module:SVGEditor.addExtension
+ * @param {string} name Used internally; no need for i18n.
+ * @param {module:svgcanvas.ExtensionInitCallback} init Config to be invoked on this module
+ * @param {module:svgcanvas.ExtensionInitArgs} initArgs
+ * @throws {Error} If called too early
+ * @returns {Promise} Resolves to `undefined`
+ */
+
+
+ editor.addExtension = function (name, init, initArgs) {
+ // Note that we don't want this on editor.ready since some extensions
+ // may want to run before then (like server_opensave).
+ // $(function () {
+ if (!svgCanvas) {
+ throw new Error('Extension added too early');
+ }
+
+ return svgCanvas.addExtension.call(this, name, init, initArgs); // });
+ }; // Defer injection to wait out initial menu processing. This probably goes
+ // away once all context menu behavior is brought to context menu.
+
+
+ editor.ready(function () {
+ injectExtendedContextMenuItemsIntoDom();
+ });
+ var extensionsAdded = false;
+ var messageQueue = [];
+ /**
+ * @param {PlainObject} info
+ * @param {any} info.data
+ * @param {string} info.origin
+ * @fires module:svgcanvas.SvgCanvas#event:message
+ * @returns {void}
+ */
+
+ var messageListener = function messageListener(_ref39) {
+ var data = _ref39.data,
+ origin = _ref39.origin;
+ // eslint-disable-line no-shadow
+ // console.log('data, origin, extensionsAdded', data, origin, extensionsAdded);
+ var messageObj = {
+ data: data,
+ origin: origin
+ };
+
+ if (!extensionsAdded) {
+ messageQueue.push(messageObj);
+ } else {
+ // Extensions can handle messages at this stage with their own
+ // canvas `message` listeners
+ svgCanvas.call('message', messageObj);
+ }
+ };
+
+ window.addEventListener('message', messageListener); // Run init once DOM is loaded
+ // jQuery(editor.init);
+
+ _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee23() {
+ return regeneratorRuntime.wrap(function _callee23$(_context23) {
+ while (1) {
+ switch (_context23.prev = _context23.next) {
+ case 0:
+ _context23.prev = 0;
+ _context23.next = 3;
+ return Promise.resolve();
+
+ case 3:
+ editor.init();
+ _context23.next = 9;
+ break;
+
+ case 6:
+ _context23.prev = 6;
+ _context23.t0 = _context23["catch"](0);
+ console.error(_context23.t0); // eslint-disable-line no-console
+
+ case 9:
+ case "end":
+ return _context23.stop();
+ }
+ }
+ }, _callee23, null, [[0, 6]]);
+ }))();
+
+ editor.setConfig({
+ /* To override the ability for URLs to set URL-based SVG content,
+ uncomment the following: */
+ // preventURLContentLoading: true,
+
+ /* To override the ability for URLs to set other configuration (including
+ extension config), uncomment the following: */
+ // preventAllURLConfig: true,
+
+ /* To override the ability for URLs to set their own extensions, uncomment the
+ following (note that if `setConfig()` is used in extension code, it will still
+ be additive to extensions, however): */
+ // lockExtensions: true,
+ });
+ editor.setConfig({
+ /*
+ Provide default values here which differ from that of the editor but
+ which the URL can override
+ */
+ }, {
+ allowInitialUserOverride: true
+ }); // EXTENSION CONFIG
+
+ editor.setConfig({
+ extensions: [// 'ext-overview_window.js', 'ext-markers.js', 'ext-connector.js',
+ // 'ext-eyedropper.js', 'ext-shapes.js', 'ext-imagelib.js',
+ // 'ext-grid.js', 'ext-polygon.js', 'ext-star.js', 'ext-panning.js',
+ // 'ext-storage.js'
+ ],
+ // noDefaultExtensions can only be meaningfully used in
+ // `svgedit-config-es.js` or in the URL
+ noDefaultExtensions: false
+ }); // OTHER CONFIG
+
+ editor.setConfig({// canvasName: 'default',
+ // canvas_expansion: 3,
+ // initFill: {
+ // color: 'FF0000', // solid red
+ // opacity: 1
+ // },
+ // initStroke: {
+ // width: 5,
+ // color: '000000', // solid black
+ // opacity: 1
+ // },
+ // initOpacity: 1,
+ // colorPickerCSS: null,
+ // initTool: 'select',
+ // exportWindowType: 'new', // 'same'
+ // wireframe: false,
+ // showlayers: false,
+ // no_save_warning: false,
+ // PATH CONFIGURATION
+ // imgPath: 'images/',
+ // langPath: '/src/editor/locale/',
+ // extPath: 'extensions/',
+ // jGraduatePath: 'jgraduate/images/',
+
+ /*
+ Uncomment the following to allow at least same domain (embedded) access,
+ including `file:///` access.
+ Setting as `['*']` would allow any domain to access but would be unsafe to
+ data privacy and integrity.
+ */
+ // May be 'null' (as a string) when used as a `file:///` URL
+ // allowedOrigins: [location.origin || 'null'],
+ // DOCUMENT PROPERTIES
+ // dimensions: [640, 480],
+ // EDITOR OPTIONS
+ // gridSnapping: false,
+ // gridColor: '#000',
+ // baseUnit: 'px',
+ // snappingStep: 10,
+ // showRulers: true,
+ // EXTENSION-RELATED (GRID)
+ // showGrid: false, // Set by ext-grid.js
+ // EXTENSION-RELATED (STORAGE)
+ // Some interaction with `ext-storage.js`; prevent even the loading of
+ // previously saved local storage
+ // noStorageOnLoad: false,
+ // Some interaction with `ext-storage.js`; strongly discouraged from
+ // modification as it bypasses user privacy by preventing them from
+ // choosing whether to keep local storage or not
+ // forceStorage: false,
+ // Used by `ext-storage.js`; empty any prior storage if the user
+ // declines to store
+ // emptyStorageOnDecline: true,
+ }); // PREF CHANGES
+
+ /*
+ setConfig() can also be used to set preferences in addition to
+ configuration (see defaultPrefs in svg-editor.js for a list of
+ possible settings), but at least if you are using ext-storage.js
+ to store preferences, it will probably be better to let your
+ users control these.
+ As with configuration, one may use allowInitialUserOverride, but
+ in the case of preferences, any previously stored preferences
+ will also thereby be enabled to override this setting (and at a
+ higher priority than any URL preference setting overrides).
+ Failing to use allowInitialUserOverride will ensure preferences
+ are hard-coded here regardless of URL or prior user storage setting.
+ */
+
+ editor.setConfig({// Set dynamically within locale.js if not previously set
+ // lang: '',
+ // Will default to 's' if the window height is smaller than the minimum
+ // height and 'm' otherwise
+ // iconsize: '',
+
+ /**
+ * When showing the preferences dialog, svg-editor.js currently relies
+ * on `curPrefs` instead of `svgEditor.pref`, so allowing an override for
+ * `bkgd_color` means that this value won't have priority over block
+ * auto-detection as far as determining which color shows initially
+ * in the preferences dialog (though it can be changed and saved).
+ */
+ // bkgd_color: '#FFF',
+ // bkgd_url: '',
+ // img_save: 'embed',
+ // Only shows in UI as far as alert notices
+ // save_notice_done: false,
+ // export_notice_done: false
+ });
+ editor.setConfig({// Indicate pref settings here if you wish to allow user storage or URL
+ // settings to be able to override your default preferences (unless
+ // other config options have already explicitly prevented one or the
+ // other)
+ }, {
+ allowInitialUserOverride: true
+ });
+
+ var underscoreMin = createCommonjsModule(function (module, exports) {
+ !function (n, r) {
+ module.exports = r() ;
+ }(commonjsGlobal, function () {
+ // Underscore.js 1.10.2
+ // https://underscorejs.org
+ // (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ // Underscore may be freely distributed under the MIT license.
+ var n = "object" == (typeof self === "undefined" ? "undefined" : _typeof(self)) && self.self === self && self || "object" == _typeof(commonjsGlobal) && commonjsGlobal.global === commonjsGlobal && commonjsGlobal || Function("return this")() || {},
+ e = Array.prototype,
+ i = Object.prototype,
+ p = "undefined" != typeof Symbol ? Symbol.prototype : null,
+ u = e.push,
+ f = e.slice,
+ s = i.toString,
+ o = i.hasOwnProperty,
+ r = Array.isArray,
+ a = Object.keys,
+ t = Object.create,
+ c = n.isNaN,
+ l = n.isFinite,
+ v = function v() {};
+
+ function h(n) {
+ return n instanceof h ? n : this instanceof h ? void (this._wrapped = n) : new h(n);
+ }
+
+ var g = h.VERSION = "1.10.2";
+
+ function y(u, o, n) {
+ if (void 0 === o) return u;
+
+ switch (null == n ? 3 : n) {
+ case 1:
+ return function (n) {
+ return u.call(o, n);
+ };
+
+ case 3:
+ return function (n, r, t) {
+ return u.call(o, n, r, t);
+ };
+
+ case 4:
+ return function (n, r, t, e) {
+ return u.call(o, n, r, t, e);
+ };
+ }
+
+ return function () {
+ return u.apply(o, arguments);
+ };
+ }
+
+ function d(n, r, t) {
+ return null == n ? ur : Cn(n) ? y(n, r, t) : Ln(n) && !Kn(n) ? ir(n) : or(n);
+ }
+
+ function m(n, r) {
+ return d(n, r, 1 / 0);
+ }
+
+ function b(n, r, t) {
+ return h.iteratee !== m ? h.iteratee(n, r) : d(n, r, t);
+ }
+
+ function j(u, o) {
+ return o = null == o ? u.length - 1 : +o, function () {
+ for (var n = Math.max(arguments.length - o, 0), r = Array(n), t = 0; t < n; t++) {
+ r[t] = arguments[t + o];
+ }
+
+ switch (o) {
+ case 0:
+ return u.call(this, r);
+
+ case 1:
+ return u.call(this, arguments[0], r);
+
+ case 2:
+ return u.call(this, arguments[0], arguments[1], r);
+ }
+
+ var e = Array(o + 1);
+
+ for (t = 0; t < o; t++) {
+ e[t] = arguments[t];
+ }
+
+ return e[o] = r, u.apply(this, e);
+ };
+ }
+
+ function _(n) {
+ if (!Ln(n)) return {};
+ if (t) return t(n);
+ v.prototype = n;
+ var r = new v();
+ return v.prototype = null, r;
+ }
+
+ function w(r) {
+ return function (n) {
+ return null == n ? void 0 : n[r];
+ };
+ }
+
+ function x(n, r) {
+ return null != n && o.call(n, r);
+ }
+
+ function S(n, r) {
+ for (var t = r.length, e = 0; e < t; e++) {
+ if (null == n) return;
+ n = n[r[e]];
+ }
+
+ return t ? n : void 0;
+ }
+
+ h.iteratee = m;
+ var A = Math.pow(2, 53) - 1,
+ O = w("length");
+
+ function M(n) {
+ var r = O(n);
+ return "number" == typeof r && 0 <= r && r <= A;
+ }
+
+ function E(n, r, t) {
+ var e, u;
+ if (r = y(r, t), M(n)) for (e = 0, u = n.length; e < u; e++) {
+ r(n[e], e, n);
+ } else {
+ var o = Sn(n);
+
+ for (e = 0, u = o.length; e < u; e++) {
+ r(n[o[e]], o[e], n);
+ }
+ }
+ return n;
+ }
+
+ function N(n, r, t) {
+ r = b(r, t);
+
+ for (var e = !M(n) && Sn(n), u = (e || n).length, o = Array(u), i = 0; i < u; i++) {
+ var a = e ? e[i] : i;
+ o[i] = r(n[a], a, n);
+ }
+
+ return o;
+ }
+
+ function k(f) {
+ return function (n, r, t, e) {
+ var u = 3 <= arguments.length;
+ return function (n, r, t, e) {
+ var u = !M(n) && Sn(n),
+ o = (u || n).length,
+ i = 0 < f ? 0 : o - 1;
+
+ for (e || (t = n[u ? u[i] : i], i += f); 0 <= i && i < o; i += f) {
+ var a = u ? u[i] : i;
+ t = r(t, n[a], a, n);
+ }
+
+ return t;
+ }(n, y(r, e, 4), t, u);
+ };
+ }
+
+ var I = k(1),
+ T = k(-1);
+
+ function B(n, r, t) {
+ var e = (M(n) ? on : Tn)(n, r, t);
+ if (void 0 !== e && -1 !== e) return n[e];
+ }
+
+ function R(n, e, r) {
+ var u = [];
+ return e = b(e, r), E(n, function (n, r, t) {
+ e(n, r, t) && u.push(n);
+ }), u;
+ }
+
+ function F(n, r, t) {
+ r = b(r, t);
+
+ for (var e = !M(n) && Sn(n), u = (e || n).length, o = 0; o < u; o++) {
+ var i = e ? e[o] : o;
+ if (!r(n[i], i, n)) return !1;
+ }
+
+ return !0;
+ }
+
+ function q(n, r, t) {
+ r = b(r, t);
+
+ for (var e = !M(n) && Sn(n), u = (e || n).length, o = 0; o < u; o++) {
+ var i = e ? e[o] : o;
+ if (r(n[i], i, n)) return !0;
+ }
+
+ return !1;
+ }
+
+ function D(n, r, t, e) {
+ return M(n) || (n = On(n)), ("number" != typeof t || e) && (t = 0), 0 <= ln(n, r, t);
+ }
+
+ var W = j(function (n, t, e) {
+ var u, o;
+ return Cn(t) ? o = t : Kn(t) && (u = t.slice(0, -1), t = t[t.length - 1]), N(n, function (n) {
+ var r = o;
+
+ if (!r) {
+ if (u && u.length && (n = S(n, u)), null == n) return;
+ r = n[t];
+ }
+
+ return null == r ? r : r.apply(n, e);
+ });
+ });
+
+ function z(n, r) {
+ return N(n, or(r));
+ }
+
+ function P(n, e, r) {
+ var t,
+ u,
+ o = -1 / 0,
+ i = -1 / 0;
+ if (null == e || "number" == typeof e && "object" != _typeof(n[0]) && null != n) for (var a = 0, f = (n = M(n) ? n : On(n)).length; a < f; a++) {
+ null != (t = n[a]) && o < t && (o = t);
+ } else e = b(e, r), E(n, function (n, r, t) {
+ u = e(n, r, t), (i < u || u === -1 / 0 && o === -1 / 0) && (o = n, i = u);
+ });
+ return o;
+ }
+
+ function K(n, r, t) {
+ if (null == r || t) return M(n) || (n = On(n)), n[ar(n.length - 1)];
+ var e = M(n) ? Dn(n) : On(n),
+ u = O(e);
+ r = Math.max(Math.min(r, u), 0);
+
+ for (var o = u - 1, i = 0; i < r; i++) {
+ var a = ar(i, o),
+ f = e[i];
+ e[i] = e[a], e[a] = f;
+ }
+
+ return e.slice(0, r);
+ }
+
+ function L(i, r) {
+ return function (e, u, n) {
+ var o = r ? [[], []] : {};
+ return u = b(u, n), E(e, function (n, r) {
+ var t = u(n, r, e);
+ i(o, n, t);
+ }), o;
+ };
+ }
+
+ var V = L(function (n, r, t) {
+ x(n, t) ? n[t].push(r) : n[t] = [r];
+ }),
+ C = L(function (n, r, t) {
+ n[t] = r;
+ }),
+ J = L(function (n, r, t) {
+ x(n, t) ? n[t]++ : n[t] = 1;
+ }),
+ U = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
+ var $ = L(function (n, r, t) {
+ n[t ? 0 : 1].push(r);
+ }, !0);
+
+ function G(n, r, t) {
+ return null == n || n.length < 1 ? null == r ? void 0 : [] : null == r || t ? n[0] : H(n, n.length - r);
+ }
+
+ function H(n, r, t) {
+ return f.call(n, 0, Math.max(0, n.length - (null == r || t ? 1 : r)));
+ }
+
+ function Q(n, r, t) {
+ return f.call(n, null == r || t ? 1 : r);
+ }
+
+ function X(n, r, t, e) {
+ for (var u = (e = e || []).length, o = 0, i = O(n); o < i; o++) {
+ var a = n[o];
+ if (M(a) && (Kn(a) || Vn(a))) {
+ if (r) for (var f = 0, c = a.length; f < c;) {
+ e[u++] = a[f++];
+ } else X(a, r, t, e), u = e.length;
+ } else t || (e[u++] = a);
+ }
+
+ return e;
+ }
+
+ var Y = j(function (n, r) {
+ return rn(n, r);
+ });
+
+ function Z(n, r, t, e) {
+ er(r) || (e = t, t = r, r = !1), null != t && (t = b(t, e));
+
+ for (var u = [], o = [], i = 0, a = O(n); i < a; i++) {
+ var f = n[i],
+ c = t ? t(f, i, n) : f;
+ r && !t ? (i && o === c || u.push(f), o = c) : t ? D(o, c) || (o.push(c), u.push(f)) : D(u, f) || u.push(f);
+ }
+
+ return u;
+ }
+
+ var nn = j(function (n) {
+ return Z(X(n, !0, !0));
+ });
+ var rn = j(function (n, r) {
+ return r = X(r, !0, !0), R(n, function (n) {
+ return !D(r, n);
+ });
+ });
+
+ function tn(n) {
+ for (var r = n && P(n, O).length || 0, t = Array(r), e = 0; e < r; e++) {
+ t[e] = z(n, e);
+ }
+
+ return t;
+ }
+
+ var en = j(tn);
+
+ function un(o) {
+ return function (n, r, t) {
+ r = b(r, t);
+
+ for (var e = O(n), u = 0 < o ? 0 : e - 1; 0 <= u && u < e; u += o) {
+ if (r(n[u], u, n)) return u;
+ }
+
+ return -1;
+ };
+ }
+
+ var on = un(1),
+ an = un(-1);
+
+ function fn(n, r, t, e) {
+ for (var u = (t = b(t, e, 1))(r), o = 0, i = O(n); o < i;) {
+ var a = Math.floor((o + i) / 2);
+ t(n[a]) < u ? o = a + 1 : i = a;
+ }
+
+ return o;
+ }
+
+ function cn(o, i, a) {
+ return function (n, r, t) {
+ var e = 0,
+ u = O(n);
+ if ("number" == typeof t) 0 < o ? e = 0 <= t ? t : Math.max(t + u, e) : u = 0 <= t ? Math.min(t + 1, u) : t + u + 1;else if (a && t && u) return n[t = a(n, r)] === r ? t : -1;
+ if (r != r) return 0 <= (t = i(f.call(n, e, u), tr)) ? t + e : -1;
+
+ for (t = 0 < o ? e : u - 1; 0 <= t && t < u; t += o) {
+ if (n[t] === r) return t;
+ }
+
+ return -1;
+ };
+ }
+
+ var ln = cn(1, on, fn),
+ pn = cn(-1, an);
+
+ function sn(n, r, t, e, u) {
+ if (!(e instanceof r)) return n.apply(t, u);
+
+ var o = _(n.prototype),
+ i = n.apply(o, u);
+
+ return Ln(i) ? i : o;
+ }
+
+ var vn = j(function (r, t, e) {
+ if (!Cn(r)) throw new TypeError("Bind must be called on a function");
+ var u = j(function (n) {
+ return sn(r, u, t, this, e.concat(n));
+ });
+ return u;
+ }),
+ hn = j(function (u, o) {
+ var i = hn.placeholder,
+ a = function a() {
+ for (var n = 0, r = o.length, t = Array(r), e = 0; e < r; e++) {
+ t[e] = o[e] === i ? arguments[n++] : o[e];
+ }
+
+ for (; n < arguments.length;) {
+ t.push(arguments[n++]);
+ }
+
+ return sn(u, a, this, this, t);
+ };
+
+ return a;
+ });
+ hn.placeholder = h;
+ var gn = j(function (n, r) {
+ var t = (r = X(r, !1, !1)).length;
+ if (t < 1) throw new Error("bindAll must be passed function names");
+
+ for (; t--;) {
+ var e = r[t];
+ n[e] = vn(n[e], n);
+ }
+ });
+ var yn = j(function (n, r, t) {
+ return setTimeout(function () {
+ return n.apply(null, t);
+ }, r);
+ }),
+ dn = hn(yn, h, 1);
+
+ function mn(n) {
+ return function () {
+ return !n.apply(this, arguments);
+ };
+ }
+
+ function bn(n, r) {
+ var t;
+ return function () {
+ return 0 < --n && (t = r.apply(this, arguments)), n <= 1 && (r = null), t;
+ };
+ }
+
+ var jn = hn(bn, 2),
+ _n = !{
+ toString: null
+ }.propertyIsEnumerable("toString"),
+ wn = ["valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"];
+
+ function xn(n, r) {
+ var t = wn.length,
+ e = n.constructor,
+ u = Cn(e) && e.prototype || i,
+ o = "constructor";
+
+ for (x(n, o) && !D(r, o) && r.push(o); t--;) {
+ (o = wn[t]) in n && n[o] !== u[o] && !D(r, o) && r.push(o);
+ }
+ }
+
+ function Sn(n) {
+ if (!Ln(n)) return [];
+ if (a) return a(n);
+ var r = [];
+
+ for (var t in n) {
+ x(n, t) && r.push(t);
+ }
+
+ return _n && xn(n, r), r;
+ }
+
+ function An(n) {
+ if (!Ln(n)) return [];
+ var r = [];
+
+ for (var t in n) {
+ r.push(t);
+ }
+
+ return _n && xn(n, r), r;
+ }
+
+ function On(n) {
+ for (var r = Sn(n), t = r.length, e = Array(t), u = 0; u < t; u++) {
+ e[u] = n[r[u]];
+ }
+
+ return e;
+ }
+
+ function Mn(n) {
+ for (var r = {}, t = Sn(n), e = 0, u = t.length; e < u; e++) {
+ r[n[t[e]]] = t[e];
+ }
+
+ return r;
+ }
+
+ function En(n) {
+ var r = [];
+
+ for (var t in n) {
+ Cn(n[t]) && r.push(t);
+ }
+
+ return r.sort();
+ }
+
+ function Nn(f, c) {
+ return function (n) {
+ var r = arguments.length;
+ if (c && (n = Object(n)), r < 2 || null == n) return n;
+
+ for (var t = 1; t < r; t++) {
+ for (var e = arguments[t], u = f(e), o = u.length, i = 0; i < o; i++) {
+ var a = u[i];
+ c && void 0 !== n[a] || (n[a] = e[a]);
+ }
+ }
+
+ return n;
+ };
+ }
+
+ var kn = Nn(An),
+ In = Nn(Sn);
+
+ function Tn(n, r, t) {
+ r = b(r, t);
+
+ for (var e, u = Sn(n), o = 0, i = u.length; o < i; o++) {
+ if (r(n[e = u[o]], e, n)) return e;
+ }
+ }
+
+ function Bn(n, r, t) {
+ return r in t;
+ }
+
+ var Rn = j(function (n, r) {
+ var t = {},
+ e = r[0];
+ if (null == n) return t;
+ Cn(e) ? (1 < r.length && (e = y(e, r[1])), r = An(n)) : (e = Bn, r = X(r, !1, !1), n = Object(n));
+
+ for (var u = 0, o = r.length; u < o; u++) {
+ var i = r[u],
+ a = n[i];
+ e(a, i, n) && (t[i] = a);
+ }
+
+ return t;
+ }),
+ Fn = j(function (n, t) {
+ var r,
+ e = t[0];
+ return Cn(e) ? (e = mn(e), 1 < t.length && (r = t[1])) : (t = N(X(t, !1, !1), String), e = function e(n, r) {
+ return !D(t, r);
+ }), Rn(n, e, r);
+ }),
+ qn = Nn(An, !0);
+
+ function Dn(n) {
+ return Ln(n) ? Kn(n) ? n.slice() : kn({}, n) : n;
+ }
+
+ function Wn(n, r) {
+ var t = Sn(r),
+ e = t.length;
+ if (null == n) return !e;
+
+ for (var u = Object(n), o = 0; o < e; o++) {
+ var i = t[o];
+ if (r[i] !== u[i] || !(i in u)) return !1;
+ }
+
+ return !0;
+ }
+
+ function zn(n, r, t, e) {
+ if (n === r) return 0 !== n || 1 / n == 1 / r;
+ if (null == n || null == r) return !1;
+ if (n != n) return r != r;
+
+ var u = _typeof(n);
+
+ return ("function" === u || "object" === u || "object" == _typeof(r)) && function (n, r, t, e) {
+ n instanceof h && (n = n._wrapped);
+ r instanceof h && (r = r._wrapped);
+ var u = s.call(n);
+ if (u !== s.call(r)) return !1;
+
+ switch (u) {
+ case "[object RegExp]":
+ case "[object String]":
+ return "" + n == "" + r;
+
+ case "[object Number]":
+ return +n != +n ? +r != +r : 0 == +n ? 1 / +n == 1 / r : +n == +r;
+
+ case "[object Date]":
+ case "[object Boolean]":
+ return +n == +r;
+
+ case "[object Symbol]":
+ return p.valueOf.call(n) === p.valueOf.call(r);
+ }
+
+ var o = "[object Array]" === u;
+
+ if (!o) {
+ if ("object" != _typeof(n) || "object" != _typeof(r)) return !1;
+ var i = n.constructor,
+ a = r.constructor;
+ if (i !== a && !(Cn(i) && i instanceof i && Cn(a) && a instanceof a) && "constructor" in n && "constructor" in r) return !1;
+ }
+
+ e = e || [];
+ var f = (t = t || []).length;
+
+ for (; f--;) {
+ if (t[f] === n) return e[f] === r;
+ }
+
+ if (t.push(n), e.push(r), o) {
+ if ((f = n.length) !== r.length) return !1;
+
+ for (; f--;) {
+ if (!zn(n[f], r[f], t, e)) return !1;
+ }
+ } else {
+ var c,
+ l = Sn(n);
+ if (f = l.length, Sn(r).length !== f) return !1;
+
+ for (; f--;) {
+ if (c = l[f], !x(r, c) || !zn(n[c], r[c], t, e)) return !1;
+ }
+ }
+
+ return t.pop(), e.pop(), !0;
+ }(n, r, t, e);
+ }
+
+ function Pn(r) {
+ return function (n) {
+ return s.call(n) === "[object " + r + "]";
+ };
+ }
+
+ var Kn = r || Pn("Array");
+
+ function Ln(n) {
+ var r = _typeof(n);
+
+ return "function" === r || "object" === r && !!n;
+ }
+
+ var Vn = Pn("Arguments"),
+ Cn = Pn("Function"),
+ Jn = Pn("String"),
+ Un = Pn("Number"),
+ $n = Pn("Date"),
+ Gn = Pn("RegExp"),
+ Hn = Pn("Error"),
+ Qn = Pn("Symbol"),
+ Xn = Pn("Map"),
+ Yn = Pn("WeakMap"),
+ Zn = Pn("Set"),
+ nr = Pn("WeakSet");
+ !function () {
+ Vn(arguments) || (Vn = function Vn(n) {
+ return x(n, "callee");
+ });
+ }();
+ var rr = n.document && n.document.childNodes;
+
+ function tr(n) {
+ return Un(n) && c(n);
+ }
+
+ function er(n) {
+ return !0 === n || !1 === n || "[object Boolean]" === s.call(n);
+ }
+
+ function ur(n) {
+ return n;
+ }
+
+ function or(r) {
+ return Kn(r) ? function (n) {
+ return S(n, r);
+ } : w(r);
+ }
+
+ function ir(r) {
+ return r = In({}, r), function (n) {
+ return Wn(n, r);
+ };
+ }
+
+ function ar(n, r) {
+ return null == r && (r = n, n = 0), n + Math.floor(Math.random() * (r - n + 1));
+ }
+
+ "function" != typeof /./ && "object" != (typeof Int8Array === "undefined" ? "undefined" : _typeof(Int8Array)) && "function" != typeof rr && (Cn = function Cn(n) {
+ return "function" == typeof n || !1;
+ });
+
+ var fr = Date.now || function () {
+ return new Date().getTime();
+ },
+ cr = {
+ "&": "&",
+ "<": "<",
+ ">": ">",
+ '"': """,
+ "'": "'",
+ "`": "`"
+ },
+ lr = Mn(cr);
+
+ function pr(r) {
+ var t = function t(n) {
+ return r[n];
+ },
+ n = "(?:" + Sn(r).join("|") + ")",
+ e = RegExp(n),
+ u = RegExp(n, "g");
+
+ return function (n) {
+ return n = null == n ? "" : "" + n, e.test(n) ? n.replace(u, t) : n;
+ };
+ }
+
+ var sr = pr(cr),
+ vr = pr(lr);
+ var hr = 0;
+
+ var gr = h.templateSettings = {
+ evaluate: /<%([\s\S]+?)%>/g,
+ interpolate: /<%=([\s\S]+?)%>/g,
+ escape: /<%-([\s\S]+?)%>/g
+ },
+ yr = /(.)^/,
+ dr = {
+ "'": "'",
+ "\\": "\\",
+ "\r": "r",
+ "\n": "n",
+ "\u2028": "u2028",
+ "\u2029": "u2029"
+ },
+ mr = /\\|'|\r|\n|\u2028|\u2029/g,
+ br = function br(n) {
+ return "\\" + dr[n];
+ };
+
+ function jr(n, r) {
+ return n._chain ? h(r).chain() : r;
+ }
+
+ function _r(t) {
+ return E(En(t), function (n) {
+ var r = h[n] = t[n];
+
+ h.prototype[n] = function () {
+ var n = [this._wrapped];
+ return u.apply(n, arguments), jr(this, r.apply(h, n));
+ };
+ }), h;
+ }
+
+ E(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function (r) {
+ var t = e[r];
+
+ h.prototype[r] = function () {
+ var n = this._wrapped;
+ return t.apply(n, arguments), "shift" !== r && "splice" !== r || 0 !== n.length || delete n[0], jr(this, n);
+ };
+ }), E(["concat", "join", "slice"], function (n) {
+ var r = e[n];
+
+ h.prototype[n] = function () {
+ return jr(this, r.apply(this._wrapped, arguments));
+ };
+ }), h.prototype.valueOf = h.prototype.toJSON = h.prototype.value = function () {
+ return this._wrapped;
+ }, h.prototype.toString = function () {
+ return String(this._wrapped);
+ };
+
+ var wr = _r({
+ "default": h,
+ VERSION: g,
+ iteratee: m,
+ restArguments: j,
+ each: E,
+ forEach: E,
+ map: N,
+ collect: N,
+ reduce: I,
+ foldl: I,
+ inject: I,
+ reduceRight: T,
+ foldr: T,
+ find: B,
+ detect: B,
+ filter: R,
+ select: R,
+ reject: function reject(n, r, t) {
+ return R(n, mn(b(r)), t);
+ },
+ every: F,
+ all: F,
+ some: q,
+ any: q,
+ contains: D,
+ includes: D,
+ include: D,
+ invoke: W,
+ pluck: z,
+ where: function where(n, r) {
+ return R(n, ir(r));
+ },
+ findWhere: function findWhere(n, r) {
+ return B(n, ir(r));
+ },
+ max: P,
+ min: function min(n, e, r) {
+ var t,
+ u,
+ o = 1 / 0,
+ i = 1 / 0;
+ if (null == e || "number" == typeof e && "object" != _typeof(n[0]) && null != n) for (var a = 0, f = (n = M(n) ? n : On(n)).length; a < f; a++) {
+ null != (t = n[a]) && t < o && (o = t);
+ } else e = b(e, r), E(n, function (n, r, t) {
+ ((u = e(n, r, t)) < i || u === 1 / 0 && o === 1 / 0) && (o = n, i = u);
+ });
+ return o;
+ },
+ shuffle: function shuffle(n) {
+ return K(n, 1 / 0);
+ },
+ sample: K,
+ sortBy: function sortBy(n, e, r) {
+ var u = 0;
+ return e = b(e, r), z(N(n, function (n, r, t) {
+ return {
+ value: n,
+ index: u++,
+ criteria: e(n, r, t)
+ };
+ }).sort(function (n, r) {
+ var t = n.criteria,
+ e = r.criteria;
+
+ if (t !== e) {
+ if (e < t || void 0 === t) return 1;
+ if (t < e || void 0 === e) return -1;
+ }
+
+ return n.index - r.index;
+ }), "value");
+ },
+ groupBy: V,
+ indexBy: C,
+ countBy: J,
+ toArray: function toArray(n) {
+ return n ? Kn(n) ? f.call(n) : Jn(n) ? n.match(U) : M(n) ? N(n, ur) : On(n) : [];
+ },
+ size: function size(n) {
+ return null == n ? 0 : M(n) ? n.length : Sn(n).length;
+ },
+ partition: $,
+ first: G,
+ head: G,
+ take: G,
+ initial: H,
+ last: function last(n, r, t) {
+ return null == n || n.length < 1 ? null == r ? void 0 : [] : null == r || t ? n[n.length - 1] : Q(n, Math.max(0, n.length - r));
+ },
+ rest: Q,
+ tail: Q,
+ drop: Q,
+ compact: function compact(n) {
+ return R(n, Boolean);
+ },
+ flatten: function flatten(n, r) {
+ return X(n, r, !1);
+ },
+ without: Y,
+ uniq: Z,
+ unique: Z,
+ union: nn,
+ intersection: function intersection(n) {
+ for (var r = [], t = arguments.length, e = 0, u = O(n); e < u; e++) {
+ var o = n[e];
+
+ if (!D(r, o)) {
+ var i;
+
+ for (i = 1; i < t && D(arguments[i], o); i++) {
+ }
+
+ i === t && r.push(o);
+ }
+ }
+
+ return r;
+ },
+ difference: rn,
+ unzip: tn,
+ zip: en,
+ object: function object(n, r) {
+ for (var t = {}, e = 0, u = O(n); e < u; e++) {
+ r ? t[n[e]] = r[e] : t[n[e][0]] = n[e][1];
+ }
+
+ return t;
+ },
+ findIndex: on,
+ findLastIndex: an,
+ sortedIndex: fn,
+ indexOf: ln,
+ lastIndexOf: pn,
+ range: function range(n, r, t) {
+ null == r && (r = n || 0, n = 0), t || (t = r < n ? -1 : 1);
+
+ for (var e = Math.max(Math.ceil((r - n) / t), 0), u = Array(e), o = 0; o < e; o++, n += t) {
+ u[o] = n;
+ }
+
+ return u;
+ },
+ chunk: function chunk(n, r) {
+ if (null == r || r < 1) return [];
+
+ for (var t = [], e = 0, u = n.length; e < u;) {
+ t.push(f.call(n, e, e += r));
+ }
+
+ return t;
+ },
+ bind: vn,
+ partial: hn,
+ bindAll: gn,
+ memoize: function memoize(e, u) {
+ var o = function o(n) {
+ var r = o.cache,
+ t = "" + (u ? u.apply(this, arguments) : n);
+ return x(r, t) || (r[t] = e.apply(this, arguments)), r[t];
+ };
+
+ return o.cache = {}, o;
+ },
+ delay: yn,
+ defer: dn,
+ throttle: function throttle(t, e, u) {
+ var o,
+ i,
+ a,
+ f,
+ c = 0;
+ u || (u = {});
+
+ var l = function l() {
+ c = !1 === u.leading ? 0 : fr(), o = null, f = t.apply(i, a), o || (i = a = null);
+ },
+ n = function n() {
+ var n = fr();
+ c || !1 !== u.leading || (c = n);
+ var r = e - (n - c);
+ return i = this, a = arguments, r <= 0 || e < r ? (o && (clearTimeout(o), o = null), c = n, f = t.apply(i, a), o || (i = a = null)) : o || !1 === u.trailing || (o = setTimeout(l, r)), f;
+ };
+
+ return n.cancel = function () {
+ clearTimeout(o), c = 0, o = i = a = null;
+ }, n;
+ },
+ debounce: function debounce(t, e, u) {
+ var o,
+ i,
+ a = function a(n, r) {
+ o = null, r && (i = t.apply(n, r));
+ },
+ n = j(function (n) {
+ if (o && clearTimeout(o), u) {
+ var r = !o;
+ o = setTimeout(a, e), r && (i = t.apply(this, n));
+ } else o = yn(a, e, this, n);
+
+ return i;
+ });
+
+ return n.cancel = function () {
+ clearTimeout(o), o = null;
+ }, n;
+ },
+ wrap: function wrap(n, r) {
+ return hn(r, n);
+ },
+ negate: mn,
+ compose: function compose() {
+ var t = arguments,
+ e = t.length - 1;
+ return function () {
+ for (var n = e, r = t[e].apply(this, arguments); n--;) {
+ r = t[n].call(this, r);
+ }
+
+ return r;
+ };
+ },
+ after: function after(n, r) {
+ return function () {
+ if (--n < 1) return r.apply(this, arguments);
+ };
+ },
+ before: bn,
+ once: jn,
+ keys: Sn,
+ allKeys: An,
+ values: On,
+ mapObject: function mapObject(n, r, t) {
+ r = b(r, t);
+
+ for (var e = Sn(n), u = e.length, o = {}, i = 0; i < u; i++) {
+ var a = e[i];
+ o[a] = r(n[a], a, n);
+ }
+
+ return o;
+ },
+ pairs: function pairs(n) {
+ for (var r = Sn(n), t = r.length, e = Array(t), u = 0; u < t; u++) {
+ e[u] = [r[u], n[r[u]]];
+ }
+
+ return e;
+ },
+ invert: Mn,
+ functions: En,
+ methods: En,
+ extend: kn,
+ extendOwn: In,
+ assign: In,
+ findKey: Tn,
+ pick: Rn,
+ omit: Fn,
+ defaults: qn,
+ create: function create(n, r) {
+ var t = _(n);
+
+ return r && In(t, r), t;
+ },
+ clone: Dn,
+ tap: function tap(n, r) {
+ return r(n), n;
+ },
+ isMatch: Wn,
+ isEqual: function isEqual(n, r) {
+ return zn(n, r);
+ },
+ isEmpty: function isEmpty(n) {
+ return null == n || (M(n) && (Kn(n) || Jn(n) || Vn(n)) ? 0 === n.length : 0 === Sn(n).length);
+ },
+ isElement: function isElement(n) {
+ return !(!n || 1 !== n.nodeType);
+ },
+ isArray: Kn,
+ isObject: Ln,
+ isArguments: Vn,
+ isFunction: Cn,
+ isString: Jn,
+ isNumber: Un,
+ isDate: $n,
+ isRegExp: Gn,
+ isError: Hn,
+ isSymbol: Qn,
+ isMap: Xn,
+ isWeakMap: Yn,
+ isSet: Zn,
+ isWeakSet: nr,
+ isFinite: function isFinite(n) {
+ return !Qn(n) && l(n) && !c(parseFloat(n));
+ },
+ isNaN: tr,
+ isBoolean: er,
+ isNull: function isNull(n) {
+ return null === n;
+ },
+ isUndefined: function isUndefined(n) {
+ return void 0 === n;
+ },
+ has: function has(n, r) {
+ if (!Kn(r)) return x(n, r);
+
+ for (var t = r.length, e = 0; e < t; e++) {
+ var u = r[e];
+ if (null == n || !o.call(n, u)) return !1;
+ n = n[u];
+ }
+
+ return !!t;
+ },
+ identity: ur,
+ constant: function constant(n) {
+ return function () {
+ return n;
+ };
+ },
+ noop: function noop() {},
+ property: or,
+ propertyOf: function propertyOf(r) {
+ return null == r ? function () {} : function (n) {
+ return Kn(n) ? S(r, n) : r[n];
+ };
+ },
+ matcher: ir,
+ matches: ir,
+ times: function times(n, r, t) {
+ var e = Array(Math.max(0, n));
+ r = y(r, t, 1);
+
+ for (var u = 0; u < n; u++) {
+ e[u] = r(u);
+ }
+
+ return e;
+ },
+ random: ar,
+ now: fr,
+ escape: sr,
+ unescape: vr,
+ result: function result(n, r, t) {
+ Kn(r) || (r = [r]);
+ var e = r.length;
+ if (!e) return Cn(t) ? t.call(n) : t;
+
+ for (var u = 0; u < e; u++) {
+ var o = null == n ? void 0 : n[r[u]];
+ void 0 === o && (o = t, u = e), n = Cn(o) ? o.call(n) : o;
+ }
+
+ return n;
+ },
+ uniqueId: function uniqueId(n) {
+ var r = ++hr + "";
+ return n ? n + r : r;
+ },
+ templateSettings: gr,
+ template: function template(o, n, r) {
+ !n && r && (n = r), n = qn({}, n, h.templateSettings);
+ var t,
+ e = RegExp([(n.escape || yr).source, (n.interpolate || yr).source, (n.evaluate || yr).source].join("|") + "|$", "g"),
+ i = 0,
+ a = "__p+='";
+ o.replace(e, function (n, r, t, e, u) {
+ return a += o.slice(i, u).replace(mr, br), i = u + n.length, r ? a += "'+\n((__t=(" + r + "))==null?'':_.escape(__t))+\n'" : t ? a += "'+\n((__t=(" + t + "))==null?'':__t)+\n'" : e && (a += "';\n" + e + "\n__p+='"), n;
+ }), a += "';\n", n.variable || (a = "with(obj||{}){\n" + a + "}\n"), a = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + a + "return __p;\n";
+
+ try {
+ t = new Function(n.variable || "obj", "_", a);
+ } catch (n) {
+ throw n.source = a, n;
+ }
+
+ var u = function u(n) {
+ return t.call(this, n, h);
+ },
+ f = n.variable || "obj";
+
+ return u.source = "function(" + f + "){\n" + a + "}", u;
+ },
+ chain: function chain(n) {
+ var r = h(n);
+ return r._chain = !0, r;
+ },
+ mixin: _r
+ });
+
+ return wr._ = wr;
+ });
+ });
+
+ var underscoreMin$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), underscoreMin, {
+ 'default': underscoreMin,
+ __moduleExports: underscoreMin
+ }));
+
+ var global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
+
+ var lookup = [];
+ var revLookup = [];
+ var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
+ var inited = false;
+
+ function init$8() {
+ inited = true;
+ var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
+
+ for (var i = 0, len = code.length; i < len; ++i) {
+ lookup[i] = code[i];
+ revLookup[code.charCodeAt(i)] = i;
+ }
+
+ revLookup['-'.charCodeAt(0)] = 62;
+ revLookup['_'.charCodeAt(0)] = 63;
+ }
+
+ function toByteArray(b64) {
+ if (!inited) {
+ init$8();
+ }
+
+ var i, j, l, tmp, placeHolders, arr;
+ var len = b64.length;
+
+ if (len % 4 > 0) {
+ throw new Error('Invalid string. Length must be a multiple of 4');
+ } // the number of equal signs (place holders)
+ // if there are two placeholders, than the two characters before it
+ // represent one byte
+ // if there is only one, then the three characters before it represent 2 bytes
+ // this is just a cheap hack to not do indexOf twice
+
+
+ placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0; // base64 is 4/3 + up to two characters of the original data
+
+ arr = new Arr(len * 3 / 4 - placeHolders); // if there are placeholders, only get up to the last complete 4 chars
+
+ l = placeHolders > 0 ? len - 4 : len;
+ var L = 0;
+
+ for (i = 0, j = 0; i < l; i += 4, j += 3) {
+ tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
+ arr[L++] = tmp >> 16 & 0xFF;
+ arr[L++] = tmp >> 8 & 0xFF;
+ arr[L++] = tmp & 0xFF;
+ }
+
+ if (placeHolders === 2) {
+ tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
+ arr[L++] = tmp & 0xFF;
+ } else if (placeHolders === 1) {
+ tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
+ arr[L++] = tmp >> 8 & 0xFF;
+ arr[L++] = tmp & 0xFF;
+ }
+
+ return arr;
+ }
+
+ function tripletToBase64(num) {
+ return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];
+ }
+
+ function encodeChunk(uint8, start, end) {
+ var tmp;
+ var output = [];
+
+ for (var i = start; i < end; i += 3) {
+ tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2];
+ output.push(tripletToBase64(tmp));
+ }
+
+ return output.join('');
+ }
+
+ function fromByteArray(uint8) {
+ if (!inited) {
+ init$8();
+ }
+
+ var tmp;
+ var len = uint8.length;
+ var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
+
+ var output = '';
+ var parts = [];
+ var maxChunkLength = 16383; // must be multiple of 3
+ // go through the array every three bytes, we'll deal with trailing stuff later
+
+ for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
+ parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
+ } // pad the end with zeros, but make sure to not forget the extra bytes
+
+
+ if (extraBytes === 1) {
+ tmp = uint8[len - 1];
+ output += lookup[tmp >> 2];
+ output += lookup[tmp << 4 & 0x3F];
+ output += '==';
+ } else if (extraBytes === 2) {
+ tmp = (uint8[len - 2] << 8) + uint8[len - 1];
+ output += lookup[tmp >> 10];
+ output += lookup[tmp >> 4 & 0x3F];
+ output += lookup[tmp << 2 & 0x3F];
+ output += '=';
+ }
+
+ parts.push(output);
+ return parts.join('');
+ }
+
+ function read(buffer, offset, isLE, mLen, nBytes) {
+ var e, m;
+ var eLen = nBytes * 8 - mLen - 1;
+ var eMax = (1 << eLen) - 1;
+ var eBias = eMax >> 1;
+ var nBits = -7;
+ var i = isLE ? nBytes - 1 : 0;
+ var d = isLE ? -1 : 1;
+ var s = buffer[offset + i];
+ i += d;
+ e = s & (1 << -nBits) - 1;
+ s >>= -nBits;
+ nBits += eLen;
+
+ for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
+
+ m = e & (1 << -nBits) - 1;
+ e >>= -nBits;
+ nBits += mLen;
+
+ for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
+
+ if (e === 0) {
+ e = 1 - eBias;
+ } else if (e === eMax) {
+ return m ? NaN : (s ? -1 : 1) * Infinity;
+ } else {
+ m = m + Math.pow(2, mLen);
+ e = e - eBias;
+ }
+
+ return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
+ }
+
+ function write(buffer, value, offset, isLE, mLen, nBytes) {
+ var e, m, c;
+ var eLen = nBytes * 8 - mLen - 1;
+ var eMax = (1 << eLen) - 1;
+ var eBias = eMax >> 1;
+ var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
+ var i = isLE ? 0 : nBytes - 1;
+ var d = isLE ? 1 : -1;
+ var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
+ value = Math.abs(value);
+
+ if (isNaN(value) || value === Infinity) {
+ m = isNaN(value) ? 1 : 0;
+ e = eMax;
+ } else {
+ e = Math.floor(Math.log(value) / Math.LN2);
+
+ if (value * (c = Math.pow(2, -e)) < 1) {
+ e--;
+ c *= 2;
+ }
+
+ if (e + eBias >= 1) {
+ value += rt / c;
+ } else {
+ value += rt * Math.pow(2, 1 - eBias);
+ }
+
+ if (value * c >= 2) {
+ e++;
+ c /= 2;
+ }
+
+ if (e + eBias >= eMax) {
+ m = 0;
+ e = eMax;
+ } else if (e + eBias >= 1) {
+ m = (value * c - 1) * Math.pow(2, mLen);
+ e = e + eBias;
+ } else {
+ m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
+ e = 0;
+ }
+ }
+
+ for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
+
+ e = e << mLen | m;
+ eLen += mLen;
+
+ for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
+
+ buffer[offset + i - d] |= s * 128;
+ }
+
+ var toString$2 = {}.toString;
+
+ var isArray$1 = Array.isArray || function (arr) {
+ return toString$2.call(arr) == '[object Array]';
+ };
+ /*!
+ * The buffer module from node.js, for the browser.
+ *
+ * @author Feross Aboukhadijeh
+ * @license MIT
+ */
+
+
+ var INSPECT_MAX_BYTES = 50;
+ /**
+ * If `Buffer.TYPED_ARRAY_SUPPORT`:
+ * === true Use Uint8Array implementation (fastest)
+ * === false Use Object implementation (most compatible, even IE6)
+ *
+ * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
+ * Opera 11.6+, iOS 4.2+.
+ *
+ * Due to various browser bugs, sometimes the Object implementation will be used even
+ * when the browser supports typed arrays.
+ *
+ * Note:
+ *
+ * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
+ * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
+ *
+ * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
+ *
+ * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
+ * incorrect length in some situations.
+
+ * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
+ * get the Object implementation, which is slower but behaves correctly.
+ */
+
+ Buffer.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== undefined ? global$1.TYPED_ARRAY_SUPPORT : true;
+ /*
+ * Export kMaxLength after typed array support is determined.
+ */
+
+ var _kMaxLength = kMaxLength();
+
+ function kMaxLength() {
+ return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff;
+ }
+
+ function createBuffer(that, length) {
+ if (kMaxLength() < length) {
+ throw new RangeError('Invalid typed array length');
+ }
+
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ // Return an augmented `Uint8Array` instance, for best performance
+ that = new Uint8Array(length);
+ that.__proto__ = Buffer.prototype;
+ } else {
+ // Fallback: Return an object instance of the Buffer class
+ if (that === null) {
+ that = new Buffer(length);
+ }
+
+ that.length = length;
+ }
+
+ return that;
+ }
+ /**
+ * The Buffer constructor returns instances of `Uint8Array` that have their
+ * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
+ * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
+ * and the `Uint8Array` methods. Square bracket notation works as expected -- it
+ * returns a single octet.
+ *
+ * The `Uint8Array` prototype remains unmodified.
+ */
+
+
+ function Buffer(arg, encodingOrOffset, length) {
+ if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
+ return new Buffer(arg, encodingOrOffset, length);
+ } // Common case.
+
+
+ if (typeof arg === 'number') {
+ if (typeof encodingOrOffset === 'string') {
+ throw new Error('If encoding is specified then the first argument must be a string');
+ }
+
+ return allocUnsafe(this, arg);
+ }
+
+ return from(this, arg, encodingOrOffset, length);
+ }
+
+ Buffer.poolSize = 8192; // not used by this implementation
+ // TODO: Legacy, not needed anymore. Remove in next major version.
+
+ Buffer._augment = function (arr) {
+ arr.__proto__ = Buffer.prototype;
+ return arr;
+ };
+
+ function from(that, value, encodingOrOffset, length) {
+ if (typeof value === 'number') {
+ throw new TypeError('"value" argument must not be a number');
+ }
+
+ if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
+ return fromArrayBuffer(that, value, encodingOrOffset, length);
+ }
+
+ if (typeof value === 'string') {
+ return fromString(that, value, encodingOrOffset);
+ }
+
+ return fromObject(that, value);
+ }
+ /**
+ * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
+ * if value is a number.
+ * Buffer.from(str[, encoding])
+ * Buffer.from(array)
+ * Buffer.from(buffer)
+ * Buffer.from(arrayBuffer[, byteOffset[, length]])
+ **/
+
+
+ Buffer.from = function (value, encodingOrOffset, length) {
+ return from(null, value, encodingOrOffset, length);
+ };
+
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ Buffer.prototype.__proto__ = Uint8Array.prototype;
+ Buffer.__proto__ = Uint8Array;
+ }
+
+ function assertSize(size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('"size" argument must be a number');
+ } else if (size < 0) {
+ throw new RangeError('"size" argument must not be negative');
+ }
+ }
+
+ function alloc(that, size, fill, encoding) {
+ assertSize(size);
+
+ if (size <= 0) {
+ return createBuffer(that, size);
+ }
+
+ if (fill !== undefined) {
+ // Only pay attention to encoding if it's a string. This
+ // prevents accidentally sending in a number that would
+ // be interpretted as a start offset.
+ return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill);
+ }
+
+ return createBuffer(that, size);
+ }
+ /**
+ * Creates a new filled Buffer instance.
+ * alloc(size[, fill[, encoding]])
+ **/
+
+
+ Buffer.alloc = function (size, fill, encoding) {
+ return alloc(null, size, fill, encoding);
+ };
+
+ function allocUnsafe(that, size) {
+ assertSize(size);
+ that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
+
+ if (!Buffer.TYPED_ARRAY_SUPPORT) {
+ for (var i = 0; i < size; ++i) {
+ that[i] = 0;
+ }
+ }
+
+ return that;
+ }
+ /**
+ * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
+ * */
+
+
+ Buffer.allocUnsafe = function (size) {
+ return allocUnsafe(null, size);
+ };
+ /**
+ * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
+ */
+
+
+ Buffer.allocUnsafeSlow = function (size) {
+ return allocUnsafe(null, size);
+ };
+
+ function fromString(that, string, encoding) {
+ if (typeof encoding !== 'string' || encoding === '') {
+ encoding = 'utf8';
+ }
+
+ if (!Buffer.isEncoding(encoding)) {
+ throw new TypeError('"encoding" must be a valid string encoding');
+ }
+
+ var length = byteLength(string, encoding) | 0;
+ that = createBuffer(that, length);
+ var actual = that.write(string, encoding);
+
+ if (actual !== length) {
+ // Writing a hex string, for example, that contains invalid characters will
+ // cause everything after the first invalid character to be ignored. (e.g.
+ // 'abxxcd' will be treated as 'ab')
+ that = that.slice(0, actual);
+ }
+
+ return that;
+ }
+
+ function fromArrayLike(that, array) {
+ var length = array.length < 0 ? 0 : checked(array.length) | 0;
+ that = createBuffer(that, length);
+
+ for (var i = 0; i < length; i += 1) {
+ that[i] = array[i] & 255;
+ }
+
+ return that;
+ }
+
+ function fromArrayBuffer(that, array, byteOffset, length) {
+ array.byteLength; // this throws if `array` is not a valid ArrayBuffer
+
+ if (byteOffset < 0 || array.byteLength < byteOffset) {
+ throw new RangeError('\'offset\' is out of bounds');
+ }
+
+ if (array.byteLength < byteOffset + (length || 0)) {
+ throw new RangeError('\'length\' is out of bounds');
+ }
+
+ if (byteOffset === undefined && length === undefined) {
+ array = new Uint8Array(array);
+ } else if (length === undefined) {
+ array = new Uint8Array(array, byteOffset);
+ } else {
+ array = new Uint8Array(array, byteOffset, length);
+ }
+
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ // Return an augmented `Uint8Array` instance, for best performance
+ that = array;
+ that.__proto__ = Buffer.prototype;
+ } else {
+ // Fallback: Return an object instance of the Buffer class
+ that = fromArrayLike(that, array);
+ }
+
+ return that;
+ }
+
+ function fromObject(that, obj) {
+ if (internalIsBuffer(obj)) {
+ var len = checked(obj.length) | 0;
+ that = createBuffer(that, len);
+
+ if (that.length === 0) {
+ return that;
+ }
+
+ obj.copy(that, 0, 0, len);
+ return that;
+ }
+
+ if (obj) {
+ if (typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer || 'length' in obj) {
+ if (typeof obj.length !== 'number' || isnan(obj.length)) {
+ return createBuffer(that, 0);
+ }
+
+ return fromArrayLike(that, obj);
+ }
+
+ if (obj.type === 'Buffer' && isArray$1(obj.data)) {
+ return fromArrayLike(that, obj.data);
+ }
+ }
+
+ throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.');
+ }
+
+ function checked(length) {
+ // Note: cannot use `length < kMaxLength()` here because that fails when
+ // length is NaN (which is otherwise coerced to zero.)
+ if (length >= kMaxLength()) {
+ throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes');
+ }
+
+ return length | 0;
+ }
+
+ function SlowBuffer(length) {
+ if (+length != length) {
+ // eslint-disable-line eqeqeq
+ length = 0;
+ }
+
+ return Buffer.alloc(+length);
+ }
+
+ Buffer.isBuffer = isBuffer;
+
+ function internalIsBuffer(b) {
+ return !!(b != null && b._isBuffer);
+ }
+
+ Buffer.compare = function compare(a, b) {
+ if (!internalIsBuffer(a) || !internalIsBuffer(b)) {
+ throw new TypeError('Arguments must be Buffers');
+ }
+
+ if (a === b) return 0;
+ var x = a.length;
+ var y = b.length;
+
+ for (var i = 0, len = Math.min(x, y); i < len; ++i) {
+ if (a[i] !== b[i]) {
+ x = a[i];
+ y = b[i];
+ break;
+ }
+ }
+
+ if (x < y) return -1;
+ if (y < x) return 1;
+ return 0;
+ };
+
+ Buffer.isEncoding = function isEncoding(encoding) {
+ switch (String(encoding).toLowerCase()) {
+ case 'hex':
+ case 'utf8':
+ case 'utf-8':
+ case 'ascii':
+ case 'latin1':
+ case 'binary':
+ case 'base64':
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return true;
+
+ default:
+ return false;
+ }
+ };
+
+ Buffer.concat = function concat(list, length) {
+ if (!isArray$1(list)) {
+ throw new TypeError('"list" argument must be an Array of Buffers');
+ }
+
+ if (list.length === 0) {
+ return Buffer.alloc(0);
+ }
+
+ var i;
+
+ if (length === undefined) {
+ length = 0;
+
+ for (i = 0; i < list.length; ++i) {
+ length += list[i].length;
+ }
+ }
+
+ var buffer = Buffer.allocUnsafe(length);
+ var pos = 0;
+
+ for (i = 0; i < list.length; ++i) {
+ var buf = list[i];
+
+ if (!internalIsBuffer(buf)) {
+ throw new TypeError('"list" argument must be an Array of Buffers');
+ }
+
+ buf.copy(buffer, pos);
+ pos += buf.length;
+ }
+
+ return buffer;
+ };
+
+ function byteLength(string, encoding) {
+ if (internalIsBuffer(string)) {
+ return string.length;
+ }
+
+ if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
+ return string.byteLength;
+ }
+
+ if (typeof string !== 'string') {
+ string = '' + string;
+ }
+
+ var len = string.length;
+ if (len === 0) return 0; // Use a for loop to avoid recursion
+
+ var loweredCase = false;
+
+ for (;;) {
+ switch (encoding) {
+ case 'ascii':
+ case 'latin1':
+ case 'binary':
+ return len;
+
+ case 'utf8':
+ case 'utf-8':
+ case undefined:
+ return utf8ToBytes(string).length;
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return len * 2;
+
+ case 'hex':
+ return len >>> 1;
+
+ case 'base64':
+ return base64ToBytes(string).length;
+
+ default:
+ if (loweredCase) return utf8ToBytes(string).length; // assume utf8
+
+ encoding = ('' + encoding).toLowerCase();
+ loweredCase = true;
+ }
+ }
+ }
+
+ Buffer.byteLength = byteLength;
+
+ function slowToString(encoding, start, end) {
+ var loweredCase = false; // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
+ // property of a typed array.
+ // This behaves neither like String nor Uint8Array in that we set start/end
+ // to their upper/lower bounds if the value passed is out of range.
+ // undefined is handled specially as per ECMA-262 6th Edition,
+ // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
+
+ if (start === undefined || start < 0) {
+ start = 0;
+ } // Return early if start > this.length. Done here to prevent potential uint32
+ // coercion fail below.
+
+
+ if (start > this.length) {
+ return '';
+ }
+
+ if (end === undefined || end > this.length) {
+ end = this.length;
+ }
+
+ if (end <= 0) {
+ return '';
+ } // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
+
+
+ end >>>= 0;
+ start >>>= 0;
+
+ if (end <= start) {
+ return '';
+ }
+
+ if (!encoding) encoding = 'utf8';
+
+ while (true) {
+ switch (encoding) {
+ case 'hex':
+ return hexSlice(this, start, end);
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Slice(this, start, end);
+
+ case 'ascii':
+ return asciiSlice(this, start, end);
+
+ case 'latin1':
+ case 'binary':
+ return latin1Slice(this, start, end);
+
+ case 'base64':
+ return base64Slice(this, start, end);
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return utf16leSlice(this, start, end);
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);
+ encoding = (encoding + '').toLowerCase();
+ loweredCase = true;
+ }
+ }
+ } // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
+ // Buffer instances.
+
+
+ Buffer.prototype._isBuffer = true;
+
+ function swap(b, n, m) {
+ var i = b[n];
+ b[n] = b[m];
+ b[m] = i;
+ }
+
+ Buffer.prototype.swap16 = function swap16() {
+ var len = this.length;
+
+ if (len % 2 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 16-bits');
+ }
+
+ for (var i = 0; i < len; i += 2) {
+ swap(this, i, i + 1);
+ }
+
+ return this;
+ };
+
+ Buffer.prototype.swap32 = function swap32() {
+ var len = this.length;
+
+ if (len % 4 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 32-bits');
+ }
+
+ for (var i = 0; i < len; i += 4) {
+ swap(this, i, i + 3);
+ swap(this, i + 1, i + 2);
+ }
+
+ return this;
+ };
+
+ Buffer.prototype.swap64 = function swap64() {
+ var len = this.length;
+
+ if (len % 8 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 64-bits');
+ }
+
+ for (var i = 0; i < len; i += 8) {
+ swap(this, i, i + 7);
+ swap(this, i + 1, i + 6);
+ swap(this, i + 2, i + 5);
+ swap(this, i + 3, i + 4);
+ }
+
+ return this;
+ };
+
+ Buffer.prototype.toString = function toString() {
+ var length = this.length | 0;
+ if (length === 0) return '';
+ if (arguments.length === 0) return utf8Slice(this, 0, length);
+ return slowToString.apply(this, arguments);
+ };
+
+ Buffer.prototype.equals = function equals(b) {
+ if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer');
+ if (this === b) return true;
+ return Buffer.compare(this, b) === 0;
+ };
+
+ Buffer.prototype.inspect = function inspect() {
+ var str = '';
+ var max = INSPECT_MAX_BYTES;
+
+ if (this.length > 0) {
+ str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');
+ if (this.length > max) str += ' ... ';
+ }
+
+ return '';
+ };
+
+ Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
+ if (!internalIsBuffer(target)) {
+ throw new TypeError('Argument must be a Buffer');
+ }
+
+ if (start === undefined) {
+ start = 0;
+ }
+
+ if (end === undefined) {
+ end = target ? target.length : 0;
+ }
+
+ if (thisStart === undefined) {
+ thisStart = 0;
+ }
+
+ if (thisEnd === undefined) {
+ thisEnd = this.length;
+ }
+
+ if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
+ throw new RangeError('out of range index');
+ }
+
+ if (thisStart >= thisEnd && start >= end) {
+ return 0;
+ }
+
+ if (thisStart >= thisEnd) {
+ return -1;
+ }
+
+ if (start >= end) {
+ return 1;
+ }
+
+ start >>>= 0;
+ end >>>= 0;
+ thisStart >>>= 0;
+ thisEnd >>>= 0;
+ if (this === target) return 0;
+ var x = thisEnd - thisStart;
+ var y = end - start;
+ var len = Math.min(x, y);
+ var thisCopy = this.slice(thisStart, thisEnd);
+ var targetCopy = target.slice(start, end);
+
+ for (var i = 0; i < len; ++i) {
+ if (thisCopy[i] !== targetCopy[i]) {
+ x = thisCopy[i];
+ y = targetCopy[i];
+ break;
+ }
+ }
+
+ if (x < y) return -1;
+ if (y < x) return 1;
+ return 0;
+ }; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
+ // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
+ //
+ // Arguments:
+ // - buffer - a Buffer to search
+ // - val - a string, Buffer, or number
+ // - byteOffset - an index into `buffer`; will be clamped to an int32
+ // - encoding - an optional encoding, relevant is val is a string
+ // - dir - true for indexOf, false for lastIndexOf
+
+
+ function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
+ // Empty buffer means no match
+ if (buffer.length === 0) return -1; // Normalize byteOffset
+
+ if (typeof byteOffset === 'string') {
+ encoding = byteOffset;
+ byteOffset = 0;
+ } else if (byteOffset > 0x7fffffff) {
+ byteOffset = 0x7fffffff;
+ } else if (byteOffset < -0x80000000) {
+ byteOffset = -0x80000000;
+ }
+
+ byteOffset = +byteOffset; // Coerce to Number.
+
+ if (isNaN(byteOffset)) {
+ // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
+ byteOffset = dir ? 0 : buffer.length - 1;
+ } // Normalize byteOffset: negative offsets start from the end of the buffer
+
+
+ if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
+
+ if (byteOffset >= buffer.length) {
+ if (dir) return -1;else byteOffset = buffer.length - 1;
+ } else if (byteOffset < 0) {
+ if (dir) byteOffset = 0;else return -1;
+ } // Normalize val
+
+
+ if (typeof val === 'string') {
+ val = Buffer.from(val, encoding);
+ } // Finally, search either indexOf (if dir is true) or lastIndexOf
+
+
+ if (internalIsBuffer(val)) {
+ // Special case: looking for empty string/buffer always fails
+ if (val.length === 0) {
+ return -1;
+ }
+
+ return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
+ } else if (typeof val === 'number') {
+ val = val & 0xFF; // Search for a byte value [0-255]
+
+ if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {
+ if (dir) {
+ return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);
+ } else {
+ return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
+ }
+ }
+
+ return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
+ }
+
+ throw new TypeError('val must be string, number or Buffer');
+ }
+
+ function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
+ var indexSize = 1;
+ var arrLength = arr.length;
+ var valLength = val.length;
+
+ if (encoding !== undefined) {
+ encoding = String(encoding).toLowerCase();
+
+ if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') {
+ if (arr.length < 2 || val.length < 2) {
+ return -1;
+ }
+
+ indexSize = 2;
+ arrLength /= 2;
+ valLength /= 2;
+ byteOffset /= 2;
+ }
+ }
+
+ function read(buf, i) {
+ if (indexSize === 1) {
+ return buf[i];
+ } else {
+ return buf.readUInt16BE(i * indexSize);
+ }
+ }
+
+ var i;
+
+ if (dir) {
+ var foundIndex = -1;
+
+ for (i = byteOffset; i < arrLength; i++) {
+ if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
+ if (foundIndex === -1) foundIndex = i;
+ if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;
+ } else {
+ if (foundIndex !== -1) i -= i - foundIndex;
+ foundIndex = -1;
+ }
+ }
+ } else {
+ if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
+
+ for (i = byteOffset; i >= 0; i--) {
+ var found = true;
+
+ for (var j = 0; j < valLength; j++) {
+ if (read(arr, i + j) !== read(val, j)) {
+ found = false;
+ break;
+ }
+ }
+
+ if (found) return i;
+ }
+ }
+
+ return -1;
+ }
+
+ Buffer.prototype.includes = function includes(val, byteOffset, encoding) {
+ return this.indexOf(val, byteOffset, encoding) !== -1;
+ };
+
+ Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
+ };
+
+ Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
+ };
+
+ function hexWrite(buf, string, offset, length) {
+ offset = Number(offset) || 0;
+ var remaining = buf.length - offset;
+
+ if (!length) {
+ length = remaining;
+ } else {
+ length = Number(length);
+
+ if (length > remaining) {
+ length = remaining;
+ }
+ } // must be an even number of digits
+
+
+ var strLen = string.length;
+ if (strLen % 2 !== 0) throw new TypeError('Invalid hex string');
+
+ if (length > strLen / 2) {
+ length = strLen / 2;
+ }
+
+ for (var i = 0; i < length; ++i) {
+ var parsed = parseInt(string.substr(i * 2, 2), 16);
+ if (isNaN(parsed)) return i;
+ buf[offset + i] = parsed;
+ }
+
+ return i;
+ }
+
+ function utf8Write(buf, string, offset, length) {
+ return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
+ }
+
+ function asciiWrite(buf, string, offset, length) {
+ return blitBuffer(asciiToBytes(string), buf, offset, length);
+ }
+
+ function latin1Write(buf, string, offset, length) {
+ return asciiWrite(buf, string, offset, length);
+ }
+
+ function base64Write(buf, string, offset, length) {
+ return blitBuffer(base64ToBytes(string), buf, offset, length);
+ }
+
+ function ucs2Write(buf, string, offset, length) {
+ return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
+ }
+
+ Buffer.prototype.write = function write(string, offset, length, encoding) {
+ // Buffer#write(string)
+ if (offset === undefined) {
+ encoding = 'utf8';
+ length = this.length;
+ offset = 0; // Buffer#write(string, encoding)
+ } else if (length === undefined && typeof offset === 'string') {
+ encoding = offset;
+ length = this.length;
+ offset = 0; // Buffer#write(string, offset[, length][, encoding])
+ } else if (isFinite(offset)) {
+ offset = offset | 0;
+
+ if (isFinite(length)) {
+ length = length | 0;
+ if (encoding === undefined) encoding = 'utf8';
+ } else {
+ encoding = length;
+ length = undefined;
+ } // legacy write(string, encoding, offset, length) - remove in v0.13
+
+ } else {
+ throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');
+ }
+
+ var remaining = this.length - offset;
+ if (length === undefined || length > remaining) length = remaining;
+
+ if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
+ throw new RangeError('Attempt to write outside buffer bounds');
+ }
+
+ if (!encoding) encoding = 'utf8';
+ var loweredCase = false;
+
+ for (;;) {
+ switch (encoding) {
+ case 'hex':
+ return hexWrite(this, string, offset, length);
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Write(this, string, offset, length);
+
+ case 'ascii':
+ return asciiWrite(this, string, offset, length);
+
+ case 'latin1':
+ case 'binary':
+ return latin1Write(this, string, offset, length);
+
+ case 'base64':
+ // Warning: maxLength not taken into account in base64Write
+ return base64Write(this, string, offset, length);
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return ucs2Write(this, string, offset, length);
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);
+ encoding = ('' + encoding).toLowerCase();
+ loweredCase = true;
+ }
+ }
+ };
+
+ Buffer.prototype.toJSON = function toJSON() {
+ return {
+ type: 'Buffer',
+ data: Array.prototype.slice.call(this._arr || this, 0)
+ };
+ };
+
+ function base64Slice(buf, start, end) {
+ if (start === 0 && end === buf.length) {
+ return fromByteArray(buf);
+ } else {
+ return fromByteArray(buf.slice(start, end));
+ }
+ }
+
+ function utf8Slice(buf, start, end) {
+ end = Math.min(buf.length, end);
+ var res = [];
+ var i = start;
+
+ while (i < end) {
+ var firstByte = buf[i];
+ var codePoint = null;
+ var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1;
+
+ if (i + bytesPerSequence <= end) {
+ var secondByte, thirdByte, fourthByte, tempCodePoint;
+
+ switch (bytesPerSequence) {
+ case 1:
+ if (firstByte < 0x80) {
+ codePoint = firstByte;
+ }
+
+ break;
+
+ case 2:
+ secondByte = buf[i + 1];
+
+ if ((secondByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F;
+
+ if (tempCodePoint > 0x7F) {
+ codePoint = tempCodePoint;
+ }
+ }
+
+ break;
+
+ case 3:
+ secondByte = buf[i + 1];
+ thirdByte = buf[i + 2];
+
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F;
+
+ if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
+ codePoint = tempCodePoint;
+ }
+ }
+
+ break;
+
+ case 4:
+ secondByte = buf[i + 1];
+ thirdByte = buf[i + 2];
+ fourthByte = buf[i + 3];
+
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F;
+
+ if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
+ codePoint = tempCodePoint;
+ }
+ }
+
+ }
+ }
+
+ if (codePoint === null) {
+ // we did not generate a valid codePoint so insert a
+ // replacement char (U+FFFD) and advance only 1 byte
+ codePoint = 0xFFFD;
+ bytesPerSequence = 1;
+ } else if (codePoint > 0xFFFF) {
+ // encode to utf16 (surrogate pair dance)
+ codePoint -= 0x10000;
+ res.push(codePoint >>> 10 & 0x3FF | 0xD800);
+ codePoint = 0xDC00 | codePoint & 0x3FF;
+ }
+
+ res.push(codePoint);
+ i += bytesPerSequence;
+ }
+
+ return decodeCodePointsArray(res);
+ } // Based on http://stackoverflow.com/a/22747272/680742, the browser with
+ // the lowest limit is Chrome, with 0x10000 args.
+ // We go 1 magnitude less, for safety
+
+
+ var MAX_ARGUMENTS_LENGTH = 0x1000;
+
+ function decodeCodePointsArray(codePoints) {
+ var len = codePoints.length;
+
+ if (len <= MAX_ARGUMENTS_LENGTH) {
+ return String.fromCharCode.apply(String, codePoints); // avoid extra slice()
+ } // Decode in chunks to avoid "call stack size exceeded".
+
+
+ var res = '';
+ var i = 0;
+
+ while (i < len) {
+ res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
+ }
+
+ return res;
+ }
+
+ function asciiSlice(buf, start, end) {
+ var ret = '';
+ end = Math.min(buf.length, end);
+
+ for (var i = start; i < end; ++i) {
+ ret += String.fromCharCode(buf[i] & 0x7F);
+ }
+
+ return ret;
+ }
+
+ function latin1Slice(buf, start, end) {
+ var ret = '';
+ end = Math.min(buf.length, end);
+
+ for (var i = start; i < end; ++i) {
+ ret += String.fromCharCode(buf[i]);
+ }
+
+ return ret;
+ }
+
+ function hexSlice(buf, start, end) {
+ var len = buf.length;
+ if (!start || start < 0) start = 0;
+ if (!end || end < 0 || end > len) end = len;
+ var out = '';
+
+ for (var i = start; i < end; ++i) {
+ out += toHex(buf[i]);
+ }
+
+ return out;
+ }
+
+ function utf16leSlice(buf, start, end) {
+ var bytes = buf.slice(start, end);
+ var res = '';
+
+ for (var i = 0; i < bytes.length; i += 2) {
+ res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
+ }
+
+ return res;
+ }
+
+ Buffer.prototype.slice = function slice(start, end) {
+ var len = this.length;
+ start = ~~start;
+ end = end === undefined ? len : ~~end;
+
+ if (start < 0) {
+ start += len;
+ if (start < 0) start = 0;
+ } else if (start > len) {
+ start = len;
+ }
+
+ if (end < 0) {
+ end += len;
+ if (end < 0) end = 0;
+ } else if (end > len) {
+ end = len;
+ }
+
+ if (end < start) end = start;
+ var newBuf;
+
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ newBuf = this.subarray(start, end);
+ newBuf.__proto__ = Buffer.prototype;
+ } else {
+ var sliceLen = end - start;
+ newBuf = new Buffer(sliceLen, undefined);
+
+ for (var i = 0; i < sliceLen; ++i) {
+ newBuf[i] = this[i + start];
+ }
+ }
+
+ return newBuf;
+ };
+ /*
+ * Need to make sure that buffer isn't trying to write out of bounds.
+ */
+
+
+ function checkOffset(offset, ext, length) {
+ if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint');
+ if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length');
+ }
+
+ Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
+ offset = offset | 0;
+ byteLength = byteLength | 0;
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
+ var val = this[offset];
+ var mul = 1;
+ var i = 0;
+
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul;
+ }
+
+ return val;
+ };
+
+ Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
+ offset = offset | 0;
+ byteLength = byteLength | 0;
+
+ if (!noAssert) {
+ checkOffset(offset, byteLength, this.length);
+ }
+
+ var val = this[offset + --byteLength];
+ var mul = 1;
+
+ while (byteLength > 0 && (mul *= 0x100)) {
+ val += this[offset + --byteLength] * mul;
+ }
+
+ return val;
+ };
+
+ Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 1, this.length);
+ return this[offset];
+ };
+
+ Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length);
+ return this[offset] | this[offset + 1] << 8;
+ };
+
+ Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length);
+ return this[offset] << 8 | this[offset + 1];
+ };
+
+ Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length);
+ return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000;
+ };
+
+ Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length);
+ return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
+ };
+
+ Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
+ offset = offset | 0;
+ byteLength = byteLength | 0;
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
+ var val = this[offset];
+ var mul = 1;
+ var i = 0;
+
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul;
+ }
+
+ mul *= 0x80;
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength);
+ return val;
+ };
+
+ Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
+ offset = offset | 0;
+ byteLength = byteLength | 0;
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
+ var i = byteLength;
+ var mul = 1;
+ var val = this[offset + --i];
+
+ while (i > 0 && (mul *= 0x100)) {
+ val += this[offset + --i] * mul;
+ }
+
+ mul *= 0x80;
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength);
+ return val;
+ };
+
+ Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 1, this.length);
+ if (!(this[offset] & 0x80)) return this[offset];
+ return (0xff - this[offset] + 1) * -1;
+ };
+
+ Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length);
+ var val = this[offset] | this[offset + 1] << 8;
+ return val & 0x8000 ? val | 0xFFFF0000 : val;
+ };
+
+ Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 2, this.length);
+ var val = this[offset + 1] | this[offset] << 8;
+ return val & 0x8000 ? val | 0xFFFF0000 : val;
+ };
+
+ Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length);
+ return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
+ };
+
+ Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length);
+ return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
+ };
+
+ Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length);
+ return read(this, offset, true, 23, 4);
+ };
+
+ Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 4, this.length);
+ return read(this, offset, false, 23, 4);
+ };
+
+ Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 8, this.length);
+ return read(this, offset, true, 52, 8);
+ };
+
+ Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
+ if (!noAssert) checkOffset(offset, 8, this.length);
+ return read(this, offset, false, 52, 8);
+ };
+
+ function checkInt(buf, value, offset, ext, max, min) {
+ if (!internalIsBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance');
+ if (value > max || value < min) throw new RangeError('"value" argument is out of bounds');
+ if (offset + ext > buf.length) throw new RangeError('Index out of range');
+ }
+
+ Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ byteLength = byteLength | 0;
+
+ if (!noAssert) {
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1;
+ checkInt(this, value, offset, byteLength, maxBytes, 0);
+ }
+
+ var mul = 1;
+ var i = 0;
+ this[offset] = value & 0xFF;
+
+ while (++i < byteLength && (mul *= 0x100)) {
+ this[offset + i] = value / mul & 0xFF;
+ }
+
+ return offset + byteLength;
+ };
+
+ Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ byteLength = byteLength | 0;
+
+ if (!noAssert) {
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1;
+ checkInt(this, value, offset, byteLength, maxBytes, 0);
+ }
+
+ var i = byteLength - 1;
+ var mul = 1;
+ this[offset + i] = value & 0xFF;
+
+ while (--i >= 0 && (mul *= 0x100)) {
+ this[offset + i] = value / mul & 0xFF;
+ }
+
+ return offset + byteLength;
+ };
+
+ Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);
+ if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
+ this[offset] = value & 0xff;
+ return offset + 1;
+ };
+
+ function objectWriteUInt16(buf, value, offset, littleEndian) {
+ if (value < 0) value = 0xffff + value + 1;
+
+ for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
+ buf[offset + i] = (value & 0xff << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8;
+ }
+ }
+
+ Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
+
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = value & 0xff;
+ this[offset + 1] = value >>> 8;
+ } else {
+ objectWriteUInt16(this, value, offset, true);
+ }
+
+ return offset + 2;
+ };
+
+ Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
+
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = value >>> 8;
+ this[offset + 1] = value & 0xff;
+ } else {
+ objectWriteUInt16(this, value, offset, false);
+ }
+
+ return offset + 2;
+ };
+
+ function objectWriteUInt32(buf, value, offset, littleEndian) {
+ if (value < 0) value = 0xffffffff + value + 1;
+
+ for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
+ buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 0xff;
+ }
+ }
+
+ Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
+
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset + 3] = value >>> 24;
+ this[offset + 2] = value >>> 16;
+ this[offset + 1] = value >>> 8;
+ this[offset] = value & 0xff;
+ } else {
+ objectWriteUInt32(this, value, offset, true);
+ }
+
+ return offset + 4;
+ };
+
+ Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
+
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = value >>> 24;
+ this[offset + 1] = value >>> 16;
+ this[offset + 2] = value >>> 8;
+ this[offset + 3] = value & 0xff;
+ } else {
+ objectWriteUInt32(this, value, offset, false);
+ }
+
+ return offset + 4;
+ };
+
+ Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
+ value = +value;
+ offset = offset | 0;
+
+ if (!noAssert) {
+ var limit = Math.pow(2, 8 * byteLength - 1);
+ checkInt(this, value, offset, byteLength, limit - 1, -limit);
+ }
+
+ var i = 0;
+ var mul = 1;
+ var sub = 0;
+ this[offset] = value & 0xFF;
+
+ while (++i < byteLength && (mul *= 0x100)) {
+ if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
+ sub = 1;
+ }
+
+ this[offset + i] = (value / mul >> 0) - sub & 0xFF;
+ }
+
+ return offset + byteLength;
+ };
+
+ Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
+ value = +value;
+ offset = offset | 0;
+
+ if (!noAssert) {
+ var limit = Math.pow(2, 8 * byteLength - 1);
+ checkInt(this, value, offset, byteLength, limit - 1, -limit);
+ }
+
+ var i = byteLength - 1;
+ var mul = 1;
+ var sub = 0;
+ this[offset + i] = value & 0xFF;
+
+ while (--i >= 0 && (mul *= 0x100)) {
+ if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
+ sub = 1;
+ }
+
+ this[offset + i] = (value / mul >> 0) - sub & 0xFF;
+ }
+
+ return offset + byteLength;
+ };
+
+ Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);
+ if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
+ if (value < 0) value = 0xff + value + 1;
+ this[offset] = value & 0xff;
+ return offset + 1;
+ };
+
+ Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
+
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = value & 0xff;
+ this[offset + 1] = value >>> 8;
+ } else {
+ objectWriteUInt16(this, value, offset, true);
+ }
+
+ return offset + 2;
+ };
+
+ Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
+
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = value >>> 8;
+ this[offset + 1] = value & 0xff;
+ } else {
+ objectWriteUInt16(this, value, offset, false);
+ }
+
+ return offset + 2;
+ };
+
+ Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
+
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = value & 0xff;
+ this[offset + 1] = value >>> 8;
+ this[offset + 2] = value >>> 16;
+ this[offset + 3] = value >>> 24;
+ } else {
+ objectWriteUInt32(this, value, offset, true);
+ }
+
+ return offset + 4;
+ };
+
+ Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
+ value = +value;
+ offset = offset | 0;
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
+ if (value < 0) value = 0xffffffff + value + 1;
+
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
+ this[offset] = value >>> 24;
+ this[offset + 1] = value >>> 16;
+ this[offset + 2] = value >>> 8;
+ this[offset + 3] = value & 0xff;
+ } else {
+ objectWriteUInt32(this, value, offset, false);
+ }
+
+ return offset + 4;
+ };
+
+ function checkIEEE754(buf, value, offset, ext, max, min) {
+ if (offset + ext > buf.length) throw new RangeError('Index out of range');
+ if (offset < 0) throw new RangeError('Index out of range');
+ }
+
+ function writeFloat(buf, value, offset, littleEndian, noAssert) {
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 4);
+ }
+
+ write(buf, value, offset, littleEndian, 23, 4);
+ return offset + 4;
+ }
+
+ Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
+ return writeFloat(this, value, offset, true, noAssert);
+ };
+
+ Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
+ return writeFloat(this, value, offset, false, noAssert);
+ };
+
+ function writeDouble(buf, value, offset, littleEndian, noAssert) {
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 8);
+ }
+
+ write(buf, value, offset, littleEndian, 52, 8);
+ return offset + 8;
+ }
+
+ Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
+ return writeDouble(this, value, offset, true, noAssert);
+ };
+
+ Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
+ return writeDouble(this, value, offset, false, noAssert);
+ }; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
+
+
+ Buffer.prototype.copy = function copy(target, targetStart, start, end) {
+ if (!start) start = 0;
+ if (!end && end !== 0) end = this.length;
+ if (targetStart >= target.length) targetStart = target.length;
+ if (!targetStart) targetStart = 0;
+ if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done
+
+ if (end === start) return 0;
+ if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions
+
+ if (targetStart < 0) {
+ throw new RangeError('targetStart out of bounds');
+ }
+
+ if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds');
+ if (end < 0) throw new RangeError('sourceEnd out of bounds'); // Are we oob?
+
+ if (end > this.length) end = this.length;
+
+ if (target.length - targetStart < end - start) {
+ end = target.length - targetStart + start;
+ }
+
+ var len = end - start;
+ var i;
+
+ if (this === target && start < targetStart && targetStart < end) {
+ // descending copy from end
+ for (i = len - 1; i >= 0; --i) {
+ target[i + targetStart] = this[i + start];
+ }
+ } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
+ // ascending copy from start
+ for (i = 0; i < len; ++i) {
+ target[i + targetStart] = this[i + start];
+ }
+ } else {
+ Uint8Array.prototype.set.call(target, this.subarray(start, start + len), targetStart);
+ }
+
+ return len;
+ }; // Usage:
+ // buffer.fill(number[, offset[, end]])
+ // buffer.fill(buffer[, offset[, end]])
+ // buffer.fill(string[, offset[, end]][, encoding])
+
+
+ Buffer.prototype.fill = function fill(val, start, end, encoding) {
+ // Handle string cases:
+ if (typeof val === 'string') {
+ if (typeof start === 'string') {
+ encoding = start;
+ start = 0;
+ end = this.length;
+ } else if (typeof end === 'string') {
+ encoding = end;
+ end = this.length;
+ }
+
+ if (val.length === 1) {
+ var code = val.charCodeAt(0);
+
+ if (code < 256) {
+ val = code;
+ }
+ }
+
+ if (encoding !== undefined && typeof encoding !== 'string') {
+ throw new TypeError('encoding must be a string');
+ }
+
+ if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
+ throw new TypeError('Unknown encoding: ' + encoding);
+ }
+ } else if (typeof val === 'number') {
+ val = val & 255;
+ } // Invalid ranges are not set to a default, so can range check early.
+
+
+ if (start < 0 || this.length < start || this.length < end) {
+ throw new RangeError('Out of range index');
+ }
+
+ if (end <= start) {
+ return this;
+ }
+
+ start = start >>> 0;
+ end = end === undefined ? this.length : end >>> 0;
+ if (!val) val = 0;
+ var i;
+
+ if (typeof val === 'number') {
+ for (i = start; i < end; ++i) {
+ this[i] = val;
+ }
+ } else {
+ var bytes = internalIsBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString());
+ var len = bytes.length;
+
+ for (i = 0; i < end - start; ++i) {
+ this[i + start] = bytes[i % len];
+ }
+ }
+
+ return this;
+ }; // HELPER FUNCTIONS
+ // ================
+
+
+ var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;
+
+ function base64clean(str) {
+ // Node strips out invalid characters like \n and \t from the string, base64-js does not
+ str = stringtrim(str).replace(INVALID_BASE64_RE, ''); // Node converts strings with length < 2 to ''
+
+ if (str.length < 2) return ''; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
+
+ while (str.length % 4 !== 0) {
+ str = str + '=';
+ }
+
+ return str;
+ }
+
+ function stringtrim(str) {
+ if (str.trim) return str.trim();
+ return str.replace(/^\s+|\s+$/g, '');
+ }
+
+ function toHex(n) {
+ if (n < 16) return '0' + n.toString(16);
+ return n.toString(16);
+ }
+
+ function utf8ToBytes(string, units) {
+ units = units || Infinity;
+ var codePoint;
+ var length = string.length;
+ var leadSurrogate = null;
+ var bytes = [];
+
+ for (var i = 0; i < length; ++i) {
+ codePoint = string.charCodeAt(i); // is surrogate component
+
+ if (codePoint > 0xD7FF && codePoint < 0xE000) {
+ // last char was a lead
+ if (!leadSurrogate) {
+ // no lead yet
+ if (codePoint > 0xDBFF) {
+ // unexpected trail
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
+ continue;
+ } else if (i + 1 === length) {
+ // unpaired lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
+ continue;
+ } // valid lead
+
+
+ leadSurrogate = codePoint;
+ continue;
+ } // 2 leads in a row
+
+
+ if (codePoint < 0xDC00) {
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
+ leadSurrogate = codePoint;
+ continue;
+ } // valid surrogate pair
+
+
+ codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;
+ } else if (leadSurrogate) {
+ // valid bmp char, but last char was a lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
+ }
+
+ leadSurrogate = null; // encode utf8
+
+ if (codePoint < 0x80) {
+ if ((units -= 1) < 0) break;
+ bytes.push(codePoint);
+ } else if (codePoint < 0x800) {
+ if ((units -= 2) < 0) break;
+ bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80);
+ } else if (codePoint < 0x10000) {
+ if ((units -= 3) < 0) break;
+ bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
+ } else if (codePoint < 0x110000) {
+ if ((units -= 4) < 0) break;
+ bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
+ } else {
+ throw new Error('Invalid code point');
+ }
+ }
+
+ return bytes;
+ }
+
+ function asciiToBytes(str) {
+ var byteArray = [];
+
+ for (var i = 0; i < str.length; ++i) {
+ // Node's code seems to be doing this and not & 0x7F..
+ byteArray.push(str.charCodeAt(i) & 0xFF);
+ }
+
+ return byteArray;
+ }
+
+ function utf16leToBytes(str, units) {
+ var c, hi, lo;
+ var byteArray = [];
+
+ for (var i = 0; i < str.length; ++i) {
+ if ((units -= 2) < 0) break;
+ c = str.charCodeAt(i);
+ hi = c >> 8;
+ lo = c % 256;
+ byteArray.push(lo);
+ byteArray.push(hi);
+ }
+
+ return byteArray;
+ }
+
+ function base64ToBytes(str) {
+ return toByteArray(base64clean(str));
+ }
+
+ function blitBuffer(src, dst, offset, length) {
+ for (var i = 0; i < length; ++i) {
+ if (i + offset >= dst.length || i >= src.length) break;
+ dst[i + offset] = src[i];
+ }
+
+ return i;
+ }
+
+ function isnan(val) {
+ return val !== val; // eslint-disable-line no-self-compare
+ } // the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence
+ // The _isBuffer check is for Safari 5-7 support, because it's missing
+ // Object.prototype.constructor. Remove this eventually
+
+
+ function isBuffer(obj) {
+ return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj));
+ }
+
+ function isFastBuffer(obj) {
+ return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj);
+ } // For Node v0.10 support. Remove this eventually.
+
+
+ function isSlowBuffer(obj) {
+ return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0));
+ }
+
+ var bufferEs6 = /*#__PURE__*/Object.freeze({
+ __proto__: null,
+ Buffer: Buffer,
+ INSPECT_MAX_BYTES: INSPECT_MAX_BYTES,
+ SlowBuffer: SlowBuffer,
+ isBuffer: isBuffer,
+ kMaxLength: _kMaxLength
+ });
+
+ var jspdf_min = createCommonjsModule(function (module) {
+ /**
+ * jsPDF - PDF Document creation from JavaScript
+ * Version 1.0.150-git Built on 2014-05-30T00:40
+ * CommitID dcbc9fcb9b
+ *
+ * Copyright (c) 2010-2014 James Hall, https://github.com/MrRio/jsPDF
+ * 2010 Aaron Spike, https://github.com/acspike
+ * 2012 Willow Systems Corporation, willow-systems.com
+ * 2012 Pablo Hess, https://github.com/pablohess
+ * 2012 Florian Jenett, https://github.com/fjenett
+ * 2013 Warren Weckesser, https://github.com/warrenweckesser
+ * 2013 Youssef Beddad, https://github.com/lifof
+ * 2013 Lee Driscoll, https://github.com/lsdriscoll
+ * 2013 Stefan Slonevskiy, https://github.com/stefslon
+ * 2013 Jeremy Morel, https://github.com/jmorel
+ * 2013 Christoph Hartmann, https://github.com/chris-rock
+ * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
+ * 2014 James Makes, https://github.com/dollaruw
+ * 2014 Diego Casorran, https://github.com/diegocr
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Contributor(s):
+ * siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
+ * kim3er, mfo, alnorth,
+ */
+
+ /**
+ * jsPDF addHTML PlugIn
+ * Copyright (c) 2014 Diego Casorran
+ * Licensed under the MIT License.
+ * http://opensource.org/licenses/mit-license
+ */
+
+ /**
+ * jsPDF addImage plugin
+ * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/
+ * 2013 Chris Dowling, https://github.com/gingerchris
+ * 2013 Trinh Ho, https://github.com/ineedfat
+ * 2013 Edwin Alejandro Perez, https://github.com/eaparango
+ * 2013 Norah Smith, https://github.com/burnburnrocket
+ * 2014 Diego Casorran, https://github.com/diegocr
+ * 2014 James Robb, https://github.com/jamesbrobb
+ */
+
+ /**
+ * jsPDF Cell plugin
+ * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com
+ * 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br
+ * 2013 Lee Driscoll, https://github.com/lsdriscoll
+ * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
+ * 2014 James Hall, james@parall.ax
+ * 2014 Diego Casorran, https://github.com/diegocr
+ */
+
+ /**
+ * jsPDF fromHTML plugin. BETA stage. API subject to change. Needs browser
+ * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
+ * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
+ * 2014 Diego Casorran, https://github.com/diegocr
+ * 2014 Daniel Husar, https://github.com/danielhusar
+ * 2014 Wolfgang Gassler, https://github.com/woolfg
+ */
+
+ /**
+ * jsPDF JavaScript plugin
+ * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com
+ */
+
+ /**
+ * jsPDF PNG PlugIn
+ * Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
+ */
+
+ /**
+ jsPDF Silly SVG plugin
+ Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
+ */
+
+ /**
+ * jsPDF split_text_to_size plugin - MIT license.
+ * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
+ * 2014 Diego Casorran, https://github.com/diegocr
+ */
+
+ /**
+ jsPDF standard_fonts_metrics plugin
+ Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
+ MIT license.
+ */
+
+ /**
+ * jsPDF total_pages plugin
+ * Copyright (c) 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br
+ */
+
+ /* Blob.js
+ * A Blob implementation.
+ * 2014-05-27
+ * By Eli Grey, http://eligrey.com
+ * By Devin Samarin, https://github.com/eboyjr
+ * License: X11/MIT
+ * See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
+ */
+
+ /* FileSaver.js
+ * A saveAs() FileSaver implementation.
+ * 2014-05-27
+ * By Eli Grey, http://eligrey.com
+ * License: X11/MIT
+ * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md
+ */
+
+ /*
+ * Copyright (c) 2012 chick307
+ * Licensed under the MIT License.
+ * http://opensource.org/licenses/mit-license
+ */
+
+ /*
+ Deflate.js - https://github.com/gildas-lormeau/zip.js
+ Copyright (c) 2013 Gildas Lormeau. All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the distribution.
+ 3. The names of the authors may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
+ INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+ /*
+ # PNG.js
+ # Copyright (c) 2011 Devon Govett
+ # MIT LICENSE
+ #
+ */
+
+ /*
+ * Extracted from pdf.js
+ * https://github.com/andreasgal/pdf.js
+ * Copyright (c) 2011 Mozilla Foundation
+ * Contributors: Andreas Gal
+ * Chris G Jones
+ * Shaon Barman
+ * Vivien Nicolas <21@vingtetun.org>
+ * Justin D'Arcangelo
+ * Yury Delendik
+ */
+
+ /**
+ * JavaScript Polyfill functions for jsPDF
+ * Collected from public resources by
+ * https://github.com/diegocr
+ */
+ !function (t, e) {
+ e["true"] = t;
+
+ var r = function (t) {
+
+ function e(e) {
+ var r = {};
+ this.subscribe = function (t, e, n) {
+ if ("function" != typeof e) return !1;
+ r.hasOwnProperty(t) || (r[t] = {});
+ var s = Math.random().toString(35);
+ return r[t][s] = [e, !!n], s;
+ }, this.unsubscribe = function (t) {
+ for (var e in r) {
+ if (r[e][t]) return delete r[e][t], !0;
+ }
+
+ return !1;
+ }, this.publish = function (n) {
+ if (r.hasOwnProperty(n)) {
+ var s = Array.prototype.slice.call(arguments, 1),
+ o = [];
+
+ for (var i in r[n]) {
+ var a = r[n][i];
+
+ try {
+ a[0].apply(e, s);
+ } catch (u) {
+ t.console && console.error("jsPDF PubSub Error", u.message, u);
+ }
+
+ a[1] && o.push(i);
+ }
+
+ o.length && o.forEach(this.unsubscribe);
+ }
+ };
+ }
+
+ function r(a, u, c, l) {
+ var f = {};
+ "object" == _typeof(a) && (f = a, a = f.orientation, u = f.unit || u, c = f.format || c, l = f.compress || f.compressPdf || l), u = u || "mm", c = c || "a4", a = ("" + (a || "P")).toLowerCase();
+
+ var d,
+ h,
+ p,
+ m,
+ w,
+ y = ("" + c).toLowerCase(),
+ g = !!l && "function" == typeof Uint8Array,
+ v = f.textColor || "0 g",
+ b = f.drawColor || "0 G",
+ q = f.fontSize || 16,
+ x = f.lineHeight || 1.15,
+ k = f.lineWidth || .200025,
+ _ = 2,
+ A = !1,
+ C = [],
+ S = {},
+ E = {},
+ z = 0,
+ I = [],
+ T = [],
+ B = 0,
+ O = 0,
+ P = 0,
+ R = {
+ title: "",
+ subject: "",
+ author: "",
+ keywords: "",
+ creator: ""
+ },
+ D = {},
+ U = new e(D),
+ F = function F(t) {
+ return t.toFixed(2);
+ },
+ L = function L(t) {
+ return t.toFixed(3);
+ },
+ j = function j(t) {
+ return ("0" + parseInt(t)).slice(-2);
+ },
+ N = function N(t) {
+ A ? I[z].push(t) : (P += t.length + 1, T.push(t));
+ },
+ M = function M() {
+ return _++, C[_] = P, N(_ + " 0 obj"), _;
+ },
+ H = function H(t) {
+ N("stream"), N(t), N("endstream");
+ },
+ G = function G() {
+ var e,
+ n,
+ o,
+ i,
+ a,
+ u,
+ c,
+ l = m * h,
+ f = w * h;
+
+ for (c = t.adler32cs || r.adler32cs, g && "undefined" == typeof c && (g = !1), e = 1; z >= e; e++) {
+ if (M(), N("<>"), N("endobj"), n = I[e].join("\n"), M(), g) {
+ for (o = [], i = n.length; i--;) {
+ o[i] = n.charCodeAt(i);
+ }
+
+ u = c.from(n), a = new s(6), a.append(new Uint8Array(o)), n = a.flush(), o = new Uint8Array(n.length + 6), o.set(new Uint8Array([120, 156])), o.set(n, 2), o.set(new Uint8Array([255 & u, u >> 8 & 255, u >> 16 & 255, u >> 24 & 255]), n.length + 2), n = String.fromCharCode.apply(null, o), N("<>");
+ } else N("<>");
+
+ H(n), N("endobj");
+ }
+
+ C[1] = P, N("1 0 obj"), N("< i; i++) {
+ d += 3 + 2 * i + " 0 R ";
+ }
+
+ N(d + "]"), N("/Count " + z), N("/MediaBox [0 0 " + F(l) + " " + F(f) + "]"), N(">>"), N("endobj");
+ },
+ J = function J(t) {
+ t.objectNumber = M(), N("<>"), N("endobj");
+ },
+ V = function V() {
+ for (var t in S) {
+ S.hasOwnProperty(t) && J(S[t]);
+ }
+ },
+ W = function W() {
+ U.publish("putXobjectDict");
+ },
+ X = function X() {
+ N("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"), N("/Font <<");
+
+ for (var t in S) {
+ S.hasOwnProperty(t) && N("/" + t + " " + S[t].objectNumber + " 0 R");
+ }
+
+ N(">>"), N("/XObject <<"), W(), N(">>");
+ },
+ Y = function Y() {
+ V(), U.publish("putResources"), C[2] = P, N("2 0 obj"), N("<<"), X(), N(">>"), N("endobj"), U.publish("postPutResources");
+ },
+ K = function K(t, e, r) {
+ E.hasOwnProperty(e) || (E[e] = {}), E[e][r] = t;
+ },
+ Q = function Q(t, e, r, n) {
+ var s = "F" + (Object.keys(S).length + 1).toString(10),
+ o = S[s] = {
+ id: s,
+ PostScriptName: t,
+ fontName: e,
+ fontStyle: r,
+ encoding: n,
+ metadata: {}
+ };
+ return K(s, e, r), U.publish("addFont", o), s;
+ },
+ $ = function $() {
+ for (var t = "helvetica", e = "times", r = "courier", n = "normal", s = "bold", o = "italic", i = "bolditalic", a = "StandardEncoding", u = [["Helvetica", t, n], ["Helvetica-Bold", t, s], ["Helvetica-Oblique", t, o], ["Helvetica-BoldOblique", t, i], ["Courier", r, n], ["Courier-Bold", r, s], ["Courier-Oblique", r, o], ["Courier-BoldOblique", r, i], ["Times-Roman", e, n], ["Times-Bold", e, s], ["Times-Italic", e, o], ["Times-BoldItalic", e, i]], c = 0, l = u.length; l > c; c++) {
+ var f = Q(u[c][0], u[c][1], u[c][2], a),
+ d = u[c][0].split("-");
+ K(f, d[0], d[1] || "");
+ }
+
+ U.publish("addFonts", {
+ fonts: S,
+ dictionary: E
+ });
+ },
+ Z = function Z(e) {
+ return e.foo = function () {
+ try {
+ return e.apply(this, arguments);
+ } catch (r) {
+ var n = r.stack || "";
+ ~n.indexOf(" at ") && (n = n.split(" at ")[1]);
+ var s = "Error in function " + n.split("\n")[0].split("<")[0] + ": " + r.message;
+ if (!t.console) throw new Error(s);
+ console.log(s, r), t.alert && alert(s), console.trace();
+ }
+ }, e.foo.bar = e, e.foo;
+ },
+ te = function te(t, e) {
+ var r, n, s, o, i, a, u, c, l;
+
+ if (e = e || {}, s = e.sourceEncoding || "Unicode", i = e.outputEncoding, (e.autoencode || i) && S[d].metadata && S[d].metadata[s] && S[d].metadata[s].encoding && (o = S[d].metadata[s].encoding, !i && S[d].encoding && (i = S[d].encoding), !i && o.codePages && (i = o.codePages[0]), "string" == typeof i && (i = o[i]), i)) {
+ for (u = !1, a = [], r = 0, n = t.length; n > r; r++) {
+ c = i[t.charCodeAt(r)], c ? a.push(String.fromCharCode(c)) : a.push(t[r]), a[r].charCodeAt(0) >> 8 && (u = !0);
+ }
+
+ t = a.join("");
+ }
+
+ for (r = t.length; void 0 === u && 0 !== r;) {
+ t.charCodeAt(r - 1) >> 8 && (u = !0), r--;
+ }
+
+ if (!u) return t;
+
+ for (a = e.noBOM ? [] : [254, 255], r = 0, n = t.length; n > r; r++) {
+ if (c = t.charCodeAt(r), l = c >> 8, l >> 8) throw new Error("Character at position " + r + " of string '" + t + "' exceeds 16bits. Cannot be encoded into UCS-2 BE");
+ a.push(l), a.push(c - (l << 8));
+ }
+
+ return String.fromCharCode.apply(void 0, a);
+ },
+ ee = function ee(t, e) {
+ return te(t, e).replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
+ },
+ re = function re() {
+ N("/Producer (jsPDF " + r.version + ")");
+
+ for (var t in R) {
+ R.hasOwnProperty(t) && R[t] && N("/" + t.substr(0, 1).toUpperCase() + t.substr(1) + " (" + ee(R[t]) + ")");
+ }
+
+ var e = new Date();
+ N(["/CreationDate (D:", e.getFullYear(), j(e.getMonth() + 1), j(e.getDate()), j(e.getHours()), j(e.getMinutes()), j(e.getSeconds()), ")"].join(""));
+ },
+ ne = function ne() {
+ N("/Type /Catalog"), N("/Pages 1 0 R"), N("/OpenAction [3 0 R /FitH null]"), N("/PageLayout /OneColumn"), U.publish("putCatalog");
+ },
+ se = function se() {
+ N("/Size " + (_ + 1)), N("/Root " + _ + " 0 R"), N("/Info " + (_ - 1) + " 0 R");
+ },
+ oe = function oe() {
+ z++, A = !0, I[z] = [];
+ },
+ ie = function ie() {
+ oe(), N(F(k * h) + " w"), N(b), 0 !== B && N(B + " J"), 0 !== O && N(O + " j"), U.publish("addPage", {
+ pageNumber: z
+ });
+ },
+ ae = function ae(t, e) {
+ var r;
+ t = void 0 !== t ? t : S[d].fontName, e = void 0 !== e ? e : S[d].fontStyle;
+
+ try {
+ r = E[t][e] || E[t].normal;
+ } catch (n) {}
+
+ if (!r) throw new Error("Unable to look up font label for font '" + t + "', '" + e + "'. Refer to getFontList() for available fonts.");
+ return r;
+ },
+ ue = function ue() {
+ A = !1, _ = 2, T = [], C = [], N("%PDF-" + o), G(), Y(), M(), N("<<"), re(), N(">>"), N("endobj"), M(), N("<<"), ne(), N(">>"), N("endobj");
+ var t,
+ e = P,
+ r = "0000000000";
+
+ for (N("xref"), N("0 " + (_ + 1)), N(r + " 65535 f "), t = 1; _ >= t; t++) {
+ N((r + C[t]).slice(-10) + " 00000 n ");
+ }
+
+ return N("trailer"), N("<<"), se(), N(">>"), N("startxref"), N(e), N("%%EOF"), A = !0, T.join("\n");
+ },
+ ce = function ce(t) {
+ var e = "S";
+ return "F" === t ? e = "f" : "FD" === t || "DF" === t ? e = "B" : ("f" === t || "f*" === t || "B" === t || "B*" === t) && (e = t), e;
+ },
+ le = function le() {
+ for (var t = ue(), e = t.length, r = new ArrayBuffer(e), n = new Uint8Array(r); e--;) {
+ n[e] = t.charCodeAt(e);
+ }
+
+ return r;
+ },
+ fe = function fe() {
+ return new Blob([le()], {
+ type: "application/pdf"
+ });
+ },
+ de = Z(function (e, r) {
+ switch (e) {
+ case void 0:
+ return ue();
+
+ case "save":
+ if (navigator.getUserMedia && (void 0 === t.URL || void 0 === t.URL.createObjectURL)) return D.output("dataurlnewwindow");
+ n(fe(), r), "function" == typeof n.unload && t.setTimeout && setTimeout(n.unload, 70);
+ break;
+
+ case "arraybuffer":
+ return le();
+
+ case "blob":
+ return fe();
+
+ case "datauristring":
+ case "dataurlstring":
+ return "data:application/pdf;base64," + btoa(ue());
+
+ case "datauri":
+ case "dataurl":
+ t.document.location.href = "data:application/pdf;base64," + btoa(ue());
+ break;
+
+ case "dataurlnewwindow":
+ t.open("data:application/pdf;base64," + btoa(ue()));
+ break;
+
+ default:
+ throw new Error('Output type "' + e + '" is not supported.');
+ }
+ });
+
+ switch (u) {
+ case "pt":
+ h = 1;
+ break;
+
+ case "mm":
+ h = 72 / 25.4;
+ break;
+
+ case "cm":
+ h = 72 / 2.54;
+ break;
+
+ case "in":
+ h = 72;
+ break;
+
+ case "px":
+ h = 96 / 72;
+ break;
+
+ case "pc":
+ h = 12;
+ break;
+
+ case "em":
+ h = 12;
+ break;
+
+ case "ex":
+ h = 6;
+ break;
+
+ default:
+ throw "Invalid unit: " + u;
+ }
+
+ if (i.hasOwnProperty(y)) w = i[y][1] / h, m = i[y][0] / h;else try {
+ w = c[1], m = c[0];
+ } catch (he) {
+ throw new Error("Invalid format: " + c);
+ }
+ if ("p" === a || "portrait" === a) a = "p", m > w && (p = m, m = w, w = p);else {
+ if ("l" !== a && "landscape" !== a) throw "Invalid orientation: " + a;
+ a = "l", w > m && (p = m, m = w, w = p);
+ }
+ D.internal = {
+ pdfEscape: ee,
+ getStyle: ce,
+ getFont: function getFont() {
+ return S[ae.apply(D, arguments)];
+ },
+ getFontSize: function getFontSize() {
+ return q;
+ },
+ getLineHeight: function getLineHeight() {
+ return q * x;
+ },
+ write: function write(t) {
+ N(1 === arguments.length ? t : Array.prototype.join.call(arguments, " "));
+ },
+ getCoordinateString: function getCoordinateString(t) {
+ return F(t * h);
+ },
+ getVerticalCoordinateString: function getVerticalCoordinateString(t) {
+ return F((w - t) * h);
+ },
+ collections: {},
+ newObject: M,
+ putStream: H,
+ events: U,
+ scaleFactor: h,
+ pageSize: {
+ width: m,
+ height: w
+ },
+ output: function output(t, e) {
+ return de(t, e);
+ },
+ getNumberOfPages: function getNumberOfPages() {
+ return I.length - 1;
+ },
+ pages: I
+ }, D.addPage = function () {
+ return ie(), this;
+ }, D.text = function (t, e, r, n, s) {
+ function o(t) {
+ return t = t.split(" ").join(Array(f.TabLen || 9).join(" ")), ee(t, n);
+ }
+
+ "number" == typeof t && (p = r, r = e, e = t, t = p), "string" == typeof t && t.match(/[\n\r]/) && (t = t.split(/\r\n|\r|\n/g)), "number" == typeof n && (s = n, n = null);
+ var i = "",
+ a = "Td";
+
+ if (s) {
+ s *= Math.PI / 180;
+ var u = Math.cos(s),
+ c = Math.sin(s);
+ i = [F(u), F(c), F(-1 * c), F(u), ""].join(" "), a = "Tm";
+ }
+
+ if (n = n || {}, "noBOM" in n || (n.noBOM = !0), "autoencode" in n || (n.autoencode = !0), "string" == typeof t) t = o(t);else {
+ if (!(t instanceof Array)) throw new Error('Type of text must be string or Array. "' + t + '" is not recognized.');
+
+ for (var l = t.concat(), m = [], y = l.length; y--;) {
+ m.push(o(l.shift()));
+ }
+
+ t = m.join(") Tj\nT* (");
+ }
+ return N("BT\n/" + d + " " + q + " Tf\n" + q * x + " TL\n" + v + "\n" + i + F(e * h) + " " + F((w - r) * h) + " " + a + "\n(" + t + ") Tj\nET"), this;
+ }, D.line = function (t, e, r, n) {
+ return this.lines([[r - t, n - e]], t, e);
+ }, D.lines = function (t, e, r, n, s, o) {
+ var i, a, u, c, l, f, d, m, y, g, v;
+
+ for ("number" == typeof t && (p = r, r = e, e = t, t = p), n = n || [1, 1], N(L(e * h) + " " + L((w - r) * h) + " m "), i = n[0], a = n[1], c = t.length, g = e, v = r, u = 0; c > u; u++) {
+ l = t[u], 2 === l.length ? (g = l[0] * i + g, v = l[1] * a + v, N(L(g * h) + " " + L((w - v) * h) + " l")) : (f = l[0] * i + g, d = l[1] * a + v, m = l[2] * i + g, y = l[3] * a + v, g = l[4] * i + g, v = l[5] * a + v, N(L(f * h) + " " + L((w - d) * h) + " " + L(m * h) + " " + L((w - y) * h) + " " + L(g * h) + " " + L((w - v) * h) + " c"));
+ }
+
+ return o && N(" h"), null !== s && N(ce(s)), this;
+ }, D.rect = function (t, e, r, n, s) {
+ ce(s);
+ return N([F(t * h), F((w - e) * h), F(r * h), F(-n * h), "re"].join(" ")), null !== s && N(ce(s)), this;
+ }, D.triangle = function (t, e, r, n, s, o, i) {
+ return this.lines([[r - t, n - e], [s - r, o - n], [t - s, e - o]], t, e, [1, 1], i, !0), this;
+ }, D.roundedRect = function (t, e, r, n, s, o, i) {
+ var a = 4 / 3 * (Math.SQRT2 - 1);
+ return this.lines([[r - 2 * s, 0], [s * a, 0, s, o - o * a, s, o], [0, n - 2 * o], [0, o * a, -(s * a), o, -s, o], [-r + 2 * s, 0], [-(s * a), 0, -s, -(o * a), -s, -o], [0, -n + 2 * o], [0, -(o * a), s * a, -o, s, -o]], t + s, e, [1, 1], i), this;
+ }, D.ellipse = function (t, e, r, n, s) {
+ var o = 4 / 3 * (Math.SQRT2 - 1) * r,
+ i = 4 / 3 * (Math.SQRT2 - 1) * n;
+ return N([F((t + r) * h), F((w - e) * h), "m", F((t + r) * h), F((w - (e - i)) * h), F((t + o) * h), F((w - (e - n)) * h), F(t * h), F((w - (e - n)) * h), "c"].join(" ")), N([F((t - o) * h), F((w - (e - n)) * h), F((t - r) * h), F((w - (e - i)) * h), F((t - r) * h), F((w - e) * h), "c"].join(" ")), N([F((t - r) * h), F((w - (e + i)) * h), F((t - o) * h), F((w - (e + n)) * h), F(t * h), F((w - (e + n)) * h), "c"].join(" ")), N([F((t + o) * h), F((w - (e + n)) * h), F((t + r) * h), F((w - (e + i)) * h), F((t + r) * h), F((w - e) * h), "c"].join(" ")), null !== s && N(ce(s)), this;
+ }, D.circle = function (t, e, r, n) {
+ return this.ellipse(t, e, r, r, n);
+ }, D.setProperties = function (t) {
+ for (var e in R) {
+ R.hasOwnProperty(e) && t[e] && (R[e] = t[e]);
+ }
+
+ return this;
+ }, D.setFontSize = function (t) {
+ return q = t, this;
+ }, D.setFont = function (t, e) {
+ return d = ae(t, e), this;
+ }, D.setFontStyle = D.setFontType = function (t) {
+ return d = ae(void 0, t), this;
+ }, D.getFontList = function () {
+ var t,
+ e,
+ r,
+ n = {};
+
+ for (t in E) {
+ if (E.hasOwnProperty(t)) {
+ n[t] = r = [];
+
+ for (e in E[t]) {
+ E[t].hasOwnProperty(e) && r.push(e);
+ }
+ }
+ }
+
+ return n;
+ }, D.setLineWidth = function (t) {
+ return N((t * h).toFixed(2) + " w"), this;
+ }, D.setDrawColor = function (t, e, r, n) {
+ var s;
+ return s = void 0 === e || void 0 === n && t === e === r ? "string" == typeof t ? t + " G" : F(t / 255) + " G" : void 0 === n ? "string" == typeof t ? [t, e, r, "RG"].join(" ") : [F(t / 255), F(e / 255), F(r / 255), "RG"].join(" ") : "string" == typeof t ? [t, e, r, n, "K"].join(" ") : [F(t), F(e), F(r), F(n), "K"].join(" "), N(s), this;
+ }, D.setFillColor = function (t, e, r, n) {
+ var s;
+ return s = void 0 === e || void 0 === n && t === e === r ? "string" == typeof t ? t + " g" : F(t / 255) + " g" : void 0 === n ? "string" == typeof t ? [t, e, r, "rg"].join(" ") : [F(t / 255), F(e / 255), F(r / 255), "rg"].join(" ") : "string" == typeof t ? [t, e, r, n, "k"].join(" ") : [F(t), F(e), F(r), F(n), "k"].join(" "), N(s), this;
+ }, D.setTextColor = function (t, e, r) {
+ if ("string" == typeof t && /^#[0-9A-Fa-f]{6}$/.test(t)) {
+ var n = parseInt(t.substr(1), 16);
+ t = n >> 16 & 255, e = n >> 8 & 255, r = 255 & n;
+ }
+
+ return v = 0 === t && 0 === e && 0 === r || "undefined" == typeof e ? L(t / 255) + " g" : [L(t / 255), L(e / 255), L(r / 255), "rg"].join(" "), this;
+ }, D.CapJoinStyles = {
+ 0: 0,
+ butt: 0,
+ but: 0,
+ miter: 0,
+ 1: 1,
+ round: 1,
+ rounded: 1,
+ circle: 1,
+ 2: 2,
+ projecting: 2,
+ project: 2,
+ square: 2,
+ bevel: 2
+ }, D.setLineCap = function (t) {
+ var e = this.CapJoinStyles[t];
+ if (void 0 === e) throw new Error("Line cap style of '" + t + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
+ return B = e, N(e + " J"), this;
+ }, D.setLineJoin = function (t) {
+ var e = this.CapJoinStyles[t];
+ if (void 0 === e) throw new Error("Line join style of '" + t + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
+ return O = e, N(e + " j"), this;
+ }, D.output = de, D.save = function (t) {
+ D.output("save", t);
+ };
+
+ for (var pe in r.API) {
+ r.API.hasOwnProperty(pe) && ("events" === pe && r.API.events.length ? !function (t, e) {
+ var r, n, s;
+
+ for (s = e.length - 1; -1 !== s; s--) {
+ r = e[s][0], n = e[s][1], t.subscribe.apply(t, [r].concat("function" == typeof n ? [n] : n));
+ }
+ }(U, r.API.events) : D[pe] = r.API[pe]);
+ }
+
+ return $(), d = "F1", ie(), U.publish("initialized"), D;
+ }
+
+ var o = "1.3",
+ i = {
+ a0: [2383.94, 3370.39],
+ a1: [1683.78, 2383.94],
+ a2: [1190.55, 1683.78],
+ a3: [841.89, 1190.55],
+ a4: [595.28, 841.89],
+ a5: [419.53, 595.28],
+ a6: [297.64, 419.53],
+ a7: [209.76, 297.64],
+ a8: [147.4, 209.76],
+ a9: [104.88, 147.4],
+ a10: [73.7, 104.88],
+ b0: [2834.65, 4008.19],
+ b1: [2004.09, 2834.65],
+ b2: [1417.32, 2004.09],
+ b3: [1000.63, 1417.32],
+ b4: [708.66, 1000.63],
+ b5: [498.9, 708.66],
+ b6: [354.33, 498.9],
+ b7: [249.45, 354.33],
+ b8: [175.75, 249.45],
+ b9: [124.72, 175.75],
+ b10: [87.87, 124.72],
+ c0: [2599.37, 3676.54],
+ c1: [1836.85, 2599.37],
+ c2: [1298.27, 1836.85],
+ c3: [918.43, 1298.27],
+ c4: [649.13, 918.43],
+ c5: [459.21, 649.13],
+ c6: [323.15, 459.21],
+ c7: [229.61, 323.15],
+ c8: [161.57, 229.61],
+ c9: [113.39, 161.57],
+ c10: [79.37, 113.39],
+ dl: [311.81, 623.62],
+ letter: [612, 792],
+ "government-letter": [576, 756],
+ legal: [612, 1008],
+ "junior-legal": [576, 360],
+ ledger: [1224, 792],
+ tabloid: [792, 1224],
+ "credit-card": [153, 243]
+ };
+ return r.API = {
+ events: []
+ }, r.version = "1.0.150-git 2014-05-30T00:40:diegocr", t.jsPDF = r, r;
+ }("undefined" != typeof self && self || "undefined" != typeof window && window || this);
+
+ !function (t) {
+
+ t.addHTML = function (t, e, r, n, s) {
+ if ("undefined" == typeof html2canvas && "undefined" == typeof rasterizeHTML) throw new Error("You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js");
+ "number" != typeof e && (n = e, s = r), "function" == typeof n && (s = n, n = null);
+ var o = this.internal,
+ i = o.scaleFactor,
+ a = o.pageSize.width,
+ u = o.pageSize.height;
+ if (n = n || {}, n.onrendered = function (t) {
+ e = parseInt(e) || 0, r = parseInt(r) || 0;
+ var o = n.dim || {},
+ c = o.h || 0,
+ l = o.w || Math.min(a, t.width / i) - e,
+ f = "JPEG";
+
+ if (n.format && (f = n.format), t.height > u && n.pagesplit) {
+ var d = function () {
+ for (var n = 0;;) {
+ var o = document.createElement("canvas");
+ o.width = Math.min(a * i, t.width), o.height = Math.min(u * i, t.height - n);
+ var c = o.getContext("2d");
+ c.drawImage(t, 0, n, t.width, o.height, 0, 0, o.width, o.height);
+ var d = [o, e, n ? 0 : r, o.width / i, o.height / i, f, null, "SLOW"];
+ if (this.addImage.apply(this, d), n += o.height, n >= t.height) break;
+ this.addPage();
+ }
+
+ s(l, n, null, d);
+ }.bind(this);
+
+ if ("CANVAS" === t.nodeName) {
+ var h = new Image();
+ h.onload = d, h.src = t.toDataURL("image/png"), t = h;
+ } else d();
+ } else {
+ var p = Math.random().toString(35),
+ m = [t, e, r, l, c, f, p, "SLOW"];
+ this.addImage.apply(this, m), s(l, c, p, m);
+ }
+ }.bind(this), "undefined" != typeof html2canvas && !n.rstz) return html2canvas(t, n);
+
+ if ("undefined" != typeof rasterizeHTML) {
+ var c = "drawDocument";
+ return "string" == typeof t && (c = /^http/.test(t) ? "drawURL" : "drawHTML"), n.width = n.width || a * i, rasterizeHTML[c](t, void 0, n).then(function (t) {
+ n.onrendered(t.image);
+ }, function (t) {
+ s(null, t);
+ });
+ }
+
+ return null;
+ };
+ }(r.API), function (t) {
+
+ var e = "addImage_",
+ r = ["jpeg", "jpg", "png"],
+ n = function n(t) {
+ var e = this.internal.newObject(),
+ r = this.internal.write,
+ s = this.internal.putStream;
+
+ if (t.n = e, r("<>"), "trns" in t && t.trns.constructor == Array) {
+ for (var o = "", i = 0, a = t.trns.length; a > i; i++) {
+ o += t.trns[i] + " " + t.trns[i] + " ";
+ }
+
+ r("/Mask [" + o + "]");
+ }
+
+ if ("smask" in t && r("/SMask " + (e + 1) + " 0 R"), r("/Length " + t.data.length + ">>"), s(t.data), r("endobj"), "smask" in t) {
+ var u = "/Predictor 15 /Colors 1 /BitsPerComponent " + t.bpc + " /Columns " + t.w,
+ c = {
+ w: t.w,
+ h: t.h,
+ cs: "DeviceGray",
+ bpc: t.bpc,
+ dp: u,
+ data: t.smask
+ };
+ "f" in t && (c.f = t.f), n.call(this, c);
+ }
+
+ t.cs === this.color_spaces.INDEXED && (this.internal.newObject(), r("<< /Length " + t.pal.length + ">>"), s(this.arrayBufferToBinaryString(new Uint8Array(t.pal))), r("endobj"));
+ },
+ s = function s() {
+ var t = this.internal.collections[e + "images"];
+
+ for (var r in t) {
+ n.call(this, t[r]);
+ }
+ },
+ o = function o() {
+ var t,
+ r = this.internal.collections[e + "images"],
+ n = this.internal.write;
+
+ for (var s in r) {
+ t = r[s], n("/I" + t.i, t.n, "0", "R");
+ }
+ },
+ i = function i(e) {
+ return e && "string" == typeof e && (e = e.toUpperCase()), e in t.image_compression ? e : t.image_compression.NONE;
+ },
+ a = function a() {
+ var t = this.internal.collections[e + "images"];
+ return t || (this.internal.collections[e + "images"] = t = {}, this.internal.events.subscribe("putResources", s), this.internal.events.subscribe("putXobjectDict", o)), t;
+ },
+ u = function u(t) {
+ var e = 0;
+ return t && (e = Object.keys ? Object.keys(t).length : function (t) {
+ var e = 0;
+
+ for (var r in t) {
+ t.hasOwnProperty(r) && e++;
+ }
+
+ return e;
+ }(t)), e;
+ },
+ c = function c(t) {
+ return "undefined" == typeof t || null === t;
+ },
+ l = function l() {
+ return void 0;
+ },
+ f = function f(t) {
+ return -1 === r.indexOf(t);
+ },
+ d = function d(e) {
+ return "function" != typeof t["process" + e.toUpperCase()];
+ },
+ h = function h(t) {
+ return "object" == _typeof(t) && 1 === t.nodeType;
+ },
+ p = function p(t, e) {
+ if ("IMG" === t.nodeName && t.hasAttribute("src") && 0 === ("" + t.getAttribute("src")).indexOf("data:image/")) return t.getAttribute("src");
+ if ("CANVAS" === t.nodeName) var r = t;else {
+ var r = document.createElement("canvas");
+ r.width = t.clientWidth || t.width, r.height = t.clientHeight || t.height;
+ var n = r.getContext("2d");
+ if (!n) throw "addImage requires canvas to be supported by browser.";
+ n.drawImage(t, 0, 0, r.width, r.height);
+ }
+ return r.toDataURL("png" == e ? "image/png" : "image/jpeg");
+ },
+ m = function m(t, e) {
+ var r;
+ if (e) for (var n in e) {
+ if (t === e[n].alias) {
+ r = e[n];
+ break;
+ }
+ }
+ return r;
+ },
+ w = function w(t, e, r) {
+ return t || e || (t = -96, e = -96), 0 > t && (t = -1 * r.w * 72 / t / this.internal.scaleFactor), 0 > e && (e = -1 * r.h * 72 / e / this.internal.scaleFactor), 0 === t && (t = e * r.w / r.h), 0 === e && (e = t * r.h / r.w), [t, e];
+ },
+ y = function y(t, e, r, n, s, o, i) {
+ var a = w.call(this, r, n, s),
+ u = this.internal.getCoordinateString,
+ c = this.internal.getVerticalCoordinateString;
+ r = a[0], n = a[1], i[o] = s, this.internal.write("q", u(r), "0 0", u(n), u(t), c(e + n), "cm /I" + s.i, "Do Q");
+ };
+
+ t.color_spaces = {
+ DEVICE_RGB: "DeviceRGB",
+ DEVICE_GRAY: "DeviceGray",
+ DEVICE_CMYK: "DeviceCMYK",
+ CAL_GREY: "CalGray",
+ CAL_RGB: "CalRGB",
+ LAB: "Lab",
+ ICC_BASED: "ICCBased",
+ INDEXED: "Indexed",
+ PATTERN: "Pattern",
+ SEPERATION: "Seperation",
+ DEVICE_N: "DeviceN"
+ }, t.decode = {
+ DCT_DECODE: "DCTDecode",
+ FLATE_DECODE: "FlateDecode",
+ LZW_DECODE: "LZWDecode",
+ JPX_DECODE: "JPXDecode",
+ JBIG2_DECODE: "JBIG2Decode",
+ ASCII85_DECODE: "ASCII85Decode",
+ ASCII_HEX_DECODE: "ASCIIHexDecode",
+ RUN_LENGTH_DECODE: "RunLengthDecode",
+ CCITT_FAX_DECODE: "CCITTFaxDecode"
+ }, t.image_compression = {
+ NONE: "NONE",
+ FAST: "FAST",
+ MEDIUM: "MEDIUM",
+ SLOW: "SLOW"
+ }, t.isString = function (t) {
+ return "string" == typeof t;
+ }, t.extractInfoFromBase64DataURI = function (t) {
+ return /^data:([\w]+?\/([\w]+?));base64,(.+?)$/g.exec(t);
+ }, t.supportsArrayBuffer = function () {
+ return "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array;
+ }, t.isArrayBuffer = function (t) {
+ return this.supportsArrayBuffer() ? t instanceof ArrayBuffer : !1;
+ }, t.isArrayBufferView = function (t) {
+ return this.supportsArrayBuffer() ? "undefined" == typeof Uint32Array ? !1 : t instanceof Int8Array || t instanceof Uint8Array || "undefined" != typeof Uint8ClampedArray && t instanceof Uint8ClampedArray || t instanceof Int16Array || t instanceof Uint16Array || t instanceof Int32Array || t instanceof Uint32Array || t instanceof Float32Array || t instanceof Float64Array : !1;
+ }, t.binaryStringToUint8Array = function (t) {
+ for (var e = t.length, r = new Uint8Array(e), n = 0; e > n; n++) {
+ r[n] = t.charCodeAt(n);
+ }
+
+ return r;
+ }, t.arrayBufferToBinaryString = function (t) {
+ this.isArrayBuffer(t) && (t = new Uint8Array(t));
+
+ for (var e = "", r = t.byteLength, n = 0; r > n; n++) {
+ e += String.fromCharCode(t[n]);
+ }
+
+ return e;
+ }, t.arrayBufferToBase64 = function (t) {
+ for (var e, r, n, s, o, i = "", a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", u = new Uint8Array(t), c = u.byteLength, l = c % 3, f = c - l, d = 0; f > d; d += 3) {
+ o = u[d] << 16 | u[d + 1] << 8 | u[d + 2], e = (16515072 & o) >> 18, r = (258048 & o) >> 12, n = (4032 & o) >> 6, s = 63 & o, i += a[e] + a[r] + a[n] + a[s];
+ }
+
+ return 1 == l ? (o = u[f], e = (252 & o) >> 2, r = (3 & o) << 4, i += a[e] + a[r] + "==") : 2 == l && (o = u[f] << 8 | u[f + 1], e = (64512 & o) >> 10, r = (1008 & o) >> 4, n = (15 & o) << 2, i += a[e] + a[r] + a[n] + "="), i;
+ }, t.createImageInfo = function (t, e, r, n, s, o, i, a, u, c, l, f) {
+ var d = {
+ alias: a,
+ w: e,
+ h: r,
+ cs: n,
+ bpc: s,
+ i: i,
+ data: t
+ };
+ return o && (d.f = o), u && (d.dp = u), c && (d.trns = c), l && (d.pal = l), f && (d.smask = f), d;
+ }, t.addImage = function (t, e, n, s, o, w, g, v) {
+ if ("number" == typeof e) {
+ var b = w;
+ w = o, o = s, s = n, n = e, e = b;
+ }
+
+ var q,
+ x,
+ k = a.call(this);
+
+ if (v = i(v), e = (e || "JPEG").toLowerCase(), c(g) && (g = l()), h(t) && (t = p(t, e)), this.isString(t)) {
+ var _ = this.extractInfoFromBase64DataURI(t);
+
+ _ ? (e = _[2], t = atob(_[3]), this.supportsArrayBuffer() && (x = t, t = this.binaryStringToUint8Array(t))) : 255 !== t.charCodeAt(0) && (q = m(t, k));
+ }
+
+ if (f(e)) throw new Error("addImage currently only supports formats " + r + ", not '" + e + "'");
+ if (d(e)) throw new Error("please ensure that the plugin for '" + e + "' support is added");
+ var A = u(k),
+ C = q;
+ if (C || (C = this["process" + e.toUpperCase()](t, A, g, v, x)), !C) throw new Error("An unkwown error occurred whilst processing the image");
+ return y.call(this, n, s, o, w, C, A, k), this;
+ };
+
+ var g = function g(t) {
+ var e, r;
+ if (255 === !t.charCodeAt(0) || 216 === !t.charCodeAt(1) || 255 === !t.charCodeAt(2) || 224 === !t.charCodeAt(3) || !t.charCodeAt(6) === "J".charCodeAt(0) || !t.charCodeAt(7) === "F".charCodeAt(0) || !t.charCodeAt(8) === "I".charCodeAt(0) || !t.charCodeAt(9) === "F".charCodeAt(0) || 0 === !t.charCodeAt(10)) throw new Error("getJpegSize requires a binary string jpeg file");
+
+ for (var n = 256 * t.charCodeAt(4) + t.charCodeAt(5), s = 4, o = t.length; o > s;) {
+ if (s += n, 255 !== t.charCodeAt(s)) throw new Error("getJpegSize could not find the size of the image");
+ if (192 === t.charCodeAt(s + 1) || 193 === t.charCodeAt(s + 1) || 194 === t.charCodeAt(s + 1) || 195 === t.charCodeAt(s + 1) || 196 === t.charCodeAt(s + 1) || 197 === t.charCodeAt(s + 1) || 198 === t.charCodeAt(s + 1) || 199 === t.charCodeAt(s + 1)) return r = 256 * t.charCodeAt(s + 5) + t.charCodeAt(s + 6), e = 256 * t.charCodeAt(s + 7) + t.charCodeAt(s + 8), [e, r];
+ s += 2, n = 256 * t.charCodeAt(s) + t.charCodeAt(s + 1);
+ }
+ },
+ v = function v(t) {
+ var e = t[0] << 8 | t[1];
+ if (65496 !== e) throw new Error("Supplied data is not a JPEG");
+
+ for (var r, n, s, o = t.length, i = (t[4] << 8) + t[5], a = 4; o > a;) {
+ if (a += i, r = b(t, a), i = (r[2] << 8) + r[3], (192 === r[1] || 194 === r[1]) && 255 === r[0] && i > 7) return r = b(t, a + 5), n = (r[2] << 8) + r[3], s = (r[0] << 8) + r[1], {
+ width: n,
+ height: s
+ };
+ a += 2;
+ }
+
+ throw new Error("getJpegSizeFromBytes could not find the size of the image");
+ },
+ b = function b(t, e) {
+ return t.subarray(e, e + 4);
+ };
+
+ t.processJPEG = function (t, e, r, n, s) {
+ var o,
+ i = this.color_spaces.DEVICE_RGB,
+ a = this.decode.DCT_DECODE,
+ u = 8;
+ return this.isString(t) ? (o = g(t), this.createImageInfo(t, o[0], o[1], i, u, a, e, r)) : (this.isArrayBuffer(t) && (t = new Uint8Array(t)), this.isArrayBufferView(t) ? (o = v(t), t = s || this.arrayBufferToBinaryString(t), this.createImageInfo(t, o.width, o.height, i, u, a, e, r)) : null);
+ }, t.processJPG = function () {
+ return this.processJPEG.apply(this, arguments);
+ };
+ }(r.API), function (t) {
+
+ t.autoPrint = function () {
+ var t;
+ return this.internal.events.subscribe("postPutResources", function () {
+ t = this.internal.newObject(), this.internal.write("<< /S/Named /Type/Action /N/Print >>", "endobj");
+ }), this.internal.events.subscribe("putCatalog", function () {
+ this.internal.write("/OpenAction " + t + " 0 R");
+ }), this;
+ };
+ }(r.API), function (t) {
+
+ var e,
+ r,
+ n,
+ s,
+ o = 3,
+ i = 13,
+ a = {
+ x: void 0,
+ y: void 0,
+ w: void 0,
+ h: void 0,
+ ln: void 0
+ },
+ u = 1,
+ c = function c(t, e, r, n, s) {
+ a = {
+ x: t,
+ y: e,
+ w: r,
+ h: n,
+ ln: s
+ };
+ },
+ l = function l() {
+ return a;
+ },
+ f = {
+ left: 0,
+ top: 0,
+ bottom: 0
+ };
+
+ t.setHeaderFunction = function (t) {
+ s = t;
+ }, t.getTextDimensions = function (t) {
+ e = this.internal.getFont().fontName, r = this.table_font_size || this.internal.getFontSize(), n = this.internal.getFont().fontStyle;
+ var s,
+ o,
+ i = 19.049976 / 25.4;
+ return o = document.createElement("font"), o.id = "jsPDFCell", o.style.fontStyle = n, o.style.fontName = e, o.style.fontSize = r + "pt", o.innerText = t, document.body.appendChild(o), s = {
+ w: (o.offsetWidth + 1) * i,
+ h: (o.offsetHeight + 1) * i
+ }, document.body.removeChild(o), s;
+ }, t.cellAddPage = function () {
+ var t = this.margins || f;
+ this.addPage(), c(t.left, t.top, void 0, void 0), u += 1;
+ }, t.cellInitialize = function () {
+ a = {
+ x: void 0,
+ y: void 0,
+ w: void 0,
+ h: void 0,
+ ln: void 0
+ }, u = 1;
+ }, t.cell = function (t, e, r, n, s, a, u) {
+ var d = l();
+ if (void 0 !== d.ln) if (d.ln === a) t = d.x + d.w, e = d.y;else {
+ var h = this.margins || f;
+ d.y + d.h + n + i >= this.internal.pageSize.height - h.bottom && (this.cellAddPage(), this.printHeaders && this.tableHeaderRow && this.printHeaderRow(a, !0)), e = l().y + l().h;
+ }
+ if (void 0 !== s[0]) if (this.printingHeaderRow ? this.rect(t, e, r, n, "FD") : this.rect(t, e, r, n), "right" === u) {
+ if (s instanceof Array) for (var p = 0; p < s.length; p++) {
+ var m = s[p],
+ w = this.getStringUnitWidth(m) * this.internal.getFontSize();
+ this.text(m, t + r - w - o, e + this.internal.getLineHeight() * (p + 1));
+ }
+ } else this.text(s, t + o, e + this.internal.getLineHeight());
+ return c(t, e, r, n, a), this;
+ }, t.arrayMax = function (t, e) {
+ var r,
+ n,
+ s,
+ o = t[0];
+
+ for (r = 0, n = t.length; n > r; r += 1) {
+ s = t[r], e ? -1 === e(o, s) && (o = s) : s > o && (o = s);
+ }
+
+ return o;
+ }, t.table = function (e, r, n, s, o) {
+ if (!n) throw "No data for PDF table";
+ var i,
+ c,
+ l,
+ d,
+ h,
+ p,
+ m,
+ w,
+ y,
+ g,
+ v = [],
+ b = [],
+ q = {},
+ x = {},
+ k = [],
+ _ = [],
+ A = !1,
+ C = !0,
+ S = 12,
+ E = f;
+ if (E.width = this.internal.pageSize.width, o && (o.autoSize === !0 && (A = !0), o.printHeaders === !1 && (C = !1), o.fontSize && (S = o.fontSize), o.margins && (E = o.margins)), this.lnMod = 0, a = {
+ x: void 0,
+ y: void 0,
+ w: void 0,
+ h: void 0,
+ ln: void 0
+ }, u = 1, this.printHeaders = C, this.margins = E, this.setFontSize(S), this.table_font_size = S, void 0 === s || null === s) v = Object.keys(n[0]);else if (s[0] && "string" != typeof s[0]) {
+ var z = 19.049976 / 25.4;
+
+ for (c = 0, l = s.length; l > c; c += 1) {
+ i = s[c], v.push(i.name), b.push(i.prompt), x[i.name] = i.width * z;
+ }
+ } else v = s;
+ if (A) for (g = function g(t) {
+ return t[i];
+ }, c = 0, l = v.length; l > c; c += 1) {
+ for (i = v[c], q[i] = n.map(g), k.push(this.getTextDimensions(b[c] || i).w), p = q[i], m = 0, d = p.length; d > m; m += 1) {
+ h = p[m], k.push(this.getTextDimensions(h).w);
+ }
+
+ x[i] = t.arrayMax(k);
+ }
+
+ if (C) {
+ var I = this.calculateLineHeight(v, x, b.length ? b : v);
+
+ for (c = 0, l = v.length; l > c; c += 1) {
+ i = v[c], _.push([e, r, x[i], I, String(b.length ? b[c] : i)]);
+ }
+
+ this.setTableHeaderRow(_), this.printHeaderRow(1, !1);
+ }
+
+ for (c = 0, l = n.length; l > c; c += 1) {
+ var I;
+
+ for (w = n[c], I = this.calculateLineHeight(v, x, w), m = 0, y = v.length; y > m; m += 1) {
+ i = v[m], this.cell(e, r, x[i], I, w[i], c + 2, i.align);
+ }
+ }
+
+ return this.lastCellPos = a, this.table_x = e, this.table_y = r, this;
+ }, t.calculateLineHeight = function (t, e, r) {
+ for (var n, s = 0, i = 0; i < t.length; i++) {
+ n = t[i], r[n] = this.splitTextToSize(String(r[n]), e[n] - o);
+ var a = this.internal.getLineHeight() * r[n].length + o;
+ a > s && (s = a);
+ }
+
+ return s;
+ }, t.setTableHeaderRow = function (t) {
+ this.tableHeaderRow = t;
+ }, t.printHeaderRow = function (t, e) {
+ if (!this.tableHeaderRow) throw "Property tableHeaderRow does not exist.";
+ var r, n, o, i;
+
+ if (this.printingHeaderRow = !0, void 0 !== s) {
+ var a = s(this, u);
+ c(a[0], a[1], a[2], a[3], -1);
+ }
+
+ this.setFontStyle("bold");
+ var l = [];
+
+ for (o = 0, i = this.tableHeaderRow.length; i > o; o += 1) {
+ this.setFillColor(200, 200, 200), r = this.tableHeaderRow[o], e && (r[1] = this.margins && this.margins.top || 0, l.push(r)), n = [].concat(r), this.cell.apply(this, n.concat(t));
+ }
+
+ l.length > 0 && this.setTableHeaderRow(l), this.setFontStyle("normal"), this.printingHeaderRow = !1;
+ };
+ }(r.API), function (t) {
+ var e, _r, n, s, o, i, a, u, c, l, f, d, h, p, m, w, y;
+
+ e = function () {
+ function t() {}
+
+ return function (e) {
+ return t.prototype = e, new t();
+ };
+ }(), a = function a(t) {
+ var e, r, n, s, o, i, a;
+
+ for (r = 0, n = t.length, e = void 0, s = !1, i = !1; !s && r !== n;) {
+ e = t[r] = t[r].trimLeft(), e && (s = !0), r++;
+ }
+
+ for (r = n - 1; n && !i && -1 !== r;) {
+ e = t[r] = t[r].trimRight(), e && (i = !0), r--;
+ }
+
+ for (o = /\s+$/g, a = !0, r = 0; r !== n;) {
+ e = t[r].replace(/\s+/g, " "), a && (e = e.trimLeft()), e && (a = o.test(e)), t[r] = e, r++;
+ }
+
+ return t;
+ }, u = function u(t, e, r, n) {
+ return this.pdf = t, this.x = e, this.y = r, this.settings = n, this.init(), this;
+ }, c = function c(t) {
+ var e, r, s;
+
+ for (e = void 0, s = t.split(","), r = s.shift(); !e && r;) {
+ e = n[r.trim().toLowerCase()], r = s.shift();
+ }
+
+ return e;
+ }, l = function l(t) {
+ t = "auto" === t ? "0px" : t, t.indexOf("em") > -1 && !isNaN(Number(t.replace("em", ""))) && (t = 18.719 * Number(t.replace("em", "")) + "px"), t.indexOf("pt") > -1 && !isNaN(Number(t.replace("pt", ""))) && (t = 1.333 * Number(t.replace("pt", "")) + "px");
+ var e, r, n;
+ return r = void 0, e = 16, (n = f[t]) ? n : (n = {
+ "xx-small": 9,
+ "x-small": 11,
+ small: 13,
+ medium: 16,
+ large: 19,
+ "x-large": 23,
+ "xx-large": 28,
+ auto: 0
+ }[{
+ css_line_height_string: t
+ }], n !== r ? f[t] = n / e : (n = parseFloat(t)) ? f[t] = n / e : (n = t.match(/([\d\.]+)(px)/), f[t] = 3 === n.length ? parseFloat(n[1]) / e : 1));
+ }, i = function i(t) {
+ var e, r, n;
+ return n = function (t) {
+ var e;
+ return e = function (t) {
+ return document.defaultView && document.defaultView.getComputedStyle ? document.defaultView.getComputedStyle(t, null) : t.currentStyle ? t.currentStyle : t.style;
+ }(t), function (t) {
+ return t = t.replace(/-\D/g, function (t) {
+ return t.charAt(1).toUpperCase();
+ }), e[t];
+ };
+ }(t), e = {}, r = void 0, e["font-family"] = c(n("font-family")) || "times", e["font-style"] = s[n("font-style")] || "normal", e["text-align"] = TextAlignMap[n("text-align")] || "left", r = o[n("font-weight")] || "normal", "bold" === r && (e["font-style"] = "normal" === e["font-style"] ? r : r + e["font-style"]), e["font-size"] = l(n("font-size")) || 1, e["line-height"] = l(n("line-height")) || 1, e.display = "inline" === n("display") ? "inline" : "block", "block" === e.display && (e["margin-top"] = l(n("margin-top")) || 0, e["margin-bottom"] = l(n("margin-bottom")) || 0, e["padding-top"] = l(n("padding-top")) || 0, e["padding-bottom"] = l(n("padding-bottom")) || 0, e["margin-left"] = l(n("margin-left")) || 0, e["margin-right"] = l(n("margin-right")) || 0, e["padding-left"] = l(n("padding-left")) || 0, e["padding-right"] = l(n("padding-right")) || 0), e;
+ }, d = function d(t, e, r) {
+ var n, s, o, i;
+ if (o = !1, s = void 0, i = void 0, n = r["#" + t.id]) if ("function" == typeof n) o = n(t, e);else for (s = 0, i = n.length; !o && s !== i;) {
+ o = n[s](t, e), s++;
+ }
+ if (n = r[t.nodeName], !o && n) if ("function" == typeof n) o = n(t, e);else for (s = 0, i = n.length; !o && s !== i;) {
+ o = n[s](t, e), s++;
+ }
+ return o;
+ }, y = function y(t, e) {
+ var r, n, s, o, i, a, u, c, l, f;
+
+ for (r = [], n = [], s = 0, f = t.rows[0].cells.length, c = t.clientWidth; f > s;) {
+ l = t.rows[0].cells[s], n[s] = {
+ name: l.textContent.toLowerCase().replace(/\s+/g, ""),
+ prompt: l.textContent.replace(/\r?\n/g, ""),
+ width: l.clientWidth / c * e.pdf.internal.pageSize.width
+ }, s++;
+ }
+
+ for (s = 1; s < t.rows.length;) {
+ for (a = t.rows[s], i = {}, o = 0; o < a.cells.length;) {
+ i[n[o].name] = a.cells[o].textContent.replace(/\r?\n/g, ""), o++;
+ }
+
+ r.push(i), s++;
+ }
+
+ return u = {
+ rows: r,
+ headers: n
+ };
+ };
+ var g = {
+ SCRIPT: 1,
+ STYLE: 1,
+ NOSCRIPT: 1,
+ OBJECT: 1,
+ EMBED: 1,
+ SELECT: 1
+ },
+ v = 1;
+ _r = function r(t, e, n) {
+ var s, o, a, u, c, l, p, m;
+
+ for (o = t.childNodes, s = void 0, a = i(t), c = "block" === a.display, c && (e.setBlockBoundary(), e.setBlockStyle(a)), u = 0, l = o.length; l > u;) {
+ if (s = o[u], "object" == _typeof(s)) {
+ if (1 === s.nodeType && "HEADER" === s.nodeName) {
+ var w = s,
+ b = e.pdf.margins_doc.top;
+ e.pdf.internal.events.subscribe("addPage", function () {
+ e.y = b, _r(w, e, n), e.pdf.margins_doc.top = e.y + 10, e.y += 10;
+ }, !1);
+ }
+
+ if (8 === s.nodeType && "#comment" === s.nodeName) ~s.textContent.indexOf("ADD_PAGE") && (e.pdf.addPage(), e.y = e.pdf.margins_doc.top);else if (1 !== s.nodeType || g[s.nodeName]) {
+ if (3 === s.nodeType) {
+ var q = s.nodeValue;
+ if (s.nodeValue && "LI" === s.parentNode.nodeName) if ("OL" === s.parentNode.parentNode.nodeName) q = v++ + ". " + q;else {
+ var x = 16 * a["font-size"],
+ k = 2;
+ x > 20 && (k = 3), m = function m(t, e) {
+ this.pdf.circle(t, e, k, "FD");
+ };
+ }
+ e.addText(q, a);
+ } else "string" == typeof s && e.addText(s, a);
+ } else if ("IMG" === s.nodeName && h[s.getAttribute("src")]) e.pdf.internal.pageSize.height - e.pdf.margins_doc.bottom < e.y + s.height && e.y > e.pdf.margins_doc.top && (e.pdf.addPage(), e.y = e.pdf.margins_doc.top), e.pdf.addImage(h[s.getAttribute("src")], e.x, e.y, s.width, s.height), e.y += s.height;else if ("TABLE" === s.nodeName) p = y(s, e), e.y += 10, e.pdf.table(e.x, e.y, p.rows, p.headers, {
+ autoSize: !1,
+ printHeaders: !0,
+ margins: e.pdf.margins_doc
+ }), e.y = e.pdf.lastCellPos.y + e.pdf.lastCellPos.h + 20;else if ("OL" === s.nodeName || "UL" === s.nodeName) v = 1, d(s, e, n) || _r(s, e, n), e.y += 10;else if ("LI" === s.nodeName) {
+ var _ = e.x;
+ e.x += "UL" === s.parentNode.nodeName ? 22 : 10, e.y += 3, d(s, e, n) || _r(s, e, n), e.x = _;
+ } else d(s, e, n) || _r(s, e, n);
+ }
+
+ u++;
+ }
+
+ return c ? e.setBlockBoundary(m) : void 0;
+ }, h = {}, p = function p(t, e, r, n) {
+ function s() {
+ e.pdf.internal.events.publish("imagesLoaded"), n();
+ }
+
+ function o(t, e, r) {
+ if (t) {
+ var n = new Image();
+ ++u, n.crossOrigin = "", n.onerror = n.onload = function () {
+ n.complete && (0 === n.src.indexOf("data:image/") && (n.width = e || n.width || 0, n.height = r || n.height || 0), n.width + n.height && (h[t] = h[t] || n)), --u || s();
+ }, n.src = t;
+ }
+ }
+
+ for (var i = t.getElementsByTagName("img"), a = i.length, u = 0; a--;) {
+ o(i[a].getAttribute("src"), i[a].width, i[a].height);
+ }
+
+ return u || s();
+ }, m = function m(t, e, n, s) {
+ var o = t.getElementsByTagName("footer");
+
+ if (o.length > 0) {
+ o = o[0];
+ var i = e.pdf.internal.write,
+ a = e.y;
+ e.pdf.internal.write = function () {}, _r(o, e, n);
+ var u = Math.ceil(e.y - a) + 5;
+ e.y = a, e.pdf.internal.write = i, e.pdf.margins_doc.bottom += u;
+
+ for (var c = function c(t) {
+ var s = void 0 !== t ? t.pageNumber : 1,
+ i = e.y;
+ e.y = e.pdf.internal.pageSize.height - e.pdf.margins_doc.bottom, e.pdf.margins_doc.bottom -= u;
+
+ for (var a = o.getElementsByTagName("span"), c = 0; c < a.length; ++c) {
+ (" " + a[c].className + " ").replace(/[\n\t]/g, " ").indexOf(" pageCounter ") > -1 && (a[c].innerHTML = s), (" " + a[c].className + " ").replace(/[\n\t]/g, " ").indexOf(" totalPages ") > -1 && (a[c].innerHTML = "###jsPDFVarTotalPages###");
+ }
+
+ _r(o, e, n), e.pdf.margins_doc.bottom += u, e.y = i;
+ }, l = o.getElementsByTagName("span"), f = 0; f < l.length; ++f) {
+ (" " + l[f].className + " ").replace(/[\n\t]/g, " ").indexOf(" totalPages ") > -1 && e.pdf.internal.events.subscribe("htmlRenderingFinished", e.pdf.putTotalPages.bind(e.pdf, "###jsPDFVarTotalPages###"), !0);
+ }
+
+ e.pdf.internal.events.subscribe("addPage", c, !1), c(), g.FOOTER = 1;
+ }
+
+ s();
+ }, w = function w(t, e, n, s, o, i) {
+ if (!e) return !1;
+ "string" == typeof e || e.parentNode || (e = "" + e.innerHTML), "string" == typeof e && (e = function (t) {
+ var e, r, n, s;
+ return n = "jsPDFhtmlText" + Date.now().toString() + (1e3 * Math.random()).toFixed(0), s = "position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;", r = document.createElement("div"), r.style.cssText = s, r.innerHTML = '', document.body.appendChild(r), e = window.frames[n], e.document.body.innerHTML = t, e.document.body;
+ }(e.replace(/<\/?script[^>]*?>/gi, "")));
+ var a = new u(t, n, s, o);
+ return i = i || function () {}, p.call(this, e, a, o.elementHandlers, function () {
+ m.call(this, e, a, o.elementHandlers, function () {
+ _r(e, a, o.elementHandlers), a.pdf.internal.events.publish("htmlRenderingFinished"), i(a.dispose());
+ });
+ }), a.dispose();
+ }, u.prototype.init = function () {
+ return this.paragraph = {
+ text: [],
+ style: []
+ }, this.pdf.internal.write("q");
+ }, u.prototype.dispose = function () {
+ return this.pdf.internal.write("Q"), {
+ x: this.x,
+ y: this.y
+ };
+ }, u.prototype.splitFragmentsIntoLines = function (t, r) {
+ var n, s, o, i, a, u, c, l, f, d, h, p, m, w, y;
+
+ for (s = 12, h = this.pdf.internal.scaleFactor, a = {}, o = void 0, d = void 0, i = void 0, u = void 0, y = void 0, f = void 0, l = void 0, c = void 0, p = [], m = [p], n = 0, w = this.settings.width; t.length;) {
+ if (u = t.shift(), y = r.shift(), u) if (o = y["font-family"], d = y["font-style"], i = a[o + d], i || (i = this.pdf.internal.getFont(o, d).metadata.Unicode, a[o + d] = i), f = {
+ widths: i.widths,
+ kerning: i.kerning,
+ fontSize: y["font-size"] * s,
+ textIndent: n
+ }, l = this.pdf.getStringUnitWidth(u, f) * f.fontSize / h, n + l > w) {
+ for (c = this.pdf.splitTextToSize(u, w, f), p.push([c.shift(), y]); c.length;) {
+ p = [[c.shift(), y]], m.push(p);
+ }
+
+ n = this.pdf.getStringUnitWidth(p[0][0], f) * f.fontSize / h;
+ } else p.push([u, y]), n += l;
+ }
+
+ if (void 0 !== y["text-align"] && ("center" === y["text-align"] || "right" === y["text-align"] || "justify" === y["text-align"])) for (var g = 0; g < m.length; ++g) {
+ var v = this.pdf.getStringUnitWidth(m[g][0][0], f) * f.fontSize / h;
+ g > 0 && (m[g][0][1] = e(m[g][0][1]));
+ var b = w - v;
+ if ("right" === y["text-align"]) m[g][0][1]["margin-left"] = b;else if ("center" === y["text-align"]) m[g][0][1]["margin-left"] = b / 2;else if ("justify" === y["text-align"]) {
+ var q = m[g][0][0].split(" ").length - 1;
+ m[g][0][1]["word-spacing"] = b / q, g === m.length - 1 && (m[g][0][1]["word-spacing"] = 0);
+ }
+ }
+ return m;
+ }, u.prototype.RenderTextFragment = function (t, e) {
+ var r, n;
+ this.pdf.internal.pageSize.height - this.pdf.margins_doc.bottom < this.y + this.pdf.internal.getFontSize() && (this.pdf.internal.write("ET", "Q"), this.pdf.addPage(), this.y = this.pdf.margins_doc.top, this.pdf.internal.write("q", "BT", this.pdf.internal.getCoordinateString(this.x), this.pdf.internal.getVerticalCoordinateString(this.y), "Td")), r = 12, n = this.pdf.internal.getFont(e["font-family"], e["font-style"]), void 0 !== e["word-spacing"] && e["word-spacing"] > 0 && this.pdf.internal.write(e["word-spacing"].toFixed(2), "Tw"), this.pdf.internal.write("/" + n.id, (r * e["font-size"]).toFixed(2), "Tf", "(" + this.pdf.internal.pdfEscape(t) + ") Tj"), void 0 !== e["word-spacing"] && this.pdf.internal.write(0, "Tw");
+ }, u.prototype.renderParagraph = function (t) {
+ var e, r, n, s, o, i, u, c, l, f, d, h, p, m, w;
+
+ if (s = a(this.paragraph.text), m = this.paragraph.style, e = this.paragraph.blockstyle, p = this.paragraph.blockstyle || {}, this.paragraph = {
+ text: [],
+ style: [],
+ blockstyle: {},
+ priorblockstyle: e
+ }, s.join("").trim()) {
+ c = this.splitFragmentsIntoLines(s, m), u = void 0, l = void 0, r = 12, n = r / this.pdf.internal.scaleFactor, h = (Math.max((e["margin-top"] || 0) - (p["margin-bottom"] || 0), 0) + (e["padding-top"] || 0)) * n, d = ((e["margin-bottom"] || 0) + (e["padding-bottom"] || 0)) * n, f = this.pdf.internal.write, o = void 0, i = void 0, this.y += h, f("q", "BT", this.pdf.internal.getCoordinateString(this.x), this.pdf.internal.getVerticalCoordinateString(this.y), "Td");
+
+ for (var y = 0; c.length;) {
+ for (u = c.shift(), l = 0, o = 0, i = u.length; o !== i;) {
+ u[o][0].trim() && (l = Math.max(l, u[o][1]["line-height"], u[o][1]["font-size"]), w = 7 * u[o][1]["font-size"]), o++;
+ }
+
+ var g = 0;
+
+ for (void 0 !== u[0][1]["margin-left"] && u[0][1]["margin-left"] > 0 && (wantedIndent = this.pdf.internal.getCoordinateString(u[0][1]["margin-left"]), g = wantedIndent - y, y = wantedIndent), f(g, (-1 * r * l).toFixed(2), "Td"), o = 0, i = u.length; o !== i;) {
+ u[o][0] && this.RenderTextFragment(u[o][0], u[o][1]), o++;
+ }
+
+ this.y += l * n;
+ }
+
+ return t && "function" == typeof t && t.call(this, this.x - 9, this.y - w / 2), f("ET", "Q"), this.y += d;
+ }
+ }, u.prototype.setBlockBoundary = function (t) {
+ return this.renderParagraph(t);
+ }, u.prototype.setBlockStyle = function (t) {
+ return this.paragraph.blockstyle = t;
+ }, u.prototype.addText = function (t, e) {
+ return this.paragraph.text.push(t), this.paragraph.style.push(e);
+ }, n = {
+ helvetica: "helvetica",
+ "sans-serif": "helvetica",
+ "times new roman": "times",
+ serif: "times",
+ times: "times",
+ monospace: "courier",
+ courier: "courier"
+ }, o = {
+ 100: "normal",
+ 200: "normal",
+ 300: "normal",
+ 400: "normal",
+ 500: "bold",
+ 600: "bold",
+ 700: "bold",
+ 800: "bold",
+ 900: "bold",
+ normal: "normal",
+ bold: "bold",
+ bolder: "bold",
+ lighter: "normal"
+ }, s = {
+ normal: "normal",
+ italic: "italic",
+ oblique: "italic"
+ }, TextAlignMap = {
+ left: "left",
+ right: "right",
+ center: "center",
+ justify: "justify"
+ }, f = {
+ normal: 1
+ }, t.fromHTML = function (t, e, r, n, s, o) {
+
+ return this.margins_doc = o || {
+ top: 0,
+ bottom: 0
+ }, n || (n = {}), n.elementHandlers || (n.elementHandlers = {}), w(this, t, e || 4, r || 4, n, s);
+ };
+ }(r.API), function (t) {
+
+ var e, r, n;
+
+ t.addJS = function (t) {
+ return n = t, this.internal.events.subscribe("postPutResources", function () {
+ e = this.internal.newObject(), this.internal.write("<< /Names [(EmbeddedJS) " + (e + 1) + " 0 R] >>", "endobj"), r = this.internal.newObject(), this.internal.write("<< /S /JavaScript /JS (", n, ") >>", "endobj");
+ }), this.internal.events.subscribe("putCatalog", function () {
+ void 0 !== e && void 0 !== r && this.internal.write("/Names <>");
+ }), this;
+ };
+ }(r.API), function (t) {
+
+ var e = function e() {
+ return "function" != typeof PNG || "function" != typeof i;
+ },
+ r = function r(e) {
+ return e !== t.image_compression.NONE && n();
+ },
+ n = function n() {
+ var t = "function" == typeof s;
+ if (!t) throw new Error("requires deflate.js for compression");
+ return t;
+ },
+ o = function o(e, r, n, _o) {
+ var i = 5,
+ l = d;
+
+ switch (_o) {
+ case t.image_compression.FAST:
+ i = 3, l = f;
+ break;
+
+ case t.image_compression.MEDIUM:
+ i = 6, l = h;
+ break;
+
+ case t.image_compression.SLOW:
+ i = 9, l = p;
+ }
+
+ e = c(e, r, n, l);
+ var m = new Uint8Array(a()),
+ w = u(e),
+ y = new s(i),
+ g = y.append(e),
+ v = y.flush(),
+ b = m.length + g.length + v.length,
+ q = new Uint8Array(b + 4);
+ return q.set(m), q.set(g, m.length), q.set(v, m.length + g.length), q[b++] = w >>> 24 & 255, q[b++] = w >>> 16 & 255, q[b++] = w >>> 8 & 255, q[b++] = 255 & w, t.arrayBufferToBinaryString(q);
+ },
+ a = function a(t, e) {
+ var r = 8,
+ n = Math.LOG2E * Math.log(32768) - 8,
+ s = n << 4 | r,
+ o = s << 8,
+ i = Math.min(3, (e - 1 & 255) >> 1);
+ return o |= i << 6, o |= 0, o += 31 - o % 31, [s, 255 & o & 255];
+ },
+ u = function u(t, e) {
+ for (var r, n = 1, s = 65535 & n, o = n >>> 16 & 65535, i = t.length, a = 0; i > 0;) {
+ r = i > e ? e : i, i -= r;
+
+ do {
+ s += t[a++], o += s;
+ } while (--r);
+
+ s %= 65521, o %= 65521;
+ }
+
+ return (o << 16 | s) >>> 0;
+ },
+ c = function c(t, e, r, n) {
+ for (var s, o, i, a = t.length / e, u = new Uint8Array(t.length + a), c = w(), l = 0; a > l; l++) {
+ if (i = l * e, s = t.subarray(i, i + e), n) u.set(n(s, r, o), i + l);else {
+ for (var f = 0, d = c.length, h = []; d > f; f++) {
+ h[f] = c[f](s, r, o);
+ }
+
+ var p = y(h.concat());
+ u.set(h[p], i + l);
+ }
+ o = s;
+ }
+
+ return u;
+ },
+ l = function l(t) {
+ var e = Array.apply([], t);
+ return e.unshift(0), e;
+ },
+ f = function f(t, e) {
+ var r,
+ n = [],
+ s = 0,
+ o = t.length;
+
+ for (n[0] = 1; o > s; s++) {
+ r = t[s - e] || 0, n[s + 1] = t[s] - r + 256 & 255;
+ }
+
+ return n;
+ },
+ d = function d(t, e, r) {
+ var n,
+ s = [],
+ o = 0,
+ i = t.length;
+
+ for (s[0] = 2; i > o; o++) {
+ n = r && r[o] || 0, s[o + 1] = t[o] - n + 256 & 255;
+ }
+
+ return s;
+ },
+ h = function h(t, e, r) {
+ var n,
+ s,
+ o = [],
+ i = 0,
+ a = t.length;
+
+ for (o[0] = 3; a > i; i++) {
+ n = t[i - e] || 0, s = r && r[i] || 0, o[i + 1] = t[i] + 256 - (n + s >>> 1) & 255;
+ }
+
+ return o;
+ },
+ p = function p(t, e, r) {
+ var n,
+ s,
+ o,
+ i,
+ a = [],
+ u = 0,
+ c = t.length;
+
+ for (a[0] = 4; c > u; u++) {
+ n = t[u - e] || 0, s = r && r[u] || 0, o = r && r[u - e] || 0, i = m(n, s, o), a[u + 1] = t[u] - i + 256 & 255;
+ }
+
+ return a;
+ },
+ m = function m(t, e, r) {
+ var n = t + e - r,
+ s = Math.abs(n - t),
+ o = Math.abs(n - e),
+ i = Math.abs(n - r);
+ return o >= s && i >= s ? t : i >= o ? e : r;
+ },
+ w = function w() {
+ return [l, f, d, h, p];
+ },
+ y = function y(t) {
+ for (var e, r, n, s = 0, o = t.length; o > s;) {
+ e = g(t[s].slice(1)), (r > e || !r) && (r = e, n = s), s++;
+ }
+
+ return n;
+ },
+ g = function g(t) {
+ for (var e = 0, r = t.length, n = 0; r > e;) {
+ n += Math.abs(t[e++]);
+ }
+
+ return n;
+ };
+
+ t.processPNG = function (t, n, s, i) {
+ var a,
+ u,
+ c,
+ l,
+ f,
+ d,
+ h = this.color_spaces.DEVICE_RGB,
+ p = this.decode.FLATE_DECODE,
+ m = 8;
+
+ if (this.isArrayBuffer(t) && (t = new Uint8Array(t)), this.isArrayBufferView(t)) {
+ if (e()) throw new Error("PNG support requires png.js and zlib.js");
+
+ if (a = new PNG(t), t = a.imgData, m = a.bits, h = a.colorSpace, l = a.colors, -1 !== [4, 6].indexOf(a.colorType)) {
+ if (8 === a.bits) for (var w, y, g = window["Uint" + a.pixelBitlength + "Array"], v = new g(a.decodePixels().buffer), b = v.length, q = new Uint8Array(b * a.colors), x = new Uint8Array(b), k = a.pixelBitlength - a.bits, _ = 0, A = 0; b > _; _++) {
+ for (w = v[_], y = 0; k > y;) {
+ q[A++] = w >>> y & 255, y += a.bits;
+ }
+
+ x[_] = w >>> y & 255;
+ }
+
+ if (16 === a.bits) {
+ for (var w, v = new Uint32Array(a.decodePixels().buffer), b = v.length, q = new Uint8Array(b * (32 / a.pixelBitlength) * a.colors), x = new Uint8Array(b * (32 / a.pixelBitlength)), C = a.colors > 1, _ = 0, A = 0, S = 0; b > _;) {
+ w = v[_++], q[A++] = w >>> 0 & 255, C && (q[A++] = w >>> 16 & 255, w = v[_++], q[A++] = w >>> 0 & 255), x[S++] = w >>> 16 & 255;
+ }
+
+ m = 8;
+ }
+
+ r(i) ? (t = o(q, a.width * a.colors, a.colors, i), d = o(x, a.width, 1, i)) : (t = q, d = x, p = null);
+ }
+
+ if (3 === a.colorType && (h = this.color_spaces.INDEXED, f = a.palette, a.transparency.indexed)) {
+ for (var E = a.transparency.indexed, z = 0, _ = 0, b = E.length; b > _; ++_) {
+ z += E[_];
+ }
+
+ if (z /= 255, z === b - 1 && -1 !== E.indexOf(0)) c = [E.indexOf(0)];else if (z !== b) {
+ for (var v = a.decodePixels(), x = new Uint8Array(v.length), _ = 0, b = v.length; b > _; _++) {
+ x[_] = E[v[_]];
+ }
+
+ d = o(x, a.width, 1);
+ }
+ }
+
+ return u = p === this.decode.FLATE_DECODE ? "/Predictor 15 /Colors " + l + " /BitsPerComponent " + m + " /Columns " + a.width : "/Colors " + l + " /BitsPerComponent " + m + " /Columns " + a.width, (this.isArrayBuffer(t) || this.isArrayBufferView(t)) && (t = this.arrayBufferToBinaryString(t)), (d && this.isArrayBuffer(d) || this.isArrayBufferView(d)) && (d = this.arrayBufferToBinaryString(d)), this.createImageInfo(t, a.width, a.height, h, m, p, n, s, u, c, f, d);
+ }
+
+ throw new Error("Unsupported PNG image data, try using JPEG instead.");
+ };
+ }(r.API), function (t) {
+
+ t.addSVG = function (t, e, r, n, s) {
+ function o(t, e) {
+ var r = e.createElement("style");
+ r.type = "text/css", r.styleSheet ? r.styleSheet.cssText = t : r.appendChild(e.createTextNode(t)), e.getElementsByTagName("head")[0].appendChild(r);
+ }
+
+ function i(t) {
+ var e = "childframe",
+ r = t.createElement("iframe");
+ return o(".jsPDF_sillysvg_iframe {display:none;position:absolute;}", t), r.name = e, r.setAttribute("width", 0), r.setAttribute("height", 0), r.setAttribute("frameborder", "0"), r.setAttribute("scrolling", "no"), r.setAttribute("seamless", "seamless"), r.setAttribute("class", "jsPDF_sillysvg_iframe"), t.body.appendChild(r), r;
+ }
+
+ function a(t, e) {
+ var r = (e.contentWindow || e.contentDocument).document;
+ return r.write(t), r.close(), r.getElementsByTagName("svg")[0];
+ }
+
+ function u(t) {
+ for (var e = parseFloat(t[1]), r = parseFloat(t[2]), n = [], s = 3, o = t.length; o > s;) {
+ "c" === t[s] ? (n.push([parseFloat(t[s + 1]), parseFloat(t[s + 2]), parseFloat(t[s + 3]), parseFloat(t[s + 4]), parseFloat(t[s + 5]), parseFloat(t[s + 6])]), s += 7) : "l" === t[s] ? (n.push([parseFloat(t[s + 1]), parseFloat(t[s + 2])]), s += 3) : s += 1;
+ }
+
+ return [e, r, n];
+ }
+
+ var c;
+ if (e === c || e === c) throw new Error("addSVG needs values for 'x' and 'y'");
+ var l = i(document),
+ f = a(t, l),
+ d = [1, 1],
+ h = parseFloat(f.getAttribute("width")),
+ p = parseFloat(f.getAttribute("height"));
+ h && p && (n && s ? d = [n / h, s / p] : n ? d = [n / h, n / h] : s && (d = [s / p, s / p]));
+ var m,
+ w,
+ y,
+ g,
+ v = f.childNodes;
+
+ for (m = 0, w = v.length; w > m; m++) {
+ y = v[m], y.tagName && "PATH" === y.tagName.toUpperCase() && (g = u(y.getAttribute("d").split(" ")), g[0] = g[0] * d[0] + e, g[1] = g[1] * d[1] + r, this.lines.call(this, g[2], g[0], g[1], d));
+ }
+
+ return this;
+ };
+ }(r.API), function (t) {
+
+ var e = t.getCharWidthsArray = function (t, e) {
+ e || (e = {});
+ var r,
+ n,
+ s,
+ o = e.widths ? e.widths : this.internal.getFont().metadata.Unicode.widths,
+ i = o.fof ? o.fof : 1,
+ a = e.kerning ? e.kerning : this.internal.getFont().metadata.Unicode.kerning,
+ u = a.fof ? a.fof : 1,
+ c = 0,
+ l = o[0] || i,
+ f = [];
+
+ for (r = 0, n = t.length; n > r; r++) {
+ s = t.charCodeAt(r), f.push((o[s] || l) / i + (a[s] && a[s][c] || 0) / u), c = s;
+ }
+
+ return f;
+ },
+ r = function r(t) {
+ for (var e = t.length, r = 0; e;) {
+ e--, r += t[e];
+ }
+
+ return r;
+ },
+ n = t.getStringUnitWidth = function (t, n) {
+ return r(e.call(this, t, n));
+ },
+ s = function s(t, e, r, n) {
+ for (var s = [], o = 0, i = t.length, a = 0; o !== i && a + e[o] < r;) {
+ a += e[o], o++;
+ }
+
+ s.push(t.slice(0, o));
+ var u = o;
+
+ for (a = 0; o !== i;) {
+ a + e[o] > n && (s.push(t.slice(u, o)), a = 0, u = o), a += e[o], o++;
+ }
+
+ return u !== o && s.push(t.slice(u, o)), s;
+ },
+ o = function o(t, _o2, i) {
+ i || (i = {});
+ var a,
+ u,
+ c,
+ l,
+ f,
+ d,
+ h = [],
+ p = [h],
+ m = i.textIndent || 0,
+ w = 0,
+ y = 0,
+ g = t.split(" "),
+ v = e(" ", i)[0];
+
+ if (d = -1 === i.lineIndent ? g[0].length + 2 : i.lineIndent || 0) {
+ var b = Array(d).join(" "),
+ q = [];
+ g.map(function (t) {
+ t = t.split(/\s*\n/), t.length > 1 ? q = q.concat(t.map(function (t, e) {
+ return (e && t.length ? "\n" : "") + t;
+ })) : q.push(t[0]);
+ }), g = q, d = n(b, i);
+ }
+
+ for (c = 0, l = g.length; l > c; c++) {
+ var x = 0;
+
+ if (a = g[c], d && "\n" == a[0] && (a = a.substr(1), x = 1), u = e(a, i), y = r(u), m + w + y > _o2 || x) {
+ if (y > _o2) {
+ for (f = s(a, u, _o2 - (m + w), _o2), h.push(f.shift()), h = [f.pop()]; f.length;) {
+ p.push([f.shift()]);
+ }
+
+ y = r(u.slice(a.length - h[0].length));
+ } else h = [a];
+
+ p.push(h), m = y + d, w = v;
+ } else h.push(a), m += w + y, w = v;
+ }
+
+ if (d) var k = function k(t, e) {
+ return (e ? b : "") + t.join(" ");
+ };else var k = function k(t) {
+ return t.join(" ");
+ };
+ return p.map(k);
+ };
+
+ t.splitTextToSize = function (t, e, r) {
+ r || (r = {});
+
+ var n,
+ s = r.fontSize || this.internal.getFontSize(),
+ i = function (t) {
+ var e = {
+ 0: 1
+ },
+ r = {};
+ if (t.widths && t.kerning) return {
+ widths: t.widths,
+ kerning: t.kerning
+ };
+ var n = this.internal.getFont(t.fontName, t.fontStyle),
+ s = "Unicode";
+ return n.metadata[s] ? {
+ widths: n.metadata[s].widths || e,
+ kerning: n.metadata[s].kerning || r
+ } : {
+ widths: e,
+ kerning: r
+ };
+ }.call(this, r);
+
+ n = Array.isArray(t) ? t : t.split(/\r?\n/);
+ var a = 1 * this.internal.scaleFactor * e / s;
+ i.textIndent = r.textIndent ? 1 * r.textIndent * this.internal.scaleFactor / s : 0, i.lineIndent = r.lineIndent;
+ var u,
+ c,
+ l = [];
+
+ for (u = 0, c = n.length; c > u; u++) {
+ l = l.concat(o(n[u], a, i));
+ }
+
+ return l;
+ };
+ }(r.API), function (t) {
+
+ var e = function e(t) {
+ for (var e = "0123456789abcdef", r = "klmnopqrstuvwxyz", n = {}, s = 0; s < r.length; s++) {
+ n[r[s]] = e[s];
+ }
+
+ var o,
+ i,
+ a,
+ u,
+ c,
+ l = {},
+ f = 1,
+ d = l,
+ h = [],
+ p = "",
+ m = "",
+ w = t.length - 1;
+
+ for (s = 1; s != w;) {
+ c = t[s], s += 1, "'" == c ? i ? (u = i.join(""), i = o) : i = [] : i ? i.push(c) : "{" == c ? (h.push([d, u]), d = {}, u = o) : "}" == c ? (a = h.pop(), a[0][a[1]] = d, u = o, d = a[0]) : "-" == c ? f = -1 : u === o ? n.hasOwnProperty(c) ? (p += n[c], u = parseInt(p, 16) * f, f = 1, p = "") : p += c : n.hasOwnProperty(c) ? (m += n[c], d[u] = parseInt(m, 16) * f, f = 1, u = o, m = "") : m += c;
+ }
+
+ return l;
+ },
+ r = {
+ codePages: ["WinAnsiEncoding"],
+ WinAnsiEncoding: e("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")
+ },
+ n = {
+ Unicode: {
+ Courier: r,
+ "Courier-Bold": r,
+ "Courier-BoldOblique": r,
+ "Courier-Oblique": r,
+ Helvetica: r,
+ "Helvetica-Bold": r,
+ "Helvetica-BoldOblique": r,
+ "Helvetica-Oblique": r,
+ "Times-Roman": r,
+ "Times-Bold": r,
+ "Times-BoldItalic": r,
+ "Times-Italic": r
+ }
+ },
+ s = {
+ Unicode: {
+ "Courier-Oblique": e("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),
+ "Times-BoldItalic": e("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),
+ "Helvetica-Bold": e("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),
+ Courier: e("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),
+ "Courier-BoldOblique": e("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),
+ "Times-Bold": e("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),
+ Helvetica: e("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),
+ "Helvetica-BoldOblique": e("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),
+ "Courier-Bold": e("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),
+ "Times-Italic": e("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),
+ "Times-Roman": e("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),
+ "Helvetica-Oblique": e("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")
+ }
+ };
+
+ t.events.push(["addFonts", function (t) {
+ var e,
+ r,
+ o,
+ i,
+ a,
+ u = "Unicode";
+
+ for (r in t.fonts) {
+ t.fonts.hasOwnProperty(r) && (e = t.fonts[r], o = s[u][e.PostScriptName], o && (i = e.metadata[u] ? e.metadata[u] : e.metadata[u] = {}, i.widths = o.widths, i.kerning = o.kerning), a = n[u][e.PostScriptName], a && (i = e.metadata[u] ? e.metadata[u] : e.metadata[u] = {}, i.encoding = a, a.codePages && a.codePages.length && (e.encoding = a.codePages[0])));
+ }
+ }]);
+ }(r.API), function (t) {
+
+ t.putTotalPages = function (t) {
+ for (var e = new RegExp(t, "g"), r = 1; r <= this.internal.getNumberOfPages(); r++) {
+ for (var n = 0; n < this.internal.pages[r].length; n++) {
+ this.internal.pages[r][n] = this.internal.pages[r][n].replace(e, this.internal.getNumberOfPages());
+ }
+ }
+
+ return this;
+ };
+ }(r.API), function (t) {
+
+ if (t.URL = t.URL || t.webkitURL, t.Blob && t.URL) try {
+ return new Blob(), void 0;
+ } catch (e) {}
+
+ var r = t.BlobBuilder || t.WebKitBlobBuilder || t.MozBlobBuilder || function (t) {
+ var e = function e(t) {
+ return Object.prototype.toString.call(t).match(/^\[object\s(.*)\]$/)[1];
+ },
+ r = function r() {
+ this.data = [];
+ },
+ n = function n(t, e, r) {
+ this.data = t, this.size = t.length, this.type = e, this.encoding = r;
+ },
+ s = r.prototype,
+ o = n.prototype,
+ i = t.FileReaderSync,
+ a = function a(t) {
+ this.code = this[this.name = t];
+ },
+ u = "NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),
+ c = u.length,
+ l = t.URL || t.webkitURL || t,
+ f = l.createObjectURL,
+ d = l.revokeObjectURL,
+ h = l,
+ p = t.btoa,
+ m = t.atob,
+ w = t.ArrayBuffer,
+ y = t.Uint8Array;
+
+ for (n.fake = o.fake = !0; c--;) {
+ a.prototype[u[c]] = c + 1;
+ }
+
+ return l.createObjectURL || (h = t.URL = {}), h.createObjectURL = function (t) {
+ var e,
+ r = t.type;
+ return null === r && (r = "application/octet-stream"), t instanceof n ? (e = "data:" + r, "base64" === t.encoding ? e + ";base64," + t.data : "URI" === t.encoding ? e + "," + decodeURIComponent(t.data) : p ? e + ";base64," + p(t.data) : e + "," + encodeURIComponent(t.data)) : f ? f.call(l, t) : void 0;
+ }, h.revokeObjectURL = function (t) {
+ "data:" !== t.substring(0, 5) && d && d.call(l, t);
+ }, s.append = function (t) {
+ var r = this.data;
+
+ if (y && (t instanceof w || t instanceof y)) {
+ for (var s = "", o = new y(t), u = 0, c = o.length; c > u; u++) {
+ s += String.fromCharCode(o[u]);
+ }
+
+ r.push(s);
+ } else if ("Blob" === e(t) || "File" === e(t)) {
+ if (!i) throw new a("NOT_READABLE_ERR");
+ var l = new i();
+ r.push(l.readAsBinaryString(t));
+ } else t instanceof n ? "base64" === t.encoding && m ? r.push(m(t.data)) : "URI" === t.encoding ? r.push(decodeURIComponent(t.data)) : "raw" === t.encoding && r.push(t.data) : ("string" != typeof t && (t += ""), r.push(unescape(encodeURIComponent(t))));
+ }, s.getBlob = function (t) {
+ return arguments.length || (t = null), new n(this.data.join(""), t, "raw");
+ }, s.toString = function () {
+ return "[object BlobBuilder]";
+ }, o.slice = function (t, e, r) {
+ var s = arguments.length;
+ return 3 > s && (r = null), new n(this.data.slice(t, s > 1 ? e : this.data.length), r, this.encoding);
+ }, o.toString = function () {
+ return "[object Blob]";
+ }, o.close = function () {
+ this.size = this.data.length = 0;
+ }, r;
+ }(t);
+
+ t.Blob = function (t, e) {
+ var n = e ? e.type || "" : "",
+ s = new r();
+ if (t) for (var o = 0, i = t.length; i > o; o++) {
+ s.append(t[o]);
+ }
+ return s.getBlob(n);
+ };
+ }("undefined" != typeof self && self || "undefined" != typeof window && window || this.content || this);
+
+ var n = n || "undefined" != typeof navigator && navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator) || function (t) {
+
+ if ("undefined" == typeof navigator || !/MSIE [1-9]\./.test(navigator.userAgent)) {
+ var e = t.document,
+ r = function r() {
+ return t.URL || t.webkitURL || t;
+ },
+ n = e.createElementNS("http://www.w3.org/1999/xhtml", "a"),
+ s = !t.externalHost && "download" in n,
+ o = function o(r) {
+ var n = e.createEvent("MouseEvents");
+ n.initMouseEvent("click", !0, !1, t, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), r.dispatchEvent(n);
+ },
+ i = t.webkitRequestFileSystem,
+ a = t.requestFileSystem || i || t.mozRequestFileSystem,
+ u = function u(e) {
+ (t.setImmediate || t.setTimeout)(function () {
+ throw e;
+ }, 0);
+ },
+ c = "application/octet-stream",
+ l = 0,
+ f = [],
+ d = function d() {
+ for (var t = f.length; t--;) {
+ var e = f[t];
+ "string" == typeof e ? r().revokeObjectURL(e) : e.remove();
+ }
+
+ f.length = 0;
+ },
+ h = function h(t, e, r) {
+ e = [].concat(e);
+
+ for (var n = e.length; n--;) {
+ var s = t["on" + e[n]];
+ if ("function" == typeof s) try {
+ s.call(t, r || t);
+ } catch (o) {
+ u(o);
+ }
+ }
+ },
+ p = function p(e, u) {
+ var d,
+ p,
+ m,
+ w = this,
+ y = e.type,
+ g = !1,
+ v = function v() {
+ var t = r().createObjectURL(e);
+ return f.push(t), t;
+ },
+ b = function b() {
+ h(w, "writestart progress write writeend".split(" "));
+ },
+ q = function q() {
+ (g || !d) && (d = v()), p ? p.location.href = d : window.open(d, "_blank"), w.readyState = w.DONE, b();
+ },
+ x = function x(t) {
+ return function () {
+ return w.readyState !== w.DONE ? t.apply(this, arguments) : void 0;
+ };
+ },
+ k = {
+ create: !0,
+ exclusive: !1
+ };
+
+ return w.readyState = w.INIT, u || (u = "download"), s ? (d = v(), n.href = d, n.download = u, o(n), w.readyState = w.DONE, b(), void 0) : (t.chrome && y && y !== c && (m = e.slice || e.webkitSlice, e = m.call(e, 0, e.size, c), g = !0), i && "download" !== u && (u += ".download"), (y === c || i) && (p = t), a ? (l += e.size, a(t.TEMPORARY, l, x(function (t) {
+ t.root.getDirectory("saved", k, x(function (t) {
+ var r = function r() {
+ t.getFile(u, k, x(function (t) {
+ t.createWriter(x(function (r) {
+ r.onwriteend = function (e) {
+ p.location.href = t.toURL(), f.push(t), w.readyState = w.DONE, h(w, "writeend", e);
+ }, r.onerror = function () {
+ var t = r.error;
+ t.code !== t.ABORT_ERR && q();
+ }, "writestart progress write abort".split(" ").forEach(function (t) {
+ r["on" + t] = w["on" + t];
+ }), r.write(e), w.abort = function () {
+ r.abort(), w.readyState = w.DONE;
+ }, w.readyState = w.WRITING;
+ }), q);
+ }), q);
+ };
+
+ t.getFile(u, {
+ create: !1
+ }, x(function (t) {
+ t.remove(), r();
+ }), x(function (t) {
+ t.code === t.NOT_FOUND_ERR ? r() : q();
+ }));
+ }), q);
+ }), q), void 0) : (q(), void 0));
+ },
+ m = p.prototype,
+ w = function w(t, e) {
+ return new p(t, e);
+ };
+
+ return m.abort = function () {
+ var t = this;
+ t.readyState = t.DONE, h(t, "abort");
+ }, m.readyState = m.INIT = 0, m.WRITING = 1, m.DONE = 2, m.error = m.onwritestart = m.onprogress = m.onwrite = m.onabort = m.onerror = m.onwriteend = null, t.addEventListener("unload", d, !1), w.unload = function () {
+ d(), t.removeEventListener("unload", d, !1);
+ }, w;
+ }
+ }("undefined" != typeof self && self || "undefined" != typeof window && window || this.content);
+
+ null !== module ? module.exports = n : "undefined" != typeof undefined , void function (t, e) {
+ module.exports = e() ;
+ }(r, function () {
+ var t = "function" == typeof ArrayBuffer && "function" == typeof Uint8Array,
+ e = null,
+ r = function () {
+ if (!t) return function () {
+ return !1;
+ };
+
+ try {
+ var r = bufferEs6;
+ "function" == typeof r.Buffer && (e = r.Buffer);
+ } catch (n) {}
+
+ return function (t) {
+ return t instanceof ArrayBuffer || null !== e && t instanceof e;
+ };
+ }(),
+ n = function () {
+ return null !== e ? function (t) {
+ return new e(t, "utf8").toString("binary");
+ } : function (t) {
+ return unescape(encodeURIComponent(t));
+ };
+ }(),
+ s = 65521,
+ o = function o(t, e) {
+ for (var r = 65535 & t, n = t >>> 16, o = 0, i = e.length; i > o; o++) {
+ r = (r + (255 & e.charCodeAt(o))) % s, n = (n + r) % s;
+ }
+
+ return (n << 16 | r) >>> 0;
+ },
+ i = function i(t, e) {
+ for (var r = 65535 & t, n = t >>> 16, o = 0, i = e.length; i > o; o++) {
+ r = (r + e[o]) % s, n = (n + r) % s;
+ }
+
+ return (n << 16 | r) >>> 0;
+ },
+ a = {},
+ u = a.Adler32 = function () {
+ var e = function e(t) {
+ if (!(this instanceof e)) throw new TypeError("Constructor cannot called be as a function.");
+ if (!isFinite(t = null == t ? 1 : +t)) throw new Error("First arguments needs to be a finite number.");
+ this.checksum = t >>> 0;
+ },
+ s = e.prototype = {};
+
+ return s.constructor = e, e.from = function (t) {
+ return t.prototype = s, t;
+ }(function (t) {
+ if (!(this instanceof e)) throw new TypeError("Constructor cannot called be as a function.");
+ if (null == t) throw new Error("First argument needs to be a string.");
+ this.checksum = o(1, t.toString());
+ }), e.fromUtf8 = function (t) {
+ return t.prototype = s, t;
+ }(function (t) {
+ if (!(this instanceof e)) throw new TypeError("Constructor cannot called be as a function.");
+ if (null == t) throw new Error("First argument needs to be a string.");
+ var r = n(t.toString());
+ this.checksum = o(1, r);
+ }), t && (e.fromBuffer = function (t) {
+ return t.prototype = s, t;
+ }(function (t) {
+ if (!(this instanceof e)) throw new TypeError("Constructor cannot called be as a function.");
+ if (!r(t)) throw new Error("First argument needs to be ArrayBuffer.");
+ var n = new Uint8Array(t);
+ return this.checksum = i(1, n);
+ })), s.update = function (t) {
+ if (null == t) throw new Error("First argument needs to be a string.");
+ return t = t.toString(), this.checksum = o(this.checksum, t);
+ }, s.updateUtf8 = function (t) {
+ if (null == t) throw new Error("First argument needs to be a string.");
+ var e = n(t.toString());
+ return this.checksum = o(this.checksum, e);
+ }, t && (s.updateBuffer = function (t) {
+ if (!r(t)) throw new Error("First argument needs to be ArrayBuffer.");
+ var e = new Uint8Array(t);
+ return this.checksum = i(this.checksum, e);
+ }), s.clone = function () {
+ return new u(this.checksum);
+ }, e;
+ }();
+
+ return a.from = function (t) {
+ if (null == t) throw new Error("First argument needs to be a string.");
+ return o(1, t.toString());
+ }, a.fromUtf8 = function (t) {
+ if (null == t) throw new Error("First argument needs to be a string.");
+ var e = n(t.toString());
+ return o(1, e);
+ }, t && (a.fromBuffer = function (t) {
+ if (!r(t)) throw new Error("First argument need to be ArrayBuffer.");
+ var e = new Uint8Array(t);
+ return i(1, e);
+ }), a;
+ });
+
+ var s = function () {
+ function t() {
+ function t(t) {
+ var e,
+ r,
+ s,
+ o,
+ a,
+ u,
+ c = n.dyn_tree,
+ l = n.stat_desc.static_tree,
+ f = n.stat_desc.extra_bits,
+ h = n.stat_desc.extra_base,
+ p = n.stat_desc.max_length,
+ m = 0;
+
+ for (o = 0; i >= o; o++) {
+ t.bl_count[o] = 0;
+ }
+
+ for (c[2 * t.heap[t.heap_max] + 1] = 0, e = t.heap_max + 1; d > e; e++) {
+ r = t.heap[e], o = c[2 * c[2 * r + 1] + 1] + 1, o > p && (o = p, m++), c[2 * r + 1] = o, r > n.max_code || (t.bl_count[o]++, a = 0, r >= h && (a = f[r - h]), u = c[2 * r], t.opt_len += u * (o + a), l && (t.static_len += u * (l[2 * r + 1] + a)));
+ }
+
+ if (0 !== m) {
+ do {
+ for (o = p - 1; 0 === t.bl_count[o];) {
+ o--;
+ }
+
+ t.bl_count[o]--, t.bl_count[o + 1] += 2, t.bl_count[p]--, m -= 2;
+ } while (m > 0);
+
+ for (o = p; 0 !== o; o--) {
+ for (r = t.bl_count[o]; 0 !== r;) {
+ s = t.heap[--e], s > n.max_code || (c[2 * s + 1] != o && (t.opt_len += (o - c[2 * s + 1]) * c[2 * s], c[2 * s + 1] = o), r--);
+ }
+ }
+ }
+ }
+
+ function e(t, e) {
+ var r = 0;
+
+ do {
+ r |= 1 & t, t >>>= 1, r <<= 1;
+ } while (--e > 0);
+
+ return r >>> 1;
+ }
+
+ function r(t, r, n) {
+ var s,
+ o,
+ a,
+ u = [],
+ c = 0;
+
+ for (s = 1; i >= s; s++) {
+ u[s] = c = c + n[s - 1] << 1;
+ }
+
+ for (o = 0; r >= o; o++) {
+ a = t[2 * o + 1], 0 !== a && (t[2 * o] = e(u[a]++, a));
+ }
+ }
+
+ var n = this;
+
+ n.build_tree = function (e) {
+ var s,
+ o,
+ i,
+ a = n.dyn_tree,
+ u = n.stat_desc.static_tree,
+ c = n.stat_desc.elems,
+ l = -1;
+
+ for (e.heap_len = 0, e.heap_max = d, s = 0; c > s; s++) {
+ 0 !== a[2 * s] ? (e.heap[++e.heap_len] = l = s, e.depth[s] = 0) : a[2 * s + 1] = 0;
+ }
+
+ for (; e.heap_len < 2;) {
+ i = e.heap[++e.heap_len] = 2 > l ? ++l : 0, a[2 * i] = 1, e.depth[i] = 0, e.opt_len--, u && (e.static_len -= u[2 * i + 1]);
+ }
+
+ for (n.max_code = l, s = Math.floor(e.heap_len / 2); s >= 1; s--) {
+ e.pqdownheap(a, s);
+ }
+
+ i = c;
+
+ do {
+ s = e.heap[1], e.heap[1] = e.heap[e.heap_len--], e.pqdownheap(a, 1), o = e.heap[1], e.heap[--e.heap_max] = s, e.heap[--e.heap_max] = o, a[2 * i] = a[2 * s] + a[2 * o], e.depth[i] = Math.max(e.depth[s], e.depth[o]) + 1, a[2 * s + 1] = a[2 * o + 1] = i, e.heap[1] = i++, e.pqdownheap(a, 1);
+ } while (e.heap_len >= 2);
+
+ e.heap[--e.heap_max] = e.heap[1], t(e), r(a, n.max_code, e.bl_count);
+ };
+ }
+
+ function e(t, e, r, n, s) {
+ var o = this;
+ o.static_tree = t, o.extra_bits = e, o.extra_base = r, o.elems = n, o.max_length = s;
+ }
+
+ function r(t, e, r, n, s) {
+ var o = this;
+ o.good_length = t, o.max_lazy = e, o.nice_length = r, o.max_chain = n, o.func = s;
+ }
+
+ function n(t, e, r, n) {
+ var s = t[2 * e],
+ o = t[2 * r];
+ return o > s || s == o && n[e] <= n[r];
+ }
+
+ function s() {
+ function r() {
+ var t;
+
+ for (Ie = 2 * Ce, Be[Pe - 1] = 0, t = 0; Pe - 1 > t; t++) {
+ Be[t] = 0;
+ }
+
+ We = L[Xe].max_lazy, Ke = L[Xe].good_length, Qe = L[Xe].nice_length, Ve = L[Xe].max_chain, Me = 0, Fe = 0, Ge = 0, Le = Je = Z - 1, Ne = 0, Oe = 0;
+ }
+
+ function s() {
+ var t;
+
+ for (t = 0; f > t; t++) {
+ $e[2 * t] = 0;
+ }
+
+ for (t = 0; a > t; t++) {
+ Ze[2 * t] = 0;
+ }
+
+ for (t = 0; u > t; t++) {
+ tr[2 * t] = 0;
+ }
+
+ $e[2 * h] = 1, er.opt_len = er.static_len = 0, ar = cr = 0;
+ }
+
+ function o() {
+ rr.dyn_tree = $e, rr.stat_desc = e.static_l_desc, nr.dyn_tree = Ze, nr.stat_desc = e.static_d_desc, sr.dyn_tree = tr, sr.stat_desc = e.static_bl_desc, fr = 0, dr = 0, lr = 8, s();
+ }
+
+ function i(t, e) {
+ var r,
+ n,
+ s = -1,
+ o = t[1],
+ i = 0,
+ a = 7,
+ u = 4;
+
+ for (0 === o && (a = 138, u = 3), t[2 * (e + 1) + 1] = 65535, r = 0; e >= r; r++) {
+ n = o, o = t[2 * (r + 1) + 1], ++i < a && n == o || (u > i ? tr[2 * n] += i : 0 !== n ? (n != s && tr[2 * n]++, tr[2 * m]++) : 10 >= i ? tr[2 * w]++ : tr[2 * y]++, i = 0, s = n, 0 === o ? (a = 138, u = 3) : n == o ? (a = 6, u = 3) : (a = 7, u = 4));
+ }
+ }
+
+ function c() {
+ var e;
+
+ for (i($e, rr.max_code), i(Ze, nr.max_code), sr.build_tree(er), e = u - 1; e >= 3 && 0 === tr[2 * t.bl_order[e] + 1]; e--) {
+ }
+
+ return er.opt_len += 3 * (e + 1) + 5 + 5 + 4, e;
+ }
+
+ function d(t) {
+ er.pending_buf[er.pending++] = t;
+ }
+
+ function p(t) {
+ d(255 & t), d(t >>> 8 & 255);
+ }
+
+ function O(t) {
+ d(t >> 8 & 255), d(255 & t & 255);
+ }
+
+ function re(t, e) {
+ var r,
+ n = e;
+ dr > g - n ? (r = t, fr |= r << dr & 65535, p(fr), fr = r >>> g - dr, dr += n - g) : (fr |= t << dr & 65535, dr += n);
+ }
+
+ function ne(t, e) {
+ var r = 2 * t;
+ re(65535 & e[r], 65535 & e[r + 1]);
+ }
+
+ function se(t, e) {
+ var r,
+ n,
+ s = -1,
+ o = t[1],
+ i = 0,
+ a = 7,
+ u = 4;
+
+ for (0 === o && (a = 138, u = 3), r = 0; e >= r; r++) {
+ if (n = o, o = t[2 * (r + 1) + 1], !(++i < a && n == o)) {
+ if (u > i) {
+ do {
+ ne(n, tr);
+ } while (0 !== --i);
+ } else 0 !== n ? (n != s && (ne(n, tr), i--), ne(m, tr), re(i - 3, 2)) : 10 >= i ? (ne(w, tr), re(i - 3, 3)) : (ne(y, tr), re(i - 11, 7));
+
+ i = 0, s = n, 0 === o ? (a = 138, u = 3) : n == o ? (a = 6, u = 3) : (a = 7, u = 4);
+ }
+ }
+ }
+
+ function oe(e, r, n) {
+ var s;
+
+ for (re(e - 257, 5), re(r - 1, 5), re(n - 4, 4), s = 0; n > s; s++) {
+ re(tr[2 * t.bl_order[s] + 1], 3);
+ }
+
+ se($e, e - 1), se(Ze, r - 1);
+ }
+
+ function ie() {
+ 16 == dr ? (p(fr), fr = 0, dr = 0) : dr >= 8 && (d(255 & fr), fr >>>= 8, dr -= 8);
+ }
+
+ function ae() {
+ re(Q << 1, 3), ne(h, e.static_ltree), ie(), 9 > 1 + lr + 10 - dr && (re(Q << 1, 3), ne(h, e.static_ltree), ie()), lr = 7;
+ }
+
+ function ue(e, r) {
+ var n, s, o;
+
+ if (er.pending_buf[ur + 2 * ar] = e >>> 8 & 255, er.pending_buf[ur + 2 * ar + 1] = 255 & e, er.pending_buf[or + ar] = 255 & r, ar++, 0 === e ? $e[2 * r]++ : (cr++, e--, $e[2 * (t._length_code[r] + l + 1)]++, Ze[2 * t.d_code(e)]++), 0 === (8191 & ar) && Xe > 2) {
+ for (n = 8 * ar, s = Me - Fe, o = 0; a > o; o++) {
+ n += Ze[2 * o] * (5 + t.extra_dbits[o]);
+ }
+
+ if (n >>>= 3, cr < Math.floor(ar / 2) && n < Math.floor(s / 2)) return !0;
+ }
+
+ return ar == ir - 1;
+ }
+
+ function ce(e, r) {
+ var n,
+ s,
+ o,
+ i,
+ a = 0;
+ if (0 !== ar) do {
+ n = er.pending_buf[ur + 2 * a] << 8 & 65280 | 255 & er.pending_buf[ur + 2 * a + 1], s = 255 & er.pending_buf[or + a], a++, 0 === n ? ne(s, e) : (o = t._length_code[s], ne(o + l + 1, e), i = t.extra_lbits[o], 0 !== i && (s -= t.base_length[o], re(s, i)), n--, o = t.d_code(n), ne(o, r), i = t.extra_dbits[o], 0 !== i && (n -= t.base_dist[o], re(n, i)));
+ } while (ar > a);
+ ne(h, e), lr = e[2 * h + 1];
+ }
+
+ function le() {
+ dr > 8 ? p(fr) : dr > 0 && d(255 & fr), fr = 0, dr = 0;
+ }
+
+ function fe(t, e, r) {
+ le(), lr = 8, r && (p(e), p(~e)), er.pending_buf.set(ze.subarray(t, t + e), er.pending), er.pending += e;
+ }
+
+ function de(t, e, r) {
+ re((K << 1) + (r ? 1 : 0), 3), fe(t, e, !0);
+ }
+
+ function he(t, r, n) {
+ var o,
+ i,
+ a = 0;
+ Xe > 0 ? (rr.build_tree(er), nr.build_tree(er), a = c(), o = er.opt_len + 3 + 7 >>> 3, i = er.static_len + 3 + 7 >>> 3, o >= i && (o = i)) : o = i = r + 5, o >= r + 4 && -1 != t ? de(t, r, n) : i == o ? (re((Q << 1) + (n ? 1 : 0), 3), ce(e.static_ltree, e.static_dtree)) : (re(($ << 1) + (n ? 1 : 0), 3), oe(rr.max_code + 1, nr.max_code + 1, a + 1), ce($e, Ze)), s(), n && le();
+ }
+
+ function pe(t) {
+ he(Fe >= 0 ? Fe : -1, Me - Fe, t), Fe = Me, qe.flush_pending();
+ }
+
+ function me() {
+ var t, e, r, n;
+
+ do {
+ if (n = Ie - Ge - Me, 0 === n && 0 === Me && 0 === Ge) n = Ce;else if (-1 == n) n--;else if (Me >= Ce + Ce - ee) {
+ ze.set(ze.subarray(Ce, Ce + Ce), 0), He -= Ce, Me -= Ce, Fe -= Ce, t = Pe, r = t;
+
+ do {
+ e = 65535 & Be[--r], Be[r] = e >= Ce ? e - Ce : 0;
+ } while (0 !== --t);
+
+ t = Ce, r = t;
+
+ do {
+ e = 65535 & Te[--r], Te[r] = e >= Ce ? e - Ce : 0;
+ } while (0 !== --t);
+
+ n += Ce;
+ }
+ if (0 === qe.avail_in) return;
+ t = qe.read_buf(ze, Me + Ge, n), Ge += t, Ge >= Z && (Oe = 255 & ze[Me], Oe = (Oe << Ue ^ 255 & ze[Me + 1]) & De);
+ } while (ee > Ge && 0 !== qe.avail_in);
+ }
+
+ function we(t) {
+ var e,
+ r = 65535;
+
+ for (r > ke - 5 && (r = ke - 5);;) {
+ if (1 >= Ge) {
+ if (me(), 0 === Ge && t == k) return N;
+ if (0 === Ge) break;
+ }
+
+ if (Me += Ge, Ge = 0, e = Fe + r, (0 === Me || Me >= e) && (Ge = Me - e, Me = e, pe(!1), 0 === qe.avail_out)) return N;
+ if (Me - Fe >= Ce - ee && (pe(!1), 0 === qe.avail_out)) return N;
+ }
+
+ return pe(t == C), 0 === qe.avail_out ? t == C ? H : N : t == C ? G : M;
+ }
+
+ function ye(t) {
+ var e,
+ r,
+ n = Ve,
+ s = Me,
+ o = Je,
+ i = Me > Ce - ee ? Me - (Ce - ee) : 0,
+ a = Qe,
+ u = Ee,
+ c = Me + te,
+ l = ze[s + o - 1],
+ f = ze[s + o];
+ Je >= Ke && (n >>= 2), a > Ge && (a = Ge);
+
+ do {
+ if (e = t, ze[e + o] == f && ze[e + o - 1] == l && ze[e] == ze[s] && ze[++e] == ze[s + 1]) {
+ s += 2, e++;
+
+ do {
+ } while (ze[++s] == ze[++e] && ze[++s] == ze[++e] && ze[++s] == ze[++e] && ze[++s] == ze[++e] && ze[++s] == ze[++e] && ze[++s] == ze[++e] && ze[++s] == ze[++e] && ze[++s] == ze[++e] && c > s);
+
+ if (r = te - (c - s), s = c - te, r > o) {
+ if (He = t, o = r, r >= a) break;
+ l = ze[s + o - 1], f = ze[s + o];
+ }
+ }
+ } while ((t = 65535 & Te[t & u]) > i && 0 !== --n);
+
+ return Ge >= o ? o : Ge;
+ }
+
+ function ge(t) {
+ for (var e, r = 0;;) {
+ if (ee > Ge) {
+ if (me(), ee > Ge && t == k) return N;
+ if (0 === Ge) break;
+ }
+
+ if (Ge >= Z && (Oe = (Oe << Ue ^ 255 & ze[Me + (Z - 1)]) & De, r = 65535 & Be[Oe], Te[Me & Ee] = Be[Oe], Be[Oe] = Me), 0 !== r && Ce - ee >= (Me - r & 65535) && Ye != q && (Le = ye(r)), Le >= Z) {
+ if (e = ue(Me - He, Le - Z), Ge -= Le, We >= Le && Ge >= Z) {
+ Le--;
+
+ do {
+ Me++, Oe = (Oe << Ue ^ 255 & ze[Me + (Z - 1)]) & De, r = 65535 & Be[Oe], Te[Me & Ee] = Be[Oe], Be[Oe] = Me;
+ } while (0 !== --Le);
+
+ Me++;
+ } else Me += Le, Le = 0, Oe = 255 & ze[Me], Oe = (Oe << Ue ^ 255 & ze[Me + 1]) & De;
+ } else e = ue(0, 255 & ze[Me]), Ge--, Me++;
+ if (e && (pe(!1), 0 === qe.avail_out)) return N;
+ }
+
+ return pe(t == C), 0 === qe.avail_out ? t == C ? H : N : t == C ? G : M;
+ }
+
+ function ve(t) {
+ for (var e, r, n = 0;;) {
+ if (ee > Ge) {
+ if (me(), ee > Ge && t == k) return N;
+ if (0 === Ge) break;
+ }
+
+ if (Ge >= Z && (Oe = (Oe << Ue ^ 255 & ze[Me + (Z - 1)]) & De, n = 65535 & Be[Oe], Te[Me & Ee] = Be[Oe], Be[Oe] = Me), Je = Le, je = He, Le = Z - 1, 0 !== n && We > Je && Ce - ee >= (Me - n & 65535) && (Ye != q && (Le = ye(n)), 5 >= Le && (Ye == b || Le == Z && Me - He > 4096) && (Le = Z - 1)), Je >= Z && Je >= Le) {
+ r = Me + Ge - Z, e = ue(Me - 1 - je, Je - Z), Ge -= Je - 1, Je -= 2;
+
+ do {
+ ++Me <= r && (Oe = (Oe << Ue ^ 255 & ze[Me + (Z - 1)]) & De, n = 65535 & Be[Oe], Te[Me & Ee] = Be[Oe], Be[Oe] = Me);
+ } while (0 !== --Je);
+
+ if (Ne = 0, Le = Z - 1, Me++, e && (pe(!1), 0 === qe.avail_out)) return N;
+ } else if (0 !== Ne) {
+ if (e = ue(0, 255 & ze[Me - 1]), e && pe(!1), Me++, Ge--, 0 === qe.avail_out) return N;
+ } else Ne = 1, Me++, Ge--;
+ }
+
+ return 0 !== Ne && (e = ue(0, 255 & ze[Me - 1]), Ne = 0), pe(t == C), 0 === qe.avail_out ? t == C ? H : N : t == C ? G : M;
+ }
+
+ function be(t) {
+ return t.total_in = t.total_out = 0, t.msg = null, er.pending = 0, er.pending_out = 0, xe = W, Ae = k, o(), r(), S;
+ }
+
+ var qe,
+ xe,
+ ke,
+ Ae,
+ Ce,
+ Se,
+ Ee,
+ ze,
+ Ie,
+ Te,
+ Be,
+ Oe,
+ Pe,
+ Re,
+ De,
+ Ue,
+ Fe,
+ Le,
+ je,
+ Ne,
+ Me,
+ He,
+ Ge,
+ Je,
+ Ve,
+ We,
+ Xe,
+ Ye,
+ Ke,
+ Qe,
+ $e,
+ Ze,
+ tr,
+ er = this,
+ rr = new t(),
+ nr = new t(),
+ sr = new t();
+
+ er.depth = [];
+ var or, ir, ar, ur, cr, lr, fr, dr;
+ er.bl_count = [], er.heap = [], $e = [], Ze = [], tr = [], er.pqdownheap = function (t, e) {
+ for (var r = er.heap, s = r[e], o = e << 1; o <= er.heap_len && (o < er.heap_len && n(t, r[o + 1], r[o], er.depth) && o++, !n(t, s, r[o], er.depth));) {
+ r[e] = r[o], e = o, o <<= 1;
+ }
+
+ r[e] = s;
+ }, er.deflateInit = function (t, e, r, n, s, o) {
+ return n || (n = Y), s || (s = R), o || (o = x), t.msg = null, e == v && (e = 6), 1 > s || s > P || n != Y || 9 > r || r > 15 || 0 > e || e > 9 || 0 > o || o > q ? I : (t.dstate = er, Se = r, Ce = 1 << Se, Ee = Ce - 1, Re = s + 7, Pe = 1 << Re, De = Pe - 1, Ue = Math.floor((Re + Z - 1) / Z), ze = new Uint8Array(2 * Ce), Te = [], Be = [], ir = 1 << s + 6, er.pending_buf = new Uint8Array(4 * ir), ke = 4 * ir, ur = Math.floor(ir / 2), or = 3 * ir, Xe = e, Ye = o, be(t));
+ }, er.deflateEnd = function () {
+ return xe != V && xe != W && xe != X ? I : (er.pending_buf = null, Be = null, Te = null, ze = null, er.dstate = null, xe == W ? T : S);
+ }, er.deflateParams = function (t, e, r) {
+ var n = S;
+ return e == v && (e = 6), 0 > e || e > 9 || 0 > r || r > q ? I : (L[Xe].func != L[e].func && 0 !== t.total_in && (n = t.deflate(_)), Xe != e && (Xe = e, We = L[Xe].max_lazy, Ke = L[Xe].good_length, Qe = L[Xe].nice_length, Ve = L[Xe].max_chain), Ye = r, n);
+ }, er.deflateSetDictionary = function (t, e, r) {
+ var n,
+ s = r,
+ o = 0;
+ if (!e || xe != V) return I;
+ if (Z > s) return S;
+
+ for (s > Ce - ee && (s = Ce - ee, o = r - s), ze.set(e.subarray(o, o + s), 0), Me = s, Fe = s, Oe = 255 & ze[0], Oe = (Oe << Ue ^ 255 & ze[1]) & De, n = 0; s - Z >= n; n++) {
+ Oe = (Oe << Ue ^ 255 & ze[n + (Z - 1)]) & De, Te[n & Ee] = Be[Oe], Be[Oe] = n;
+ }
+
+ return S;
+ }, er.deflate = function (t, e) {
+ var r, n, s, o, i;
+ if (e > C || 0 > e) return I;
+ if (!t.next_out || !t.next_in && 0 !== t.avail_in || xe == X && e != C) return t.msg = j[z - I], I;
+ if (0 === t.avail_out) return t.msg = j[z - B], B;
+
+ if (qe = t, o = Ae, Ae = e, xe == V && (n = Y + (Se - 8 << 4) << 8, s = (Xe - 1 & 255) >> 1, s > 3 && (s = 3), n |= s << 6, 0 !== Me && (n |= J), n += 31 - n % 31, xe = W, O(n)), 0 !== er.pending) {
+ if (qe.flush_pending(), 0 === qe.avail_out) return Ae = -1, S;
+ } else if (0 === qe.avail_in && o >= e && e != C) return qe.msg = j[z - B], B;
+
+ if (xe == X && 0 !== qe.avail_in) return t.msg = j[z - B], B;
+
+ if (0 !== qe.avail_in || 0 !== Ge || e != k && xe != X) {
+ switch (i = -1, L[Xe].func) {
+ case D:
+ i = we(e);
+ break;
+
+ case U:
+ i = ge(e);
+ break;
+
+ case F:
+ i = ve(e);
+ }
+
+ if ((i == H || i == G) && (xe = X), i == N || i == H) return 0 === qe.avail_out && (Ae = -1), S;
+
+ if (i == M) {
+ if (e == _) ae();else if (de(0, 0, !1), e == A) for (r = 0; Pe > r; r++) {
+ Be[r] = 0;
+ }
+ if (qe.flush_pending(), 0 === qe.avail_out) return Ae = -1, S;
+ }
+ }
+
+ return e != C ? S : E;
+ };
+ }
+
+ function o() {
+ var t = this;
+ t.next_in_index = 0, t.next_out_index = 0, t.avail_in = 0, t.total_in = 0, t.avail_out = 0, t.total_out = 0;
+ }
+
+ var i = 15,
+ a = 30,
+ u = 19,
+ c = 29,
+ l = 256,
+ f = l + 1 + c,
+ d = 2 * f + 1,
+ h = 256,
+ p = 7,
+ m = 16,
+ w = 17,
+ y = 18,
+ g = 16,
+ v = -1,
+ b = 1,
+ q = 2,
+ x = 0,
+ k = 0,
+ _ = 1,
+ A = 3,
+ C = 4,
+ S = 0,
+ E = 1,
+ z = 2,
+ I = -2,
+ T = -3,
+ B = -5,
+ O = [0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29];
+ t._length_code = [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28], t.base_length = [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 0], t.base_dist = [0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576], t.d_code = function (t) {
+ return 256 > t ? O[t] : O[256 + (t >>> 7)];
+ }, t.extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], t.extra_dbits = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], t.extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], t.bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], e.static_ltree = [12, 8, 140, 8, 76, 8, 204, 8, 44, 8, 172, 8, 108, 8, 236, 8, 28, 8, 156, 8, 92, 8, 220, 8, 60, 8, 188, 8, 124, 8, 252, 8, 2, 8, 130, 8, 66, 8, 194, 8, 34, 8, 162, 8, 98, 8, 226, 8, 18, 8, 146, 8, 82, 8, 210, 8, 50, 8, 178, 8, 114, 8, 242, 8, 10, 8, 138, 8, 74, 8, 202, 8, 42, 8, 170, 8, 106, 8, 234, 8, 26, 8, 154, 8, 90, 8, 218, 8, 58, 8, 186, 8, 122, 8, 250, 8, 6, 8, 134, 8, 70, 8, 198, 8, 38, 8, 166, 8, 102, 8, 230, 8, 22, 8, 150, 8, 86, 8, 214, 8, 54, 8, 182, 8, 118, 8, 246, 8, 14, 8, 142, 8, 78, 8, 206, 8, 46, 8, 174, 8, 110, 8, 238, 8, 30, 8, 158, 8, 94, 8, 222, 8, 62, 8, 190, 8, 126, 8, 254, 8, 1, 8, 129, 8, 65, 8, 193, 8, 33, 8, 161, 8, 97, 8, 225, 8, 17, 8, 145, 8, 81, 8, 209, 8, 49, 8, 177, 8, 113, 8, 241, 8, 9, 8, 137, 8, 73, 8, 201, 8, 41, 8, 169, 8, 105, 8, 233, 8, 25, 8, 153, 8, 89, 8, 217, 8, 57, 8, 185, 8, 121, 8, 249, 8, 5, 8, 133, 8, 69, 8, 197, 8, 37, 8, 165, 8, 101, 8, 229, 8, 21, 8, 149, 8, 85, 8, 213, 8, 53, 8, 181, 8, 117, 8, 245, 8, 13, 8, 141, 8, 77, 8, 205, 8, 45, 8, 173, 8, 109, 8, 237, 8, 29, 8, 157, 8, 93, 8, 221, 8, 61, 8, 189, 8, 125, 8, 253, 8, 19, 9, 275, 9, 147, 9, 403, 9, 83, 9, 339, 9, 211, 9, 467, 9, 51, 9, 307, 9, 179, 9, 435, 9, 115, 9, 371, 9, 243, 9, 499, 9, 11, 9, 267, 9, 139, 9, 395, 9, 75, 9, 331, 9, 203, 9, 459, 9, 43, 9, 299, 9, 171, 9, 427, 9, 107, 9, 363, 9, 235, 9, 491, 9, 27, 9, 283, 9, 155, 9, 411, 9, 91, 9, 347, 9, 219, 9, 475, 9, 59, 9, 315, 9, 187, 9, 443, 9, 123, 9, 379, 9, 251, 9, 507, 9, 7, 9, 263, 9, 135, 9, 391, 9, 71, 9, 327, 9, 199, 9, 455, 9, 39, 9, 295, 9, 167, 9, 423, 9, 103, 9, 359, 9, 231, 9, 487, 9, 23, 9, 279, 9, 151, 9, 407, 9, 87, 9, 343, 9, 215, 9, 471, 9, 55, 9, 311, 9, 183, 9, 439, 9, 119, 9, 375, 9, 247, 9, 503, 9, 15, 9, 271, 9, 143, 9, 399, 9, 79, 9, 335, 9, 207, 9, 463, 9, 47, 9, 303, 9, 175, 9, 431, 9, 111, 9, 367, 9, 239, 9, 495, 9, 31, 9, 287, 9, 159, 9, 415, 9, 95, 9, 351, 9, 223, 9, 479, 9, 63, 9, 319, 9, 191, 9, 447, 9, 127, 9, 383, 9, 255, 9, 511, 9, 0, 7, 64, 7, 32, 7, 96, 7, 16, 7, 80, 7, 48, 7, 112, 7, 8, 7, 72, 7, 40, 7, 104, 7, 24, 7, 88, 7, 56, 7, 120, 7, 4, 7, 68, 7, 36, 7, 100, 7, 20, 7, 84, 7, 52, 7, 116, 7, 3, 8, 131, 8, 67, 8, 195, 8, 35, 8, 163, 8, 99, 8, 227, 8], e.static_dtree = [0, 5, 16, 5, 8, 5, 24, 5, 4, 5, 20, 5, 12, 5, 28, 5, 2, 5, 18, 5, 10, 5, 26, 5, 6, 5, 22, 5, 14, 5, 30, 5, 1, 5, 17, 5, 9, 5, 25, 5, 5, 5, 21, 5, 13, 5, 29, 5, 3, 5, 19, 5, 11, 5, 27, 5, 7, 5, 23, 5], e.static_l_desc = new e(e.static_ltree, t.extra_lbits, l + 1, f, i), e.static_d_desc = new e(e.static_dtree, t.extra_dbits, 0, a, i), e.static_bl_desc = new e(null, t.extra_blbits, 0, u, p);
+ var P = 9,
+ R = 8,
+ D = 0,
+ U = 1,
+ F = 2,
+ L = [new r(0, 0, 0, 0, D), new r(4, 4, 8, 4, U), new r(4, 5, 16, 8, U), new r(4, 6, 32, 32, U), new r(4, 4, 16, 16, F), new r(8, 16, 32, 32, F), new r(8, 16, 128, 128, F), new r(8, 32, 128, 256, F), new r(32, 128, 258, 1024, F), new r(32, 258, 258, 4096, F)],
+ j = ["need dictionary", "stream end", "", "", "stream error", "data error", "", "buffer error", "", ""],
+ N = 0,
+ M = 1,
+ H = 2,
+ G = 3,
+ J = 32,
+ V = 42,
+ W = 113,
+ X = 666,
+ Y = 8,
+ K = 0,
+ Q = 1,
+ $ = 2,
+ Z = 3,
+ te = 258,
+ ee = te + Z + 1;
+ return o.prototype = {
+ deflateInit: function deflateInit(t, e) {
+ var r = this;
+ return r.dstate = new s(), e || (e = i), r.dstate.deflateInit(r, t, e);
+ },
+ deflate: function deflate(t) {
+ var e = this;
+ return e.dstate ? e.dstate.deflate(e, t) : I;
+ },
+ deflateEnd: function deflateEnd() {
+ var t = this;
+ if (!t.dstate) return I;
+ var e = t.dstate.deflateEnd();
+ return t.dstate = null, e;
+ },
+ deflateParams: function deflateParams(t, e) {
+ var r = this;
+ return r.dstate ? r.dstate.deflateParams(r, t, e) : I;
+ },
+ deflateSetDictionary: function deflateSetDictionary(t, e) {
+ var r = this;
+ return r.dstate ? r.dstate.deflateSetDictionary(r, t, e) : I;
+ },
+ read_buf: function read_buf(t, e, r) {
+ var n = this,
+ s = n.avail_in;
+ return s > r && (s = r), 0 === s ? 0 : (n.avail_in -= s, t.set(n.next_in.subarray(n.next_in_index, n.next_in_index + s), e), n.next_in_index += s, n.total_in += s, s);
+ },
+ flush_pending: function flush_pending() {
+ var t = this,
+ e = t.dstate.pending;
+ e > t.avail_out && (e = t.avail_out), 0 !== e && (t.next_out.set(t.dstate.pending_buf.subarray(t.dstate.pending_out, t.dstate.pending_out + e), t.next_out_index), t.next_out_index += e, t.dstate.pending_out += e, t.total_out += e, t.avail_out -= e, t.dstate.pending -= e, 0 === t.dstate.pending && (t.dstate.pending_out = 0));
+ }
+ }, function (t) {
+ var e = this,
+ r = new o(),
+ n = 512,
+ s = k,
+ i = new Uint8Array(n);
+ "undefined" == typeof t && (t = v), r.deflateInit(t), r.next_out = i, e.append = function (t, e) {
+ var o,
+ a,
+ u = [],
+ c = 0,
+ l = 0,
+ f = 0;
+
+ if (t.length) {
+ r.next_in_index = 0, r.next_in = t, r.avail_in = t.length;
+
+ do {
+ if (r.next_out_index = 0, r.avail_out = n, o = r.deflate(s), o != S) throw "deflating: " + r.msg;
+ r.next_out_index && (r.next_out_index == n ? u.push(new Uint8Array(i)) : u.push(new Uint8Array(i.subarray(0, r.next_out_index)))), f += r.next_out_index, e && r.next_in_index > 0 && r.next_in_index != c && (e(r.next_in_index), c = r.next_in_index);
+ } while (r.avail_in > 0 || 0 === r.avail_out);
+
+ return a = new Uint8Array(f), u.forEach(function (t) {
+ a.set(t, l), l += t.length;
+ }), a;
+ }
+ }, e.flush = function () {
+ var t,
+ e,
+ s = [],
+ o = 0,
+ a = 0;
+
+ do {
+ if (r.next_out_index = 0, r.avail_out = n, t = r.deflate(C), t != E && t != S) throw "deflating: " + r.msg;
+ n - r.avail_out > 0 && s.push(new Uint8Array(i.subarray(0, r.next_out_index))), a += r.next_out_index;
+ } while (r.avail_in > 0 || 0 === r.avail_out);
+
+ return r.deflateEnd(), e = new Uint8Array(a), s.forEach(function (t) {
+ e.set(t, o), o += t.length;
+ }), e;
+ };
+ };
+ }();
+
+ !function (t) {
+ var e;
+ e = function () {
+ function e(t) {
+ var e, r, n, s, o, i, a, u, c, l, f, d, h, p, m;
+
+ for (this.data = t, this.pos = 8, this.palette = [], this.imgData = [], this.transparency = {}, this.animation = null, this.text = {}, i = null;;) {
+ switch (e = this.readUInt32(), l = function () {
+ var t, e;
+
+ for (e = [], a = t = 0; 4 > t; a = ++t) {
+ e.push(String.fromCharCode(this.data[this.pos++]));
+ }
+
+ return e;
+ }.call(this).join("")) {
+ case "IHDR":
+ this.width = this.readUInt32(), this.height = this.readUInt32(), this.bits = this.data[this.pos++], this.colorType = this.data[this.pos++], this.compressionMethod = this.data[this.pos++], this.filterMethod = this.data[this.pos++], this.interlaceMethod = this.data[this.pos++];
+ break;
+
+ case "acTL":
+ this.animation = {
+ numFrames: this.readUInt32(),
+ numPlays: this.readUInt32() || 1 / 0,
+ frames: []
+ };
+ break;
+
+ case "PLTE":
+ this.palette = this.read(e);
+ break;
+
+ case "fcTL":
+ i && this.animation.frames.push(i), this.pos += 4, i = {
+ width: this.readUInt32(),
+ height: this.readUInt32(),
+ xOffset: this.readUInt32(),
+ yOffset: this.readUInt32()
+ }, o = this.readUInt16(), s = this.readUInt16() || 100, i.delay = 1e3 * o / s, i.disposeOp = this.data[this.pos++], i.blendOp = this.data[this.pos++], i.data = [];
+ break;
+
+ case "IDAT":
+ case "fdAT":
+ for ("fdAT" === l && (this.pos += 4, e -= 4), t = (null != i ? i.data : void 0) || this.imgData, a = h = 0; e >= 0 ? e > h : h > e; a = e >= 0 ? ++h : --h) {
+ t.push(this.data[this.pos++]);
+ }
+
+ break;
+
+ case "tRNS":
+ switch (this.transparency = {}, this.colorType) {
+ case 3:
+ if (n = this.palette.length / 3, this.transparency.indexed = this.read(e), this.transparency.indexed.length > n) throw new Error("More transparent colors than palette size");
+ if (f = n - this.transparency.indexed.length, f > 0) for (a = p = 0; f >= 0 ? f > p : p > f; a = f >= 0 ? ++p : --p) {
+ this.transparency.indexed.push(255);
+ }
+ break;
+
+ case 0:
+ this.transparency.grayscale = this.read(e)[0];
+ break;
+
+ case 2:
+ this.transparency.rgb = this.read(e);
+ }
+
+ break;
+
+ case "tEXt":
+ d = this.read(e), u = d.indexOf(0), c = String.fromCharCode.apply(String, d.slice(0, u)), this.text[c] = String.fromCharCode.apply(String, d.slice(u + 1));
+ break;
+
+ case "IEND":
+ return i && this.animation.frames.push(i), this.colors = function () {
+ switch (this.colorType) {
+ case 0:
+ case 3:
+ case 4:
+ return 1;
+
+ case 2:
+ case 6:
+ return 3;
+ }
+ }.call(this), this.hasAlphaChannel = 4 === (m = this.colorType) || 6 === m, r = this.colors + (this.hasAlphaChannel ? 1 : 0), this.pixelBitlength = this.bits * r, this.colorSpace = function () {
+ switch (this.colors) {
+ case 1:
+ return "DeviceGray";
+
+ case 3:
+ return "DeviceRGB";
+ }
+ }.call(this), this.imgData = new Uint8Array(this.imgData), void 0;
+
+ default:
+ this.pos += e;
+ }
+
+ if (this.pos += 4, this.pos > this.data.length) throw new Error("Incomplete or corrupt PNG file");
+ }
+ }
+
+ var n, s, a, u, c, l;
+ e.load = function (t, r, n) {
+ var s;
+ return "function" == typeof r && (n = r), s = new XMLHttpRequest(), s.open("GET", t, !0), s.responseType = "arraybuffer", s.onload = function () {
+ var t, o;
+ return t = new Uint8Array(s.response || s.mozResponseArrayBuffer), o = new e(t), "function" == typeof (null != r ? r.getContext : void 0) && o.render(r), "function" == typeof n ? n(o) : void 0;
+ }, s.send(null);
+ }, s = 1, a = 2, n = 0, e.prototype.read = function (t) {
+ var e, r, n;
+
+ for (n = [], e = r = 0; t >= 0 ? t > r : r > t; e = t >= 0 ? ++r : --r) {
+ n.push(this.data[this.pos++]);
+ }
+
+ return n;
+ }, e.prototype.readUInt32 = function () {
+ var t, e, r, n;
+ return t = this.data[this.pos++] << 24, e = this.data[this.pos++] << 16, r = this.data[this.pos++] << 8, n = this.data[this.pos++], t | e | r | n;
+ }, e.prototype.readUInt16 = function () {
+ var t, e;
+ return t = this.data[this.pos++] << 8, e = this.data[this.pos++], t | e;
+ }, e.prototype.decodePixels = function (t) {
+ var e, r, n, s, o, a, u, c, l, f, d, h, p, m, w, y, g, v, b, q, x, k, _;
+
+ if (null == t && (t = this.imgData), 0 === t.length) return new Uint8Array(0);
+
+ for (t = new i(t), t = t.getBytes(), h = this.pixelBitlength / 8, y = h * this.width, p = new Uint8Array(y * this.height), a = t.length, w = 0, m = 0, r = 0; a > m;) {
+ switch (t[m++]) {
+ case 0:
+ for (s = b = 0; y > b; s = b += 1) {
+ p[r++] = t[m++];
+ }
+
+ break;
+
+ case 1:
+ for (s = q = 0; y > q; s = q += 1) {
+ e = t[m++], o = h > s ? 0 : p[r - h], p[r++] = (e + o) % 256;
+ }
+
+ break;
+
+ case 2:
+ for (s = x = 0; y > x; s = x += 1) {
+ e = t[m++], n = (s - s % h) / h, g = w && p[(w - 1) * y + n * h + s % h], p[r++] = (g + e) % 256;
+ }
+
+ break;
+
+ case 3:
+ for (s = k = 0; y > k; s = k += 1) {
+ e = t[m++], n = (s - s % h) / h, o = h > s ? 0 : p[r - h], g = w && p[(w - 1) * y + n * h + s % h], p[r++] = (e + Math.floor((o + g) / 2)) % 256;
+ }
+
+ break;
+
+ case 4:
+ for (s = _ = 0; y > _; s = _ += 1) {
+ e = t[m++], n = (s - s % h) / h, o = h > s ? 0 : p[r - h], 0 === w ? g = v = 0 : (g = p[(w - 1) * y + n * h + s % h], v = n && p[(w - 1) * y + (n - 1) * h + s % h]), u = o + g - v, c = Math.abs(u - o), f = Math.abs(u - g), d = Math.abs(u - v), l = f >= c && d >= c ? o : d >= f ? g : v, p[r++] = (e + l) % 256;
+ }
+
+ break;
+
+ default:
+ throw new Error("Invalid filter algorithm: " + t[m - 1]);
+ }
+
+ w++;
+ }
+
+ return p;
+ }, e.prototype.decodePalette = function () {
+ var t, e, r, n, s, o, i, a, u, c;
+
+ for (n = this.palette, i = this.transparency.indexed || [], o = new Uint8Array((i.length || 0) + n.length), s = 0, r = n.length, t = 0, e = a = 0, u = n.length; u > a; e = a += 3) {
+ o[s++] = n[e], o[s++] = n[e + 1], o[s++] = n[e + 2], o[s++] = null != (c = i[t++]) ? c : 255;
+ }
+
+ return o;
+ }, e.prototype.copyToImageData = function (t, e) {
+ var r, n, s, o, i, a, u, c, l, f, d;
+ if (n = this.colors, l = null, r = this.hasAlphaChannel, this.palette.length && (l = null != (d = this._decodedPalette) ? d : this._decodedPalette = this.decodePalette(), n = 4, r = !0), s = t.data || t, c = s.length, i = l || e, o = a = 0, 1 === n) for (; c > o;) {
+ u = l ? 4 * e[o / 4] : a, f = i[u++], s[o++] = f, s[o++] = f, s[o++] = f, s[o++] = r ? i[u++] : 255, a = u;
+ } else for (; c > o;) {
+ u = l ? 4 * e[o / 4] : a, s[o++] = i[u++], s[o++] = i[u++], s[o++] = i[u++], s[o++] = r ? i[u++] : 255, a = u;
+ }
+ }, e.prototype.decode = function () {
+ var t;
+ return t = new Uint8Array(this.width * this.height * 4), this.copyToImageData(t, this.decodePixels()), t;
+ };
+
+ try {
+ c = t.document.createElement("canvas"), l = c.getContext("2d");
+ } catch (f) {
+ return -1;
+ }
+
+ return u = function u(t) {
+ var e;
+ return l.width = t.width, l.height = t.height, l.clearRect(0, 0, t.width, t.height), l.putImageData(t, 0, 0), e = new Image(), e.src = c.toDataURL(), e;
+ }, e.prototype.decodeFrames = function (t) {
+ var e, r, n, s, o, i, a, c;
+
+ if (this.animation) {
+ for (a = this.animation.frames, c = [], r = o = 0, i = a.length; i > o; r = ++o) {
+ e = a[r], n = t.createImageData(e.width, e.height), s = this.decodePixels(new Uint8Array(e.data)), this.copyToImageData(n, s), e.imageData = n, c.push(e.image = u(n));
+ }
+
+ return c;
+ }
+ }, e.prototype.renderFrame = function (t, e) {
+ var r, o, i;
+ return o = this.animation.frames, r = o[e], i = o[e - 1], 0 === e && t.clearRect(0, 0, this.width, this.height), (null != i ? i.disposeOp : void 0) === s ? t.clearRect(i.xOffset, i.yOffset, i.width, i.height) : (null != i ? i.disposeOp : void 0) === a && t.putImageData(i.imageData, i.xOffset, i.yOffset), r.blendOp === n && t.clearRect(r.xOffset, r.yOffset, r.width, r.height), t.drawImage(r.image, r.xOffset, r.yOffset);
+ }, e.prototype.animate = function (t) {
+ var _e2,
+ r,
+ n,
+ s,
+ o,
+ i,
+ a = this;
+
+ return r = 0, i = this.animation, s = i.numFrames, n = i.frames, o = i.numPlays, (_e2 = function e() {
+ var i, u;
+ return i = r++ % s, u = n[i], a.renderFrame(t, i), s > 1 && o > r / s ? a.animation._timeout = setTimeout(_e2, u.delay) : void 0;
+ })();
+ }, e.prototype.stopAnimation = function () {
+ var t;
+ return clearTimeout(null != (t = this.animation) ? t._timeout : void 0);
+ }, e.prototype.render = function (t) {
+ var e, r;
+ return t._png && t._png.stopAnimation(), t._png = this, t.width = this.width, t.height = this.height, e = t.getContext("2d"), this.animation ? (this.decodeFrames(e), this.animate(e)) : (r = e.createImageData(this.width, this.height), this.copyToImageData(r, this.decodePixels()), e.putImageData(r, 0, 0));
+ }, e;
+ }(), t.PNG = e;
+ }("undefined" != typeof window && window || this);
+
+ var o = function () {
+ function t() {
+ this.pos = 0, this.bufferLength = 0, this.eof = !1, this.buffer = null;
+ }
+
+ return t.prototype = {
+ ensureBuffer: function ensureBuffer(t) {
+ var e = this.buffer,
+ r = e ? e.byteLength : 0;
+ if (r > t) return e;
+
+ for (var n = 512; t > n;) {
+ n <<= 1;
+ }
+
+ for (var s = new Uint8Array(n), o = 0; r > o; ++o) {
+ s[o] = e[o];
+ }
+
+ return this.buffer = s;
+ },
+ getByte: function getByte() {
+ for (var t = this.pos; this.bufferLength <= t;) {
+ if (this.eof) return null;
+ this.readBlock();
+ }
+
+ return this.buffer[this.pos++];
+ },
+ getBytes: function getBytes(t) {
+ var e = this.pos;
+
+ if (t) {
+ this.ensureBuffer(e + t);
+
+ for (var r = e + t; !this.eof && this.bufferLength < r;) {
+ this.readBlock();
+ }
+
+ var n = this.bufferLength;
+ r > n && (r = n);
+ } else {
+ for (; !this.eof;) {
+ this.readBlock();
+ }
+
+ var r = this.bufferLength;
+ }
+
+ return this.pos = r, this.buffer.subarray(e, r);
+ },
+ lookChar: function lookChar() {
+ for (var t = this.pos; this.bufferLength <= t;) {
+ if (this.eof) return null;
+ this.readBlock();
+ }
+
+ return String.fromCharCode(this.buffer[this.pos]);
+ },
+ getChar: function getChar() {
+ for (var t = this.pos; this.bufferLength <= t;) {
+ if (this.eof) return null;
+ this.readBlock();
+ }
+
+ return String.fromCharCode(this.buffer[this.pos++]);
+ },
+ makeSubStream: function makeSubStream(t, e, r) {
+ for (var n = t + e; this.bufferLength <= n && !this.eof;) {
+ this.readBlock();
+ }
+
+ return new Stream(this.buffer, t, e, r);
+ },
+ skip: function skip(t) {
+ t || (t = 1), this.pos += t;
+ },
+ reset: function reset() {
+ this.pos = 0;
+ }
+ }, t;
+ }(),
+ i = function () {
+ function t(t) {
+ throw new Error(t);
+ }
+
+ function e(e) {
+ var r = 0,
+ n = e[r++],
+ s = e[r++];
+ (-1 == n || -1 == s) && t("Invalid header in flate stream"), 8 != (15 & n) && t("Unknown compression method in flate stream"), ((n << 8) + s) % 31 != 0 && t("Bad FCHECK in flate stream"), 32 & s && t("FDICT bit set in flate stream"), this.bytes = e, this.bytesPos = r, this.codeSize = 0, this.codeBuf = 0, o.call(this);
+ }
+
+ if ("undefined" == typeof Uint32Array) return void 0;
+ var r = new Uint32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]),
+ n = new Uint32Array([3, 4, 5, 6, 7, 8, 9, 10, 65547, 65549, 65551, 65553, 131091, 131095, 131099, 131103, 196643, 196651, 196659, 196667, 262211, 262227, 262243, 262259, 327811, 327843, 327875, 327907, 258, 258, 258]),
+ s = new Uint32Array([1, 2, 3, 4, 65541, 65543, 131081, 131085, 196625, 196633, 262177, 262193, 327745, 327777, 393345, 393409, 459009, 459137, 524801, 525057, 590849, 591361, 657409, 658433, 724993, 727041, 794625, 798721, 868353, 876545]),
+ i = [new Uint32Array([459008, 524368, 524304, 524568, 459024, 524400, 524336, 590016, 459016, 524384, 524320, 589984, 524288, 524416, 524352, 590048, 459012, 524376, 524312, 589968, 459028, 524408, 524344, 590032, 459020, 524392, 524328, 59e4, 524296, 524424, 524360, 590064, 459010, 524372, 524308, 524572, 459026, 524404, 524340, 590024, 459018, 524388, 524324, 589992, 524292, 524420, 524356, 590056, 459014, 524380, 524316, 589976, 459030, 524412, 524348, 590040, 459022, 524396, 524332, 590008, 524300, 524428, 524364, 590072, 459009, 524370, 524306, 524570, 459025, 524402, 524338, 590020, 459017, 524386, 524322, 589988, 524290, 524418, 524354, 590052, 459013, 524378, 524314, 589972, 459029, 524410, 524346, 590036, 459021, 524394, 524330, 590004, 524298, 524426, 524362, 590068, 459011, 524374, 524310, 524574, 459027, 524406, 524342, 590028, 459019, 524390, 524326, 589996, 524294, 524422, 524358, 590060, 459015, 524382, 524318, 589980, 459031, 524414, 524350, 590044, 459023, 524398, 524334, 590012, 524302, 524430, 524366, 590076, 459008, 524369, 524305, 524569, 459024, 524401, 524337, 590018, 459016, 524385, 524321, 589986, 524289, 524417, 524353, 590050, 459012, 524377, 524313, 589970, 459028, 524409, 524345, 590034, 459020, 524393, 524329, 590002, 524297, 524425, 524361, 590066, 459010, 524373, 524309, 524573, 459026, 524405, 524341, 590026, 459018, 524389, 524325, 589994, 524293, 524421, 524357, 590058, 459014, 524381, 524317, 589978, 459030, 524413, 524349, 590042, 459022, 524397, 524333, 590010, 524301, 524429, 524365, 590074, 459009, 524371, 524307, 524571, 459025, 524403, 524339, 590022, 459017, 524387, 524323, 589990, 524291, 524419, 524355, 590054, 459013, 524379, 524315, 589974, 459029, 524411, 524347, 590038, 459021, 524395, 524331, 590006, 524299, 524427, 524363, 590070, 459011, 524375, 524311, 524575, 459027, 524407, 524343, 590030, 459019, 524391, 524327, 589998, 524295, 524423, 524359, 590062, 459015, 524383, 524319, 589982, 459031, 524415, 524351, 590046, 459023, 524399, 524335, 590014, 524303, 524431, 524367, 590078, 459008, 524368, 524304, 524568, 459024, 524400, 524336, 590017, 459016, 524384, 524320, 589985, 524288, 524416, 524352, 590049, 459012, 524376, 524312, 589969, 459028, 524408, 524344, 590033, 459020, 524392, 524328, 590001, 524296, 524424, 524360, 590065, 459010, 524372, 524308, 524572, 459026, 524404, 524340, 590025, 459018, 524388, 524324, 589993, 524292, 524420, 524356, 590057, 459014, 524380, 524316, 589977, 459030, 524412, 524348, 590041, 459022, 524396, 524332, 590009, 524300, 524428, 524364, 590073, 459009, 524370, 524306, 524570, 459025, 524402, 524338, 590021, 459017, 524386, 524322, 589989, 524290, 524418, 524354, 590053, 459013, 524378, 524314, 589973, 459029, 524410, 524346, 590037, 459021, 524394, 524330, 590005, 524298, 524426, 524362, 590069, 459011, 524374, 524310, 524574, 459027, 524406, 524342, 590029, 459019, 524390, 524326, 589997, 524294, 524422, 524358, 590061, 459015, 524382, 524318, 589981, 459031, 524414, 524350, 590045, 459023, 524398, 524334, 590013, 524302, 524430, 524366, 590077, 459008, 524369, 524305, 524569, 459024, 524401, 524337, 590019, 459016, 524385, 524321, 589987, 524289, 524417, 524353, 590051, 459012, 524377, 524313, 589971, 459028, 524409, 524345, 590035, 459020, 524393, 524329, 590003, 524297, 524425, 524361, 590067, 459010, 524373, 524309, 524573, 459026, 524405, 524341, 590027, 459018, 524389, 524325, 589995, 524293, 524421, 524357, 590059, 459014, 524381, 524317, 589979, 459030, 524413, 524349, 590043, 459022, 524397, 524333, 590011, 524301, 524429, 524365, 590075, 459009, 524371, 524307, 524571, 459025, 524403, 524339, 590023, 459017, 524387, 524323, 589991, 524291, 524419, 524355, 590055, 459013, 524379, 524315, 589975, 459029, 524411, 524347, 590039, 459021, 524395, 524331, 590007, 524299, 524427, 524363, 590071, 459011, 524375, 524311, 524575, 459027, 524407, 524343, 590031, 459019, 524391, 524327, 589999, 524295, 524423, 524359, 590063, 459015, 524383, 524319, 589983, 459031, 524415, 524351, 590047, 459023, 524399, 524335, 590015, 524303, 524431, 524367, 590079]), 9],
+ a = [new Uint32Array([327680, 327696, 327688, 327704, 327684, 327700, 327692, 327708, 327682, 327698, 327690, 327706, 327686, 327702, 327694, 0, 327681, 327697, 327689, 327705, 327685, 327701, 327693, 327709, 327683, 327699, 327691, 327707, 327687, 327703, 327695, 0]), 5];
+ return e.prototype = Object.create(o.prototype), e.prototype.getBits = function (e) {
+ for (var r, n = this.codeSize, s = this.codeBuf, o = this.bytes, i = this.bytesPos; e > n;) {
+ "undefined" == typeof (r = o[i++]) && t("Bad encoding in flate stream"), s |= r << n, n += 8;
+ }
+
+ return r = s & (1 << e) - 1, this.codeBuf = s >> e, this.codeSize = n -= e, this.bytesPos = i, r;
+ }, e.prototype.getCode = function (e) {
+ for (var r = e[0], n = e[1], s = this.codeSize, o = this.codeBuf, i = this.bytes, a = this.bytesPos; n > s;) {
+ var u;
+ "undefined" == typeof (u = i[a++]) && t("Bad encoding in flate stream"), o |= u << s, s += 8;
+ }
+
+ var c = r[o & (1 << n) - 1],
+ l = c >> 16,
+ f = 65535 & c;
+ return (0 == s || l > s || 0 == l) && t("Bad encoding in flate stream"), this.codeBuf = o >> l, this.codeSize = s - l, this.bytesPos = a, f;
+ }, e.prototype.generateHuffmanTable = function (t) {
+ for (var e = t.length, r = 0, n = 0; e > n; ++n) {
+ t[n] > r && (r = t[n]);
+ }
+
+ for (var s = 1 << r, o = new Uint32Array(s), i = 1, a = 0, u = 2; r >= i; ++i, a <<= 1, u <<= 1) {
+ for (var c = 0; e > c; ++c) {
+ if (t[c] == i) {
+ for (var l = 0, f = a, n = 0; i > n; ++n) {
+ l = l << 1 | 1 & f, f >>= 1;
+ }
+
+ for (var n = l; s > n; n += u) {
+ o[n] = i << 16 | c;
+ }
+
+ ++a;
+ }
+ }
+ }
+
+ return [o, r];
+ }, e.prototype.readBlock = function () {
+ function e(t, e, r, n, s) {
+ for (var o = t.getBits(r) + n; o-- > 0;) {
+ e[k++] = s;
+ }
+ }
+
+ var o = this.getBits(3);
+
+ if (1 & o && (this.eof = !0), o >>= 1, 0 == o) {
+ var u,
+ c = this.bytes,
+ l = this.bytesPos;
+ "undefined" == typeof (u = c[l++]) && t("Bad block header in flate stream");
+ var f = u;
+ "undefined" == typeof (u = c[l++]) && t("Bad block header in flate stream"), f |= u << 8, "undefined" == typeof (u = c[l++]) && t("Bad block header in flate stream");
+ var d = u;
+ "undefined" == typeof (u = c[l++]) && t("Bad block header in flate stream"), d |= u << 8, d != (65535 & ~f) && t("Bad uncompressed block length in flate stream"), this.codeBuf = 0, this.codeSize = 0;
+ var h = this.bufferLength,
+ p = this.ensureBuffer(h + f),
+ m = h + f;
+ this.bufferLength = m;
+
+ for (var w = h; m > w; ++w) {
+ if ("undefined" == typeof (u = c[l++])) {
+ this.eof = !0;
+ break;
+ }
+
+ p[w] = u;
+ }
+
+ return this.bytesPos = l, void 0;
+ }
+
+ var y, g;
+ if (1 == o) y = i, g = a;else if (2 == o) {
+ for (var v = this.getBits(5) + 257, b = this.getBits(5) + 1, q = this.getBits(4) + 4, x = Array(r.length), k = 0; q > k;) {
+ x[r[k++]] = this.getBits(3);
+ }
+
+ for (var _ = this.generateHuffmanTable(x), A = 0, k = 0, C = v + b, S = new Array(C); C > k;) {
+ var E = this.getCode(_);
+ 16 == E ? e(this, S, 2, 3, A) : 17 == E ? e(this, S, 3, 3, A = 0) : 18 == E ? e(this, S, 7, 11, A = 0) : S[k++] = A = E;
+ }
+
+ y = this.generateHuffmanTable(S.slice(0, v)), g = this.generateHuffmanTable(S.slice(v, C));
+ } else t("Unknown block type in flate stream");
+
+ for (var p = this.buffer, z = p ? p.length : 0, I = this.bufferLength;;) {
+ var T = this.getCode(y);
+ if (256 > T) I + 1 >= z && (p = this.ensureBuffer(I + 1), z = p.length), p[I++] = T;else {
+ if (256 == T) return this.bufferLength = I, void 0;
+ T -= 257, T = n[T];
+ var B = T >> 16;
+ B > 0 && (B = this.getBits(B));
+ var A = (65535 & T) + B;
+ T = this.getCode(g), T = s[T], B = T >> 16, B > 0 && (B = this.getBits(B));
+ var O = (65535 & T) + B;
+ I + A >= z && (p = this.ensureBuffer(I + A), z = p.length);
+
+ for (var P = 0; A > P; ++P, ++I) {
+ p[I] = p[I - O];
+ }
+ }
+ }
+ }, e;
+ }();
+
+ !function (t) {
+ var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+ "undefined" == typeof t.btoa && (t.btoa = function (t) {
+ var r,
+ n,
+ s,
+ o,
+ i,
+ a,
+ u,
+ c,
+ l = 0,
+ f = 0,
+ d = "",
+ h = [];
+ if (!t) return t;
+
+ do {
+ r = t.charCodeAt(l++), n = t.charCodeAt(l++), s = t.charCodeAt(l++), c = r << 16 | n << 8 | s, o = c >> 18 & 63, i = c >> 12 & 63, a = c >> 6 & 63, u = 63 & c, h[f++] = e.charAt(o) + e.charAt(i) + e.charAt(a) + e.charAt(u);
+ } while (l < t.length);
+
+ d = h.join("");
+ var p = t.length % 3;
+ return (p ? d.slice(0, p - 3) : d) + "===".slice(p || 3);
+ }), "undefined" == typeof t.atob && (t.atob = function (t) {
+ var r,
+ n,
+ s,
+ o,
+ i,
+ a,
+ u,
+ c,
+ l = 0,
+ f = 0,
+ d = "",
+ h = [];
+ if (!t) return t;
+ t += "";
+
+ do {
+ o = e.indexOf(t.charAt(l++)), i = e.indexOf(t.charAt(l++)), a = e.indexOf(t.charAt(l++)), u = e.indexOf(t.charAt(l++)), c = o << 18 | i << 12 | a << 6 | u, r = c >> 16 & 255, n = c >> 8 & 255, s = 255 & c, h[f++] = 64 == a ? String.fromCharCode(r) : 64 == u ? String.fromCharCode(r, n) : String.fromCharCode(r, n, s);
+ } while (l < t.length);
+
+ return d = h.join("");
+ }), Array.prototype.map || (Array.prototype.map = function (t) {
+ if (void 0 === this || null === this || "function" != typeof t) throw new TypeError();
+
+ for (var e = Object(this), r = e.length >>> 0, n = new Array(r), s = arguments.length > 1 ? arguments[1] : void 0, o = 0; r > o; o++) {
+ o in e && (n[o] = t.call(s, e[o], o, e));
+ }
+
+ return n;
+ }), Array.isArray || (Array.isArray = function (t) {
+ return "[object Array]" === Object.prototype.toString.call(t);
+ }), Array.prototype.forEach || (Array.prototype.forEach = function (t, e) {
+
+ if (void 0 === this || null === this || "function" != typeof t) throw new TypeError();
+
+ for (var r = Object(this), n = r.length >>> 0, s = 0; n > s; s++) {
+ s in r && t.call(e, r[s], s, r);
+ }
+ }), Object.keys || (Object.keys = function () {
+
+ var t = Object.prototype.hasOwnProperty,
+ e = !{
+ toString: null
+ }.propertyIsEnumerable("toString"),
+ r = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"],
+ n = r.length;
+ return function (s) {
+ if ("object" != _typeof(s) && ("function" != typeof s || null === s)) throw new TypeError();
+ var o,
+ i,
+ a = [];
+
+ for (o in s) {
+ t.call(s, o) && a.push(o);
+ }
+
+ if (e) for (i = 0; n > i; i++) {
+ t.call(s, r[i]) && a.push(r[i]);
+ }
+ return a;
+ };
+ }()), String.prototype.trim || (String.prototype.trim = function () {
+ return this.replace(/^\s+|\s+$/g, "");
+ }), String.prototype.trimLeft || (String.prototype.trimLeft = function () {
+ return this.replace(/^\s+/g, "");
+ }), String.prototype.trimRight || (String.prototype.trimRight = function () {
+ return this.replace(/\s+$/g, "");
+ });
+ }("undefined" != typeof self && self || "undefined" != typeof window && window || this);
+ }({}, function () {
+ return this;
+ }());
+ });
+
+ var jspdf_min$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), jspdf_min, {
+ 'default': jspdf_min,
+ __moduleExports: jspdf_min
+ }));
+
+ /**
+ * For parsing color values.
+ * @module RGBColor
+ * @author Stoyan Stefanov
+ * @see https://www.phpied.com/rgb-color-parser-in-javascript/
+ * @license MIT
+ */
+ var simpleColors = {
+ aliceblue: 'f0f8ff',
+ antiquewhite: 'faebd7',
+ aqua: '00ffff',
+ aquamarine: '7fffd4',
+ azure: 'f0ffff',
+ beige: 'f5f5dc',
+ bisque: 'ffe4c4',
+ black: '000000',
+ blanchedalmond: 'ffebcd',
+ blue: '0000ff',
+ blueviolet: '8a2be2',
+ brown: 'a52a2a',
+ burlywood: 'deb887',
+ cadetblue: '5f9ea0',
+ chartreuse: '7fff00',
+ chocolate: 'd2691e',
+ coral: 'ff7f50',
+ cornflowerblue: '6495ed',
+ cornsilk: 'fff8dc',
+ crimson: 'dc143c',
+ cyan: '00ffff',
+ darkblue: '00008b',
+ darkcyan: '008b8b',
+ darkgoldenrod: 'b8860b',
+ darkgray: 'a9a9a9',
+ darkgreen: '006400',
+ darkkhaki: 'bdb76b',
+ darkmagenta: '8b008b',
+ darkolivegreen: '556b2f',
+ darkorange: 'ff8c00',
+ darkorchid: '9932cc',
+ darkred: '8b0000',
+ darksalmon: 'e9967a',
+ darkseagreen: '8fbc8f',
+ darkslateblue: '483d8b',
+ darkslategray: '2f4f4f',
+ darkturquoise: '00ced1',
+ darkviolet: '9400d3',
+ deeppink: 'ff1493',
+ deepskyblue: '00bfff',
+ dimgray: '696969',
+ dodgerblue: '1e90ff',
+ feldspar: 'd19275',
+ firebrick: 'b22222',
+ floralwhite: 'fffaf0',
+ forestgreen: '228b22',
+ fuchsia: 'ff00ff',
+ gainsboro: 'dcdcdc',
+ ghostwhite: 'f8f8ff',
+ gold: 'ffd700',
+ goldenrod: 'daa520',
+ gray: '808080',
+ green: '008000',
+ greenyellow: 'adff2f',
+ honeydew: 'f0fff0',
+ hotpink: 'ff69b4',
+ indianred: 'cd5c5c',
+ indigo: '4b0082',
+ ivory: 'fffff0',
+ khaki: 'f0e68c',
+ lavender: 'e6e6fa',
+ lavenderblush: 'fff0f5',
+ lawngreen: '7cfc00',
+ lemonchiffon: 'fffacd',
+ lightblue: 'add8e6',
+ lightcoral: 'f08080',
+ lightcyan: 'e0ffff',
+ lightgoldenrodyellow: 'fafad2',
+ lightgrey: 'd3d3d3',
+ lightgreen: '90ee90',
+ lightpink: 'ffb6c1',
+ lightsalmon: 'ffa07a',
+ lightseagreen: '20b2aa',
+ lightskyblue: '87cefa',
+ lightslateblue: '8470ff',
+ lightslategray: '778899',
+ lightsteelblue: 'b0c4de',
+ lightyellow: 'ffffe0',
+ lime: '00ff00',
+ limegreen: '32cd32',
+ linen: 'faf0e6',
+ magenta: 'ff00ff',
+ maroon: '800000',
+ mediumaquamarine: '66cdaa',
+ mediumblue: '0000cd',
+ mediumorchid: 'ba55d3',
+ mediumpurple: '9370d8',
+ mediumseagreen: '3cb371',
+ mediumslateblue: '7b68ee',
+ mediumspringgreen: '00fa9a',
+ mediumturquoise: '48d1cc',
+ mediumvioletred: 'c71585',
+ midnightblue: '191970',
+ mintcream: 'f5fffa',
+ mistyrose: 'ffe4e1',
+ moccasin: 'ffe4b5',
+ navajowhite: 'ffdead',
+ navy: '000080',
+ oldlace: 'fdf5e6',
+ olive: '808000',
+ olivedrab: '6b8e23',
+ orange: 'ffa500',
+ orangered: 'ff4500',
+ orchid: 'da70d6',
+ palegoldenrod: 'eee8aa',
+ palegreen: '98fb98',
+ paleturquoise: 'afeeee',
+ palevioletred: 'd87093',
+ papayawhip: 'ffefd5',
+ peachpuff: 'ffdab9',
+ peru: 'cd853f',
+ pink: 'ffc0cb',
+ plum: 'dda0dd',
+ powderblue: 'b0e0e6',
+ purple: '800080',
+ red: 'ff0000',
+ rosybrown: 'bc8f8f',
+ royalblue: '4169e1',
+ saddlebrown: '8b4513',
+ salmon: 'fa8072',
+ sandybrown: 'f4a460',
+ seagreen: '2e8b57',
+ seashell: 'fff5ee',
+ sienna: 'a0522d',
+ silver: 'c0c0c0',
+ skyblue: '87ceeb',
+ slateblue: '6a5acd',
+ slategray: '708090',
+ snow: 'fffafa',
+ springgreen: '00ff7f',
+ steelblue: '4682b4',
+ tan: 'd2b48c',
+ teal: '008080',
+ thistle: 'd8bfd8',
+ tomato: 'ff6347',
+ turquoise: '40e0d0',
+ violet: 'ee82ee',
+ violetred: 'd02090',
+ wheat: 'f5deb3',
+ white: 'ffffff',
+ whitesmoke: 'f5f5f5',
+ yellow: 'ffff00',
+ yellowgreen: '9acd32'
+ }; // array of color definition objects
+
+ var colorDefs = [{
+ re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
+ // re: /^rgb\((?\d{1,3}),\s*(?\d{1,3}),\s*(?\d{1,3})\)$/,
+ example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],
+ process: function process(_) {
+ for (var _len = arguments.length, bits = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ bits[_key - 1] = arguments[_key];
+ }
+
+ return bits.map(function (b) {
+ return Number.parseInt(b);
+ });
+ }
+ }, {
+ re: /^(\w{2})(\w{2})(\w{2})$/,
+ // re: /^(?\w{2})(?\w{2})(?\w{2})$/,
+ example: ['#00ff00', '336699'],
+ process: function process(_) {
+ for (var _len2 = arguments.length, bits = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
+ bits[_key2 - 1] = arguments[_key2];
+ }
+
+ return bits.map(function (b) {
+ return Number.parseInt(b, 16);
+ });
+ }
+ }, {
+ re: /^(\w)(\w)(\w)$/,
+ // re: /^(?\w{1})(?\w{1})(?\w{1})$/,
+ example: ['#fb0', 'f0f'],
+ process: function process(_) {
+ for (var _len3 = arguments.length, bits = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
+ bits[_key3 - 1] = arguments[_key3];
+ }
+
+ return bits.map(function (b) {
+ return Number.parseInt(b + b, 16);
+ });
+ }
+ }];
+ /**
+ * A class to parse color values.
+ */
+
+ var RGBColor = /*#__PURE__*/function () {
+ /**
+ * @param {string} colorString
+ */
+ function RGBColor(colorString) {
+ var _this = this;
+
+ _classCallCheck(this, RGBColor);
+
+ this.ok = false; // strip any leading #
+
+ if (colorString.charAt(0) === '#') {
+ // remove # if any
+ colorString = colorString.substr(1, 6);
+ }
+
+ colorString = colorString.replace(/ /g, '');
+ colorString = colorString.toLowerCase(); // before getting into regexps, try simple matches
+ // and overwrite the input
+
+ if (colorString in simpleColors) {
+ colorString = simpleColors[colorString];
+ } // end of simple type-in colors
+ // search through the definitions to find a match
+
+
+ colorDefs.forEach(function (_ref) {
+ var re = _ref.re,
+ processor = _ref.process;
+ var bits = re.exec(colorString);
+
+ if (bits) {
+ var _processor = processor.apply(void 0, _toConsumableArray(bits)),
+ _processor2 = _slicedToArray(_processor, 3),
+ r = _processor2[0],
+ g = _processor2[1],
+ b = _processor2[2];
+
+ Object.assign(_this, {
+ r: r,
+ g: g,
+ b: b
+ });
+ _this.ok = true;
+ }
+ }); // validate/cleanup values
+
+ this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r;
+ this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g;
+ this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b;
+ } // some getters
+
+ /**
+ * @returns {string}
+ */
+
+
+ _createClass(RGBColor, [{
+ key: "toRGB",
+ value: function toRGB() {
+ return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')';
+ }
+ /**
+ * @returns {string}
+ */
+
+ }, {
+ key: "toHex",
+ value: function toHex() {
+ var r = this.r.toString(16);
+ var g = this.g.toString(16);
+ var b = this.b.toString(16);
+
+ if (r.length === 1) {
+ r = '0' + r;
+ }
+
+ if (g.length === 1) {
+ g = '0' + g;
+ }
+
+ if (b.length === 1) {
+ b = '0' + b;
+ }
+
+ return '#' + r + g + b;
+ }
+ /**
+ * Offers a bulleted list of help.
+ * @returns {HTMLUListElement}
+ */
+
+ }], [{
+ key: "getHelpXML",
+ value: function getHelpXML() {
+ var examples = [].concat(_toConsumableArray(colorDefs.flatMap(function (_ref2) {
+ var example = _ref2.example;
+ return example;
+ })), _toConsumableArray(Object.keys(simpleColors)));
+ var xml = document.createElement('ul');
+ xml.setAttribute('id', 'rgbcolor-examples');
+ xml.append.apply(xml, _toConsumableArray(examples.map(function (example) {
+ try {
+ var listItem = document.createElement('li');
+ var listColor = new RGBColor(example);
+ var exampleDiv = document.createElement('div');
+ exampleDiv.style.cssText = "\n margin: 3px;\n border: 1px solid black;\n background: ".concat(listColor.toHex(), ";\n color: ").concat(listColor.toHex(), ";");
+ exampleDiv.append('test');
+ var listItemValue = " ".concat(example, " -> ").concat(listColor.toRGB(), " -> ").concat(listColor.toHex());
+ listItem.append(exampleDiv, listItemValue);
+ return listItem;
+ } catch (e) {
+ return '';
+ }
+ })));
+ return xml;
+ }
+ }]);
+
+ return RGBColor;
+ }();
+
+ var jsPDFAPI = jsPDF.API;
+ var pdfSvgAttr = {
+ // allowed attributes. all others are removed from the preview.
+ g: ['stroke', 'fill', 'stroke-width'],
+ line: ['x1', 'y1', 'x2', 'y2', 'stroke', 'stroke-width'],
+ rect: ['x', 'y', 'width', 'height', 'stroke', 'fill', 'stroke-width'],
+ ellipse: ['cx', 'cy', 'rx', 'ry', 'stroke', 'fill', 'stroke-width'],
+ circle: ['cx', 'cy', 'r', 'stroke', 'fill', 'stroke-width'],
+ polygon: ['points', 'stroke', 'fill', 'stroke-width'],
+ // polyline attributes are the same as those of polygon
+ path: ['d', 'stroke', 'fill', 'stroke-width'],
+ text: ['x', 'y', 'font-size', 'font-family', 'text-anchor', 'font-weight', 'font-style', 'fill']
+ };
+
+ var attributeIsNotEmpty = function attributeIsNotEmpty(node, attr) {
+ var attVal = attr ? node.getAttribute(attr) : node;
+ return attVal !== '' && attVal !== null && attVal !== 'null';
+ };
+
+ var nodeIs = function nodeIs(node, possible) {
+ return possible.includes(node.tagName.toLowerCase());
+ };
+
+ var removeAttributes = function removeAttributes(node, attributes) {
+ var toRemove = [];
+ [].forEach.call(node.attributes, function (a) {
+ if (attributeIsNotEmpty(a) && !attributes.includes(a.name.toLowerCase())) {
+ toRemove.push(a.name);
+ }
+ });
+ toRemove.forEach(function (a) {
+ node.removeAttribute(a.name);
+ });
+ };
+
+ var numRgx = /[+-]?(?:\d+\.\d*|\d+|\.\d+)(?:[eE]\d+|[eE][+-]\d+|)/g;
+
+ var getLinesOptionsOfPoly = function getLinesOptionsOfPoly(node) {
+ var nums = node.getAttribute('points');
+ nums = nums && nums.match(numRgx) || [];
+
+ if (nums && nums.length) {
+ nums = nums.map(function (n) {
+ return Number(n);
+ });
+
+ if (nums.length % 2) {
+ nums.length--;
+ }
+ }
+
+ if (nums.length < 4) {
+ console.log('invalid points attribute:', node); // eslint-disable-line no-console
+
+ return undefined;
+ }
+
+ var _nums = nums,
+ _nums2 = _slicedToArray(_nums, 2),
+ x = _nums2[0],
+ y = _nums2[1],
+ lines = [];
+
+ for (var i = 2; i < nums.length; i += 2) {
+ lines.push([nums[i] - nums[i - 2], nums[i + 1] - nums[i - 1]]);
+ }
+
+ return {
+ x: x,
+ y: y,
+ lines: lines
+ };
+ };
+
+ var getLinesOptionsOfPath = function getLinesOptionsOfPath(node) {
+ var segList = node.pathSegList,
+ n = segList.numberOfItems,
+ opsList = [];
+ var ops = {
+ lines: []
+ };
+ var curr = {
+ x: 0,
+ y: 0
+ };
+ var reflectControl = {
+ x: 0,
+ y: 0
+ };
+
+ var toRelative = function toRelative(nums, relativeTo) {
+ var re = [];
+
+ for (var i = 0; i < nums.length - 1; i += 2) {
+ re[i] = nums[i] - relativeTo.x;
+ re[i + 1] = nums[i + 1] - relativeTo.y;
+ }
+
+ return re;
+ };
+
+ var curveQToC = function curveQToC(nums) {
+ var a = 2 / 3;
+ var re = [nums[0] * a, nums[1] * a, nums[2] + (nums[0] - nums[2]) * a, nums[3] + (nums[1] - nums[3]) * a, nums[2], nums[3]];
+ return re;
+ };
+
+ for (var i = 0, letterPrev; i < n; i++) {
+ var seg = segList.getItem(i);
+ var x1 = seg.x1,
+ y1 = seg.y1,
+ x2 = seg.x2,
+ y2 = seg.y2,
+ x = seg.x,
+ y = seg.y,
+ letter = seg.pathSegTypeAsLetter;
+ var isRelative = letter >= 'a'; // lowercase letter
+
+ switch (letter) {
+ case 'M':
+ case 'm':
+ {
+ if (ops.lines.length && Object.prototype.hasOwnProperty.call(ops, 'x')) {
+ opsList.push(ops);
+ }
+
+ ops = {
+ lines: [],
+ x: isRelative ? x + curr.x : x,
+ y: isRelative ? y + curr.y : y,
+ closed: false
+ };
+ ops.closed = false;
+ break;
+ }
+
+ case 'L':
+ {
+ ops.lines.push(toRelative([x, y], curr));
+ break;
+ }
+
+ case 'l':
+ {
+ ops.lines.push([x, y]);
+ break;
+ }
+
+ case 'H':
+ {
+ ops.lines.push([x - curr.x, 0]);
+ break;
+ }
+
+ case 'h':
+ {
+ ops.lines.push([x, 0]);
+ break;
+ }
+
+ case 'V':
+ {
+ ops.lines.push([0, y - curr.y]);
+ break;
+ }
+
+ case 'v':
+ {
+ ops.lines.push([0, y]);
+ break;
+ }
+
+ case 'Q':
+ {
+ ops.lines.push(curveQToC(toRelative([x1, y1, x, y], curr)));
+ reflectControl.x = x - x1;
+ reflectControl.y = y - y1;
+ break;
+ }
+
+ case 'q':
+ {
+ ops.lines.push(curveQToC([x1, y1, x, y]));
+ reflectControl.x = x - x1;
+ reflectControl.y = y - y1;
+ break;
+ }
+
+ case 'T':
+ {
+ var p1 = letterPrev && 'QqTt'.includes(letterPrev) ? reflectControl : {
+ x: 0,
+ y: 0
+ };
+ ops.lines.push(curveQToC([p1.x, p1.y, x - curr.x, y - curr.y]));
+ reflectControl.x = x - curr.x - p1.x;
+ reflectControl.y = y - curr.y - p1.y;
+ break;
+ }
+
+ case 't':
+ {
+ var _p = letterPrev && 'QqTt'.includes(letterPrev) ? reflectControl : {
+ x: 0,
+ y: 0
+ };
+
+ ops.lines.push([_p.x, _p.y, x, y]);
+ reflectControl.x = x - _p.x;
+ reflectControl.y = y - _p.y;
+ break;
+ }
+
+ case 'C':
+ {
+ ops.lines.push(toRelative([x1, y1, x2, y2, x, y], curr));
+ break;
+ }
+
+ case 'c':
+ {
+ ops.lines.push([x1, y1, x2, y2, x, y]);
+ break;
+ }
+
+ case 'S':
+ case 's':
+ {
+ var _p2 = letterPrev && 'CcSs'.includes(letterPrev) ? reflectControl : {
+ x: 0,
+ y: 0
+ };
+
+ if (isRelative) {
+ ops.lines.push([_p2.x, _p2.y, x2, y2, x, y]);
+ } else {
+ ops.lines.push([_p2.x, _p2.y].concat(toRelative([x2, y2, x, y], curr)));
+ }
+
+ reflectControl.x = x - x2;
+ reflectControl.y = y - y2;
+ break;
+ }
+
+ case 'A':
+ case 'a':
+ {
+ // Not support command 'A' and 'a' yet. Treat it as straight line instead.
+ if (isRelative) {
+ ops.lines.push([x, y]);
+ } else {
+ ops.lines.push(toRelative([x, y], curr));
+ }
+
+ break;
+ }
+
+ case 'z':
+ case 'Z':
+ {
+ ops.closed = true;
+ break;
+ }
+
+ default:
+ {
+ // throw new Error('Unknown path command ' + letter);
+ return opsList;
+ }
+ }
+
+ if (letter === 'Z' || letter === 'z') {
+ curr.x = ops.x;
+ curr.y = ops.y;
+ } else {
+ if (letter !== 'V' && letter !== 'v') {
+ curr.x = isRelative ? x + curr.x : x;
+ }
+
+ if (letter !== 'H' && letter !== 'h') {
+ curr.y = isRelative ? y + curr.y : y;
+ }
+ }
+
+ letterPrev = letter;
+ }
+
+ if (ops.lines.length && Object.prototype.hasOwnProperty.call(ops, 'x')) {
+ opsList.push(ops);
+ }
+
+ return opsList;
+ };
+
+ var svgElementToPdf = function svgElementToPdf(element, pdf, options) {
+ // pdf is a jsPDF object
+ // console.log('options =', options);
+ var remove = options.removeInvalid === undefined ? false : options.removeInvalid;
+ var k = options.scale === undefined ? 1.0 : options.scale;
+ var colorMode = null;
+ [].forEach.call(element.children, function (node) {
+ // console.log('passing: ', node);
+ // let hasStrokeColor = false;
+ var hasFillColor = false;
+ var fillRGB;
+ colorMode = null;
+
+ if (nodeIs(node, ['g', 'line', 'rect', 'ellipse', 'circle', 'polygon', 'polyline', 'path', 'text'])) {
+ var fillColor = node.getAttribute('fill');
+
+ if (attributeIsNotEmpty(fillColor) && node.getAttribute('fill-opacity') !== '0') {
+ fillRGB = new RGBColor(fillColor);
+
+ if (fillRGB.ok) {
+ hasFillColor = true;
+ colorMode = 'F';
+ } else {
+ colorMode = null;
+ }
+ }
+ }
+
+ if (nodeIs(node, ['g', 'line', 'rect', 'ellipse', 'circle', 'polygon', 'polyline', 'path'])) {
+ if (hasFillColor) {
+ pdf.setFillColor(fillRGB.r, fillRGB.g, fillRGB.b);
+ }
+
+ if (attributeIsNotEmpty(node, 'stroke-width')) {
+ pdf.setLineWidth(k * Number.parseInt(node.getAttribute('stroke-width')));
+ }
+
+ var strokeColor = node.getAttribute('stroke');
+
+ if (attributeIsNotEmpty(strokeColor) && node.getAttribute('stroke-width') !== '0' && node.getAttribute('stroke-opacity') !== '0') {
+ var strokeRGB = new RGBColor(strokeColor);
+
+ if (strokeRGB.ok) {
+ // hasStrokeColor = true;
+ pdf.setDrawColor(strokeRGB.r, strokeRGB.g, strokeRGB.b);
+
+ if (hasFillColor) {
+ colorMode = 'FD';
+ } else {
+ colorMode = 'S';
+ }
+ } else {
+ colorMode = null;
+ }
+ }
+ }
+
+ var tag = node.tagName.toLowerCase();
+
+ switch (tag) {
+ case 'svg':
+ case 'a':
+ case 'g':
+ svgElementToPdf(node, pdf, options);
+ removeAttributes(node, pdfSvgAttr.g);
+ break;
+
+ case 'line':
+ pdf.line(k * Number.parseInt(node.getAttribute('x1')), k * Number.parseInt(node.getAttribute('y1')), k * Number.parseInt(node.getAttribute('x2')), k * Number.parseInt(node.getAttribute('y2')));
+ removeAttributes(node, pdfSvgAttr.line);
+ break;
+
+ case 'rect':
+ pdf.rect(k * Number.parseInt(node.getAttribute('x')), k * Number.parseInt(node.getAttribute('y')), k * Number.parseInt(node.getAttribute('width')), k * Number.parseInt(node.getAttribute('height')), colorMode);
+ removeAttributes(node, pdfSvgAttr.rect);
+ break;
+
+ case 'ellipse':
+ pdf.ellipse(k * Number.parseInt(node.getAttribute('cx')), k * Number.parseInt(node.getAttribute('cy')), k * Number.parseInt(node.getAttribute('rx')), k * Number.parseInt(node.getAttribute('ry')), colorMode);
+ removeAttributes(node, pdfSvgAttr.ellipse);
+ break;
+
+ case 'circle':
+ pdf.circle(k * Number.parseInt(node.getAttribute('cx')), k * Number.parseInt(node.getAttribute('cy')), k * Number.parseInt(node.getAttribute('r')), colorMode);
+ removeAttributes(node, pdfSvgAttr.circle);
+ break;
+
+ case 'polygon':
+ case 'polyline':
+ {
+ var linesOptions = getLinesOptionsOfPoly(node);
+
+ if (linesOptions) {
+ pdf.lines(linesOptions.lines, k * linesOptions.x, k * linesOptions.y, [k, k], colorMode, tag === 'polygon' // polygon is closed, polyline is not closed
+ );
+ }
+
+ removeAttributes(node, pdfSvgAttr.polygon);
+ break;
+ }
+
+ case 'path':
+ {
+ if (colorMode) {
+ var linesOptionsList = getLinesOptionsOfPath(node);
+
+ if (linesOptionsList.length > 0) {
+ linesOptionsList.forEach(function (linesOptions) {
+ pdf.lines(linesOptions.lines, k * linesOptions.x, k * linesOptions.y, [k, k], null, linesOptions.closed);
+ }); // svg fill rule default is nonzero
+
+ var fillRule = node.getAttribute('fill-rule');
+
+ if (fillRule === 'evenodd') {
+ // f* : fill using even-odd rule
+ // B* : stroke and fill using even-odd rule
+ if (colorMode === 'F') {
+ colorMode = 'f*';
+ } else if (colorMode === 'FD') {
+ colorMode = 'B*';
+ }
+ }
+
+ pdf.internal.write(pdf.internal.getStyle(colorMode));
+ }
+ }
+
+ removeAttributes(node, pdfSvgAttr.path);
+ break;
+ }
+
+ case 'text':
+ {
+ if (node.hasAttribute('font-family')) {
+ switch ((node.getAttribute('font-family') || '').toLowerCase()) {
+ case 'serif':
+ pdf.setFont('times');
+ break;
+
+ case 'monospace':
+ pdf.setFont('courier');
+ break;
+
+ case 'times':
+ pdf.setFont('times');
+ break;
+
+ case 'courier':
+ pdf.setFont('courier');
+ break;
+
+ case 'helvetica':
+ pdf.setFont('helvetica');
+ break;
+
+ default:
+ node.setAttribute('font-family', 'sans-serif');
+ pdf.setFont('helvetica');
+ }
+ }
+
+ if (hasFillColor) {
+ pdf.setTextColor(fillRGB.r, fillRGB.g, fillRGB.b);
+ }
+
+ var fontType = '';
+
+ if (node.hasAttribute('font-weight')) {
+ if (node.getAttribute('font-weight') === 'bold') {
+ fontType = 'bold';
+ } else {
+ node.removeAttribute('font-weight');
+ }
+ }
+
+ if (node.hasAttribute('font-style')) {
+ if (node.getAttribute('font-style') === 'italic') {
+ fontType += 'italic';
+ } else {
+ node.removeAttribute('font-style');
+ }
+ }
+
+ pdf.setFontType(fontType);
+ var pdfFontSize = node.hasAttribute('font-size') ? Number.parseInt(node.getAttribute('font-size')) : 16;
+ /**
+ *
+ * @param {Element} elem
+ * @returns {Float}
+ */
+
+ var getWidth = function getWidth(elem) {
+ var box;
+
+ try {
+ box = elem.getBBox(); // Firefox on MacOS will raise error here
+ } catch (err) {
+ // copy and append to body so that getBBox is available
+ var nodeCopy = elem.cloneNode(true);
+ var svg = elem.ownerSVGElement.cloneNode(false);
+ svg.appendChild(nodeCopy);
+ document.body.appendChild(svg);
+
+ try {
+ box = nodeCopy.getBBox();
+ } catch (error) {
+ box = {
+ width: 0
+ };
+ }
+
+ svg.remove();
+ }
+
+ return box.width;
+ }; // TODO: use more accurate positioning!!
+
+
+ var x,
+ y,
+ xOffset = 0;
+
+ if (node.hasAttribute('text-anchor')) {
+ switch (node.getAttribute('text-anchor')) {
+ case 'end':
+ xOffset = getWidth(node);
+ break;
+
+ case 'middle':
+ xOffset = getWidth(node) / 2;
+ break;
+
+ case 'start':
+ break;
+
+ case 'default':
+ node.setAttribute('text-anchor', 'start');
+ break;
+ }
+
+ x = Number.parseInt(node.getAttribute('x')) - xOffset;
+ y = Number.parseInt(node.getAttribute('y'));
+ } // console.log('fontSize:', pdfFontSize, 'text:', node.textContent);
+
+
+ pdf.setFontSize(pdfFontSize).text(k * x, k * y, node.textContent);
+ removeAttributes(node, pdfSvgAttr.text);
+ break; // TODO: image
+ }
+
+ default:
+ if (remove) {
+ console.log("can't translate to pdf:", node); // eslint-disable-line no-console
+
+ node.remove();
+ }
+
+ }
+ });
+ return pdf;
+ };
+
+ jsPDFAPI.addSVG = function (element, x, y, options) {
+ options = options === undefined ? {} : options;
+ options.x_offset = x;
+ options.y_offset = y;
+
+ if (typeof element === 'string') {
+ element = new DOMParser().parseFromString(element, 'text/xml').documentElement;
+ }
+
+ svgElementToPdf(element, this, options);
+ return this;
+ };
+
+ var jspdf_plugin_svgToPdf = /*#__PURE__*/Object.freeze({
+ __proto__: null
+ });
+
+ }
+ };
+});
+//# sourceMappingURL=index-system.js.map
diff --git a/dist/editor/index-system.js.map b/dist/editor/index-system.js.map
new file mode 100644
index 00000000..af324e3b
--- /dev/null
+++ b/dist/editor/index-system.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index-system.js","sources":["../../node_modules/core-js/internals/global.js","../../node_modules/core-js/internals/fails.js","../../node_modules/core-js/internals/descriptors.js","../../node_modules/core-js/internals/object-property-is-enumerable.js","../../node_modules/core-js/internals/create-property-descriptor.js","../../node_modules/core-js/internals/classof-raw.js","../../node_modules/core-js/internals/indexed-object.js","../../node_modules/core-js/internals/require-object-coercible.js","../../node_modules/core-js/internals/to-indexed-object.js","../../node_modules/core-js/internals/is-object.js","../../node_modules/core-js/internals/to-primitive.js","../../node_modules/core-js/internals/has.js","../../node_modules/core-js/internals/document-create-element.js","../../node_modules/core-js/internals/ie8-dom-define.js","../../node_modules/core-js/internals/object-get-own-property-descriptor.js","../../node_modules/core-js/internals/an-object.js","../../node_modules/core-js/internals/object-define-property.js","../../node_modules/core-js/internals/create-non-enumerable-property.js","../../node_modules/core-js/internals/set-global.js","../../node_modules/core-js/internals/shared-store.js","../../node_modules/core-js/internals/inspect-source.js","../../node_modules/core-js/internals/native-weak-map.js","../../node_modules/core-js/internals/is-pure.js","../../node_modules/core-js/internals/shared.js","../../node_modules/core-js/internals/uid.js","../../node_modules/core-js/internals/shared-key.js","../../node_modules/core-js/internals/hidden-keys.js","../../node_modules/core-js/internals/internal-state.js","../../node_modules/core-js/internals/redefine.js","../../node_modules/core-js/internals/path.js","../../node_modules/core-js/internals/get-built-in.js","../../node_modules/core-js/internals/to-integer.js","../../node_modules/core-js/internals/to-length.js","../../node_modules/core-js/internals/to-absolute-index.js","../../node_modules/core-js/internals/array-includes.js","../../node_modules/core-js/internals/object-keys-internal.js","../../node_modules/core-js/internals/enum-bug-keys.js","../../node_modules/core-js/internals/object-get-own-property-names.js","../../node_modules/core-js/internals/object-get-own-property-symbols.js","../../node_modules/core-js/internals/own-keys.js","../../node_modules/core-js/internals/copy-constructor-properties.js","../../node_modules/core-js/internals/is-forced.js","../../node_modules/core-js/internals/export.js","../../node_modules/core-js/internals/native-symbol.js","../../node_modules/core-js/internals/use-symbol-as-uid.js","../../node_modules/core-js/internals/is-array.js","../../node_modules/core-js/internals/to-object.js","../../node_modules/core-js/internals/object-keys.js","../../node_modules/core-js/internals/object-define-properties.js","../../node_modules/core-js/internals/html.js","../../node_modules/core-js/internals/object-create.js","../../node_modules/core-js/internals/object-get-own-property-names-external.js","../../node_modules/core-js/internals/well-known-symbol.js","../../node_modules/core-js/internals/well-known-symbol-wrapped.js","../../node_modules/core-js/internals/define-well-known-symbol.js","../../node_modules/core-js/internals/set-to-string-tag.js","../../node_modules/core-js/internals/a-function.js","../../node_modules/core-js/internals/function-bind-context.js","../../node_modules/core-js/internals/array-species-create.js","../../node_modules/core-js/internals/array-iteration.js","../../node_modules/core-js/modules/es.symbol.js","../../node_modules/core-js/modules/es.symbol.description.js","../../node_modules/core-js/modules/es.symbol.async-iterator.js","../../node_modules/core-js/modules/es.symbol.has-instance.js","../../node_modules/core-js/modules/es.symbol.is-concat-spreadable.js","../../node_modules/core-js/modules/es.symbol.iterator.js","../../node_modules/core-js/modules/es.symbol.match.js","../../node_modules/core-js/modules/es.symbol.match-all.js","../../node_modules/core-js/modules/es.symbol.replace.js","../../node_modules/core-js/modules/es.symbol.search.js","../../node_modules/core-js/modules/es.symbol.species.js","../../node_modules/core-js/modules/es.symbol.split.js","../../node_modules/core-js/modules/es.symbol.to-primitive.js","../../node_modules/core-js/modules/es.symbol.to-string-tag.js","../../node_modules/core-js/modules/es.symbol.unscopables.js","../../node_modules/core-js/internals/create-property.js","../../node_modules/core-js/internals/engine-user-agent.js","../../node_modules/core-js/internals/engine-v8-version.js","../../node_modules/core-js/internals/array-method-has-species-support.js","../../node_modules/core-js/modules/es.array.concat.js","../../node_modules/core-js/internals/array-copy-within.js","../../node_modules/core-js/internals/add-to-unscopables.js","../../node_modules/core-js/modules/es.array.copy-within.js","../../node_modules/core-js/internals/array-method-is-strict.js","../../node_modules/core-js/internals/array-method-uses-to-length.js","../../node_modules/core-js/modules/es.array.every.js","../../node_modules/core-js/internals/array-fill.js","../../node_modules/core-js/modules/es.array.fill.js","../../node_modules/core-js/modules/es.array.filter.js","../../node_modules/core-js/modules/es.array.find.js","../../node_modules/core-js/modules/es.array.find-index.js","../../node_modules/core-js/internals/flatten-into-array.js","../../node_modules/core-js/modules/es.array.flat.js","../../node_modules/core-js/modules/es.array.flat-map.js","../../node_modules/core-js/internals/array-for-each.js","../../node_modules/core-js/modules/es.array.for-each.js","../../node_modules/core-js/internals/call-with-safe-iteration-closing.js","../../node_modules/core-js/internals/iterators.js","../../node_modules/core-js/internals/is-array-iterator-method.js","../../node_modules/core-js/internals/to-string-tag-support.js","../../node_modules/core-js/internals/classof.js","../../node_modules/core-js/internals/get-iterator-method.js","../../node_modules/core-js/internals/array-from.js","../../node_modules/core-js/internals/check-correctness-of-iteration.js","../../node_modules/core-js/modules/es.array.from.js","../../node_modules/core-js/modules/es.array.includes.js","../../node_modules/core-js/modules/es.array.index-of.js","../../node_modules/core-js/modules/es.array.is-array.js","../../node_modules/core-js/internals/correct-prototype-getter.js","../../node_modules/core-js/internals/object-get-prototype-of.js","../../node_modules/core-js/internals/iterators-core.js","../../node_modules/core-js/internals/create-iterator-constructor.js","../../node_modules/core-js/internals/a-possible-prototype.js","../../node_modules/core-js/internals/object-set-prototype-of.js","../../node_modules/core-js/internals/define-iterator.js","../../node_modules/core-js/modules/es.array.iterator.js","../../node_modules/core-js/modules/es.array.join.js","../../node_modules/core-js/internals/array-last-index-of.js","../../node_modules/core-js/modules/es.array.last-index-of.js","../../node_modules/core-js/modules/es.array.map.js","../../node_modules/core-js/modules/es.array.of.js","../../node_modules/core-js/internals/array-reduce.js","../../node_modules/core-js/modules/es.array.reduce.js","../../node_modules/core-js/modules/es.array.reduce-right.js","../../node_modules/core-js/modules/es.array.reverse.js","../../node_modules/core-js/modules/es.array.slice.js","../../node_modules/core-js/modules/es.array.some.js","../../node_modules/core-js/modules/es.array.sort.js","../../node_modules/core-js/internals/set-species.js","../../node_modules/core-js/modules/es.array.species.js","../../node_modules/core-js/modules/es.array.splice.js","../../node_modules/core-js/modules/es.array.unscopables.flat.js","../../node_modules/core-js/modules/es.array.unscopables.flat-map.js","../../node_modules/core-js/internals/array-buffer-native.js","../../node_modules/core-js/internals/redefine-all.js","../../node_modules/core-js/internals/an-instance.js","../../node_modules/core-js/internals/to-index.js","../../node_modules/core-js/internals/ieee754.js","../../node_modules/core-js/internals/array-buffer.js","../../node_modules/core-js/modules/es.array-buffer.constructor.js","../../node_modules/core-js/internals/array-buffer-view-core.js","../../node_modules/core-js/modules/es.array-buffer.is-view.js","../../node_modules/core-js/internals/species-constructor.js","../../node_modules/core-js/modules/es.array-buffer.slice.js","../../node_modules/core-js/modules/es.data-view.js","../../node_modules/core-js/modules/es.date.now.js","../../node_modules/core-js/internals/string-repeat.js","../../node_modules/core-js/internals/string-pad.js","../../node_modules/core-js/internals/date-to-iso-string.js","../../node_modules/core-js/modules/es.date.to-iso-string.js","../../node_modules/core-js/modules/es.date.to-json.js","../../node_modules/core-js/internals/date-to-primitive.js","../../node_modules/core-js/modules/es.date.to-primitive.js","../../node_modules/core-js/modules/es.date.to-string.js","../../node_modules/core-js/internals/function-bind.js","../../node_modules/core-js/modules/es.function.bind.js","../../node_modules/core-js/modules/es.function.has-instance.js","../../node_modules/core-js/modules/es.function.name.js","../../node_modules/core-js/modules/es.global-this.js","../../node_modules/core-js/modules/es.json.stringify.js","../../node_modules/core-js/modules/es.json.to-string-tag.js","../../node_modules/core-js/internals/freezing.js","../../node_modules/core-js/internals/internal-metadata.js","../../node_modules/core-js/internals/iterate.js","../../node_modules/core-js/internals/inherit-if-required.js","../../node_modules/core-js/internals/collection.js","../../node_modules/core-js/internals/collection-strong.js","../../node_modules/core-js/modules/es.map.js","../../node_modules/core-js/internals/math-log1p.js","../../node_modules/core-js/modules/es.math.acosh.js","../../node_modules/core-js/modules/es.math.asinh.js","../../node_modules/core-js/modules/es.math.atanh.js","../../node_modules/core-js/internals/math-sign.js","../../node_modules/core-js/modules/es.math.cbrt.js","../../node_modules/core-js/modules/es.math.clz32.js","../../node_modules/core-js/internals/math-expm1.js","../../node_modules/core-js/modules/es.math.cosh.js","../../node_modules/core-js/modules/es.math.expm1.js","../../node_modules/core-js/internals/math-fround.js","../../node_modules/core-js/modules/es.math.fround.js","../../node_modules/core-js/modules/es.math.hypot.js","../../node_modules/core-js/modules/es.math.imul.js","../../node_modules/core-js/modules/es.math.log10.js","../../node_modules/core-js/modules/es.math.log1p.js","../../node_modules/core-js/modules/es.math.log2.js","../../node_modules/core-js/modules/es.math.sign.js","../../node_modules/core-js/modules/es.math.sinh.js","../../node_modules/core-js/modules/es.math.tanh.js","../../node_modules/core-js/modules/es.math.to-string-tag.js","../../node_modules/core-js/modules/es.math.trunc.js","../../node_modules/core-js/internals/whitespaces.js","../../node_modules/core-js/internals/string-trim.js","../../node_modules/core-js/modules/es.number.constructor.js","../../node_modules/core-js/modules/es.number.epsilon.js","../../node_modules/core-js/internals/number-is-finite.js","../../node_modules/core-js/modules/es.number.is-finite.js","../../node_modules/core-js/internals/is-integer.js","../../node_modules/core-js/modules/es.number.is-integer.js","../../node_modules/core-js/modules/es.number.is-nan.js","../../node_modules/core-js/modules/es.number.is-safe-integer.js","../../node_modules/core-js/modules/es.number.max-safe-integer.js","../../node_modules/core-js/modules/es.number.min-safe-integer.js","../../node_modules/core-js/internals/number-parse-float.js","../../node_modules/core-js/modules/es.number.parse-float.js","../../node_modules/core-js/internals/number-parse-int.js","../../node_modules/core-js/modules/es.number.parse-int.js","../../node_modules/core-js/internals/this-number-value.js","../../node_modules/core-js/modules/es.number.to-fixed.js","../../node_modules/core-js/modules/es.number.to-precision.js","../../node_modules/core-js/internals/object-assign.js","../../node_modules/core-js/modules/es.object.assign.js","../../node_modules/core-js/modules/es.object.create.js","../../node_modules/core-js/internals/object-prototype-accessors-forced.js","../../node_modules/core-js/modules/es.object.define-getter.js","../../node_modules/core-js/modules/es.object.define-properties.js","../../node_modules/core-js/modules/es.object.define-property.js","../../node_modules/core-js/modules/es.object.define-setter.js","../../node_modules/core-js/internals/object-to-array.js","../../node_modules/core-js/modules/es.object.entries.js","../../node_modules/core-js/modules/es.object.freeze.js","../../node_modules/core-js/modules/es.object.from-entries.js","../../node_modules/core-js/modules/es.object.get-own-property-descriptor.js","../../node_modules/core-js/modules/es.object.get-own-property-descriptors.js","../../node_modules/core-js/modules/es.object.get-own-property-names.js","../../node_modules/core-js/modules/es.object.get-prototype-of.js","../../node_modules/core-js/internals/same-value.js","../../node_modules/core-js/modules/es.object.is.js","../../node_modules/core-js/modules/es.object.is-extensible.js","../../node_modules/core-js/modules/es.object.is-frozen.js","../../node_modules/core-js/modules/es.object.is-sealed.js","../../node_modules/core-js/modules/es.object.keys.js","../../node_modules/core-js/modules/es.object.lookup-getter.js","../../node_modules/core-js/modules/es.object.lookup-setter.js","../../node_modules/core-js/modules/es.object.prevent-extensions.js","../../node_modules/core-js/modules/es.object.seal.js","../../node_modules/core-js/modules/es.object.set-prototype-of.js","../../node_modules/core-js/internals/object-to-string.js","../../node_modules/core-js/modules/es.object.to-string.js","../../node_modules/core-js/modules/es.object.values.js","../../node_modules/core-js/modules/es.parse-float.js","../../node_modules/core-js/modules/es.parse-int.js","../../node_modules/core-js/internals/native-promise-constructor.js","../../node_modules/core-js/internals/engine-is-ios.js","../../node_modules/core-js/internals/task.js","../../node_modules/core-js/internals/microtask.js","../../node_modules/core-js/internals/new-promise-capability.js","../../node_modules/core-js/internals/promise-resolve.js","../../node_modules/core-js/internals/host-report-errors.js","../../node_modules/core-js/internals/perform.js","../../node_modules/core-js/modules/es.promise.js","../../node_modules/core-js/modules/es.promise.all-settled.js","../../node_modules/core-js/modules/es.promise.finally.js","../../node_modules/core-js/modules/es.reflect.apply.js","../../node_modules/core-js/modules/es.reflect.construct.js","../../node_modules/core-js/modules/es.reflect.define-property.js","../../node_modules/core-js/modules/es.reflect.delete-property.js","../../node_modules/core-js/modules/es.reflect.get.js","../../node_modules/core-js/modules/es.reflect.get-own-property-descriptor.js","../../node_modules/core-js/modules/es.reflect.get-prototype-of.js","../../node_modules/core-js/modules/es.reflect.has.js","../../node_modules/core-js/modules/es.reflect.is-extensible.js","../../node_modules/core-js/modules/es.reflect.own-keys.js","../../node_modules/core-js/modules/es.reflect.prevent-extensions.js","../../node_modules/core-js/modules/es.reflect.set.js","../../node_modules/core-js/modules/es.reflect.set-prototype-of.js","../../node_modules/core-js/internals/is-regexp.js","../../node_modules/core-js/internals/regexp-flags.js","../../node_modules/core-js/internals/regexp-sticky-helpers.js","../../node_modules/core-js/modules/es.regexp.constructor.js","../../node_modules/core-js/internals/regexp-exec.js","../../node_modules/core-js/modules/es.regexp.exec.js","../../node_modules/core-js/modules/es.regexp.flags.js","../../node_modules/core-js/modules/es.regexp.sticky.js","../../node_modules/core-js/modules/es.regexp.test.js","../../node_modules/core-js/modules/es.regexp.to-string.js","../../node_modules/core-js/modules/es.set.js","../../node_modules/core-js/internals/string-multibyte.js","../../node_modules/core-js/modules/es.string.code-point-at.js","../../node_modules/core-js/internals/not-a-regexp.js","../../node_modules/core-js/internals/correct-is-regexp-logic.js","../../node_modules/core-js/modules/es.string.ends-with.js","../../node_modules/core-js/modules/es.string.from-code-point.js","../../node_modules/core-js/modules/es.string.includes.js","../../node_modules/core-js/modules/es.string.iterator.js","../../node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js","../../node_modules/core-js/internals/advance-string-index.js","../../node_modules/core-js/internals/regexp-exec-abstract.js","../../node_modules/core-js/modules/es.string.match.js","../../node_modules/core-js/modules/es.string.match-all.js","../../node_modules/core-js/internals/string-pad-webkit-bug.js","../../node_modules/core-js/modules/es.string.pad-end.js","../../node_modules/core-js/modules/es.string.pad-start.js","../../node_modules/core-js/modules/es.string.raw.js","../../node_modules/core-js/modules/es.string.repeat.js","../../node_modules/core-js/modules/es.string.replace.js","../../node_modules/core-js/modules/es.string.search.js","../../node_modules/core-js/modules/es.string.split.js","../../node_modules/core-js/modules/es.string.starts-with.js","../../node_modules/core-js/internals/string-trim-forced.js","../../node_modules/core-js/modules/es.string.trim.js","../../node_modules/core-js/modules/es.string.trim-end.js","../../node_modules/core-js/modules/es.string.trim-start.js","../../node_modules/core-js/internals/create-html.js","../../node_modules/core-js/internals/string-html-forced.js","../../node_modules/core-js/modules/es.string.anchor.js","../../node_modules/core-js/modules/es.string.big.js","../../node_modules/core-js/modules/es.string.blink.js","../../node_modules/core-js/modules/es.string.bold.js","../../node_modules/core-js/modules/es.string.fixed.js","../../node_modules/core-js/modules/es.string.fontcolor.js","../../node_modules/core-js/modules/es.string.fontsize.js","../../node_modules/core-js/modules/es.string.italics.js","../../node_modules/core-js/modules/es.string.link.js","../../node_modules/core-js/modules/es.string.small.js","../../node_modules/core-js/modules/es.string.strike.js","../../node_modules/core-js/modules/es.string.sub.js","../../node_modules/core-js/modules/es.string.sup.js","../../node_modules/core-js/internals/typed-array-constructors-require-wrappers.js","../../node_modules/core-js/internals/to-positive-integer.js","../../node_modules/core-js/internals/to-offset.js","../../node_modules/core-js/internals/typed-array-from.js","../../node_modules/core-js/internals/typed-array-constructor.js","../../node_modules/core-js/modules/es.typed-array.float32-array.js","../../node_modules/core-js/modules/es.typed-array.float64-array.js","../../node_modules/core-js/modules/es.typed-array.int8-array.js","../../node_modules/core-js/modules/es.typed-array.int16-array.js","../../node_modules/core-js/modules/es.typed-array.int32-array.js","../../node_modules/core-js/modules/es.typed-array.uint8-array.js","../../node_modules/core-js/modules/es.typed-array.uint8-clamped-array.js","../../node_modules/core-js/modules/es.typed-array.uint16-array.js","../../node_modules/core-js/modules/es.typed-array.uint32-array.js","../../node_modules/core-js/modules/es.typed-array.copy-within.js","../../node_modules/core-js/modules/es.typed-array.every.js","../../node_modules/core-js/modules/es.typed-array.fill.js","../../node_modules/core-js/modules/es.typed-array.filter.js","../../node_modules/core-js/modules/es.typed-array.find.js","../../node_modules/core-js/modules/es.typed-array.find-index.js","../../node_modules/core-js/modules/es.typed-array.for-each.js","../../node_modules/core-js/modules/es.typed-array.from.js","../../node_modules/core-js/modules/es.typed-array.includes.js","../../node_modules/core-js/modules/es.typed-array.index-of.js","../../node_modules/core-js/modules/es.typed-array.iterator.js","../../node_modules/core-js/modules/es.typed-array.join.js","../../node_modules/core-js/modules/es.typed-array.last-index-of.js","../../node_modules/core-js/modules/es.typed-array.map.js","../../node_modules/core-js/modules/es.typed-array.of.js","../../node_modules/core-js/modules/es.typed-array.reduce.js","../../node_modules/core-js/modules/es.typed-array.reduce-right.js","../../node_modules/core-js/modules/es.typed-array.reverse.js","../../node_modules/core-js/modules/es.typed-array.set.js","../../node_modules/core-js/modules/es.typed-array.slice.js","../../node_modules/core-js/modules/es.typed-array.some.js","../../node_modules/core-js/modules/es.typed-array.sort.js","../../node_modules/core-js/modules/es.typed-array.subarray.js","../../node_modules/core-js/modules/es.typed-array.to-locale-string.js","../../node_modules/core-js/modules/es.typed-array.to-string.js","../../node_modules/core-js/internals/collection-weak.js","../../node_modules/core-js/modules/es.weak-map.js","../../node_modules/core-js/modules/es.weak-set.js","../../node_modules/core-js/internals/dom-iterables.js","../../node_modules/core-js/modules/web.dom-collections.for-each.js","../../node_modules/core-js/modules/web.dom-collections.iterator.js","../../node_modules/core-js/modules/web.immediate.js","../../node_modules/core-js/modules/web.queue-microtask.js","../../node_modules/core-js/internals/native-url.js","../../node_modules/core-js/internals/string-punycode-to-ascii.js","../../node_modules/core-js/internals/get-iterator.js","../../node_modules/core-js/modules/web.url-search-params.js","../../node_modules/core-js/modules/web.url.js","../../node_modules/core-js/modules/web.url.to-json.js","../../node_modules/regenerator-runtime/runtime.js","../../src/editor/touch.js","../../src/common/namespaces.js","../../src/common/svgpathseg.js","../../src/common/browser.js","../../src/common/jQuery.attr.js","../../src/common/svgtransformlist.js","../../src/common/units.js","../../src/common/math.js","../../src/common/utilities.js","../../src/editor/contextmenu.js","../../src/external/deparam/deparam.esm.js","../../src/svgcanvas/dbox.js","../../src/svgcanvas/history.js","../../src/svgcanvas/path.js","../../src/common/layer.js","../../src/svgcanvas/historyrecording.js","../../src/svgcanvas/copy-elem.js","../../src/svgcanvas/draw.js","../../src/svgcanvas/sanitize.js","../../src/svgcanvas/coords.js","../../src/svgcanvas/recalculate.js","../../src/svgcanvas/select.js","../../src/svgcanvas/svgcanvas.js","../../src/editor/js-hotkeys/jquery.hotkeys.min.js","../../src/editor/svgicons/jQuery.svgIcons.js","../../src/editor/jgraduate/jQuery.jGraduate.js","../../src/editor/spinbtn/jQuery.SpinButton.js","../../src/editor/contextmenu/jQuery.contextMenu.js","../../src/editor/jgraduate/jQuery.jPicker.js","../../src/editor/locale/locale.js","../../src/editor/svgedit.js","../../src/editor/index.js","../../src/editor/jspdf/underscore-min.js","../../node_modules/rollup-plugin-node-polyfills/polyfills/global.js","../../node_modules/rollup-plugin-node-polyfills/polyfills/buffer-es6.js","../../src/editor/jspdf/jspdf.min.js","../../src/editor/canvg/rgbcolor.js","../../src/editor/jspdf/jspdf.plugin.svgToPdf.js"],"sourcesContent":["var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line no-undef\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func\n Function('return this')();\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var fails = require('../internals/fails');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !fails(function () {\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","'use strict';\nvar nativePropertyIsEnumerable = {}.propertyIsEnumerable;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : nativePropertyIsEnumerable;\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","var fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar split = ''.split;\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins\n return !Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split.call(it, '') : Object(it);\n} : Object;\n","// `RequireObjectCoercible` abstract operation\n// https://tc39.github.io/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var isObject = require('../internals/is-object');\n\n// `ToPrimitive` abstract operation\n// https://tc39.github.io/ecma262/#sec-toprimitive\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (input, PREFERRED_STRING) {\n if (!isObject(input)) return input;\n var fn, val;\n if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;\n if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var hasOwnProperty = {}.hasOwnProperty;\n\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var DESCRIPTORS = require('../internals/descriptors');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPrimitive = require('../internals/to-primitive');\nvar has = require('../internals/has');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\nvar nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return nativeGetOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it)) {\n throw TypeError(String(it) + ' is not an object');\n } return it;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar anObject = require('../internals/an-object');\nvar toPrimitive = require('../internals/to-primitive');\n\nvar nativeDefineProperty = Object.defineProperty;\n\n// `Object.defineProperty` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return nativeDefineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var global = require('../internals/global');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nmodule.exports = function (key, value) {\n try {\n createNonEnumerableProperty(global, key, value);\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","var global = require('../internals/global');\nvar setGlobal = require('../internals/set-global');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || setGlobal(SHARED, {});\n\nmodule.exports = store;\n","var store = require('../internals/shared-store');\n\nvar functionToString = Function.toString;\n\n// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper\nif (typeof store.inspectSource != 'function') {\n store.inspectSource = function (it) {\n return functionToString.call(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var global = require('../internals/global');\nvar inspectSource = require('../internals/inspect-source');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));\n","module.exports = false;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.6.5',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2020 Denis Pushkarev (zloirock.ru)'\n});\n","var id = 0;\nvar postfix = Math.random();\n\nmodule.exports = function (key) {\n return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);\n};\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","module.exports = {};\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar objectHas = require('../internals/has');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP) {\n var store = new WeakMap();\n var wmget = store.get;\n var wmhas = store.has;\n var wmset = store.set;\n set = function (it, metadata) {\n wmset.call(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget.call(store, it) || {};\n };\n has = function (it) {\n return wmhas.call(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return objectHas(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return objectHas(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","var global = require('../internals/global');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar setGlobal = require('../internals/set-global');\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar getInternalState = InternalStateModule.get;\nvar enforceInternalState = InternalStateModule.enforce;\nvar TEMPLATE = String(String).split('String');\n\n(module.exports = function (O, key, value, options) {\n var unsafe = options ? !!options.unsafe : false;\n var simple = options ? !!options.enumerable : false;\n var noTargetGet = options ? !!options.noTargetGet : false;\n if (typeof value == 'function') {\n if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);\n enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');\n }\n if (O === global) {\n if (simple) O[key] = value;\n else setGlobal(key, value);\n return;\n } else if (!unsafe) {\n delete O[key];\n } else if (!noTargetGet && O[key]) {\n simple = true;\n }\n if (simple) O[key] = value;\n else createNonEnumerableProperty(O, key, value);\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, 'toString', function toString() {\n return typeof this == 'function' && getInternalState(this).source || inspectSource(this);\n});\n","var global = require('../internals/global');\n\nmodule.exports = global;\n","var path = require('../internals/path');\nvar global = require('../internals/global');\n\nvar aFunction = function (variable) {\n return typeof variable == 'function' ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `ToInteger` abstract operation\n// https://tc39.github.io/ecma262/#sec-tointeger\nmodule.exports = function (argument) {\n return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);\n};\n","var toInteger = require('../internals/to-integer');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.github.io/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var toInteger = require('../internals/to-integer');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toInteger(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var has = require('../internals/has');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~indexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertynames\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","exports.f = Object.getOwnPropertySymbols;\n","var getBuiltIn = require('../internals/get-built-in');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;\n};\n","var has = require('../internals/has');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n};\n","var fails = require('../internals/fails');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : typeof detection == 'function' ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar setGlobal = require('../internals/set-global');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.noTargetGet - prevent calling a getter on target\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = global;\n } else if (STATIC) {\n target = global[TARGET] || setGlobal(TARGET, {});\n } else {\n target = (global[TARGET] || {}).prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.noTargetGet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty === typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n // extend global\n redefine(target, key, sourceProperty, options);\n }\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n // Chrome 38 Symbol has incorrect toString conversion\n // eslint-disable-next-line no-undef\n return !String(Symbol());\n});\n","var NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n // eslint-disable-next-line no-undef\n && !Symbol.sham\n // eslint-disable-next-line no-undef\n && typeof Symbol.iterator == 'symbol';\n","var classof = require('../internals/classof-raw');\n\n// `IsArray` abstract operation\n// https://tc39.github.io/ecma262/#sec-isarray\nmodule.exports = Array.isArray || function isArray(arg) {\n return classof(arg) == 'Array';\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `ToObject` abstract operation\n// https://tc39.github.io/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return Object(requireObjectCoercible(argument));\n};\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\n// `Object.keys` method\n// https://tc39.github.io/ecma262/#sec-object.keys\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar anObject = require('../internals/an-object');\nvar objectKeys = require('../internals/object-keys');\n\n// `Object.defineProperties` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperties\nmodule.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);\n return O;\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","var anObject = require('../internals/an-object');\nvar defineProperties = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null; // avoid memory leak\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n /* global ActiveXObject */\n activeXDocument = document.domain && new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.github.io/ecma262/#sec-object.create\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : defineProperties(result, Properties);\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar nativeGetOwnPropertyNames = require('../internals/object-get-own-property-names').f;\n\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return nativeGetOwnPropertyNames(it);\n } catch (error) {\n return windowNames.slice();\n }\n};\n\n// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]'\n ? getWindowNames(it)\n : nativeGetOwnPropertyNames(toIndexedObject(it));\n};\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar has = require('../internals/has');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!has(WellKnownSymbolsStore, name)) {\n if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];\n else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nexports.f = wellKnownSymbol;\n","var path = require('../internals/path');\nvar has = require('../internals/has');\nvar wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');\nvar defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (NAME) {\n var Symbol = path.Symbol || (path.Symbol = {});\n if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {\n value: wrappedWellKnownSymbolModule.f(NAME)\n });\n};\n","var defineProperty = require('../internals/object-define-property').f;\nvar has = require('../internals/has');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (it, TAG, STATIC) {\n if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {\n defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n};\n","module.exports = function (it) {\n if (typeof it != 'function') {\n throw TypeError(String(it) + ' is not a function');\n } return it;\n};\n","var aFunction = require('../internals/a-function');\n\n// optional / simple context binding\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 0: return function () {\n return fn.call(that);\n };\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `ArraySpeciesCreate` abstract operation\n// https://tc39.github.io/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray, length) {\n var C;\n if (isArray(originalArray)) {\n C = originalArray.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n else if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);\n};\n","var bind = require('../internals/function-bind-context');\nvar IndexedObject = require('../internals/indexed-object');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\nvar push = [].push;\n\n// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation\nvar createMethod = function (TYPE) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n return function ($this, callbackfn, that, specificCreate) {\n var O = toObject($this);\n var self = IndexedObject(O);\n var boundFunction = bind(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var create = specificCreate || arraySpeciesCreate;\n var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var value, result;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n value = self[index];\n result = boundFunction(value, index, O);\n if (TYPE) {\n if (IS_MAP) target[index] = result; // map\n else if (result) switch (TYPE) {\n case 3: return true; // some\n case 5: return value; // find\n case 6: return index; // findIndex\n case 2: push.call(target, value); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.forEach` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.foreach\n forEach: createMethod(0),\n // `Array.prototype.map` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.map\n map: createMethod(1),\n // `Array.prototype.filter` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.filter\n filter: createMethod(2),\n // `Array.prototype.some` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.some\n some: createMethod(3),\n // `Array.prototype.every` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.every\n every: createMethod(4),\n // `Array.prototype.find` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.find\n find: createMethod(5),\n // `Array.prototype.findIndex` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex\n findIndex: createMethod(6)\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar getBuiltIn = require('../internals/get-built-in');\nvar IS_PURE = require('../internals/is-pure');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\nvar fails = require('../internals/fails');\nvar has = require('../internals/has');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar anObject = require('../internals/an-object');\nvar toObject = require('../internals/to-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPrimitive = require('../internals/to-primitive');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar nativeObjectCreate = require('../internals/object-create');\nvar objectKeys = require('../internals/object-keys');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertyNamesExternal = require('../internals/object-get-own-property-names-external');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar shared = require('../internals/shared');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar uid = require('../internals/uid');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');\nvar defineWellKnownSymbol = require('../internals/define-well-known-symbol');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar InternalStateModule = require('../internals/internal-state');\nvar $forEach = require('../internals/array-iteration').forEach;\n\nvar HIDDEN = sharedKey('hidden');\nvar SYMBOL = 'Symbol';\nvar PROTOTYPE = 'prototype';\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(SYMBOL);\nvar ObjectPrototype = Object[PROTOTYPE];\nvar $Symbol = global.Symbol;\nvar $stringify = getBuiltIn('JSON', 'stringify');\nvar nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\nvar nativeDefineProperty = definePropertyModule.f;\nvar nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;\nvar nativePropertyIsEnumerable = propertyIsEnumerableModule.f;\nvar AllSymbols = shared('symbols');\nvar ObjectPrototypeSymbols = shared('op-symbols');\nvar StringToSymbolRegistry = shared('string-to-symbol-registry');\nvar SymbolToStringRegistry = shared('symbol-to-string-registry');\nvar WellKnownSymbolsStore = shared('wks');\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDescriptor = DESCRIPTORS && fails(function () {\n return nativeObjectCreate(nativeDefineProperty({}, 'a', {\n get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (O, P, Attributes) {\n var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);\n if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];\n nativeDefineProperty(O, P, Attributes);\n if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {\n nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);\n }\n} : nativeDefineProperty;\n\nvar wrap = function (tag, description) {\n var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]);\n setInternalState(symbol, {\n type: SYMBOL,\n tag: tag,\n description: description\n });\n if (!DESCRIPTORS) symbol.description = description;\n return symbol;\n};\n\nvar isSymbol = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return Object(it) instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(O, P, Attributes) {\n if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);\n anObject(O);\n var key = toPrimitive(P, true);\n anObject(Attributes);\n if (has(AllSymbols, key)) {\n if (!Attributes.enumerable) {\n if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));\n O[HIDDEN][key] = true;\n } else {\n if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;\n Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });\n } return setSymbolDescriptor(O, key, Attributes);\n } return nativeDefineProperty(O, key, Attributes);\n};\n\nvar $defineProperties = function defineProperties(O, Properties) {\n anObject(O);\n var properties = toIndexedObject(Properties);\n var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));\n $forEach(keys, function (key) {\n if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);\n });\n return O;\n};\n\nvar $create = function create(O, Properties) {\n return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);\n};\n\nvar $propertyIsEnumerable = function propertyIsEnumerable(V) {\n var P = toPrimitive(V, true);\n var enumerable = nativePropertyIsEnumerable.call(this, P);\n if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;\n return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;\n};\n\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {\n var it = toIndexedObject(O);\n var key = toPrimitive(P, true);\n if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;\n var descriptor = nativeGetOwnPropertyDescriptor(it, key);\n if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {\n descriptor.enumerable = true;\n }\n return descriptor;\n};\n\nvar $getOwnPropertyNames = function getOwnPropertyNames(O) {\n var names = nativeGetOwnPropertyNames(toIndexedObject(O));\n var result = [];\n $forEach(names, function (key) {\n if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);\n });\n return result;\n};\n\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(O) {\n var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;\n var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));\n var result = [];\n $forEach(names, function (key) {\n if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {\n result.push(AllSymbols[key]);\n }\n });\n return result;\n};\n\n// `Symbol` constructor\n// https://tc39.github.io/ecma262/#sec-symbol-constructor\nif (!NATIVE_SYMBOL) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');\n var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);\n var tag = uid(description);\n var setter = function (value) {\n if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));\n };\n if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });\n return wrap(tag, description);\n };\n\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return getInternalState(this).tag;\n });\n\n redefine($Symbol, 'withoutSetter', function (description) {\n return wrap(uid(description), description);\n });\n\n propertyIsEnumerableModule.f = $propertyIsEnumerable;\n definePropertyModule.f = $defineProperty;\n getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;\n getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;\n getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;\n\n wrappedWellKnownSymbolModule.f = function (name) {\n return wrap(wellKnownSymbol(name), name);\n };\n\n if (DESCRIPTORS) {\n // https://github.com/tc39/proposal-Symbol-description\n nativeDefineProperty($Symbol[PROTOTYPE], 'description', {\n configurable: true,\n get: function description() {\n return getInternalState(this).description;\n }\n });\n if (!IS_PURE) {\n redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });\n }\n }\n}\n\n$({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {\n Symbol: $Symbol\n});\n\n$forEach(objectKeys(WellKnownSymbolsStore), function (name) {\n defineWellKnownSymbol(name);\n});\n\n$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {\n // `Symbol.for` method\n // https://tc39.github.io/ecma262/#sec-symbol.for\n 'for': function (key) {\n var string = String(key);\n if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];\n var symbol = $Symbol(string);\n StringToSymbolRegistry[string] = symbol;\n SymbolToStringRegistry[symbol] = string;\n return symbol;\n },\n // `Symbol.keyFor` method\n // https://tc39.github.io/ecma262/#sec-symbol.keyfor\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');\n if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];\n },\n useSetter: function () { USE_SETTER = true; },\n useSimple: function () { USE_SETTER = false; }\n});\n\n$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {\n // `Object.create` method\n // https://tc39.github.io/ecma262/#sec-object.create\n create: $create,\n // `Object.defineProperty` method\n // https://tc39.github.io/ecma262/#sec-object.defineproperty\n defineProperty: $defineProperty,\n // `Object.defineProperties` method\n // https://tc39.github.io/ecma262/#sec-object.defineproperties\n defineProperties: $defineProperties,\n // `Object.getOwnPropertyDescriptor` method\n // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor\n});\n\n$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {\n // `Object.getOwnPropertyNames` method\n // https://tc39.github.io/ecma262/#sec-object.getownpropertynames\n getOwnPropertyNames: $getOwnPropertyNames,\n // `Object.getOwnPropertySymbols` method\n // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives\n// https://bugs.chromium.org/p/v8/issues/detail?id=3443\n$({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, {\n getOwnPropertySymbols: function getOwnPropertySymbols(it) {\n return getOwnPropertySymbolsModule.f(toObject(it));\n }\n});\n\n// `JSON.stringify` method behavior with symbols\n// https://tc39.github.io/ecma262/#sec-json.stringify\nif ($stringify) {\n var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {\n var symbol = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n return $stringify([symbol]) != '[null]'\n // WebKit converts symbol values to JSON as null\n || $stringify({ a: symbol }) != '{}'\n // V8 throws on boxed symbols\n || $stringify(Object(symbol)) != '{}';\n });\n\n $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {\n // eslint-disable-next-line no-unused-vars\n stringify: function stringify(it, replacer, space) {\n var args = [it];\n var index = 1;\n var $replacer;\n while (arguments.length > index) args.push(arguments[index++]);\n $replacer = replacer;\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return $stringify.apply(null, args);\n }\n });\n}\n\n// `Symbol.prototype[@@toPrimitive]` method\n// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive\nif (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {\n createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n}\n// `Symbol.prototype[@@toStringTag]` property\n// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag\nsetToStringTag($Symbol, SYMBOL);\n\nhiddenKeys[HIDDEN] = true;\n","// `Symbol.prototype.description` getter\n// https://tc39.github.io/ecma262/#sec-symbol.prototype.description\n'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar global = require('../internals/global');\nvar has = require('../internals/has');\nvar isObject = require('../internals/is-object');\nvar defineProperty = require('../internals/object-define-property').f;\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\n\nvar NativeSymbol = global.Symbol;\n\nif (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) ||\n // Safari 12 bug\n NativeSymbol().description !== undefined\n)) {\n var EmptyStringDescriptionStore = {};\n // wrap Symbol constructor for correct work with undefined description\n var SymbolWrapper = function Symbol() {\n var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);\n var result = this instanceof SymbolWrapper\n ? new NativeSymbol(description)\n // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'\n : description === undefined ? NativeSymbol() : NativeSymbol(description);\n if (description === '') EmptyStringDescriptionStore[result] = true;\n return result;\n };\n copyConstructorProperties(SymbolWrapper, NativeSymbol);\n var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;\n symbolPrototype.constructor = SymbolWrapper;\n\n var symbolToString = symbolPrototype.toString;\n var native = String(NativeSymbol('test')) == 'Symbol(test)';\n var regexp = /^Symbol\\((.*)\\)[^)]+$/;\n defineProperty(symbolPrototype, 'description', {\n configurable: true,\n get: function description() {\n var symbol = isObject(this) ? this.valueOf() : this;\n var string = symbolToString.call(symbol);\n if (has(EmptyStringDescriptionStore, symbol)) return '';\n var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1');\n return desc === '' ? undefined : desc;\n }\n });\n\n $({ global: true, forced: true }, {\n Symbol: SymbolWrapper\n });\n}\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.asyncIterator` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.asynciterator\ndefineWellKnownSymbol('asyncIterator');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.hasInstance` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.hasinstance\ndefineWellKnownSymbol('hasInstance');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.isConcatSpreadable` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.isconcatspreadable\ndefineWellKnownSymbol('isConcatSpreadable');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.iterator` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.iterator\ndefineWellKnownSymbol('iterator');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.match` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.match\ndefineWellKnownSymbol('match');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.matchAll` well-known symbol\ndefineWellKnownSymbol('matchAll');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.replace` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.replace\ndefineWellKnownSymbol('replace');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.search` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.search\ndefineWellKnownSymbol('search');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.species` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.species\ndefineWellKnownSymbol('species');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.split` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.split\ndefineWellKnownSymbol('split');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.toPrimitive` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.toprimitive\ndefineWellKnownSymbol('toPrimitive');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.toStringTag` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.tostringtag\ndefineWellKnownSymbol('toStringTag');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.unscopables` well-known symbol\n// https://tc39.github.io/ecma262/#sec-symbol.unscopables\ndefineWellKnownSymbol('unscopables');\n","'use strict';\nvar toPrimitive = require('../internals/to-primitive');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n var propertyKey = toPrimitive(key);\n if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n version = match[0] + match[1];\n} else if (userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = match[1];\n }\n}\n\nmodule.exports = version && +version;\n","var fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (METHOD_NAME) {\n // We can't use this feature detection in V8 since it causes\n // deoptimization and serious performance degradation\n // https://github.com/zloirock/core-js/issues/677\n return V8_VERSION >= 51 || !fails(function () {\n var array = [];\n var constructor = array.constructor = {};\n constructor[SPECIES] = function () {\n return { foo: 1 };\n };\n return array[METHOD_NAME](Boolean).foo !== 1;\n });\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar createProperty = require('../internals/create-property');\nvar arraySpeciesCreate = require('../internals/array-species-create');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;\nvar MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';\n\n// We can't use this feature detection in V8 since it causes\n// deoptimization and serious performance degradation\n// https://github.com/zloirock/core-js/issues/679\nvar IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {\n var array = [];\n array[IS_CONCAT_SPREADABLE] = false;\n return array.concat()[0] !== array;\n});\n\nvar SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');\n\nvar isConcatSpreadable = function (O) {\n if (!isObject(O)) return false;\n var spreadable = O[IS_CONCAT_SPREADABLE];\n return spreadable !== undefined ? !!spreadable : isArray(O);\n};\n\nvar FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;\n\n// `Array.prototype.concat` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.concat\n// with adding support of @@isConcatSpreadable and @@species\n$({ target: 'Array', proto: true, forced: FORCED }, {\n concat: function concat(arg) { // eslint-disable-line no-unused-vars\n var O = toObject(this);\n var A = arraySpeciesCreate(O, 0);\n var n = 0;\n var i, k, length, len, E;\n for (i = -1, length = arguments.length; i < length; i++) {\n E = i === -1 ? O : arguments[i];\n if (isConcatSpreadable(E)) {\n len = toLength(E.length);\n if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);\n } else {\n if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n createProperty(A, n++, E);\n }\n }\n A.length = n;\n return A;\n }\n});\n","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\n\nvar min = Math.min;\n\n// `Array.prototype.copyWithin` method implementation\n// https://tc39.github.io/ecma262/#sec-array.prototype.copywithin\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar create = require('../internals/object-create');\nvar definePropertyModule = require('../internals/object-define-property');\n\nvar UNSCOPABLES = wellKnownSymbol('unscopables');\nvar ArrayPrototype = Array.prototype;\n\n// Array.prototype[@@unscopables]\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\nif (ArrayPrototype[UNSCOPABLES] == undefined) {\n definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {\n configurable: true,\n value: create(null)\n });\n}\n\n// add a key to Array.prototype[@@unscopables]\nmodule.exports = function (key) {\n ArrayPrototype[UNSCOPABLES][key] = true;\n};\n","var $ = require('../internals/export');\nvar copyWithin = require('../internals/array-copy-within');\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// `Array.prototype.copyWithin` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.copywithin\n$({ target: 'Array', proto: true }, {\n copyWithin: copyWithin\n});\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('copyWithin');\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = function (METHOD_NAME, argument) {\n var method = [][METHOD_NAME];\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call,no-throw-literal\n method.call(null, argument || function () { throw 1; }, 1);\n });\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar has = require('../internals/has');\n\nvar defineProperty = Object.defineProperty;\nvar cache = {};\n\nvar thrower = function (it) { throw it; };\n\nmodule.exports = function (METHOD_NAME, options) {\n if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];\n if (!options) options = {};\n var method = [][METHOD_NAME];\n var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;\n var argument0 = has(options, 0) ? options[0] : thrower;\n var argument1 = has(options, 1) ? options[1] : undefined;\n\n return cache[METHOD_NAME] = !!method && !fails(function () {\n if (ACCESSORS && !DESCRIPTORS) return true;\n var O = { length: -1 };\n\n if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });\n else O[1] = 1;\n\n method.call(O, argument0, argument1);\n });\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $every = require('../internals/array-iteration').every;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar STRICT_METHOD = arrayMethodIsStrict('every');\nvar USES_TO_LENGTH = arrayMethodUsesToLength('every');\n\n// `Array.prototype.every` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.every\n$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {\n every: function every(callbackfn /* , thisArg */) {\n return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\n\n// `Array.prototype.fill` method implementation\n// https://tc39.github.io/ecma262/#sec-array.prototype.fill\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var argumentsLength = arguments.length;\n var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);\n var end = argumentsLength > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n","var $ = require('../internals/export');\nvar fill = require('../internals/array-fill');\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// `Array.prototype.fill` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.fill\n$({ target: 'Array', proto: true }, {\n fill: fill\n});\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('fill');\n","'use strict';\nvar $ = require('../internals/export');\nvar $filter = require('../internals/array-iteration').filter;\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');\n// Edge 14- issue\nvar USES_TO_LENGTH = arrayMethodUsesToLength('filter');\n\n// `Array.prototype.filter` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.filter\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $find = require('../internals/array-iteration').find;\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar FIND = 'find';\nvar SKIPS_HOLES = true;\n\nvar USES_TO_LENGTH = arrayMethodUsesToLength(FIND);\n\n// Shouldn't skip holes\nif (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });\n\n// `Array.prototype.find` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.find\n$({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables(FIND);\n","'use strict';\nvar $ = require('../internals/export');\nvar $findIndex = require('../internals/array-iteration').findIndex;\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar FIND_INDEX = 'findIndex';\nvar SKIPS_HOLES = true;\n\nvar USES_TO_LENGTH = arrayMethodUsesToLength(FIND_INDEX);\n\n// Shouldn't skip holes\nif (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });\n\n// `Array.prototype.findIndex` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.findindex\n$({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {\n findIndex: function findIndex(callbackfn /* , that = undefined */) {\n return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables(FIND_INDEX);\n","'use strict';\nvar isArray = require('../internals/is-array');\nvar toLength = require('../internals/to-length');\nvar bind = require('../internals/function-bind-context');\n\n// `FlattenIntoArray` abstract operation\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? bind(mapper, thisArg, 3) : false;\n var element;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n if (depth > 0 && isArray(element)) {\n targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;\n } else {\n if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length');\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n};\n\nmodule.exports = flattenIntoArray;\n","'use strict';\nvar $ = require('../internals/export');\nvar flattenIntoArray = require('../internals/flatten-into-array');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar toInteger = require('../internals/to-integer');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\n// `Array.prototype.flat` method\n// https://github.com/tc39/proposal-flatMap\n$({ target: 'Array', proto: true }, {\n flat: function flat(/* depthArg = 1 */) {\n var depthArg = arguments.length ? arguments[0] : undefined;\n var O = toObject(this);\n var sourceLen = toLength(O.length);\n var A = arraySpeciesCreate(O, 0);\n A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));\n return A;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar flattenIntoArray = require('../internals/flatten-into-array');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar aFunction = require('../internals/a-function');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\n// `Array.prototype.flatMap` method\n// https://github.com/tc39/proposal-flatMap\n$({ target: 'Array', proto: true }, {\n flatMap: function flatMap(callbackfn /* , thisArg */) {\n var O = toObject(this);\n var sourceLen = toLength(O.length);\n var A;\n aFunction(callbackfn);\n A = arraySpeciesCreate(O, 0);\n A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return A;\n }\n});\n","'use strict';\nvar $forEach = require('../internals/array-iteration').forEach;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar STRICT_METHOD = arrayMethodIsStrict('forEach');\nvar USES_TO_LENGTH = arrayMethodUsesToLength('forEach');\n\n// `Array.prototype.forEach` method implementation\n// https://tc39.github.io/ecma262/#sec-array.prototype.foreach\nmodule.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n} : [].forEach;\n","'use strict';\nvar $ = require('../internals/export');\nvar forEach = require('../internals/array-for-each');\n\n// `Array.prototype.forEach` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.foreach\n$({ target: 'Array', proto: true, forced: [].forEach != forEach }, {\n forEach: forEach\n});\n","var anObject = require('../internals/an-object');\n\n// call something on iterator step with safe closing on error\nmodule.exports = function (iterator, fn, value, ENTRIES) {\n try {\n return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (error) {\n var returnMethod = iterator['return'];\n if (returnMethod !== undefined) anObject(returnMethod.call(iterator));\n throw error;\n }\n};\n","module.exports = {};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;\n};\n","var classof = require('../internals/classof');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","'use strict';\nvar bind = require('../internals/function-bind-context');\nvar toObject = require('../internals/to-object');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar createProperty = require('../internals/create-property');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\n// `Array.from` method implementation\n// https://tc39.github.io/ecma262/#sec-array.from\nmodule.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var argumentsLength = arguments.length;\n var mapfn = argumentsLength > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iteratorMethod = getIteratorMethod(O);\n var index = 0;\n var length, result, step, iterator, next, value;\n if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);\n // if the target is not iterable or it's an array with the default iterator - use a simple case\n if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {\n iterator = iteratorMethod.call(O);\n next = iterator.next;\n result = new C();\n for (;!(step = next.call(iterator)).done; index++) {\n value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;\n createProperty(result, index, value);\n }\n } else {\n length = toLength(O.length);\n result = new C(length);\n for (;length > index; index++) {\n value = mapping ? mapfn(O[index], index) : O[index];\n createProperty(result, index, value);\n }\n }\n result.length = index;\n return result;\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line no-throw-literal\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n","var $ = require('../internals/export');\nvar from = require('../internals/array-from');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\n\nvar INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {\n Array.from(iterable);\n});\n\n// `Array.from` method\n// https://tc39.github.io/ecma262/#sec-array.from\n$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {\n from: from\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $includes = require('../internals/array-includes').includes;\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });\n\n// `Array.prototype.includes` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.includes\n$({ target: 'Array', proto: true, forced: !USES_TO_LENGTH }, {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('includes');\n","'use strict';\nvar $ = require('../internals/export');\nvar $indexOf = require('../internals/array-includes').indexOf;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar nativeIndexOf = [].indexOf;\n\nvar NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;\nvar STRICT_METHOD = arrayMethodIsStrict('indexOf');\nvar USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });\n\n// `Array.prototype.indexOf` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.indexof\n$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH }, {\n indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {\n return NEGATIVE_ZERO\n // convert -0 to +0\n ? nativeIndexOf.apply(this, arguments) || 0\n : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","var $ = require('../internals/export');\nvar isArray = require('../internals/is-array');\n\n// `Array.isArray` method\n// https://tc39.github.io/ecma262/#sec-array.isarray\n$({ target: 'Array', stat: true }, {\n isArray: isArray\n});\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n","var has = require('../internals/has');\nvar toObject = require('../internals/to-object');\nvar sharedKey = require('../internals/shared-key');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar ObjectPrototype = Object.prototype;\n\n// `Object.getPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.getprototypeof\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectPrototype : null;\n};\n","'use strict';\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\nvar returnThis = function () { return this; };\n\n// `%IteratorPrototype%` object\n// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nif (IteratorPrototype == undefined) IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nif (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {\n createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n","'use strict';\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar Iterators = require('../internals/iterators');\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it) && it !== null) {\n throw TypeError(\"Can't set \" + String(it) + ' as a prototype');\n } return it;\n};\n","var anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;\n setter.call(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter.call(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","'use strict';\nvar $ = require('../internals/export');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\nvar Iterators = require('../internals/iterators');\nvar IteratorsCore = require('../internals/iterators-core');\n\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n } return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {\n createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return nativeIterator.call(this); };\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);\n }\n Iterators[NAME] = defaultIterator;\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n redefine(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n return methods;\n};\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar Iterators = require('../internals/iterators');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.github.io/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return { value: undefined, done: true };\n }\n if (kind == 'keys') return { value: index, done: false };\n if (kind == 'values') return { value: target[index], done: false };\n return { value: [index, target[index]], done: false };\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.github.io/ecma262/#sec-createmappedargumentsobject\nIterators.Arguments = Iterators.Array;\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","'use strict';\nvar $ = require('../internals/export');\nvar IndexedObject = require('../internals/indexed-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar nativeJoin = [].join;\n\nvar ES3_STRINGS = IndexedObject != Object;\nvar STRICT_METHOD = arrayMethodIsStrict('join', ',');\n\n// `Array.prototype.join` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.join\n$({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {\n join: function join(separator) {\n return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);\n }\n});\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toInteger = require('../internals/to-integer');\nvar toLength = require('../internals/to-length');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar min = Math.min;\nvar nativeLastIndexOf = [].lastIndexOf;\nvar NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;\nvar STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');\n// For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method\nvar USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });\nvar FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH;\n\n// `Array.prototype.lastIndexOf` method implementation\n// https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof\nmodule.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {\n // convert -0 to +0\n if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0;\n var O = toIndexedObject(this);\n var length = toLength(O.length);\n var index = length - 1;\n if (arguments.length > 1) index = min(index, toInteger(arguments[1]));\n if (index < 0) index = length + index;\n for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;\n return -1;\n} : nativeLastIndexOf;\n","var $ = require('../internals/export');\nvar lastIndexOf = require('../internals/array-last-index-of');\n\n// `Array.prototype.lastIndexOf` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof\n$({ target: 'Array', proto: true, forced: lastIndexOf !== [].lastIndexOf }, {\n lastIndexOf: lastIndexOf\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $map = require('../internals/array-iteration').map;\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');\n// FF49- issue\nvar USES_TO_LENGTH = arrayMethodUsesToLength('map');\n\n// `Array.prototype.map` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.map\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {\n map: function map(callbackfn /* , thisArg */) {\n return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar createProperty = require('../internals/create-property');\n\nvar ISNT_GENERIC = fails(function () {\n function F() { /* empty */ }\n return !(Array.of.call(F) instanceof F);\n});\n\n// `Array.of` method\n// https://tc39.github.io/ecma262/#sec-array.of\n// WebKit Array.of isn't generic\n$({ target: 'Array', stat: true, forced: ISNT_GENERIC }, {\n of: function of(/* ...args */) {\n var index = 0;\n var argumentsLength = arguments.length;\n var result = new (typeof this == 'function' ? this : Array)(argumentsLength);\n while (argumentsLength > index) createProperty(result, index, arguments[index++]);\n result.length = argumentsLength;\n return result;\n }\n});\n","var aFunction = require('../internals/a-function');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\nvar toLength = require('../internals/to-length');\n\n// `Array.prototype.{ reduce, reduceRight }` methods implementation\nvar createMethod = function (IS_RIGHT) {\n return function (that, callbackfn, argumentsLength, memo) {\n aFunction(callbackfn);\n var O = toObject(that);\n var self = IndexedObject(O);\n var length = toLength(O.length);\n var index = IS_RIGHT ? length - 1 : 0;\n var i = IS_RIGHT ? -1 : 1;\n if (argumentsLength < 2) while (true) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (IS_RIGHT ? index < 0 : length <= index) {\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.reduce` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.reduce\n left: createMethod(false),\n // `Array.prototype.reduceRight` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright\n right: createMethod(true)\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $reduce = require('../internals/array-reduce').left;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar STRICT_METHOD = arrayMethodIsStrict('reduce');\nvar USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });\n\n// `Array.prototype.reduce` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.reduce\n$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {\n reduce: function reduce(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $reduceRight = require('../internals/array-reduce').right;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar STRICT_METHOD = arrayMethodIsStrict('reduceRight');\n// For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method\nvar USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });\n\n// `Array.prototype.reduceRight` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.reduceright\n$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {\n reduceRight: function reduceRight(callbackfn /* , initialValue */) {\n return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar isArray = require('../internals/is-array');\n\nvar nativeReverse = [].reverse;\nvar test = [1, 2];\n\n// `Array.prototype.reverse` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.reverse\n// fix for Safari 12.0 bug\n// https://bugs.webkit.org/show_bug.cgi?id=188794\n$({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {\n reverse: function reverse() {\n // eslint-disable-next-line no-self-assign\n if (isArray(this)) this.length = this.length;\n return nativeReverse.call(this);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar createProperty = require('../internals/create-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');\nvar USES_TO_LENGTH = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });\n\nvar SPECIES = wellKnownSymbol('species');\nvar nativeSlice = [].slice;\nvar max = Math.max;\n\n// `Array.prototype.slice` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.slice\n// fallback for not array-like ES3 strings and DOM objects\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {\n slice: function slice(start, end) {\n var O = toIndexedObject(this);\n var length = toLength(O.length);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible\n var Constructor, result, n;\n if (isArray(O)) {\n Constructor = O.constructor;\n // cross-realm fallback\n if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {\n Constructor = undefined;\n } else if (isObject(Constructor)) {\n Constructor = Constructor[SPECIES];\n if (Constructor === null) Constructor = undefined;\n }\n if (Constructor === Array || Constructor === undefined) {\n return nativeSlice.call(O, k, fin);\n }\n }\n result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));\n for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $some = require('../internals/array-iteration').some;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar STRICT_METHOD = arrayMethodIsStrict('some');\nvar USES_TO_LENGTH = arrayMethodUsesToLength('some');\n\n// `Array.prototype.some` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.some\n$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {\n some: function some(callbackfn /* , thisArg */) {\n return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar toObject = require('../internals/to-object');\nvar fails = require('../internals/fails');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar test = [];\nvar nativeSort = test.sort;\n\n// IE8-\nvar FAILS_ON_UNDEFINED = fails(function () {\n test.sort(undefined);\n});\n// V8 bug\nvar FAILS_ON_NULL = fails(function () {\n test.sort(null);\n});\n// Old WebKit\nvar STRICT_METHOD = arrayMethodIsStrict('sort');\n\nvar FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD;\n\n// `Array.prototype.sort` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.sort\n$({ target: 'Array', proto: true, forced: FORCED }, {\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? nativeSort.call(toObject(this))\n : nativeSort.call(toObject(this), aFunction(comparefn));\n }\n});\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar definePropertyModule = require('../internals/object-define-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n var defineProperty = definePropertyModule.f;\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineProperty(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","var setSpecies = require('../internals/set-species');\n\n// `Array[@@species]` getter\n// https://tc39.github.io/ecma262/#sec-get-array-@@species\nsetSpecies('Array');\n","'use strict';\nvar $ = require('../internals/export');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toInteger = require('../internals/to-integer');\nvar toLength = require('../internals/to-length');\nvar toObject = require('../internals/to-object');\nvar arraySpeciesCreate = require('../internals/array-species-create');\nvar createProperty = require('../internals/create-property');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');\nvar USES_TO_LENGTH = arrayMethodUsesToLength('splice', { ACCESSORS: true, 0: 0, 1: 2 });\n\nvar max = Math.max;\nvar min = Math.min;\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;\nvar MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';\n\n// `Array.prototype.splice` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.splice\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {\n splice: function splice(start, deleteCount /* , ...items */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var actualStart = toAbsoluteIndex(start, len);\n var argumentsLength = arguments.length;\n var insertCount, actualDeleteCount, A, k, from, to;\n if (argumentsLength === 0) {\n insertCount = actualDeleteCount = 0;\n } else if (argumentsLength === 1) {\n insertCount = 0;\n actualDeleteCount = len - actualStart;\n } else {\n insertCount = argumentsLength - 2;\n actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart);\n }\n if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {\n throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);\n }\n A = arraySpeciesCreate(O, actualDeleteCount);\n for (k = 0; k < actualDeleteCount; k++) {\n from = actualStart + k;\n if (from in O) createProperty(A, k, O[from]);\n }\n A.length = actualDeleteCount;\n if (insertCount < actualDeleteCount) {\n for (k = actualStart; k < len - actualDeleteCount; k++) {\n from = k + actualDeleteCount;\n to = k + insertCount;\n if (from in O) O[to] = O[from];\n else delete O[to];\n }\n for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];\n } else if (insertCount > actualDeleteCount) {\n for (k = len - actualDeleteCount; k > actualStart; k--) {\n from = k + actualDeleteCount - 1;\n to = k + insertCount - 1;\n if (from in O) O[to] = O[from];\n else delete O[to];\n }\n }\n for (k = 0; k < insertCount; k++) {\n O[k + actualStart] = arguments[k + 2];\n }\n O.length = len - actualDeleteCount + insertCount;\n return A;\n }\n});\n","// this method was added to unscopables after implementation\n// in popular engines, so it's moved to a separate module\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\naddToUnscopables('flat');\n","// this method was added to unscopables after implementation\n// in popular engines, so it's moved to a separate module\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\naddToUnscopables('flatMap');\n","module.exports = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined';\n","var redefine = require('../internals/redefine');\n\nmodule.exports = function (target, src, options) {\n for (var key in src) redefine(target, key, src[key], options);\n return target;\n};\n","module.exports = function (it, Constructor, name) {\n if (!(it instanceof Constructor)) {\n throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');\n } return it;\n};\n","var toInteger = require('../internals/to-integer');\nvar toLength = require('../internals/to-length');\n\n// `ToIndex` abstract operation\n// https://tc39.github.io/ecma262/#sec-toindex\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toInteger(it);\n var length = toLength(number);\n if (number !== length) throw RangeError('Wrong length or index');\n return length;\n};\n","// IEEE754 conversions based on https://github.com/feross/ieee754\n// eslint-disable-next-line no-shadow-restricted-names\nvar Infinity = 1 / 0;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\n\nvar pack = function (number, mantissaLength, bytes) {\n var buffer = new Array(bytes);\n var exponentLength = bytes * 8 - mantissaLength - 1;\n var eMax = (1 << exponentLength) - 1;\n var eBias = eMax >> 1;\n var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;\n var index = 0;\n var exponent, mantissa, c;\n number = abs(number);\n // eslint-disable-next-line no-self-compare\n if (number != number || number === Infinity) {\n // eslint-disable-next-line no-self-compare\n mantissa = number != number ? 1 : 0;\n exponent = eMax;\n } else {\n exponent = floor(log(number) / LN2);\n if (number * (c = pow(2, -exponent)) < 1) {\n exponent--;\n c *= 2;\n }\n if (exponent + eBias >= 1) {\n number += rt / c;\n } else {\n number += rt * pow(2, 1 - eBias);\n }\n if (number * c >= 2) {\n exponent++;\n c /= 2;\n }\n if (exponent + eBias >= eMax) {\n mantissa = 0;\n exponent = eMax;\n } else if (exponent + eBias >= 1) {\n mantissa = (number * c - 1) * pow(2, mantissaLength);\n exponent = exponent + eBias;\n } else {\n mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);\n exponent = 0;\n }\n }\n for (; mantissaLength >= 8; buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8);\n exponent = exponent << mantissaLength | mantissa;\n exponentLength += mantissaLength;\n for (; exponentLength > 0; buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8);\n buffer[--index] |= sign * 128;\n return buffer;\n};\n\nvar unpack = function (buffer, mantissaLength) {\n var bytes = buffer.length;\n var exponentLength = bytes * 8 - mantissaLength - 1;\n var eMax = (1 << exponentLength) - 1;\n var eBias = eMax >> 1;\n var nBits = exponentLength - 7;\n var index = bytes - 1;\n var sign = buffer[index--];\n var exponent = sign & 127;\n var mantissa;\n sign >>= 7;\n for (; nBits > 0; exponent = exponent * 256 + buffer[index], index--, nBits -= 8);\n mantissa = exponent & (1 << -nBits) - 1;\n exponent >>= -nBits;\n nBits += mantissaLength;\n for (; nBits > 0; mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8);\n if (exponent === 0) {\n exponent = 1 - eBias;\n } else if (exponent === eMax) {\n return mantissa ? NaN : sign ? -Infinity : Infinity;\n } else {\n mantissa = mantissa + pow(2, mantissaLength);\n exponent = exponent - eBias;\n } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);\n};\n\nmodule.exports = {\n pack: pack,\n unpack: unpack\n};\n","'use strict';\nvar global = require('../internals/global');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefineAll = require('../internals/redefine-all');\nvar fails = require('../internals/fails');\nvar anInstance = require('../internals/an-instance');\nvar toInteger = require('../internals/to-integer');\nvar toLength = require('../internals/to-length');\nvar toIndex = require('../internals/to-index');\nvar IEEE754 = require('../internals/ieee754');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar defineProperty = require('../internals/object-define-property').f;\nvar arrayFill = require('../internals/array-fill');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length';\nvar WRONG_INDEX = 'Wrong index';\nvar NativeArrayBuffer = global[ARRAY_BUFFER];\nvar $ArrayBuffer = NativeArrayBuffer;\nvar $DataView = global[DATA_VIEW];\nvar $DataViewPrototype = $DataView && $DataView[PROTOTYPE];\nvar ObjectPrototype = Object.prototype;\nvar RangeError = global.RangeError;\n\nvar packIEEE754 = IEEE754.pack;\nvar unpackIEEE754 = IEEE754.unpack;\n\nvar packInt8 = function (number) {\n return [number & 0xFF];\n};\n\nvar packInt16 = function (number) {\n return [number & 0xFF, number >> 8 & 0xFF];\n};\n\nvar packInt32 = function (number) {\n return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF];\n};\n\nvar unpackInt32 = function (buffer) {\n return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];\n};\n\nvar packFloat32 = function (number) {\n return packIEEE754(number, 23, 4);\n};\n\nvar packFloat64 = function (number) {\n return packIEEE754(number, 52, 8);\n};\n\nvar addGetter = function (Constructor, key) {\n defineProperty(Constructor[PROTOTYPE], key, { get: function () { return getInternalState(this)[key]; } });\n};\n\nvar get = function (view, count, index, isLittleEndian) {\n var intIndex = toIndex(index);\n var store = getInternalState(view);\n if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);\n var bytes = getInternalState(store.buffer).bytes;\n var start = intIndex + store.byteOffset;\n var pack = bytes.slice(start, start + count);\n return isLittleEndian ? pack : pack.reverse();\n};\n\nvar set = function (view, count, index, conversion, value, isLittleEndian) {\n var intIndex = toIndex(index);\n var store = getInternalState(view);\n if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);\n var bytes = getInternalState(store.buffer).bytes;\n var start = intIndex + store.byteOffset;\n var pack = conversion(+value);\n for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1];\n};\n\nif (!NATIVE_ARRAY_BUFFER) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer, ARRAY_BUFFER);\n var byteLength = toIndex(length);\n setInternalState(this, {\n bytes: arrayFill.call(new Array(byteLength), 0),\n byteLength: byteLength\n });\n if (!DESCRIPTORS) this.byteLength = byteLength;\n };\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, $DataView, DATA_VIEW);\n anInstance(buffer, $ArrayBuffer, DATA_VIEW);\n var bufferLength = getInternalState(buffer).byteLength;\n var offset = toInteger(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n setInternalState(this, {\n buffer: buffer,\n byteLength: byteLength,\n byteOffset: offset\n });\n if (!DESCRIPTORS) {\n this.buffer = buffer;\n this.byteLength = byteLength;\n this.byteOffset = offset;\n }\n };\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, 'byteLength');\n addGetter($DataView, 'buffer');\n addGetter($DataView, 'byteLength');\n addGetter($DataView, 'byteOffset');\n }\n\n redefineAll($DataView[PROTOTYPE], {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packInt8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packInt8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined);\n }\n });\n} else {\n if (!fails(function () {\n NativeArrayBuffer(1);\n }) || !fails(function () {\n new NativeArrayBuffer(-1); // eslint-disable-line no-new\n }) || fails(function () {\n new NativeArrayBuffer(); // eslint-disable-line no-new\n new NativeArrayBuffer(1.5); // eslint-disable-line no-new\n new NativeArrayBuffer(NaN); // eslint-disable-line no-new\n return NativeArrayBuffer.name != ARRAY_BUFFER;\n })) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer);\n return new NativeArrayBuffer(toIndex(length));\n };\n var ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE] = NativeArrayBuffer[PROTOTYPE];\n for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) {\n createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]);\n }\n }\n ArrayBufferPrototype.constructor = $ArrayBuffer;\n }\n\n // WebKit bug - the same parent prototype for typed arrays and data view\n if (setPrototypeOf && getPrototypeOf($DataViewPrototype) !== ObjectPrototype) {\n setPrototypeOf($DataViewPrototype, ObjectPrototype);\n }\n\n // iOS Safari 7.x bug\n var testView = new $DataView(new $ArrayBuffer(2));\n var nativeSetInt8 = $DataViewPrototype.setInt8;\n testView.setInt8(0, 2147483648);\n testView.setInt8(1, 2147483649);\n if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll($DataViewPrototype, {\n setInt8: function setInt8(byteOffset, value) {\n nativeSetInt8.call(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n nativeSetInt8.call(this, byteOffset, value << 24 >> 24);\n }\n }, { unsafe: true });\n}\n\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\n\nmodule.exports = {\n ArrayBuffer: $ArrayBuffer,\n DataView: $DataView\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar arrayBufferModule = require('../internals/array-buffer');\nvar setSpecies = require('../internals/set-species');\n\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar ArrayBuffer = arrayBufferModule[ARRAY_BUFFER];\nvar NativeArrayBuffer = global[ARRAY_BUFFER];\n\n// `ArrayBuffer` constructor\n// https://tc39.github.io/ecma262/#sec-arraybuffer-constructor\n$({ global: true, forced: NativeArrayBuffer !== ArrayBuffer }, {\n ArrayBuffer: ArrayBuffer\n});\n\nsetSpecies(ARRAY_BUFFER);\n","'use strict';\nvar NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar has = require('../internals/has');\nvar classof = require('../internals/classof');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar defineProperty = require('../internals/object-define-property').f;\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar uid = require('../internals/uid');\n\nvar Int8Array = global.Int8Array;\nvar Int8ArrayPrototype = Int8Array && Int8Array.prototype;\nvar Uint8ClampedArray = global.Uint8ClampedArray;\nvar Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;\nvar TypedArray = Int8Array && getPrototypeOf(Int8Array);\nvar TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);\nvar ObjectPrototype = Object.prototype;\nvar isPrototypeOf = ObjectPrototype.isPrototypeOf;\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');\n// Fixing native typed arrays in Opera Presto crashes the browser, see #595\nvar NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera';\nvar TYPED_ARRAY_TAG_REQIRED = false;\nvar NAME;\n\nvar TypedArrayConstructorsList = {\n Int8Array: 1,\n Uint8Array: 1,\n Uint8ClampedArray: 1,\n Int16Array: 2,\n Uint16Array: 2,\n Int32Array: 4,\n Uint32Array: 4,\n Float32Array: 4,\n Float64Array: 8\n};\n\nvar isView = function isView(it) {\n var klass = classof(it);\n return klass === 'DataView' || has(TypedArrayConstructorsList, klass);\n};\n\nvar isTypedArray = function (it) {\n return isObject(it) && has(TypedArrayConstructorsList, classof(it));\n};\n\nvar aTypedArray = function (it) {\n if (isTypedArray(it)) return it;\n throw TypeError('Target is not a typed array');\n};\n\nvar aTypedArrayConstructor = function (C) {\n if (setPrototypeOf) {\n if (isPrototypeOf.call(TypedArray, C)) return C;\n } else for (var ARRAY in TypedArrayConstructorsList) if (has(TypedArrayConstructorsList, NAME)) {\n var TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && (C === TypedArrayConstructor || isPrototypeOf.call(TypedArrayConstructor, C))) {\n return C;\n }\n } throw TypeError('Target is not a typed array constructor');\n};\n\nvar exportTypedArrayMethod = function (KEY, property, forced) {\n if (!DESCRIPTORS) return;\n if (forced) for (var ARRAY in TypedArrayConstructorsList) {\n var TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && has(TypedArrayConstructor.prototype, KEY)) {\n delete TypedArrayConstructor.prototype[KEY];\n }\n }\n if (!TypedArrayPrototype[KEY] || forced) {\n redefine(TypedArrayPrototype, KEY, forced ? property\n : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property);\n }\n};\n\nvar exportTypedArrayStaticMethod = function (KEY, property, forced) {\n var ARRAY, TypedArrayConstructor;\n if (!DESCRIPTORS) return;\n if (setPrototypeOf) {\n if (forced) for (ARRAY in TypedArrayConstructorsList) {\n TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && has(TypedArrayConstructor, KEY)) {\n delete TypedArrayConstructor[KEY];\n }\n }\n if (!TypedArray[KEY] || forced) {\n // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable\n try {\n return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8Array[KEY] || property);\n } catch (error) { /* empty */ }\n } else return;\n }\n for (ARRAY in TypedArrayConstructorsList) {\n TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {\n redefine(TypedArrayConstructor, KEY, property);\n }\n }\n};\n\nfor (NAME in TypedArrayConstructorsList) {\n if (!global[NAME]) NATIVE_ARRAY_BUFFER_VIEWS = false;\n}\n\n// WebKit bug - typed arrays constructors prototype is Object.prototype\nif (!NATIVE_ARRAY_BUFFER_VIEWS || typeof TypedArray != 'function' || TypedArray === Function.prototype) {\n // eslint-disable-next-line no-shadow\n TypedArray = function TypedArray() {\n throw TypeError('Incorrect invocation');\n };\n if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {\n if (global[NAME]) setPrototypeOf(global[NAME], TypedArray);\n }\n}\n\nif (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {\n TypedArrayPrototype = TypedArray.prototype;\n if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {\n if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype);\n }\n}\n\n// WebKit bug - one more object in Uint8ClampedArray prototype chain\nif (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {\n setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);\n}\n\nif (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) {\n TYPED_ARRAY_TAG_REQIRED = true;\n defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function () {\n return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;\n } });\n for (NAME in TypedArrayConstructorsList) if (global[NAME]) {\n createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME);\n }\n}\n\nmodule.exports = {\n NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,\n TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG,\n aTypedArray: aTypedArray,\n aTypedArrayConstructor: aTypedArrayConstructor,\n exportTypedArrayMethod: exportTypedArrayMethod,\n exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,\n isView: isView,\n isTypedArray: isTypedArray,\n TypedArray: TypedArray,\n TypedArrayPrototype: TypedArrayPrototype\n};\n","var $ = require('../internals/export');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\n\nvar NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;\n\n// `ArrayBuffer.isView` method\n// https://tc39.github.io/ecma262/#sec-arraybuffer.isview\n$({ target: 'ArrayBuffer', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {\n isView: ArrayBufferViewCore.isView\n});\n","var anObject = require('../internals/an-object');\nvar aFunction = require('../internals/a-function');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `SpeciesConstructor` abstract operation\n// https://tc39.github.io/ecma262/#sec-speciesconstructor\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar ArrayBufferModule = require('../internals/array-buffer');\nvar anObject = require('../internals/an-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\nvar speciesConstructor = require('../internals/species-constructor');\n\nvar ArrayBuffer = ArrayBufferModule.ArrayBuffer;\nvar DataView = ArrayBufferModule.DataView;\nvar nativeArrayBufferSlice = ArrayBuffer.prototype.slice;\n\nvar INCORRECT_SLICE = fails(function () {\n return !new ArrayBuffer(2).slice(1, undefined).byteLength;\n});\n\n// `ArrayBuffer.prototype.slice` method\n// https://tc39.github.io/ecma262/#sec-arraybuffer.prototype.slice\n$({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, {\n slice: function slice(start, end) {\n if (nativeArrayBufferSlice !== undefined && end === undefined) {\n return nativeArrayBufferSlice.call(anObject(this), start); // FF fix\n }\n var length = anObject(this).byteLength;\n var first = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n var result = new (speciesConstructor(this, ArrayBuffer))(toLength(fin - first));\n var viewSource = new DataView(this);\n var viewTarget = new DataView(result);\n var index = 0;\n while (first < fin) {\n viewTarget.setUint8(index++, viewSource.getUint8(first++));\n } return result;\n }\n});\n","var $ = require('../internals/export');\nvar ArrayBufferModule = require('../internals/array-buffer');\nvar NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native');\n\n// `DataView` constructor\n// https://tc39.github.io/ecma262/#sec-dataview-constructor\n$({ global: true, forced: !NATIVE_ARRAY_BUFFER }, {\n DataView: ArrayBufferModule.DataView\n});\n","var $ = require('../internals/export');\n\n// `Date.now` method\n// https://tc39.github.io/ecma262/#sec-date.now\n$({ target: 'Date', stat: true }, {\n now: function now() {\n return new Date().getTime();\n }\n});\n","'use strict';\nvar toInteger = require('../internals/to-integer');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `String.prototype.repeat` method implementation\n// https://tc39.github.io/ecma262/#sec-string.prototype.repeat\nmodule.exports = ''.repeat || function repeat(count) {\n var str = String(requireObjectCoercible(this));\n var result = '';\n var n = toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;\n return result;\n};\n","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('../internals/to-length');\nvar repeat = require('../internals/string-repeat');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar ceil = Math.ceil;\n\n// `String.prototype.{ padStart, padEnd }` methods implementation\nvar createMethod = function (IS_END) {\n return function ($this, maxLength, fillString) {\n var S = String(requireObjectCoercible($this));\n var stringLength = S.length;\n var fillStr = fillString === undefined ? ' ' : String(fillString);\n var intMaxLength = toLength(maxLength);\n var fillLen, stringFiller;\n if (intMaxLength <= stringLength || fillStr == '') return S;\n fillLen = intMaxLength - stringLength;\n stringFiller = repeat.call(fillStr, ceil(fillLen / fillStr.length));\n if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);\n return IS_END ? S + stringFiller : stringFiller + S;\n };\n};\n\nmodule.exports = {\n // `String.prototype.padStart` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.padstart\n start: createMethod(false),\n // `String.prototype.padEnd` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.padend\n end: createMethod(true)\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar padStart = require('../internals/string-pad').start;\n\nvar abs = Math.abs;\nvar DatePrototype = Date.prototype;\nvar getTime = DatePrototype.getTime;\nvar nativeDateToISOString = DatePrototype.toISOString;\n\n// `Date.prototype.toISOString` method implementation\n// https://tc39.github.io/ecma262/#sec-date.prototype.toisostring\n// PhantomJS / old WebKit fails here:\nmodule.exports = (fails(function () {\n return nativeDateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';\n}) || !fails(function () {\n nativeDateToISOString.call(new Date(NaN));\n})) ? function toISOString() {\n if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');\n var date = this;\n var year = date.getUTCFullYear();\n var milliseconds = date.getUTCMilliseconds();\n var sign = year < 0 ? '-' : year > 9999 ? '+' : '';\n return sign + padStart(abs(year), sign ? 6 : 4, 0) +\n '-' + padStart(date.getUTCMonth() + 1, 2, 0) +\n '-' + padStart(date.getUTCDate(), 2, 0) +\n 'T' + padStart(date.getUTCHours(), 2, 0) +\n ':' + padStart(date.getUTCMinutes(), 2, 0) +\n ':' + padStart(date.getUTCSeconds(), 2, 0) +\n '.' + padStart(milliseconds, 3, 0) +\n 'Z';\n} : nativeDateToISOString;\n","var $ = require('../internals/export');\nvar toISOString = require('../internals/date-to-iso-string');\n\n// `Date.prototype.toISOString` method\n// https://tc39.github.io/ecma262/#sec-date.prototype.toisostring\n// PhantomJS / old WebKit has a broken implementations\n$({ target: 'Date', proto: true, forced: Date.prototype.toISOString !== toISOString }, {\n toISOString: toISOString\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar toObject = require('../internals/to-object');\nvar toPrimitive = require('../internals/to-primitive');\n\nvar FORCED = fails(function () {\n return new Date(NaN).toJSON() !== null\n || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;\n});\n\n// `Date.prototype.toJSON` method\n// https://tc39.github.io/ecma262/#sec-date.prototype.tojson\n$({ target: 'Date', proto: true, forced: FORCED }, {\n // eslint-disable-next-line no-unused-vars\n toJSON: function toJSON(key) {\n var O = toObject(this);\n var pv = toPrimitive(O);\n return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();\n }\n});\n","'use strict';\nvar anObject = require('../internals/an-object');\nvar toPrimitive = require('../internals/to-primitive');\n\nmodule.exports = function (hint) {\n if (hint !== 'string' && hint !== 'number' && hint !== 'default') {\n throw TypeError('Incorrect hint');\n } return toPrimitive(anObject(this), hint !== 'number');\n};\n","var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar dateToPrimitive = require('../internals/date-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\nvar DatePrototype = Date.prototype;\n\n// `Date.prototype[@@toPrimitive]` method\n// https://tc39.github.io/ecma262/#sec-date.prototype-@@toprimitive\nif (!(TO_PRIMITIVE in DatePrototype)) {\n createNonEnumerableProperty(DatePrototype, TO_PRIMITIVE, dateToPrimitive);\n}\n","var redefine = require('../internals/redefine');\n\nvar DatePrototype = Date.prototype;\nvar INVALID_DATE = 'Invalid Date';\nvar TO_STRING = 'toString';\nvar nativeDateToString = DatePrototype[TO_STRING];\nvar getTime = DatePrototype.getTime;\n\n// `Date.prototype.toString` method\n// https://tc39.github.io/ecma262/#sec-date.prototype.tostring\nif (new Date(NaN) + '' != INVALID_DATE) {\n redefine(DatePrototype, TO_STRING, function toString() {\n var value = getTime.call(this);\n // eslint-disable-next-line no-self-compare\n return value === value ? nativeDateToString.call(this) : INVALID_DATE;\n });\n}\n","'use strict';\nvar aFunction = require('../internals/a-function');\nvar isObject = require('../internals/is-object');\n\nvar slice = [].slice;\nvar factories = {};\n\nvar construct = function (C, argsLength, args) {\n if (!(argsLength in factories)) {\n for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';\n // eslint-disable-next-line no-new-func\n factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')');\n } return factories[argsLength](C, args);\n};\n\n// `Function.prototype.bind` method implementation\n// https://tc39.github.io/ecma262/#sec-function.prototype.bind\nmodule.exports = Function.bind || function bind(that /* , ...args */) {\n var fn = aFunction(this);\n var partArgs = slice.call(arguments, 1);\n var boundFunction = function bound(/* args... */) {\n var args = partArgs.concat(slice.call(arguments));\n return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args);\n };\n if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype;\n return boundFunction;\n};\n","var $ = require('../internals/export');\nvar bind = require('../internals/function-bind');\n\n// `Function.prototype.bind` method\n// https://tc39.github.io/ecma262/#sec-function.prototype.bind\n$({ target: 'Function', proto: true }, {\n bind: bind\n});\n","'use strict';\nvar isObject = require('../internals/is-object');\nvar definePropertyModule = require('../internals/object-define-property');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar HAS_INSTANCE = wellKnownSymbol('hasInstance');\nvar FunctionPrototype = Function.prototype;\n\n// `Function.prototype[@@hasInstance]` method\n// https://tc39.github.io/ecma262/#sec-function.prototype-@@hasinstance\nif (!(HAS_INSTANCE in FunctionPrototype)) {\n definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: function (O) {\n if (typeof this != 'function' || !isObject(O)) return false;\n if (!isObject(this.prototype)) return O instanceof this;\n // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:\n while (O = getPrototypeOf(O)) if (this.prototype === O) return true;\n return false;\n } });\n}\n","var DESCRIPTORS = require('../internals/descriptors');\nvar defineProperty = require('../internals/object-define-property').f;\n\nvar FunctionPrototype = Function.prototype;\nvar FunctionPrototypeToString = FunctionPrototype.toString;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// Function instances `.name` property\n// https://tc39.github.io/ecma262/#sec-function-instances-name\nif (DESCRIPTORS && !(NAME in FunctionPrototype)) {\n defineProperty(FunctionPrototype, NAME, {\n configurable: true,\n get: function () {\n try {\n return FunctionPrototypeToString.call(this).match(nameRE)[1];\n } catch (error) {\n return '';\n }\n }\n });\n}\n","var $ = require('../internals/export');\nvar global = require('../internals/global');\n\n// `globalThis` object\n// https://github.com/tc39/proposal-global\n$({ global: true }, {\n globalThis: global\n});\n","var $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar fails = require('../internals/fails');\n\nvar $stringify = getBuiltIn('JSON', 'stringify');\nvar re = /[\\uD800-\\uDFFF]/g;\nvar low = /^[\\uD800-\\uDBFF]$/;\nvar hi = /^[\\uDC00-\\uDFFF]$/;\n\nvar fix = function (match, offset, string) {\n var prev = string.charAt(offset - 1);\n var next = string.charAt(offset + 1);\n if ((low.test(match) && !hi.test(next)) || (hi.test(match) && !low.test(prev))) {\n return '\\\\u' + match.charCodeAt(0).toString(16);\n } return match;\n};\n\nvar FORCED = fails(function () {\n return $stringify('\\uDF06\\uD834') !== '\"\\\\udf06\\\\ud834\"'\n || $stringify('\\uDEAD') !== '\"\\\\udead\"';\n});\n\nif ($stringify) {\n // https://github.com/tc39/proposal-well-formed-stringify\n $({ target: 'JSON', stat: true, forced: FORCED }, {\n // eslint-disable-next-line no-unused-vars\n stringify: function stringify(it, replacer, space) {\n var result = $stringify.apply(null, arguments);\n return typeof result == 'string' ? result.replace(re, fix) : result;\n }\n });\n}\n","var global = require('../internals/global');\nvar setToStringTag = require('../internals/set-to-string-tag');\n\n// JSON[@@toStringTag] property\n// https://tc39.github.io/ecma262/#sec-json-@@tostringtag\nsetToStringTag(global.JSON, 'JSON', true);\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n return Object.isExtensible(Object.preventExtensions({}));\n});\n","var hiddenKeys = require('../internals/hidden-keys');\nvar isObject = require('../internals/is-object');\nvar has = require('../internals/has');\nvar defineProperty = require('../internals/object-define-property').f;\nvar uid = require('../internals/uid');\nvar FREEZING = require('../internals/freezing');\n\nvar METADATA = uid('meta');\nvar id = 0;\n\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\n\nvar setMetadata = function (it) {\n defineProperty(it, METADATA, { value: {\n objectID: 'O' + ++id, // object ID\n weakData: {} // weak collections IDs\n } });\n};\n\nvar fastKey = function (it, create) {\n // return a primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, METADATA)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMetadata(it);\n // return object ID\n } return it[METADATA].objectID;\n};\n\nvar getWeakData = function (it, create) {\n if (!has(it, METADATA)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMetadata(it);\n // return the store of weak collections IDs\n } return it[METADATA].weakData;\n};\n\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it);\n return it;\n};\n\nvar meta = module.exports = {\n REQUIRED: false,\n fastKey: fastKey,\n getWeakData: getWeakData,\n onFreeze: onFreeze\n};\n\nhiddenKeys[METADATA] = true;\n","var anObject = require('../internals/an-object');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar bind = require('../internals/function-bind-context');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nvar iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {\n var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1);\n var iterator, iterFn, index, length, result, next, step;\n\n if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (typeof iterFn != 'function') throw TypeError('Target is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = toLength(iterable.length); length > index; index++) {\n result = AS_ENTRIES\n ? boundFunction(anObject(step = iterable[index])[0], step[1])\n : boundFunction(iterable[index]);\n if (result && result instanceof Result) return result;\n } return new Result(false);\n }\n iterator = iterFn.call(iterable);\n }\n\n next = iterator.next;\n while (!(step = next.call(iterator)).done) {\n result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);\n if (typeof result == 'object' && result && result instanceof Result) return result;\n } return new Result(false);\n};\n\niterate.stop = function (result) {\n return new Result(true, result);\n};\n","var isObject = require('../internals/is-object');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// makes subclassing work correct for wrapped built-ins\nmodule.exports = function ($this, dummy, Wrapper) {\n var NewTarget, NewTargetPrototype;\n if (\n // it can work only with native `setPrototypeOf`\n setPrototypeOf &&\n // we haven't completely correct pre-ES6 way for getting `new.target`, so use this\n typeof (NewTarget = dummy.constructor) == 'function' &&\n NewTarget !== Wrapper &&\n isObject(NewTargetPrototype = NewTarget.prototype) &&\n NewTargetPrototype !== Wrapper.prototype\n ) setPrototypeOf($this, NewTargetPrototype);\n return $this;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar isForced = require('../internals/is-forced');\nvar redefine = require('../internals/redefine');\nvar InternalMetadataModule = require('../internals/internal-metadata');\nvar iterate = require('../internals/iterate');\nvar anInstance = require('../internals/an-instance');\nvar isObject = require('../internals/is-object');\nvar fails = require('../internals/fails');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar inheritIfRequired = require('../internals/inherit-if-required');\n\nmodule.exports = function (CONSTRUCTOR_NAME, wrapper, common) {\n var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;\n var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;\n var ADDER = IS_MAP ? 'set' : 'add';\n var NativeConstructor = global[CONSTRUCTOR_NAME];\n var NativePrototype = NativeConstructor && NativeConstructor.prototype;\n var Constructor = NativeConstructor;\n var exported = {};\n\n var fixMethod = function (KEY) {\n var nativeMethod = NativePrototype[KEY];\n redefine(NativePrototype, KEY,\n KEY == 'add' ? function add(value) {\n nativeMethod.call(this, value === 0 ? 0 : value);\n return this;\n } : KEY == 'delete' ? function (key) {\n return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);\n } : KEY == 'get' ? function get(key) {\n return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);\n } : KEY == 'has' ? function has(key) {\n return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);\n } : function set(key, value) {\n nativeMethod.call(this, key === 0 ? 0 : key, value);\n return this;\n }\n );\n };\n\n // eslint-disable-next-line max-len\n if (isForced(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () {\n new NativeConstructor().entries().next();\n })))) {\n // create collection constructor\n Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);\n InternalMetadataModule.REQUIRED = true;\n } else if (isForced(CONSTRUCTOR_NAME, true)) {\n var instance = new Constructor();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n // eslint-disable-next-line no-new\n var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new NativeConstructor();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n\n if (!ACCEPT_ITERABLES) {\n Constructor = wrapper(function (dummy, iterable) {\n anInstance(dummy, Constructor, CONSTRUCTOR_NAME);\n var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);\n if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP);\n return that;\n });\n Constructor.prototype = NativePrototype;\n NativePrototype.constructor = Constructor;\n }\n\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n\n // weak collections should not contains .clear method\n if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;\n }\n\n exported[CONSTRUCTOR_NAME] = Constructor;\n $({ global: true, forced: Constructor != NativeConstructor }, exported);\n\n setToStringTag(Constructor, CONSTRUCTOR_NAME);\n\n if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);\n\n return Constructor;\n};\n","'use strict';\nvar defineProperty = require('../internals/object-define-property').f;\nvar create = require('../internals/object-create');\nvar redefineAll = require('../internals/redefine-all');\nvar bind = require('../internals/function-bind-context');\nvar anInstance = require('../internals/an-instance');\nvar iterate = require('../internals/iterate');\nvar defineIterator = require('../internals/define-iterator');\nvar setSpecies = require('../internals/set-species');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fastKey = require('../internals/internal-metadata').fastKey;\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\n\nmodule.exports = {\n getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, CONSTRUCTOR_NAME);\n setInternalState(that, {\n type: CONSTRUCTOR_NAME,\n index: create(null),\n first: undefined,\n last: undefined,\n size: 0\n });\n if (!DESCRIPTORS) that.size = 0;\n if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP);\n });\n\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n\n var define = function (that, key, value) {\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n var previous, index;\n // change existing entry\n if (entry) {\n entry.value = value;\n // create new entry\n } else {\n state.last = entry = {\n index: index = fastKey(key, true),\n key: key,\n value: value,\n previous: previous = state.last,\n next: undefined,\n removed: false\n };\n if (!state.first) state.first = entry;\n if (previous) previous.next = entry;\n if (DESCRIPTORS) state.size++;\n else that.size++;\n // add to index\n if (index !== 'F') state.index[index] = entry;\n } return that;\n };\n\n var getEntry = function (that, key) {\n var state = getInternalState(that);\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return state.index[index];\n // frozen object case\n for (entry = state.first; entry; entry = entry.next) {\n if (entry.key == key) return entry;\n }\n };\n\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n var that = this;\n var state = getInternalState(that);\n var data = state.index;\n var entry = state.first;\n while (entry) {\n entry.removed = true;\n if (entry.previous) entry.previous = entry.previous.next = undefined;\n delete data[entry.index];\n entry = entry.next;\n }\n state.first = state.last = undefined;\n if (DESCRIPTORS) state.size = 0;\n else that.size = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = this;\n var state = getInternalState(that);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.next;\n var prev = entry.previous;\n delete state.index[entry.index];\n entry.removed = true;\n if (prev) prev.next = next;\n if (next) next.previous = prev;\n if (state.first == entry) state.first = next;\n if (state.last == entry) state.last = prev;\n if (DESCRIPTORS) state.size--;\n else that.size--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n var state = getInternalState(this);\n var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.next : state.first) {\n boundFunction(entry.value, entry.key, this);\n // revert to the last existing entry\n while (entry && entry.removed) entry = entry.previous;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(this, key);\n }\n });\n\n redefineAll(C.prototype, IS_MAP ? {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = getEntry(this, key);\n return entry && entry.value;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return define(this, key === 0 ? 0 : key, value);\n }\n } : {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return define(this, value = value === 0 ? 0 : value, value);\n }\n });\n if (DESCRIPTORS) defineProperty(C.prototype, 'size', {\n get: function () {\n return getInternalState(this).size;\n }\n });\n return C;\n },\n setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {\n var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';\n var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);\n var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {\n setInternalState(this, {\n type: ITERATOR_NAME,\n target: iterated,\n state: getInternalCollectionState(iterated),\n kind: kind,\n last: undefined\n });\n }, function () {\n var state = getInternalIteratorState(this);\n var kind = state.kind;\n var entry = state.last;\n // revert to the last existing entry\n while (entry && entry.removed) entry = entry.previous;\n // get next entry\n if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {\n // or finish the iteration\n state.target = undefined;\n return { value: undefined, done: true };\n }\n // return step by kind\n if (kind == 'keys') return { value: entry.key, done: false };\n if (kind == 'values') return { value: entry.value, done: false };\n return { value: [entry.key, entry.value], done: false };\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(CONSTRUCTOR_NAME);\n }\n};\n","'use strict';\nvar collection = require('../internals/collection');\nvar collectionStrong = require('../internals/collection-strong');\n\n// `Map` constructor\n// https://tc39.github.io/ecma262/#sec-map-objects\nmodule.exports = collection('Map', function (init) {\n return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };\n}, collectionStrong);\n","var log = Math.log;\n\n// `Math.log1p` method implementation\n// https://tc39.github.io/ecma262/#sec-math.log1p\nmodule.exports = Math.log1p || function log1p(x) {\n return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x);\n};\n","var $ = require('../internals/export');\nvar log1p = require('../internals/math-log1p');\n\nvar nativeAcosh = Math.acosh;\nvar log = Math.log;\nvar sqrt = Math.sqrt;\nvar LN2 = Math.LN2;\n\nvar FORCED = !nativeAcosh\n // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509\n || Math.floor(nativeAcosh(Number.MAX_VALUE)) != 710\n // Tor Browser bug: Math.acosh(Infinity) -> NaN\n || nativeAcosh(Infinity) != Infinity;\n\n// `Math.acosh` method\n// https://tc39.github.io/ecma262/#sec-math.acosh\n$({ target: 'Math', stat: true, forced: FORCED }, {\n acosh: function acosh(x) {\n return (x = +x) < 1 ? NaN : x > 94906265.62425156\n ? log(x) + LN2\n : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));\n }\n});\n","var $ = require('../internals/export');\n\nvar nativeAsinh = Math.asinh;\nvar log = Math.log;\nvar sqrt = Math.sqrt;\n\nfunction asinh(x) {\n return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : log(x + sqrt(x * x + 1));\n}\n\n// `Math.asinh` method\n// https://tc39.github.io/ecma262/#sec-math.asinh\n// Tor Browser bug: Math.asinh(0) -> -0\n$({ target: 'Math', stat: true, forced: !(nativeAsinh && 1 / nativeAsinh(0) > 0) }, {\n asinh: asinh\n});\n","var $ = require('../internals/export');\n\nvar nativeAtanh = Math.atanh;\nvar log = Math.log;\n\n// `Math.atanh` method\n// https://tc39.github.io/ecma262/#sec-math.atanh\n// Tor Browser bug: Math.atanh(-0) -> 0\n$({ target: 'Math', stat: true, forced: !(nativeAtanh && 1 / nativeAtanh(-0) < 0) }, {\n atanh: function atanh(x) {\n return (x = +x) == 0 ? x : log((1 + x) / (1 - x)) / 2;\n }\n});\n","// `Math.sign` method implementation\n// https://tc39.github.io/ecma262/#sec-math.sign\nmodule.exports = Math.sign || function sign(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;\n};\n","var $ = require('../internals/export');\nvar sign = require('../internals/math-sign');\n\nvar abs = Math.abs;\nvar pow = Math.pow;\n\n// `Math.cbrt` method\n// https://tc39.github.io/ecma262/#sec-math.cbrt\n$({ target: 'Math', stat: true }, {\n cbrt: function cbrt(x) {\n return sign(x = +x) * pow(abs(x), 1 / 3);\n }\n});\n","var $ = require('../internals/export');\n\nvar floor = Math.floor;\nvar log = Math.log;\nvar LOG2E = Math.LOG2E;\n\n// `Math.clz32` method\n// https://tc39.github.io/ecma262/#sec-math.clz32\n$({ target: 'Math', stat: true }, {\n clz32: function clz32(x) {\n return (x >>>= 0) ? 31 - floor(log(x + 0.5) * LOG2E) : 32;\n }\n});\n","var nativeExpm1 = Math.expm1;\nvar exp = Math.exp;\n\n// `Math.expm1` method implementation\n// https://tc39.github.io/ecma262/#sec-math.expm1\nmodule.exports = (!nativeExpm1\n // Old FF bug\n || nativeExpm1(10) > 22025.465794806719 || nativeExpm1(10) < 22025.4657948067165168\n // Tor Browser bug\n || nativeExpm1(-2e-17) != -2e-17\n) ? function expm1(x) {\n return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1;\n} : nativeExpm1;\n","var $ = require('../internals/export');\nvar expm1 = require('../internals/math-expm1');\n\nvar nativeCosh = Math.cosh;\nvar abs = Math.abs;\nvar E = Math.E;\n\n// `Math.cosh` method\n// https://tc39.github.io/ecma262/#sec-math.cosh\n$({ target: 'Math', stat: true, forced: !nativeCosh || nativeCosh(710) === Infinity }, {\n cosh: function cosh(x) {\n var t = expm1(abs(x) - 1) + 1;\n return (t + 1 / (t * E * E)) * (E / 2);\n }\n});\n","var $ = require('../internals/export');\nvar expm1 = require('../internals/math-expm1');\n\n// `Math.expm1` method\n// https://tc39.github.io/ecma262/#sec-math.expm1\n$({ target: 'Math', stat: true, forced: expm1 != Math.expm1 }, { expm1: expm1 });\n","var sign = require('../internals/math-sign');\n\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar EPSILON = pow(2, -52);\nvar EPSILON32 = pow(2, -23);\nvar MAX32 = pow(2, 127) * (2 - EPSILON32);\nvar MIN32 = pow(2, -126);\n\nvar roundTiesToEven = function (n) {\n return n + 1 / EPSILON - 1 / EPSILON;\n};\n\n// `Math.fround` method implementation\n// https://tc39.github.io/ecma262/#sec-math.fround\nmodule.exports = Math.fround || function fround(x) {\n var $abs = abs(x);\n var $sign = sign(x);\n var a, result;\n if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;\n a = (1 + EPSILON32 / EPSILON) * $abs;\n result = a - (a - $abs);\n // eslint-disable-next-line no-self-compare\n if (result > MAX32 || result != result) return $sign * Infinity;\n return $sign * result;\n};\n","var $ = require('../internals/export');\nvar fround = require('../internals/math-fround');\n\n// `Math.fround` method\n// https://tc39.github.io/ecma262/#sec-math.fround\n$({ target: 'Math', stat: true }, { fround: fround });\n","var $ = require('../internals/export');\n\nvar $hypot = Math.hypot;\nvar abs = Math.abs;\nvar sqrt = Math.sqrt;\n\n// Chrome 77 bug\n// https://bugs.chromium.org/p/v8/issues/detail?id=9546\nvar BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity;\n\n// `Math.hypot` method\n// https://tc39.github.io/ecma262/#sec-math.hypot\n$({ target: 'Math', stat: true, forced: BUGGY }, {\n hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars\n var sum = 0;\n var i = 0;\n var aLen = arguments.length;\n var larg = 0;\n var arg, div;\n while (i < aLen) {\n arg = abs(arguments[i++]);\n if (larg < arg) {\n div = larg / arg;\n sum = sum * div * div + 1;\n larg = arg;\n } else if (arg > 0) {\n div = arg / larg;\n sum += div * div;\n } else sum += arg;\n }\n return larg === Infinity ? Infinity : larg * sqrt(sum);\n }\n});\n","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\n\nvar nativeImul = Math.imul;\n\nvar FORCED = fails(function () {\n return nativeImul(0xFFFFFFFF, 5) != -5 || nativeImul.length != 2;\n});\n\n// `Math.imul` method\n// https://tc39.github.io/ecma262/#sec-math.imul\n// some WebKit versions fails with big numbers, some has wrong arity\n$({ target: 'Math', stat: true, forced: FORCED }, {\n imul: function imul(x, y) {\n var UINT16 = 0xFFFF;\n var xn = +x;\n var yn = +y;\n var xl = UINT16 & xn;\n var yl = UINT16 & yn;\n return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);\n }\n});\n","var $ = require('../internals/export');\n\nvar log = Math.log;\nvar LOG10E = Math.LOG10E;\n\n// `Math.log10` method\n// https://tc39.github.io/ecma262/#sec-math.log10\n$({ target: 'Math', stat: true }, {\n log10: function log10(x) {\n return log(x) * LOG10E;\n }\n});\n","var $ = require('../internals/export');\nvar log1p = require('../internals/math-log1p');\n\n// `Math.log1p` method\n// https://tc39.github.io/ecma262/#sec-math.log1p\n$({ target: 'Math', stat: true }, { log1p: log1p });\n","var $ = require('../internals/export');\n\nvar log = Math.log;\nvar LN2 = Math.LN2;\n\n// `Math.log2` method\n// https://tc39.github.io/ecma262/#sec-math.log2\n$({ target: 'Math', stat: true }, {\n log2: function log2(x) {\n return log(x) / LN2;\n }\n});\n","var $ = require('../internals/export');\nvar sign = require('../internals/math-sign');\n\n// `Math.sign` method\n// https://tc39.github.io/ecma262/#sec-math.sign\n$({ target: 'Math', stat: true }, {\n sign: sign\n});\n","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar expm1 = require('../internals/math-expm1');\n\nvar abs = Math.abs;\nvar exp = Math.exp;\nvar E = Math.E;\n\nvar FORCED = fails(function () {\n return Math.sinh(-2e-17) != -2e-17;\n});\n\n// `Math.sinh` method\n// https://tc39.github.io/ecma262/#sec-math.sinh\n// V8 near Chromium 38 has a problem with very small numbers\n$({ target: 'Math', stat: true, forced: FORCED }, {\n sinh: function sinh(x) {\n return abs(x = +x) < 1 ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (E / 2);\n }\n});\n","var $ = require('../internals/export');\nvar expm1 = require('../internals/math-expm1');\n\nvar exp = Math.exp;\n\n// `Math.tanh` method\n// https://tc39.github.io/ecma262/#sec-math.tanh\n$({ target: 'Math', stat: true }, {\n tanh: function tanh(x) {\n var a = expm1(x = +x);\n var b = expm1(-x);\n return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));\n }\n});\n","var setToStringTag = require('../internals/set-to-string-tag');\n\n// Math[@@toStringTag] property\n// https://tc39.github.io/ecma262/#sec-math-@@tostringtag\nsetToStringTag(Math, 'Math', true);\n","var $ = require('../internals/export');\n\nvar ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `Math.trunc` method\n// https://tc39.github.io/ecma262/#sec-math.trunc\n$({ target: 'Math', stat: true }, {\n trunc: function trunc(it) {\n return (it > 0 ? floor : ceil)(it);\n }\n});\n","// a string of all valid unicode whitespaces\n// eslint-disable-next-line max-len\nmodule.exports = '\\u0009\\u000A\\u000B\\u000C\\u000D\\u0020\\u00A0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n","var requireObjectCoercible = require('../internals/require-object-coercible');\nvar whitespaces = require('../internals/whitespaces');\n\nvar whitespace = '[' + whitespaces + ']';\nvar ltrim = RegExp('^' + whitespace + whitespace + '*');\nvar rtrim = RegExp(whitespace + whitespace + '*$');\n\n// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation\nvar createMethod = function (TYPE) {\n return function ($this) {\n var string = String(requireObjectCoercible($this));\n if (TYPE & 1) string = string.replace(ltrim, '');\n if (TYPE & 2) string = string.replace(rtrim, '');\n return string;\n };\n};\n\nmodule.exports = {\n // `String.prototype.{ trimLeft, trimStart }` methods\n // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart\n start: createMethod(1),\n // `String.prototype.{ trimRight, trimEnd }` methods\n // https://tc39.github.io/ecma262/#sec-string.prototype.trimend\n end: createMethod(2),\n // `String.prototype.trim` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.trim\n trim: createMethod(3)\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar global = require('../internals/global');\nvar isForced = require('../internals/is-forced');\nvar redefine = require('../internals/redefine');\nvar has = require('../internals/has');\nvar classof = require('../internals/classof-raw');\nvar inheritIfRequired = require('../internals/inherit-if-required');\nvar toPrimitive = require('../internals/to-primitive');\nvar fails = require('../internals/fails');\nvar create = require('../internals/object-create');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar defineProperty = require('../internals/object-define-property').f;\nvar trim = require('../internals/string-trim').trim;\n\nvar NUMBER = 'Number';\nvar NativeNumber = global[NUMBER];\nvar NumberPrototype = NativeNumber.prototype;\n\n// Opera ~12 has broken Object#toString\nvar BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER;\n\n// `ToNumber` abstract operation\n// https://tc39.github.io/ecma262/#sec-tonumber\nvar toNumber = function (argument) {\n var it = toPrimitive(argument, false);\n var first, third, radix, maxCode, digits, length, index, code;\n if (typeof it == 'string' && it.length > 2) {\n it = trim(it);\n first = it.charCodeAt(0);\n if (first === 43 || first === 45) {\n third = it.charCodeAt(2);\n if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if (first === 48) {\n switch (it.charCodeAt(1)) {\n case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i\n case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i\n default: return +it;\n }\n digits = it.slice(2);\n length = digits.length;\n for (index = 0; index < length; index++) {\n code = digits.charCodeAt(index);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if (code < 48 || code > maxCode) return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n};\n\n// `Number` constructor\n// https://tc39.github.io/ecma262/#sec-number-constructor\nif (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {\n var NumberWrapper = function Number(value) {\n var it = arguments.length < 1 ? 0 : value;\n var dummy = this;\n return dummy instanceof NumberWrapper\n // check on 1..constructor(foo) case\n && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classof(dummy) != NUMBER)\n ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it);\n };\n for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES2015 (in case, if modules with ES2015 Number statics required before):\n 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +\n 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'\n ).split(','), j = 0, key; keys.length > j; j++) {\n if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) {\n defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));\n }\n }\n NumberWrapper.prototype = NumberPrototype;\n NumberPrototype.constructor = NumberWrapper;\n redefine(global, NUMBER, NumberWrapper);\n}\n","var $ = require('../internals/export');\n\n// `Number.EPSILON` constant\n// https://tc39.github.io/ecma262/#sec-number.epsilon\n$({ target: 'Number', stat: true }, {\n EPSILON: Math.pow(2, -52)\n});\n","var global = require('../internals/global');\n\nvar globalIsFinite = global.isFinite;\n\n// `Number.isFinite` method\n// https://tc39.github.io/ecma262/#sec-number.isfinite\nmodule.exports = Number.isFinite || function isFinite(it) {\n return typeof it == 'number' && globalIsFinite(it);\n};\n","var $ = require('../internals/export');\nvar numberIsFinite = require('../internals/number-is-finite');\n\n// `Number.isFinite` method\n// https://tc39.github.io/ecma262/#sec-number.isfinite\n$({ target: 'Number', stat: true }, { isFinite: numberIsFinite });\n","var isObject = require('../internals/is-object');\n\nvar floor = Math.floor;\n\n// `Number.isInteger` method implementation\n// https://tc39.github.io/ecma262/#sec-number.isinteger\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n","var $ = require('../internals/export');\nvar isInteger = require('../internals/is-integer');\n\n// `Number.isInteger` method\n// https://tc39.github.io/ecma262/#sec-number.isinteger\n$({ target: 'Number', stat: true }, {\n isInteger: isInteger\n});\n","var $ = require('../internals/export');\n\n// `Number.isNaN` method\n// https://tc39.github.io/ecma262/#sec-number.isnan\n$({ target: 'Number', stat: true }, {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare\n return number != number;\n }\n});\n","var $ = require('../internals/export');\nvar isInteger = require('../internals/is-integer');\n\nvar abs = Math.abs;\n\n// `Number.isSafeInteger` method\n// https://tc39.github.io/ecma262/#sec-number.issafeinteger\n$({ target: 'Number', stat: true }, {\n isSafeInteger: function isSafeInteger(number) {\n return isInteger(number) && abs(number) <= 0x1FFFFFFFFFFFFF;\n }\n});\n","var $ = require('../internals/export');\n\n// `Number.MAX_SAFE_INTEGER` constant\n// https://tc39.github.io/ecma262/#sec-number.max_safe_integer\n$({ target: 'Number', stat: true }, {\n MAX_SAFE_INTEGER: 0x1FFFFFFFFFFFFF\n});\n","var $ = require('../internals/export');\n\n// `Number.MIN_SAFE_INTEGER` constant\n// https://tc39.github.io/ecma262/#sec-number.min_safe_integer\n$({ target: 'Number', stat: true }, {\n MIN_SAFE_INTEGER: -0x1FFFFFFFFFFFFF\n});\n","var global = require('../internals/global');\nvar trim = require('../internals/string-trim').trim;\nvar whitespaces = require('../internals/whitespaces');\n\nvar $parseFloat = global.parseFloat;\nvar FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity;\n\n// `parseFloat` method\n// https://tc39.github.io/ecma262/#sec-parsefloat-string\nmodule.exports = FORCED ? function parseFloat(string) {\n var trimmedString = trim(String(string));\n var result = $parseFloat(trimmedString);\n return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result;\n} : $parseFloat;\n","var $ = require('../internals/export');\nvar parseFloat = require('../internals/number-parse-float');\n\n// `Number.parseFloat` method\n// https://tc39.github.io/ecma262/#sec-number.parseFloat\n$({ target: 'Number', stat: true, forced: Number.parseFloat != parseFloat }, {\n parseFloat: parseFloat\n});\n","var global = require('../internals/global');\nvar trim = require('../internals/string-trim').trim;\nvar whitespaces = require('../internals/whitespaces');\n\nvar $parseInt = global.parseInt;\nvar hex = /^[+-]?0[Xx]/;\nvar FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22;\n\n// `parseInt` method\n// https://tc39.github.io/ecma262/#sec-parseint-string-radix\nmodule.exports = FORCED ? function parseInt(string, radix) {\n var S = trim(String(string));\n return $parseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));\n} : $parseInt;\n","var $ = require('../internals/export');\nvar parseInt = require('../internals/number-parse-int');\n\n// `Number.parseInt` method\n// https://tc39.github.io/ecma262/#sec-number.parseint\n$({ target: 'Number', stat: true, forced: Number.parseInt != parseInt }, {\n parseInt: parseInt\n});\n","var classof = require('../internals/classof-raw');\n\n// `thisNumberValue` abstract operation\n// https://tc39.github.io/ecma262/#sec-thisnumbervalue\nmodule.exports = function (value) {\n if (typeof value != 'number' && classof(value) != 'Number') {\n throw TypeError('Incorrect invocation');\n }\n return +value;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar toInteger = require('../internals/to-integer');\nvar thisNumberValue = require('../internals/this-number-value');\nvar repeat = require('../internals/string-repeat');\nvar fails = require('../internals/fails');\n\nvar nativeToFixed = 1.0.toFixed;\nvar floor = Math.floor;\n\nvar pow = function (x, n, acc) {\n return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);\n};\n\nvar log = function (x) {\n var n = 0;\n var x2 = x;\n while (x2 >= 4096) {\n n += 12;\n x2 /= 4096;\n }\n while (x2 >= 2) {\n n += 1;\n x2 /= 2;\n } return n;\n};\n\nvar FORCED = nativeToFixed && (\n 0.00008.toFixed(3) !== '0.000' ||\n 0.9.toFixed(0) !== '1' ||\n 1.255.toFixed(2) !== '1.25' ||\n 1000000000000000128.0.toFixed(0) !== '1000000000000000128'\n) || !fails(function () {\n // V8 ~ Android 4.3-\n nativeToFixed.call({});\n});\n\n// `Number.prototype.toFixed` method\n// https://tc39.github.io/ecma262/#sec-number.prototype.tofixed\n$({ target: 'Number', proto: true, forced: FORCED }, {\n // eslint-disable-next-line max-statements\n toFixed: function toFixed(fractionDigits) {\n var number = thisNumberValue(this);\n var fractDigits = toInteger(fractionDigits);\n var data = [0, 0, 0, 0, 0, 0];\n var sign = '';\n var result = '0';\n var e, z, j, k;\n\n var multiply = function (n, c) {\n var index = -1;\n var c2 = c;\n while (++index < 6) {\n c2 += n * data[index];\n data[index] = c2 % 1e7;\n c2 = floor(c2 / 1e7);\n }\n };\n\n var divide = function (n) {\n var index = 6;\n var c = 0;\n while (--index >= 0) {\n c += data[index];\n data[index] = floor(c / n);\n c = (c % n) * 1e7;\n }\n };\n\n var dataToString = function () {\n var index = 6;\n var s = '';\n while (--index >= 0) {\n if (s !== '' || index === 0 || data[index] !== 0) {\n var t = String(data[index]);\n s = s === '' ? t : s + repeat.call('0', 7 - t.length) + t;\n }\n } return s;\n };\n\n if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');\n // eslint-disable-next-line no-self-compare\n if (number != number) return 'NaN';\n if (number <= -1e21 || number >= 1e21) return String(number);\n if (number < 0) {\n sign = '-';\n number = -number;\n }\n if (number > 1e-21) {\n e = log(number * pow(2, 69, 1)) - 69;\n z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);\n z *= 0x10000000000000;\n e = 52 - e;\n if (e > 0) {\n multiply(0, z);\n j = fractDigits;\n while (j >= 7) {\n multiply(1e7, 0);\n j -= 7;\n }\n multiply(pow(10, j, 1), 0);\n j = e - 1;\n while (j >= 23) {\n divide(1 << 23);\n j -= 23;\n }\n divide(1 << j);\n multiply(1, 1);\n divide(2);\n result = dataToString();\n } else {\n multiply(0, z);\n multiply(1 << -e, 0);\n result = dataToString() + repeat.call('0', fractDigits);\n }\n }\n if (fractDigits > 0) {\n k = result.length;\n result = sign + (k <= fractDigits\n ? '0.' + repeat.call('0', fractDigits - k) + result\n : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits));\n } else {\n result = sign + result;\n } return result;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar thisNumberValue = require('../internals/this-number-value');\n\nvar nativeToPrecision = 1.0.toPrecision;\n\nvar FORCED = fails(function () {\n // IE7-\n return nativeToPrecision.call(1, undefined) !== '1';\n}) || !fails(function () {\n // V8 ~ Android 4.3-\n nativeToPrecision.call({});\n});\n\n// `Number.prototype.toPrecision` method\n// https://tc39.github.io/ecma262/#sec-number.prototype.toprecision\n$({ target: 'Number', proto: true, forced: FORCED }, {\n toPrecision: function toPrecision(precision) {\n return precision === undefined\n ? nativeToPrecision.call(thisNumberValue(this))\n : nativeToPrecision.call(thisNumberValue(this), precision);\n }\n});\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar objectKeys = require('../internals/object-keys');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\n\nvar nativeAssign = Object.assign;\nvar defineProperty = Object.defineProperty;\n\n// `Object.assign` method\n// https://tc39.github.io/ecma262/#sec-object.assign\nmodule.exports = !nativeAssign || fails(function () {\n // should have correct order of operations (Edge bug)\n if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {\n enumerable: true,\n get: function () {\n defineProperty(this, 'b', {\n value: 3,\n enumerable: false\n });\n }\n }), { b: 2 })).b !== 1) return true;\n // should work with symbols and should have deterministic property order (V8 bug)\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var symbol = Symbol();\n var alphabet = 'abcdefghijklmnopqrst';\n A[symbol] = 7;\n alphabet.split('').forEach(function (chr) { B[chr] = chr; });\n return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var argumentsLength = arguments.length;\n var index = 1;\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n var propertyIsEnumerable = propertyIsEnumerableModule.f;\n while (argumentsLength > index) {\n var S = IndexedObject(arguments[index++]);\n var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];\n }\n } return T;\n} : nativeAssign;\n","var $ = require('../internals/export');\nvar assign = require('../internals/object-assign');\n\n// `Object.assign` method\n// https://tc39.github.io/ecma262/#sec-object.assign\n$({ target: 'Object', stat: true, forced: Object.assign !== assign }, {\n assign: assign\n});\n","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar create = require('../internals/object-create');\n\n// `Object.create` method\n// https://tc39.github.io/ecma262/#sec-object.create\n$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {\n create: create\n});\n","'use strict';\nvar IS_PURE = require('../internals/is-pure');\nvar global = require('../internals/global');\nvar fails = require('../internals/fails');\n\n// Forced replacement object prototype accessors methods\nmodule.exports = IS_PURE || !fails(function () {\n var key = Math.random();\n // In FF throws only define methods\n // eslint-disable-next-line no-undef, no-useless-call\n __defineSetter__.call(null, key, function () { /* empty */ });\n delete global[key];\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar FORCED = require('../internals/object-prototype-accessors-forced');\nvar toObject = require('../internals/to-object');\nvar aFunction = require('../internals/a-function');\nvar definePropertyModule = require('../internals/object-define-property');\n\n// `Object.prototype.__defineGetter__` method\n// https://tc39.github.io/ecma262/#sec-object.prototype.__defineGetter__\nif (DESCRIPTORS) {\n $({ target: 'Object', proto: true, forced: FORCED }, {\n __defineGetter__: function __defineGetter__(P, getter) {\n definePropertyModule.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });\n }\n });\n}\n","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar defineProperties = require('../internals/object-define-properties');\n\n// `Object.defineProperties` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperties\n$({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, {\n defineProperties: defineProperties\n});\n","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar objectDefinePropertyModile = require('../internals/object-define-property');\n\n// `Object.defineProperty` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperty\n$({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, {\n defineProperty: objectDefinePropertyModile.f\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar FORCED = require('../internals/object-prototype-accessors-forced');\nvar toObject = require('../internals/to-object');\nvar aFunction = require('../internals/a-function');\nvar definePropertyModule = require('../internals/object-define-property');\n\n// `Object.prototype.__defineSetter__` method\n// https://tc39.github.io/ecma262/#sec-object.prototype.__defineSetter__\nif (DESCRIPTORS) {\n $({ target: 'Object', proto: true, forced: FORCED }, {\n __defineSetter__: function __defineSetter__(P, setter) {\n definePropertyModule.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });\n }\n });\n}\n","var DESCRIPTORS = require('../internals/descriptors');\nvar objectKeys = require('../internals/object-keys');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar propertyIsEnumerable = require('../internals/object-property-is-enumerable').f;\n\n// `Object.{ entries, values }` methods implementation\nvar createMethod = function (TO_ENTRIES) {\n return function (it) {\n var O = toIndexedObject(it);\n var keys = objectKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) {\n key = keys[i++];\n if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) {\n result.push(TO_ENTRIES ? [key, O[key]] : O[key]);\n }\n }\n return result;\n };\n};\n\nmodule.exports = {\n // `Object.entries` method\n // https://tc39.github.io/ecma262/#sec-object.entries\n entries: createMethod(true),\n // `Object.values` method\n // https://tc39.github.io/ecma262/#sec-object.values\n values: createMethod(false)\n};\n","var $ = require('../internals/export');\nvar $entries = require('../internals/object-to-array').entries;\n\n// `Object.entries` method\n// https://tc39.github.io/ecma262/#sec-object.entries\n$({ target: 'Object', stat: true }, {\n entries: function entries(O) {\n return $entries(O);\n }\n});\n","var $ = require('../internals/export');\nvar FREEZING = require('../internals/freezing');\nvar fails = require('../internals/fails');\nvar isObject = require('../internals/is-object');\nvar onFreeze = require('../internals/internal-metadata').onFreeze;\n\nvar nativeFreeze = Object.freeze;\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeFreeze(1); });\n\n// `Object.freeze` method\n// https://tc39.github.io/ecma262/#sec-object.freeze\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {\n freeze: function freeze(it) {\n return nativeFreeze && isObject(it) ? nativeFreeze(onFreeze(it)) : it;\n }\n});\n","var $ = require('../internals/export');\nvar iterate = require('../internals/iterate');\nvar createProperty = require('../internals/create-property');\n\n// `Object.fromEntries` method\n// https://github.com/tc39/proposal-object-from-entries\n$({ target: 'Object', stat: true }, {\n fromEntries: function fromEntries(iterable) {\n var obj = {};\n iterate(iterable, function (k, v) {\n createProperty(obj, k, v);\n }, undefined, true);\n return obj;\n }\n});\n","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar nativeGetOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });\nvar FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor\n$({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {\n return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);\n }\n});\n","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar ownKeys = require('../internals/own-keys');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar createProperty = require('../internals/create-property');\n\n// `Object.getOwnPropertyDescriptors` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors\n$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {\n var O = toIndexedObject(object);\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n var keys = ownKeys(O);\n var result = {};\n var index = 0;\n var key, descriptor;\n while (keys.length > index) {\n descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);\n if (descriptor !== undefined) createProperty(result, key, descriptor);\n }\n return result;\n }\n});\n","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar nativeGetOwnPropertyNames = require('../internals/object-get-own-property-names-external').f;\n\nvar FAILS_ON_PRIMITIVES = fails(function () { return !Object.getOwnPropertyNames(1); });\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertynames\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {\n getOwnPropertyNames: nativeGetOwnPropertyNames\n});\n","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar toObject = require('../internals/to-object');\nvar nativeGetPrototypeOf = require('../internals/object-get-prototype-of');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });\n\n// `Object.getPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.getprototypeof\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {\n getPrototypeOf: function getPrototypeOf(it) {\n return nativeGetPrototypeOf(toObject(it));\n }\n});\n\n","// `SameValue` abstract operation\n// https://tc39.github.io/ecma262/#sec-samevalue\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n","var $ = require('../internals/export');\nvar is = require('../internals/same-value');\n\n// `Object.is` method\n// https://tc39.github.io/ecma262/#sec-object.is\n$({ target: 'Object', stat: true }, {\n is: is\n});\n","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar isObject = require('../internals/is-object');\n\nvar nativeIsExtensible = Object.isExtensible;\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeIsExtensible(1); });\n\n// `Object.isExtensible` method\n// https://tc39.github.io/ecma262/#sec-object.isextensible\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {\n isExtensible: function isExtensible(it) {\n return isObject(it) ? nativeIsExtensible ? nativeIsExtensible(it) : true : false;\n }\n});\n","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar isObject = require('../internals/is-object');\n\nvar nativeIsFrozen = Object.isFrozen;\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeIsFrozen(1); });\n\n// `Object.isFrozen` method\n// https://tc39.github.io/ecma262/#sec-object.isfrozen\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {\n isFrozen: function isFrozen(it) {\n return isObject(it) ? nativeIsFrozen ? nativeIsFrozen(it) : false : true;\n }\n});\n","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar isObject = require('../internals/is-object');\n\nvar nativeIsSealed = Object.isSealed;\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeIsSealed(1); });\n\n// `Object.isSealed` method\n// https://tc39.github.io/ecma262/#sec-object.issealed\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {\n isSealed: function isSealed(it) {\n return isObject(it) ? nativeIsSealed ? nativeIsSealed(it) : false : true;\n }\n});\n","var $ = require('../internals/export');\nvar toObject = require('../internals/to-object');\nvar nativeKeys = require('../internals/object-keys');\nvar fails = require('../internals/fails');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });\n\n// `Object.keys` method\n// https://tc39.github.io/ecma262/#sec-object.keys\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {\n keys: function keys(it) {\n return nativeKeys(toObject(it));\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar FORCED = require('../internals/object-prototype-accessors-forced');\nvar toObject = require('../internals/to-object');\nvar toPrimitive = require('../internals/to-primitive');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\n\n// `Object.prototype.__lookupGetter__` method\n// https://tc39.github.io/ecma262/#sec-object.prototype.__lookupGetter__\nif (DESCRIPTORS) {\n $({ target: 'Object', proto: true, forced: FORCED }, {\n __lookupGetter__: function __lookupGetter__(P) {\n var O = toObject(this);\n var key = toPrimitive(P, true);\n var desc;\n do {\n if (desc = getOwnPropertyDescriptor(O, key)) return desc.get;\n } while (O = getPrototypeOf(O));\n }\n });\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar FORCED = require('../internals/object-prototype-accessors-forced');\nvar toObject = require('../internals/to-object');\nvar toPrimitive = require('../internals/to-primitive');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\n\n// `Object.prototype.__lookupSetter__` method\n// https://tc39.github.io/ecma262/#sec-object.prototype.__lookupSetter__\nif (DESCRIPTORS) {\n $({ target: 'Object', proto: true, forced: FORCED }, {\n __lookupSetter__: function __lookupSetter__(P) {\n var O = toObject(this);\n var key = toPrimitive(P, true);\n var desc;\n do {\n if (desc = getOwnPropertyDescriptor(O, key)) return desc.set;\n } while (O = getPrototypeOf(O));\n }\n });\n}\n","var $ = require('../internals/export');\nvar isObject = require('../internals/is-object');\nvar onFreeze = require('../internals/internal-metadata').onFreeze;\nvar FREEZING = require('../internals/freezing');\nvar fails = require('../internals/fails');\n\nvar nativePreventExtensions = Object.preventExtensions;\nvar FAILS_ON_PRIMITIVES = fails(function () { nativePreventExtensions(1); });\n\n// `Object.preventExtensions` method\n// https://tc39.github.io/ecma262/#sec-object.preventextensions\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {\n preventExtensions: function preventExtensions(it) {\n return nativePreventExtensions && isObject(it) ? nativePreventExtensions(onFreeze(it)) : it;\n }\n});\n","var $ = require('../internals/export');\nvar isObject = require('../internals/is-object');\nvar onFreeze = require('../internals/internal-metadata').onFreeze;\nvar FREEZING = require('../internals/freezing');\nvar fails = require('../internals/fails');\n\nvar nativeSeal = Object.seal;\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeSeal(1); });\n\n// `Object.seal` method\n// https://tc39.github.io/ecma262/#sec-object.seal\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {\n seal: function seal(it) {\n return nativeSeal && isObject(it) ? nativeSeal(onFreeze(it)) : it;\n }\n});\n","var $ = require('../internals/export');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// `Object.setPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.setprototypeof\n$({ target: 'Object', stat: true }, {\n setPrototypeOf: setPrototypeOf\n});\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classof = require('../internals/classof');\n\n// `Object.prototype.toString` method implementation\n// https://tc39.github.io/ecma262/#sec-object.prototype.tostring\nmodule.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {\n return '[object ' + classof(this) + ']';\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar redefine = require('../internals/redefine');\nvar toString = require('../internals/object-to-string');\n\n// `Object.prototype.toString` method\n// https://tc39.github.io/ecma262/#sec-object.prototype.tostring\nif (!TO_STRING_TAG_SUPPORT) {\n redefine(Object.prototype, 'toString', toString, { unsafe: true });\n}\n","var $ = require('../internals/export');\nvar $values = require('../internals/object-to-array').values;\n\n// `Object.values` method\n// https://tc39.github.io/ecma262/#sec-object.values\n$({ target: 'Object', stat: true }, {\n values: function values(O) {\n return $values(O);\n }\n});\n","var $ = require('../internals/export');\nvar parseFloatImplementation = require('../internals/number-parse-float');\n\n// `parseFloat` method\n// https://tc39.github.io/ecma262/#sec-parsefloat-string\n$({ global: true, forced: parseFloat != parseFloatImplementation }, {\n parseFloat: parseFloatImplementation\n});\n","var $ = require('../internals/export');\nvar parseIntImplementation = require('../internals/number-parse-int');\n\n// `parseInt` method\n// https://tc39.github.io/ecma262/#sec-parseint-string-radix\n$({ global: true, forced: parseInt != parseIntImplementation }, {\n parseInt: parseIntImplementation\n});\n","var global = require('../internals/global');\n\nmodule.exports = global.Promise;\n","var userAgent = require('../internals/engine-user-agent');\n\nmodule.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent);\n","var global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\nvar bind = require('../internals/function-bind-context');\nvar html = require('../internals/html');\nvar createElement = require('../internals/document-create-element');\nvar IS_IOS = require('../internals/engine-is-ios');\n\nvar location = global.location;\nvar set = global.setImmediate;\nvar clear = global.clearImmediate;\nvar process = global.process;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\n\nvar run = function (id) {\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\n\nvar runner = function (id) {\n return function () {\n run(id);\n };\n};\n\nvar listener = function (event) {\n run(event.data);\n};\n\nvar post = function (id) {\n // old engines have not location.origin\n global.postMessage(id + '', location.protocol + '//' + location.host);\n};\n\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!set || !clear) {\n set = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);\n };\n defer(counter);\n return counter;\n };\n clear = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (classof(process) == 'process') {\n defer = function (id) {\n process.nextTick(runner(id));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(runner(id));\n };\n // Browsers with MessageChannel, includes WebWorkers\n // except iOS - https://github.com/zloirock/core-js/issues/624\n } else if (MessageChannel && !IS_IOS) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = bind(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (\n global.addEventListener &&\n typeof postMessage == 'function' &&\n !global.importScripts &&\n !fails(post) &&\n location.protocol !== 'file:'\n ) {\n defer = post;\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in createElement('script')) {\n defer = function (id) {\n html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(runner(id), 0);\n };\n }\n}\n\nmodule.exports = {\n set: set,\n clear: clear\n};\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar classof = require('../internals/classof-raw');\nvar macrotask = require('../internals/task').set;\nvar IS_IOS = require('../internals/engine-is-ios');\n\nvar MutationObserver = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar IS_NODE = classof(process) == 'process';\n// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`\nvar queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');\nvar queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;\n\nvar flush, head, last, notify, toggle, node, promise, then;\n\n// modern engines have queueMicrotask method\nif (!queueMicrotask) {\n flush = function () {\n var parent, fn;\n if (IS_NODE && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (error) {\n if (head) notify();\n else last = undefined;\n throw error;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (IS_NODE) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339\n } else if (MutationObserver && !IS_IOS) {\n toggle = true;\n node = document.createTextNode('');\n new MutationObserver(flush).observe(node, { characterData: true });\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n promise = Promise.resolve(undefined);\n then = promise.then;\n notify = function () {\n then.call(promise, flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n}\n\nmodule.exports = queueMicrotask || function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n};\n","'use strict';\nvar aFunction = require('../internals/a-function');\n\nvar PromiseCapability = function (C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n};\n\n// 25.4.1.5 NewPromiseCapability(C)\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","var anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar newPromiseCapability = require('../internals/new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","var global = require('../internals/global');\n\nmodule.exports = function (a, b) {\n var console = global.console;\n if (console && console.error) {\n arguments.length === 1 ? console.error(a) : console.error(a, b);\n }\n};\n","module.exports = function (exec) {\n try {\n return { error: false, value: exec() };\n } catch (error) {\n return { error: true, value: error };\n }\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar global = require('../internals/global');\nvar getBuiltIn = require('../internals/get-built-in');\nvar NativePromise = require('../internals/native-promise-constructor');\nvar redefine = require('../internals/redefine');\nvar redefineAll = require('../internals/redefine-all');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar setSpecies = require('../internals/set-species');\nvar isObject = require('../internals/is-object');\nvar aFunction = require('../internals/a-function');\nvar anInstance = require('../internals/an-instance');\nvar classof = require('../internals/classof-raw');\nvar inspectSource = require('../internals/inspect-source');\nvar iterate = require('../internals/iterate');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar speciesConstructor = require('../internals/species-constructor');\nvar task = require('../internals/task').set;\nvar microtask = require('../internals/microtask');\nvar promiseResolve = require('../internals/promise-resolve');\nvar hostReportErrors = require('../internals/host-report-errors');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar InternalStateModule = require('../internals/internal-state');\nvar isForced = require('../internals/is-forced');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\nvar PROMISE = 'Promise';\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar getInternalPromiseState = InternalStateModule.getterFor(PROMISE);\nvar PromiseConstructor = NativePromise;\nvar TypeError = global.TypeError;\nvar document = global.document;\nvar process = global.process;\nvar $fetch = getBuiltIn('fetch');\nvar newPromiseCapability = newPromiseCapabilityModule.f;\nvar newGenericPromiseCapability = newPromiseCapability;\nvar IS_NODE = classof(process) == 'process';\nvar DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);\nvar UNHANDLED_REJECTION = 'unhandledrejection';\nvar REJECTION_HANDLED = 'rejectionhandled';\nvar PENDING = 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\nvar HANDLED = 1;\nvar UNHANDLED = 2;\nvar Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;\n\nvar FORCED = isForced(PROMISE, function () {\n var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);\n if (!GLOBAL_CORE_JS_PROMISE) {\n // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // We can't detect it synchronously, so just check versions\n if (V8_VERSION === 66) return true;\n // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n if (!IS_NODE && typeof PromiseRejectionEvent != 'function') return true;\n }\n // We need Promise#finally in the pure version for preventing prototype pollution\n if (IS_PURE && !PromiseConstructor.prototype['finally']) return true;\n // We can't use @@species feature detection in V8 since it causes\n // deoptimization and performance degradation\n // https://github.com/zloirock/core-js/issues/679\n if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;\n // Detect correctness of subclassing with @@species support\n var promise = PromiseConstructor.resolve(1);\n var FakePromise = function (exec) {\n exec(function () { /* empty */ }, function () { /* empty */ });\n };\n var constructor = promise.constructor = {};\n constructor[SPECIES] = FakePromise;\n return !(promise.then(function () { /* empty */ }) instanceof FakePromise);\n});\n\nvar INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {\n PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });\n});\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\n\nvar notify = function (promise, state, isReject) {\n if (state.notified) return;\n state.notified = true;\n var chain = state.reactions;\n microtask(function () {\n var value = state.value;\n var ok = state.state == FULFILLED;\n var index = 0;\n // variable length - can't use forEach\n while (chain.length > index) {\n var reaction = chain[index++];\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state);\n state.rejection = HANDLED;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // can throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (error) {\n if (domain && !exited) domain.exit();\n reject(error);\n }\n }\n state.reactions = [];\n state.notified = false;\n if (isReject && !state.rejection) onUnhandled(promise, state);\n });\n};\n\nvar dispatchEvent = function (name, promise, reason) {\n var event, handler;\n if (DISPATCH_EVENT) {\n event = document.createEvent('Event');\n event.promise = promise;\n event.reason = reason;\n event.initEvent(name, false, true);\n global.dispatchEvent(event);\n } else event = { promise: promise, reason: reason };\n if (handler = global['on' + name]) handler(event);\n else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);\n};\n\nvar onUnhandled = function (promise, state) {\n task.call(global, function () {\n var value = state.value;\n var IS_UNHANDLED = isUnhandled(state);\n var result;\n if (IS_UNHANDLED) {\n result = perform(function () {\n if (IS_NODE) {\n process.emit('unhandledRejection', value, promise);\n } else dispatchEvent(UNHANDLED_REJECTION, promise, value);\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;\n if (result.error) throw result.value;\n }\n });\n};\n\nvar isUnhandled = function (state) {\n return state.rejection !== HANDLED && !state.parent;\n};\n\nvar onHandleUnhandled = function (promise, state) {\n task.call(global, function () {\n if (IS_NODE) {\n process.emit('rejectionHandled', promise);\n } else dispatchEvent(REJECTION_HANDLED, promise, state.value);\n });\n};\n\nvar bind = function (fn, promise, state, unwrap) {\n return function (value) {\n fn(promise, state, value, unwrap);\n };\n};\n\nvar internalReject = function (promise, state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n state.value = value;\n state.state = REJECTED;\n notify(promise, state, true);\n};\n\nvar internalResolve = function (promise, state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n var then = isThenable(value);\n if (then) {\n microtask(function () {\n var wrapper = { done: false };\n try {\n then.call(value,\n bind(internalResolve, promise, wrapper, state),\n bind(internalReject, promise, wrapper, state)\n );\n } catch (error) {\n internalReject(promise, wrapper, error, state);\n }\n });\n } else {\n state.value = value;\n state.state = FULFILLED;\n notify(promise, state, false);\n }\n } catch (error) {\n internalReject(promise, { done: false }, error, state);\n }\n};\n\n// constructor polyfill\nif (FORCED) {\n // 25.4.3.1 Promise(executor)\n PromiseConstructor = function Promise(executor) {\n anInstance(this, PromiseConstructor, PROMISE);\n aFunction(executor);\n Internal.call(this);\n var state = getInternalState(this);\n try {\n executor(bind(internalResolve, this, state), bind(internalReject, this, state));\n } catch (error) {\n internalReject(this, state, error);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n setInternalState(this, {\n type: PROMISE,\n done: false,\n notified: false,\n parent: false,\n reactions: [],\n rejection: false,\n state: PENDING,\n value: undefined\n });\n };\n Internal.prototype = redefineAll(PromiseConstructor.prototype, {\n // `Promise.prototype.then` method\n // https://tc39.github.io/ecma262/#sec-promise.prototype.then\n then: function then(onFulfilled, onRejected) {\n var state = getInternalPromiseState(this);\n var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = IS_NODE ? process.domain : undefined;\n state.parent = true;\n state.reactions.push(reaction);\n if (state.state != PENDING) notify(this, state, false);\n return reaction.promise;\n },\n // `Promise.prototype.catch` method\n // https://tc39.github.io/ecma262/#sec-promise.prototype.catch\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n var state = getInternalState(promise);\n this.promise = promise;\n this.resolve = bind(internalResolve, promise, state);\n this.reject = bind(internalReject, promise, state);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === PromiseConstructor || C === PromiseWrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n\n if (!IS_PURE && typeof NativePromise == 'function') {\n nativeThen = NativePromise.prototype.then;\n\n // wrap native Promise#then for native async functions\n redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) {\n var that = this;\n return new PromiseConstructor(function (resolve, reject) {\n nativeThen.call(that, resolve, reject);\n }).then(onFulfilled, onRejected);\n // https://github.com/zloirock/core-js/issues/640\n }, { unsafe: true });\n\n // wrap fetch result\n if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, {\n // eslint-disable-next-line no-unused-vars\n fetch: function fetch(input /* , init */) {\n return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments));\n }\n });\n }\n}\n\n$({ global: true, wrap: true, forced: FORCED }, {\n Promise: PromiseConstructor\n});\n\nsetToStringTag(PromiseConstructor, PROMISE, false, true);\nsetSpecies(PROMISE);\n\nPromiseWrapper = getBuiltIn(PROMISE);\n\n// statics\n$({ target: PROMISE, stat: true, forced: FORCED }, {\n // `Promise.reject` method\n // https://tc39.github.io/ecma262/#sec-promise.reject\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n capability.reject.call(undefined, r);\n return capability.promise;\n }\n});\n\n$({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {\n // `Promise.resolve` method\n // https://tc39.github.io/ecma262/#sec-promise.resolve\n resolve: function resolve(x) {\n return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);\n }\n});\n\n$({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {\n // `Promise.all` method\n // https://tc39.github.io/ecma262/#sec-promise.all\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aFunction(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n $promiseResolve.call(C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n },\n // `Promise.race` method\n // https://tc39.github.io/ecma262/#sec-promise.race\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aFunction(C.resolve);\n iterate(iterable, function (promise) {\n $promiseResolve.call(C, promise).then(capability.resolve, reject);\n });\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\n\n// `Promise.allSettled` method\n// https://github.com/tc39/proposal-promise-allSettled\n$({ target: 'Promise', stat: true }, {\n allSettled: function allSettled(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aFunction(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n promiseResolve.call(C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'fulfilled', value: value };\n --remaining || resolve(values);\n }, function (e) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'rejected', reason: e };\n --remaining || resolve(values);\n });\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar NativePromise = require('../internals/native-promise-constructor');\nvar fails = require('../internals/fails');\nvar getBuiltIn = require('../internals/get-built-in');\nvar speciesConstructor = require('../internals/species-constructor');\nvar promiseResolve = require('../internals/promise-resolve');\nvar redefine = require('../internals/redefine');\n\n// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829\nvar NON_GENERIC = !!NativePromise && fails(function () {\n NativePromise.prototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });\n});\n\n// `Promise.prototype.finally` method\n// https://tc39.github.io/ecma262/#sec-promise.prototype.finally\n$({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {\n 'finally': function (onFinally) {\n var C = speciesConstructor(this, getBuiltIn('Promise'));\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n }\n});\n\n// patch native Promise.prototype for native async functions\nif (!IS_PURE && typeof NativePromise == 'function' && !NativePromise.prototype['finally']) {\n redefine(NativePromise.prototype, 'finally', getBuiltIn('Promise').prototype['finally']);\n}\n","var $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar aFunction = require('../internals/a-function');\nvar anObject = require('../internals/an-object');\nvar fails = require('../internals/fails');\n\nvar nativeApply = getBuiltIn('Reflect', 'apply');\nvar functionApply = Function.apply;\n\n// MS Edge argumentsList argument is optional\nvar OPTIONAL_ARGUMENTS_LIST = !fails(function () {\n nativeApply(function () { /* empty */ });\n});\n\n// `Reflect.apply` method\n// https://tc39.github.io/ecma262/#sec-reflect.apply\n$({ target: 'Reflect', stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, {\n apply: function apply(target, thisArgument, argumentsList) {\n aFunction(target);\n anObject(argumentsList);\n return nativeApply\n ? nativeApply(target, thisArgument, argumentsList)\n : functionApply.call(target, thisArgument, argumentsList);\n }\n});\n","var $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar aFunction = require('../internals/a-function');\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar create = require('../internals/object-create');\nvar bind = require('../internals/function-bind');\nvar fails = require('../internals/fails');\n\nvar nativeConstruct = getBuiltIn('Reflect', 'construct');\n\n// `Reflect.construct` method\n// https://tc39.github.io/ecma262/#sec-reflect.construct\n// MS Edge supports only 2 arguments and argumentsList argument is optional\n// FF Nightly sets third argument as `new.target`, but does not create `this` from it\nvar NEW_TARGET_BUG = fails(function () {\n function F() { /* empty */ }\n return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F);\n});\nvar ARGS_BUG = !fails(function () {\n nativeConstruct(function () { /* empty */ });\n});\nvar FORCED = NEW_TARGET_BUG || ARGS_BUG;\n\n$({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {\n construct: function construct(Target, args /* , newTarget */) {\n aFunction(Target);\n anObject(args);\n var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);\n if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);\n if (Target == newTarget) {\n // w/o altered newTarget, optimization for 0-4 arguments\n switch (args.length) {\n case 0: return new Target();\n case 1: return new Target(args[0]);\n case 2: return new Target(args[0], args[1]);\n case 3: return new Target(args[0], args[1], args[2]);\n case 4: return new Target(args[0], args[1], args[2], args[3]);\n }\n // w/o altered newTarget, lot of arguments case\n var $args = [null];\n $args.push.apply($args, args);\n return new (bind.apply(Target, $args))();\n }\n // with altered newTarget, not support built-in constructors\n var proto = newTarget.prototype;\n var instance = create(isObject(proto) ? proto : Object.prototype);\n var result = Function.apply.call(Target, instance, args);\n return isObject(result) ? result : instance;\n }\n});\n","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar anObject = require('../internals/an-object');\nvar toPrimitive = require('../internals/to-primitive');\nvar definePropertyModule = require('../internals/object-define-property');\nvar fails = require('../internals/fails');\n\n// MS Edge has broken Reflect.defineProperty - throwing instead of returning false\nvar ERROR_INSTEAD_OF_FALSE = fails(function () {\n // eslint-disable-next-line no-undef\n Reflect.defineProperty(definePropertyModule.f({}, 1, { value: 1 }), 1, { value: 2 });\n});\n\n// `Reflect.defineProperty` method\n// https://tc39.github.io/ecma262/#sec-reflect.defineproperty\n$({ target: 'Reflect', stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: !DESCRIPTORS }, {\n defineProperty: function defineProperty(target, propertyKey, attributes) {\n anObject(target);\n var key = toPrimitive(propertyKey, true);\n anObject(attributes);\n try {\n definePropertyModule.f(target, key, attributes);\n return true;\n } catch (error) {\n return false;\n }\n }\n});\n","var $ = require('../internals/export');\nvar anObject = require('../internals/an-object');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\n\n// `Reflect.deleteProperty` method\n// https://tc39.github.io/ecma262/#sec-reflect.deleteproperty\n$({ target: 'Reflect', stat: true }, {\n deleteProperty: function deleteProperty(target, propertyKey) {\n var descriptor = getOwnPropertyDescriptor(anObject(target), propertyKey);\n return descriptor && !descriptor.configurable ? false : delete target[propertyKey];\n }\n});\n","var $ = require('../internals/export');\nvar isObject = require('../internals/is-object');\nvar anObject = require('../internals/an-object');\nvar has = require('../internals/has');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\n\n// `Reflect.get` method\n// https://tc39.github.io/ecma262/#sec-reflect.get\nfunction get(target, propertyKey /* , receiver */) {\n var receiver = arguments.length < 3 ? target : arguments[2];\n var descriptor, prototype;\n if (anObject(target) === receiver) return target[propertyKey];\n if (descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey)) return has(descriptor, 'value')\n ? descriptor.value\n : descriptor.get === undefined\n ? undefined\n : descriptor.get.call(receiver);\n if (isObject(prototype = getPrototypeOf(target))) return get(prototype, propertyKey, receiver);\n}\n\n$({ target: 'Reflect', stat: true }, {\n get: get\n});\n","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar anObject = require('../internals/an-object');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\n\n// `Reflect.getOwnPropertyDescriptor` method\n// https://tc39.github.io/ecma262/#sec-reflect.getownpropertydescriptor\n$({ target: 'Reflect', stat: true, sham: !DESCRIPTORS }, {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {\n return getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);\n }\n});\n","var $ = require('../internals/export');\nvar anObject = require('../internals/an-object');\nvar objectGetPrototypeOf = require('../internals/object-get-prototype-of');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\n// `Reflect.getPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-reflect.getprototypeof\n$({ target: 'Reflect', stat: true, sham: !CORRECT_PROTOTYPE_GETTER }, {\n getPrototypeOf: function getPrototypeOf(target) {\n return objectGetPrototypeOf(anObject(target));\n }\n});\n","var $ = require('../internals/export');\n\n// `Reflect.has` method\n// https://tc39.github.io/ecma262/#sec-reflect.has\n$({ target: 'Reflect', stat: true }, {\n has: function has(target, propertyKey) {\n return propertyKey in target;\n }\n});\n","var $ = require('../internals/export');\nvar anObject = require('../internals/an-object');\n\nvar objectIsExtensible = Object.isExtensible;\n\n// `Reflect.isExtensible` method\n// https://tc39.github.io/ecma262/#sec-reflect.isextensible\n$({ target: 'Reflect', stat: true }, {\n isExtensible: function isExtensible(target) {\n anObject(target);\n return objectIsExtensible ? objectIsExtensible(target) : true;\n }\n});\n","var $ = require('../internals/export');\nvar ownKeys = require('../internals/own-keys');\n\n// `Reflect.ownKeys` method\n// https://tc39.github.io/ecma262/#sec-reflect.ownkeys\n$({ target: 'Reflect', stat: true }, {\n ownKeys: ownKeys\n});\n","var $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar anObject = require('../internals/an-object');\nvar FREEZING = require('../internals/freezing');\n\n// `Reflect.preventExtensions` method\n// https://tc39.github.io/ecma262/#sec-reflect.preventextensions\n$({ target: 'Reflect', stat: true, sham: !FREEZING }, {\n preventExtensions: function preventExtensions(target) {\n anObject(target);\n try {\n var objectPreventExtensions = getBuiltIn('Object', 'preventExtensions');\n if (objectPreventExtensions) objectPreventExtensions(target);\n return true;\n } catch (error) {\n return false;\n }\n }\n});\n","var $ = require('../internals/export');\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar has = require('../internals/has');\nvar fails = require('../internals/fails');\nvar definePropertyModule = require('../internals/object-define-property');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\n// `Reflect.set` method\n// https://tc39.github.io/ecma262/#sec-reflect.set\nfunction set(target, propertyKey, V /* , receiver */) {\n var receiver = arguments.length < 4 ? target : arguments[3];\n var ownDescriptor = getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);\n var existingDescriptor, prototype;\n if (!ownDescriptor) {\n if (isObject(prototype = getPrototypeOf(target))) {\n return set(prototype, propertyKey, V, receiver);\n }\n ownDescriptor = createPropertyDescriptor(0);\n }\n if (has(ownDescriptor, 'value')) {\n if (ownDescriptor.writable === false || !isObject(receiver)) return false;\n if (existingDescriptor = getOwnPropertyDescriptorModule.f(receiver, propertyKey)) {\n if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;\n existingDescriptor.value = V;\n definePropertyModule.f(receiver, propertyKey, existingDescriptor);\n } else definePropertyModule.f(receiver, propertyKey, createPropertyDescriptor(0, V));\n return true;\n }\n return ownDescriptor.set === undefined ? false : (ownDescriptor.set.call(receiver, V), true);\n}\n\n// MS Edge 17-18 Reflect.set allows setting the property to object\n// with non-writable property on the prototype\nvar MS_EDGE_BUG = fails(function () {\n var object = definePropertyModule.f({}, 'a', { configurable: true });\n // eslint-disable-next-line no-undef\n return Reflect.set(getPrototypeOf(object), 'a', 1, object) !== false;\n});\n\n$({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, {\n set: set\n});\n","var $ = require('../internals/export');\nvar anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\nvar objectSetPrototypeOf = require('../internals/object-set-prototype-of');\n\n// `Reflect.setPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-reflect.setprototypeof\nif (objectSetPrototypeOf) $({ target: 'Reflect', stat: true }, {\n setPrototypeOf: function setPrototypeOf(target, proto) {\n anObject(target);\n aPossiblePrototype(proto);\n try {\n objectSetPrototypeOf(target, proto);\n return true;\n } catch (error) {\n return false;\n }\n }\n});\n","var isObject = require('../internals/is-object');\nvar classof = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\n// `IsRegExp` abstract operation\n// https://tc39.github.io/ecma262/#sec-isregexp\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');\n};\n","'use strict';\nvar anObject = require('../internals/an-object');\n\n// `RegExp.prototype.flags` getter implementation\n// https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.dotAll) result += 's';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n","'use strict';\n\nvar fails = require('./fails');\n\n// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,\n// so we use an intermediate function.\nfunction RE(s, f) {\n return RegExp(s, f);\n}\n\nexports.UNSUPPORTED_Y = fails(function () {\n // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError\n var re = RE('a', 'y');\n re.lastIndex = 2;\n return re.exec('abcd') != null;\n});\n\nexports.BROKEN_CARET = fails(function () {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=773687\n var re = RE('^r', 'gy');\n re.lastIndex = 2;\n return re.exec('str') != null;\n});\n","var DESCRIPTORS = require('../internals/descriptors');\nvar global = require('../internals/global');\nvar isForced = require('../internals/is-forced');\nvar inheritIfRequired = require('../internals/inherit-if-required');\nvar defineProperty = require('../internals/object-define-property').f;\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar isRegExp = require('../internals/is-regexp');\nvar getFlags = require('../internals/regexp-flags');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar redefine = require('../internals/redefine');\nvar fails = require('../internals/fails');\nvar setInternalState = require('../internals/internal-state').set;\nvar setSpecies = require('../internals/set-species');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\nvar NativeRegExp = global.RegExp;\nvar RegExpPrototype = NativeRegExp.prototype;\nvar re1 = /a/g;\nvar re2 = /a/g;\n\n// \"new\" should create a new object, old webkit bug\nvar CORRECT_NEW = new NativeRegExp(re1) !== re1;\n\nvar UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;\n\nvar FORCED = DESCRIPTORS && isForced('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y || fails(function () {\n re2[MATCH] = false;\n // RegExp constructor can alter flags and IsRegExp works correct with @@match\n return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';\n})));\n\n// `RegExp` constructor\n// https://tc39.github.io/ecma262/#sec-regexp-constructor\nif (FORCED) {\n var RegExpWrapper = function RegExp(pattern, flags) {\n var thisIsRegExp = this instanceof RegExpWrapper;\n var patternIsRegExp = isRegExp(pattern);\n var flagsAreUndefined = flags === undefined;\n var sticky;\n\n if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {\n return pattern;\n }\n\n if (CORRECT_NEW) {\n if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;\n } else if (pattern instanceof RegExpWrapper) {\n if (flagsAreUndefined) flags = getFlags.call(pattern);\n pattern = pattern.source;\n }\n\n if (UNSUPPORTED_Y) {\n sticky = !!flags && flags.indexOf('y') > -1;\n if (sticky) flags = flags.replace(/y/g, '');\n }\n\n var result = inheritIfRequired(\n CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),\n thisIsRegExp ? this : RegExpPrototype,\n RegExpWrapper\n );\n\n if (UNSUPPORTED_Y && sticky) setInternalState(result, { sticky: sticky });\n\n return result;\n };\n var proxy = function (key) {\n key in RegExpWrapper || defineProperty(RegExpWrapper, key, {\n configurable: true,\n get: function () { return NativeRegExp[key]; },\n set: function (it) { NativeRegExp[key] = it; }\n });\n };\n var keys = getOwnPropertyNames(NativeRegExp);\n var index = 0;\n while (keys.length > index) proxy(keys[index++]);\n RegExpPrototype.constructor = RegExpWrapper;\n RegExpWrapper.prototype = RegExpPrototype;\n redefine(global, 'RegExp', RegExpWrapper);\n}\n\n// https://tc39.github.io/ecma262/#sec-get-regexp-@@species\nsetSpecies('RegExp');\n","'use strict';\nvar regexpFlags = require('./regexp-flags');\nvar stickyHelpers = require('./regexp-sticky-helpers');\n\nvar nativeExec = RegExp.prototype.exec;\n// This always refers to the native implementation, because the\n// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,\n// which loads this file before patching the method.\nvar nativeReplace = String.prototype.replace;\n\nvar patchedExec = nativeExec;\n\nvar UPDATES_LAST_INDEX_WRONG = (function () {\n var re1 = /a/;\n var re2 = /b*/g;\n nativeExec.call(re1, 'a');\n nativeExec.call(re2, 'a');\n return re1.lastIndex !== 0 || re2.lastIndex !== 0;\n})();\n\nvar UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;\n\n// nonparticipating capturing group, copied from es5-shim's String#split patch.\nvar NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;\n\nvar PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;\n\nif (PATCH) {\n patchedExec = function exec(str) {\n var re = this;\n var lastIndex, reCopy, match, i;\n var sticky = UNSUPPORTED_Y && re.sticky;\n var flags = regexpFlags.call(re);\n var source = re.source;\n var charsAdded = 0;\n var strCopy = str;\n\n if (sticky) {\n flags = flags.replace('y', '');\n if (flags.indexOf('g') === -1) {\n flags += 'g';\n }\n\n strCopy = String(str).slice(re.lastIndex);\n // Support anchored sticky behavior.\n if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\\n')) {\n source = '(?: ' + source + ')';\n strCopy = ' ' + strCopy;\n charsAdded++;\n }\n // ^(? + rx + ) is needed, in combination with some str slicing, to\n // simulate the 'y' flag.\n reCopy = new RegExp('^(?:' + source + ')', flags);\n }\n\n if (NPCG_INCLUDED) {\n reCopy = new RegExp('^' + source + '$(?!\\\\s)', flags);\n }\n if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;\n\n match = nativeExec.call(sticky ? reCopy : re, strCopy);\n\n if (sticky) {\n if (match) {\n match.input = match.input.slice(charsAdded);\n match[0] = match[0].slice(charsAdded);\n match.index = re.lastIndex;\n re.lastIndex += match[0].length;\n } else re.lastIndex = 0;\n } else if (UPDATES_LAST_INDEX_WRONG && match) {\n re.lastIndex = re.global ? match.index + match[0].length : lastIndex;\n }\n if (NPCG_INCLUDED && match && match.length > 1) {\n // Fix browsers whose `exec` methods don't consistently return `undefined`\n // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/\n nativeReplace.call(match[0], reCopy, function () {\n for (i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undefined) match[i] = undefined;\n }\n });\n }\n\n return match;\n };\n}\n\nmodule.exports = patchedExec;\n","'use strict';\nvar $ = require('../internals/export');\nvar exec = require('../internals/regexp-exec');\n\n$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {\n exec: exec\n});\n","var DESCRIPTORS = require('../internals/descriptors');\nvar objectDefinePropertyModule = require('../internals/object-define-property');\nvar regExpFlags = require('../internals/regexp-flags');\nvar UNSUPPORTED_Y = require('../internals/regexp-sticky-helpers').UNSUPPORTED_Y;\n\n// `RegExp.prototype.flags` getter\n// https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags\nif (DESCRIPTORS && (/./g.flags != 'g' || UNSUPPORTED_Y)) {\n objectDefinePropertyModule.f(RegExp.prototype, 'flags', {\n configurable: true,\n get: regExpFlags\n });\n}\n","var DESCRIPTORS = require('../internals/descriptors');\nvar UNSUPPORTED_Y = require('../internals/regexp-sticky-helpers').UNSUPPORTED_Y;\nvar defineProperty = require('../internals/object-define-property').f;\nvar getInternalState = require('../internals/internal-state').get;\nvar RegExpPrototype = RegExp.prototype;\n\n// `RegExp.prototype.sticky` getter\nif (DESCRIPTORS && UNSUPPORTED_Y) {\n defineProperty(RegExp.prototype, 'sticky', {\n configurable: true,\n get: function () {\n if (this === RegExpPrototype) return undefined;\n // We can't use InternalStateModule.getterFor because\n // we don't add metadata for regexps created by a literal.\n if (this instanceof RegExp) {\n return !!getInternalState(this).sticky;\n }\n throw TypeError('Incompatible receiver, RegExp required');\n }\n });\n}\n","'use strict';\n// TODO: Remove from `core-js@4` since it's moved to entry points\nrequire('../modules/es.regexp.exec');\nvar $ = require('../internals/export');\nvar isObject = require('../internals/is-object');\n\nvar DELEGATES_TO_EXEC = function () {\n var execCalled = false;\n var re = /[ac]/;\n re.exec = function () {\n execCalled = true;\n return /./.exec.apply(this, arguments);\n };\n return re.test('abc') === true && execCalled;\n}();\n\nvar nativeTest = /./.test;\n\n$({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, {\n test: function (str) {\n if (typeof this.exec !== 'function') {\n return nativeTest.call(this, str);\n }\n var result = this.exec(str);\n if (result !== null && !isObject(result)) {\n throw new Error('RegExp exec method returned something other than an Object or null');\n }\n return !!result;\n }\n});\n","'use strict';\nvar redefine = require('../internals/redefine');\nvar anObject = require('../internals/an-object');\nvar fails = require('../internals/fails');\nvar flags = require('../internals/regexp-flags');\n\nvar TO_STRING = 'toString';\nvar RegExpPrototype = RegExp.prototype;\nvar nativeToString = RegExpPrototype[TO_STRING];\n\nvar NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });\n// FF44- RegExp#toString has a wrong name\nvar INCORRECT_NAME = nativeToString.name != TO_STRING;\n\n// `RegExp.prototype.toString` method\n// https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring\nif (NOT_GENERIC || INCORRECT_NAME) {\n redefine(RegExp.prototype, TO_STRING, function toString() {\n var R = anObject(this);\n var p = String(R.source);\n var rf = R.flags;\n var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);\n return '/' + p + '/' + f;\n }, { unsafe: true });\n}\n","'use strict';\nvar collection = require('../internals/collection');\nvar collectionStrong = require('../internals/collection-strong');\n\n// `Set` constructor\n// https://tc39.github.io/ecma262/#sec-set-objects\nmodule.exports = collection('Set', function (init) {\n return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };\n}, collectionStrong);\n","var toInteger = require('../internals/to-integer');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `String.prototype.{ codePointAt, at }` methods implementation\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = String(requireObjectCoercible($this));\n var position = toInteger(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = S.charCodeAt(position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING ? S.charAt(position) : first\n : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\n\nmodule.exports = {\n // `String.prototype.codePointAt` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod(true)\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar codeAt = require('../internals/string-multibyte').codeAt;\n\n// `String.prototype.codePointAt` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.codepointat\n$({ target: 'String', proto: true }, {\n codePointAt: function codePointAt(pos) {\n return codeAt(this, pos);\n }\n});\n","var isRegExp = require('../internals/is-regexp');\n\nmodule.exports = function (it) {\n if (isRegExp(it)) {\n throw TypeError(\"The method doesn't accept regular expressions\");\n } return it;\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\nmodule.exports = function (METHOD_NAME) {\n var regexp = /./;\n try {\n '/./'[METHOD_NAME](regexp);\n } catch (e) {\n try {\n regexp[MATCH] = false;\n return '/./'[METHOD_NAME](regexp);\n } catch (f) { /* empty */ }\n } return false;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar toLength = require('../internals/to-length');\nvar notARegExp = require('../internals/not-a-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');\nvar IS_PURE = require('../internals/is-pure');\n\nvar nativeEndsWith = ''.endsWith;\nvar min = Math.min;\n\nvar CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith');\n// https://github.com/zloirock/core-js/pull/702\nvar MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {\n var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith');\n return descriptor && !descriptor.writable;\n}();\n\n// `String.prototype.endsWith` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.endswith\n$({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {\n endsWith: function endsWith(searchString /* , endPosition = @length */) {\n var that = String(requireObjectCoercible(this));\n notARegExp(searchString);\n var endPosition = arguments.length > 1 ? arguments[1] : undefined;\n var len = toLength(that.length);\n var end = endPosition === undefined ? len : min(toLength(endPosition), len);\n var search = String(searchString);\n return nativeEndsWith\n ? nativeEndsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n});\n","var $ = require('../internals/export');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\n\nvar fromCharCode = String.fromCharCode;\nvar nativeFromCodePoint = String.fromCodePoint;\n\n// length should be 1, old FF problem\nvar INCORRECT_LENGTH = !!nativeFromCodePoint && nativeFromCodePoint.length != 1;\n\n// `String.fromCodePoint` method\n// https://tc39.github.io/ecma262/#sec-string.fromcodepoint\n$({ target: 'String', stat: true, forced: INCORRECT_LENGTH }, {\n fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars\n var elements = [];\n var length = arguments.length;\n var i = 0;\n var code;\n while (length > i) {\n code = +arguments[i++];\n if (toAbsoluteIndex(code, 0x10FFFF) !== code) throw RangeError(code + ' is not a valid code point');\n elements.push(code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00)\n );\n } return elements.join('');\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar notARegExp = require('../internals/not-a-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');\n\n// `String.prototype.includes` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.includes\n$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~String(requireObjectCoercible(this))\n .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\n\n// `String.prototype[@@iterator]` method\n// https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: String(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length) return { value: undefined, done: true };\n point = charAt(string, index);\n state.index += point.length;\n return { value: point, done: false };\n});\n","'use strict';\n// TODO: Remove from `core-js@4` since it's moved to entry points\nrequire('../modules/es.regexp.exec');\nvar redefine = require('../internals/redefine');\nvar fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar regexpExec = require('../internals/regexp-exec');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nvar SPECIES = wellKnownSymbol('species');\n\nvar REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {\n // #replace needs built-in support for named groups.\n // #match works fine because it just return the exec results, even if it has\n // a \"grops\" property.\n var re = /./;\n re.exec = function () {\n var result = [];\n result.groups = { a: '7' };\n return result;\n };\n return ''.replace(re, '$') !== '7';\n});\n\n// IE <= 11 replaces $0 with the whole match, as if it was $&\n// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0\nvar REPLACE_KEEPS_$0 = (function () {\n return 'a'.replace(/./, '$0') === '$0';\n})();\n\nvar REPLACE = wellKnownSymbol('replace');\n// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string\nvar REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {\n if (/./[REPLACE]) {\n return /./[REPLACE]('a', '$0') === '';\n }\n return false;\n})();\n\n// Chrome 51 has a buggy \"split\" implementation when RegExp#exec !== nativeExec\n// Weex JS has frozen built-in prototypes, so use try / catch wrapper\nvar SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {\n var re = /(?:)/;\n var originalExec = re.exec;\n re.exec = function () { return originalExec.apply(this, arguments); };\n var result = 'ab'.split(re);\n return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';\n});\n\nmodule.exports = function (KEY, length, exec, sham) {\n var SYMBOL = wellKnownSymbol(KEY);\n\n var DELEGATES_TO_SYMBOL = !fails(function () {\n // String methods call symbol-named RegEp methods\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n });\n\n var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {\n // Symbol-named RegExp methods call .exec\n var execCalled = false;\n var re = /a/;\n\n if (KEY === 'split') {\n // We can't use real regex here since it causes deoptimization\n // and serious performance degradation in V8\n // https://github.com/zloirock/core-js/issues/306\n re = {};\n // RegExp[@@split] doesn't call the regex's exec method, but first creates\n // a new one. We need to return the patched regex when creating the new one.\n re.constructor = {};\n re.constructor[SPECIES] = function () { return re; };\n re.flags = '';\n re[SYMBOL] = /./[SYMBOL];\n }\n\n re.exec = function () { execCalled = true; return null; };\n\n re[SYMBOL]('');\n return !execCalled;\n });\n\n if (\n !DELEGATES_TO_SYMBOL ||\n !DELEGATES_TO_EXEC ||\n (KEY === 'replace' && !(\n REPLACE_SUPPORTS_NAMED_GROUPS &&\n REPLACE_KEEPS_$0 &&\n !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE\n )) ||\n (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)\n ) {\n var nativeRegExpMethod = /./[SYMBOL];\n var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {\n if (regexp.exec === regexpExec) {\n if (DELEGATES_TO_SYMBOL && !forceStringMethod) {\n // The native String method already delegates to @@method (this\n // polyfilled function), leasing to infinite recursion.\n // We avoid it by directly calling the native @@method method.\n return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };\n }\n return { done: true, value: nativeMethod.call(str, regexp, arg2) };\n }\n return { done: false };\n }, {\n REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,\n REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE\n });\n var stringMethod = methods[0];\n var regexMethod = methods[1];\n\n redefine(String.prototype, KEY, stringMethod);\n redefine(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return regexMethod.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return regexMethod.call(string, this); }\n );\n }\n\n if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);\n};\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\n\n// `AdvanceStringIndex` abstract operation\n// https://tc39.github.io/ecma262/#sec-advancestringindex\nmodule.exports = function (S, index, unicode) {\n return index + (unicode ? charAt(S, index).length : 1);\n};\n","var classof = require('./classof-raw');\nvar regexpExec = require('./regexp-exec');\n\n// `RegExpExec` abstract operation\n// https://tc39.github.io/ecma262/#sec-regexpexec\nmodule.exports = function (R, S) {\n var exec = R.exec;\n if (typeof exec === 'function') {\n var result = exec.call(R, S);\n if (typeof result !== 'object') {\n throw TypeError('RegExp exec method returned something other than an Object or null');\n }\n return result;\n }\n\n if (classof(R) !== 'RegExp') {\n throw TypeError('RegExp#exec called on incompatible receiver');\n }\n\n return regexpExec.call(R, S);\n};\n\n","'use strict';\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar toLength = require('../internals/to-length');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar regExpExec = require('../internals/regexp-exec-abstract');\n\n// @@match logic\nfixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {\n return [\n // `String.prototype.match` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.match\n function match(regexp) {\n var O = requireObjectCoercible(this);\n var matcher = regexp == undefined ? undefined : regexp[MATCH];\n return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n },\n // `RegExp.prototype[@@match]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match\n function (regexp) {\n var res = maybeCallNative(nativeMatch, regexp, this);\n if (res.done) return res.value;\n\n var rx = anObject(regexp);\n var S = String(this);\n\n if (!rx.global) return regExpExec(rx, S);\n\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n var A = [];\n var n = 0;\n var result;\n while ((result = regExpExec(rx, S)) !== null) {\n var matchStr = String(result[0]);\n A[n] = matchStr;\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n n++;\n }\n return n === 0 ? null : A;\n }\n ];\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar toLength = require('../internals/to-length');\nvar aFunction = require('../internals/a-function');\nvar anObject = require('../internals/an-object');\nvar classof = require('../internals/classof-raw');\nvar isRegExp = require('../internals/is-regexp');\nvar getRegExpFlags = require('../internals/regexp-flags');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar speciesConstructor = require('../internals/species-constructor');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar InternalStateModule = require('../internals/internal-state');\nvar IS_PURE = require('../internals/is-pure');\n\nvar MATCH_ALL = wellKnownSymbol('matchAll');\nvar REGEXP_STRING = 'RegExp String';\nvar REGEXP_STRING_ITERATOR = REGEXP_STRING + ' Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(REGEXP_STRING_ITERATOR);\nvar RegExpPrototype = RegExp.prototype;\nvar regExpBuiltinExec = RegExpPrototype.exec;\nvar nativeMatchAll = ''.matchAll;\n\nvar WORKS_WITH_NON_GLOBAL_REGEX = !!nativeMatchAll && !fails(function () {\n 'a'.matchAll(/./);\n});\n\nvar regExpExec = function (R, S) {\n var exec = R.exec;\n var result;\n if (typeof exec == 'function') {\n result = exec.call(R, S);\n if (typeof result != 'object') throw TypeError('Incorrect exec result');\n return result;\n } return regExpBuiltinExec.call(R, S);\n};\n\n// eslint-disable-next-line max-len\nvar $RegExpStringIterator = createIteratorConstructor(function RegExpStringIterator(regexp, string, global, fullUnicode) {\n setInternalState(this, {\n type: REGEXP_STRING_ITERATOR,\n regexp: regexp,\n string: string,\n global: global,\n unicode: fullUnicode,\n done: false\n });\n}, REGEXP_STRING, function next() {\n var state = getInternalState(this);\n if (state.done) return { value: undefined, done: true };\n var R = state.regexp;\n var S = state.string;\n var match = regExpExec(R, S);\n if (match === null) return { value: undefined, done: state.done = true };\n if (state.global) {\n if (String(match[0]) == '') R.lastIndex = advanceStringIndex(S, toLength(R.lastIndex), state.unicode);\n return { value: match, done: false };\n }\n state.done = true;\n return { value: match, done: false };\n});\n\nvar $matchAll = function (string) {\n var R = anObject(this);\n var S = String(string);\n var C, flagsValue, flags, matcher, global, fullUnicode;\n C = speciesConstructor(R, RegExp);\n flagsValue = R.flags;\n if (flagsValue === undefined && R instanceof RegExp && !('flags' in RegExpPrototype)) {\n flagsValue = getRegExpFlags.call(R);\n }\n flags = flagsValue === undefined ? '' : String(flagsValue);\n matcher = new C(C === RegExp ? R.source : R, flags);\n global = !!~flags.indexOf('g');\n fullUnicode = !!~flags.indexOf('u');\n matcher.lastIndex = toLength(R.lastIndex);\n return new $RegExpStringIterator(matcher, S, global, fullUnicode);\n};\n\n// `String.prototype.matchAll` method\n// https://github.com/tc39/proposal-string-matchall\n$({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, {\n matchAll: function matchAll(regexp) {\n var O = requireObjectCoercible(this);\n var flags, S, matcher, rx;\n if (regexp != null) {\n if (isRegExp(regexp)) {\n flags = String(requireObjectCoercible('flags' in RegExpPrototype\n ? regexp.flags\n : getRegExpFlags.call(regexp)\n ));\n if (!~flags.indexOf('g')) throw TypeError('`.matchAll` does not allow non-global regexes');\n }\n if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll.apply(O, arguments);\n matcher = regexp[MATCH_ALL];\n if (matcher === undefined && IS_PURE && classof(regexp) == 'RegExp') matcher = $matchAll;\n if (matcher != null) return aFunction(matcher).call(regexp, O);\n } else if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll.apply(O, arguments);\n S = String(O);\n rx = new RegExp(regexp, 'g');\n return IS_PURE ? $matchAll.call(rx, S) : rx[MATCH_ALL](S);\n }\n});\n\nIS_PURE || MATCH_ALL in RegExpPrototype || createNonEnumerableProperty(RegExpPrototype, MATCH_ALL, $matchAll);\n","// https://github.com/zloirock/core-js/issues/280\nvar userAgent = require('../internals/engine-user-agent');\n\n// eslint-disable-next-line unicorn/no-unsafe-regex\nmodule.exports = /Version\\/10\\.\\d+(\\.\\d+)?( Mobile\\/\\w+)? Safari\\//.test(userAgent);\n","'use strict';\nvar $ = require('../internals/export');\nvar $padEnd = require('../internals/string-pad').end;\nvar WEBKIT_BUG = require('../internals/string-pad-webkit-bug');\n\n// `String.prototype.padEnd` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.padend\n$({ target: 'String', proto: true, forced: WEBKIT_BUG }, {\n padEnd: function padEnd(maxLength /* , fillString = ' ' */) {\n return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $padStart = require('../internals/string-pad').start;\nvar WEBKIT_BUG = require('../internals/string-pad-webkit-bug');\n\n// `String.prototype.padStart` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.padstart\n$({ target: 'String', proto: true, forced: WEBKIT_BUG }, {\n padStart: function padStart(maxLength /* , fillString = ' ' */) {\n return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","var $ = require('../internals/export');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toLength = require('../internals/to-length');\n\n// `String.raw` method\n// https://tc39.github.io/ecma262/#sec-string.raw\n$({ target: 'String', stat: true }, {\n raw: function raw(template) {\n var rawTemplate = toIndexedObject(template.raw);\n var literalSegments = toLength(rawTemplate.length);\n var argumentsLength = arguments.length;\n var elements = [];\n var i = 0;\n while (literalSegments > i) {\n elements.push(String(rawTemplate[i++]));\n if (i < argumentsLength) elements.push(String(arguments[i]));\n } return elements.join('');\n }\n});\n","var $ = require('../internals/export');\nvar repeat = require('../internals/string-repeat');\n\n// `String.prototype.repeat` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.repeat\n$({ target: 'String', proto: true }, {\n repeat: repeat\n});\n","'use strict';\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar toInteger = require('../internals/to-integer');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar regExpExec = require('../internals/regexp-exec-abstract');\n\nvar max = Math.max;\nvar min = Math.min;\nvar floor = Math.floor;\nvar SUBSTITUTION_SYMBOLS = /\\$([$&'`]|\\d\\d?|<[^>]*>)/g;\nvar SUBSTITUTION_SYMBOLS_NO_NAMED = /\\$([$&'`]|\\d\\d?)/g;\n\nvar maybeToString = function (it) {\n return it === undefined ? it : String(it);\n};\n\n// @@replace logic\nfixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {\n var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;\n var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;\n var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';\n\n return [\n // `String.prototype.replace` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.replace\n function replace(searchValue, replaceValue) {\n var O = requireObjectCoercible(this);\n var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];\n return replacer !== undefined\n ? replacer.call(searchValue, O, replaceValue)\n : nativeReplace.call(String(O), searchValue, replaceValue);\n },\n // `RegExp.prototype[@@replace]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace\n function (regexp, replaceValue) {\n if (\n (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||\n (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)\n ) {\n var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);\n if (res.done) return res.value;\n }\n\n var rx = anObject(regexp);\n var S = String(this);\n\n var functionalReplace = typeof replaceValue === 'function';\n if (!functionalReplace) replaceValue = String(replaceValue);\n\n var global = rx.global;\n if (global) {\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n }\n var results = [];\n while (true) {\n var result = regExpExec(rx, S);\n if (result === null) break;\n\n results.push(result);\n if (!global) break;\n\n var matchStr = String(result[0]);\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n }\n\n var accumulatedResult = '';\n var nextSourcePosition = 0;\n for (var i = 0; i < results.length; i++) {\n result = results[i];\n\n var matched = String(result[0]);\n var position = max(min(toInteger(result.index), S.length), 0);\n var captures = [];\n // NOTE: This is equivalent to\n // captures = result.slice(1).map(maybeToString)\n // but for some reason `nativeSlice.call(result, 1, result.length)` (called in\n // the slice polyfill when slicing native arrays) \"doesn't work\" in safari 9 and\n // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.\n for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));\n var namedCaptures = result.groups;\n if (functionalReplace) {\n var replacerArgs = [matched].concat(captures, position, S);\n if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);\n var replacement = String(replaceValue.apply(undefined, replacerArgs));\n } else {\n replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);\n }\n if (position >= nextSourcePosition) {\n accumulatedResult += S.slice(nextSourcePosition, position) + replacement;\n nextSourcePosition = position + matched.length;\n }\n }\n return accumulatedResult + S.slice(nextSourcePosition);\n }\n ];\n\n // https://tc39.github.io/ecma262/#sec-getsubstitution\n function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {\n var tailPos = position + matched.length;\n var m = captures.length;\n var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;\n if (namedCaptures !== undefined) {\n namedCaptures = toObject(namedCaptures);\n symbols = SUBSTITUTION_SYMBOLS;\n }\n return nativeReplace.call(replacement, symbols, function (match, ch) {\n var capture;\n switch (ch.charAt(0)) {\n case '$': return '$';\n case '&': return matched;\n case '`': return str.slice(0, position);\n case \"'\": return str.slice(tailPos);\n case '<':\n capture = namedCaptures[ch.slice(1, -1)];\n break;\n default: // \\d\\d?\n var n = +ch;\n if (n === 0) return match;\n if (n > m) {\n var f = floor(n / 10);\n if (f === 0) return match;\n if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);\n return match;\n }\n capture = captures[n - 1];\n }\n return capture === undefined ? '' : capture;\n });\n }\n});\n","'use strict';\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar sameValue = require('../internals/same-value');\nvar regExpExec = require('../internals/regexp-exec-abstract');\n\n// @@search logic\nfixRegExpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {\n return [\n // `String.prototype.search` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.search\n function search(regexp) {\n var O = requireObjectCoercible(this);\n var searcher = regexp == undefined ? undefined : regexp[SEARCH];\n return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n },\n // `RegExp.prototype[@@search]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search\n function (regexp) {\n var res = maybeCallNative(nativeSearch, regexp, this);\n if (res.done) return res.value;\n\n var rx = anObject(regexp);\n var S = String(this);\n\n var previousLastIndex = rx.lastIndex;\n if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;\n var result = regExpExec(rx, S);\n if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;\n return result === null ? -1 : result.index;\n }\n ];\n});\n","'use strict';\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar isRegExp = require('../internals/is-regexp');\nvar anObject = require('../internals/an-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar speciesConstructor = require('../internals/species-constructor');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar toLength = require('../internals/to-length');\nvar callRegExpExec = require('../internals/regexp-exec-abstract');\nvar regexpExec = require('../internals/regexp-exec');\nvar fails = require('../internals/fails');\n\nvar arrayPush = [].push;\nvar min = Math.min;\nvar MAX_UINT32 = 0xFFFFFFFF;\n\n// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError\nvar SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });\n\n// @@split logic\nfixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {\n var internalSplit;\n if (\n 'abbc'.split(/(b)*/)[1] == 'c' ||\n 'test'.split(/(?:)/, -1).length != 4 ||\n 'ab'.split(/(?:ab)*/).length != 2 ||\n '.'.split(/(.?)(.?)/).length != 4 ||\n '.'.split(/()()/).length > 1 ||\n ''.split(/.?/).length\n ) {\n // based on es5-shim implementation, need to rework it\n internalSplit = function (separator, limit) {\n var string = String(requireObjectCoercible(this));\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (separator === undefined) return [string];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) {\n return nativeSplit.call(string, separator, lim);\n }\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var match, lastIndex, lastLength;\n while (match = regexpExec.call(separatorCopy, string)) {\n lastIndex = separatorCopy.lastIndex;\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));\n lastLength = match[0].length;\n lastLastIndex = lastIndex;\n if (output.length >= lim) break;\n }\n if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop\n }\n if (lastLastIndex === string.length) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output.length > lim ? output.slice(0, lim) : output;\n };\n // Chakra, V8\n } else if ('0'.split(undefined, 0).length) {\n internalSplit = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);\n };\n } else internalSplit = nativeSplit;\n\n return [\n // `String.prototype.split` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.split\n function split(separator, limit) {\n var O = requireObjectCoercible(this);\n var splitter = separator == undefined ? undefined : separator[SPLIT];\n return splitter !== undefined\n ? splitter.call(separator, O, limit)\n : internalSplit.call(String(O), separator, limit);\n },\n // `RegExp.prototype[@@split]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split\n //\n // NOTE: This cannot be properly polyfilled in engines that don't support\n // the 'y' flag.\n function (regexp, limit) {\n var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);\n if (res.done) return res.value;\n\n var rx = anObject(regexp);\n var S = String(this);\n var C = speciesConstructor(rx, RegExp);\n\n var unicodeMatching = rx.unicode;\n var flags = (rx.ignoreCase ? 'i' : '') +\n (rx.multiline ? 'm' : '') +\n (rx.unicode ? 'u' : '') +\n (SUPPORTS_Y ? 'y' : 'g');\n\n // ^(? + rx + ) is needed, in combination with some S slicing, to\n // simulate the 'y' flag.\n var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];\n var p = 0;\n var q = 0;\n var A = [];\n while (q < S.length) {\n splitter.lastIndex = SUPPORTS_Y ? q : 0;\n var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));\n var e;\n if (\n z === null ||\n (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p\n ) {\n q = advanceStringIndex(S, q, unicodeMatching);\n } else {\n A.push(S.slice(p, q));\n if (A.length === lim) return A;\n for (var i = 1; i <= z.length - 1; i++) {\n A.push(z[i]);\n if (A.length === lim) return A;\n }\n q = p = e;\n }\n }\n A.push(S.slice(p));\n return A;\n }\n ];\n}, !SUPPORTS_Y);\n","'use strict';\nvar $ = require('../internals/export');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar toLength = require('../internals/to-length');\nvar notARegExp = require('../internals/not-a-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');\nvar IS_PURE = require('../internals/is-pure');\n\nvar nativeStartsWith = ''.startsWith;\nvar min = Math.min;\n\nvar CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');\n// https://github.com/zloirock/core-js/pull/702\nvar MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {\n var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');\n return descriptor && !descriptor.writable;\n}();\n\n// `String.prototype.startsWith` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.startswith\n$({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = String(requireObjectCoercible(this));\n notARegExp(searchString);\n var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = String(searchString);\n return nativeStartsWith\n ? nativeStartsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n","var fails = require('../internals/fails');\nvar whitespaces = require('../internals/whitespaces');\n\nvar non = '\\u200B\\u0085\\u180E';\n\n// check that a method works with the correct list\n// of whitespaces and has a correct name\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;\n });\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $trim = require('../internals/string-trim').trim;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\n// `String.prototype.trim` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.trim\n$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {\n trim: function trim() {\n return $trim(this);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $trimEnd = require('../internals/string-trim').end;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\nvar FORCED = forcedStringTrimMethod('trimEnd');\n\nvar trimEnd = FORCED ? function trimEnd() {\n return $trimEnd(this);\n} : ''.trimEnd;\n\n// `String.prototype.{ trimEnd, trimRight }` methods\n// https://github.com/tc39/ecmascript-string-left-right-trim\n$({ target: 'String', proto: true, forced: FORCED }, {\n trimEnd: trimEnd,\n trimRight: trimEnd\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $trimStart = require('../internals/string-trim').start;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\nvar FORCED = forcedStringTrimMethod('trimStart');\n\nvar trimStart = FORCED ? function trimStart() {\n return $trimStart(this);\n} : ''.trimStart;\n\n// `String.prototype.{ trimStart, trimLeft }` methods\n// https://github.com/tc39/ecmascript-string-left-right-trim\n$({ target: 'String', proto: true, forced: FORCED }, {\n trimStart: trimStart,\n trimLeft: trimStart\n});\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar quot = /\"/g;\n\n// B.2.3.2.1 CreateHTML(string, tag, attribute, value)\n// https://tc39.github.io/ecma262/#sec-createhtml\nmodule.exports = function (string, tag, attribute, value) {\n var S = String(requireObjectCoercible(string));\n var p1 = '<' + tag;\n if (attribute !== '') p1 += ' ' + attribute + '=\"' + String(value).replace(quot, '"') + '\"';\n return p1 + '>' + S + '' + tag + '>';\n};\n","var fails = require('../internals/fails');\n\n// check the existence of a method, lowercase\n// of a tag and escaping quotes in arguments\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n var test = ''[METHOD_NAME]('\"');\n return test !== test.toLowerCase() || test.split('\"').length > 3;\n });\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar createHTML = require('../internals/create-html');\nvar forcedStringHTMLMethod = require('../internals/string-html-forced');\n\n// `String.prototype.anchor` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.anchor\n$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('anchor') }, {\n anchor: function anchor(name) {\n return createHTML(this, 'a', 'name', name);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar createHTML = require('../internals/create-html');\nvar forcedStringHTMLMethod = require('../internals/string-html-forced');\n\n// `String.prototype.big` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.big\n$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('big') }, {\n big: function big() {\n return createHTML(this, 'big', '', '');\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar createHTML = require('../internals/create-html');\nvar forcedStringHTMLMethod = require('../internals/string-html-forced');\n\n// `String.prototype.blink` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.blink\n$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('blink') }, {\n blink: function blink() {\n return createHTML(this, 'blink', '', '');\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar createHTML = require('../internals/create-html');\nvar forcedStringHTMLMethod = require('../internals/string-html-forced');\n\n// `String.prototype.bold` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.bold\n$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('bold') }, {\n bold: function bold() {\n return createHTML(this, 'b', '', '');\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar createHTML = require('../internals/create-html');\nvar forcedStringHTMLMethod = require('../internals/string-html-forced');\n\n// `String.prototype.fixed` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.fixed\n$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fixed') }, {\n fixed: function fixed() {\n return createHTML(this, 'tt', '', '');\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar createHTML = require('../internals/create-html');\nvar forcedStringHTMLMethod = require('../internals/string-html-forced');\n\n// `String.prototype.fontcolor` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.fontcolor\n$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fontcolor') }, {\n fontcolor: function fontcolor(color) {\n return createHTML(this, 'font', 'color', color);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar createHTML = require('../internals/create-html');\nvar forcedStringHTMLMethod = require('../internals/string-html-forced');\n\n// `String.prototype.fontsize` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.fontsize\n$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fontsize') }, {\n fontsize: function fontsize(size) {\n return createHTML(this, 'font', 'size', size);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar createHTML = require('../internals/create-html');\nvar forcedStringHTMLMethod = require('../internals/string-html-forced');\n\n// `String.prototype.italics` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.italics\n$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('italics') }, {\n italics: function italics() {\n return createHTML(this, 'i', '', '');\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar createHTML = require('../internals/create-html');\nvar forcedStringHTMLMethod = require('../internals/string-html-forced');\n\n// `String.prototype.link` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.link\n$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('link') }, {\n link: function link(url) {\n return createHTML(this, 'a', 'href', url);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar createHTML = require('../internals/create-html');\nvar forcedStringHTMLMethod = require('../internals/string-html-forced');\n\n// `String.prototype.small` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.small\n$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('small') }, {\n small: function small() {\n return createHTML(this, 'small', '', '');\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar createHTML = require('../internals/create-html');\nvar forcedStringHTMLMethod = require('../internals/string-html-forced');\n\n// `String.prototype.strike` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.strike\n$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('strike') }, {\n strike: function strike() {\n return createHTML(this, 'strike', '', '');\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar createHTML = require('../internals/create-html');\nvar forcedStringHTMLMethod = require('../internals/string-html-forced');\n\n// `String.prototype.sub` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.sub\n$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('sub') }, {\n sub: function sub() {\n return createHTML(this, 'sub', '', '');\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar createHTML = require('../internals/create-html');\nvar forcedStringHTMLMethod = require('../internals/string-html-forced');\n\n// `String.prototype.sup` method\n// https://tc39.github.io/ecma262/#sec-string.prototype.sup\n$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('sup') }, {\n sup: function sup() {\n return createHTML(this, 'sup', '', '');\n }\n});\n","/* eslint-disable no-new */\nvar global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar NATIVE_ARRAY_BUFFER_VIEWS = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS;\n\nvar ArrayBuffer = global.ArrayBuffer;\nvar Int8Array = global.Int8Array;\n\nmodule.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {\n Int8Array(1);\n}) || !fails(function () {\n new Int8Array(-1);\n}) || !checkCorrectnessOfIteration(function (iterable) {\n new Int8Array();\n new Int8Array(null);\n new Int8Array(1.5);\n new Int8Array(iterable);\n}, true) || fails(function () {\n // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill\n return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;\n});\n","var toInteger = require('../internals/to-integer');\n\nmodule.exports = function (it) {\n var result = toInteger(it);\n if (result < 0) throw RangeError(\"The argument can't be less than 0\");\n return result;\n};\n","var toPositiveInteger = require('../internals/to-positive-integer');\n\nmodule.exports = function (it, BYTES) {\n var offset = toPositiveInteger(it);\n if (offset % BYTES) throw RangeError('Wrong offset');\n return offset;\n};\n","var toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar bind = require('../internals/function-bind-context');\nvar aTypedArrayConstructor = require('../internals/array-buffer-view-core').aTypedArrayConstructor;\n\nmodule.exports = function from(source /* , mapfn, thisArg */) {\n var O = toObject(source);\n var argumentsLength = arguments.length;\n var mapfn = argumentsLength > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iteratorMethod = getIteratorMethod(O);\n var i, length, result, step, iterator, next;\n if (iteratorMethod != undefined && !isArrayIteratorMethod(iteratorMethod)) {\n iterator = iteratorMethod.call(O);\n next = iterator.next;\n O = [];\n while (!(step = next.call(iterator)).done) {\n O.push(step.value);\n }\n }\n if (mapping && argumentsLength > 2) {\n mapfn = bind(mapfn, arguments[2], 2);\n }\n length = toLength(O.length);\n result = new (aTypedArrayConstructor(this))(length);\n for (i = 0; length > i; i++) {\n result[i] = mapping ? mapfn(O[i], i) : O[i];\n }\n return result;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar ArrayBufferModule = require('../internals/array-buffer');\nvar anInstance = require('../internals/an-instance');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar toLength = require('../internals/to-length');\nvar toIndex = require('../internals/to-index');\nvar toOffset = require('../internals/to-offset');\nvar toPrimitive = require('../internals/to-primitive');\nvar has = require('../internals/has');\nvar classof = require('../internals/classof');\nvar isObject = require('../internals/is-object');\nvar create = require('../internals/object-create');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar typedArrayFrom = require('../internals/typed-array-from');\nvar forEach = require('../internals/array-iteration').forEach;\nvar setSpecies = require('../internals/set-species');\nvar definePropertyModule = require('../internals/object-define-property');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar InternalStateModule = require('../internals/internal-state');\nvar inheritIfRequired = require('../internals/inherit-if-required');\n\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar nativeDefineProperty = definePropertyModule.f;\nvar nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\nvar round = Math.round;\nvar RangeError = global.RangeError;\nvar ArrayBuffer = ArrayBufferModule.ArrayBuffer;\nvar DataView = ArrayBufferModule.DataView;\nvar NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;\nvar TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;\nvar TypedArray = ArrayBufferViewCore.TypedArray;\nvar TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;\nvar aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;\nvar isTypedArray = ArrayBufferViewCore.isTypedArray;\nvar BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\nvar WRONG_LENGTH = 'Wrong length';\n\nvar fromList = function (C, list) {\n var index = 0;\n var length = list.length;\n var result = new (aTypedArrayConstructor(C))(length);\n while (length > index) result[index] = list[index++];\n return result;\n};\n\nvar addGetter = function (it, key) {\n nativeDefineProperty(it, key, { get: function () {\n return getInternalState(this)[key];\n } });\n};\n\nvar isArrayBuffer = function (it) {\n var klass;\n return it instanceof ArrayBuffer || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer';\n};\n\nvar isTypedArrayIndex = function (target, key) {\n return isTypedArray(target)\n && typeof key != 'symbol'\n && key in target\n && String(+key) == String(key);\n};\n\nvar wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {\n return isTypedArrayIndex(target, key = toPrimitive(key, true))\n ? createPropertyDescriptor(2, target[key])\n : nativeGetOwnPropertyDescriptor(target, key);\n};\n\nvar wrappedDefineProperty = function defineProperty(target, key, descriptor) {\n if (isTypedArrayIndex(target, key = toPrimitive(key, true))\n && isObject(descriptor)\n && has(descriptor, 'value')\n && !has(descriptor, 'get')\n && !has(descriptor, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !descriptor.configurable\n && (!has(descriptor, 'writable') || descriptor.writable)\n && (!has(descriptor, 'enumerable') || descriptor.enumerable)\n ) {\n target[key] = descriptor.value;\n return target;\n } return nativeDefineProperty(target, key, descriptor);\n};\n\nif (DESCRIPTORS) {\n if (!NATIVE_ARRAY_BUFFER_VIEWS) {\n getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;\n definePropertyModule.f = wrappedDefineProperty;\n addGetter(TypedArrayPrototype, 'buffer');\n addGetter(TypedArrayPrototype, 'byteOffset');\n addGetter(TypedArrayPrototype, 'byteLength');\n addGetter(TypedArrayPrototype, 'length');\n }\n\n $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {\n getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,\n defineProperty: wrappedDefineProperty\n });\n\n module.exports = function (TYPE, wrapper, CLAMPED) {\n var BYTES = TYPE.match(/\\d+$/)[0] / 8;\n var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + TYPE;\n var SETTER = 'set' + TYPE;\n var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME];\n var TypedArrayConstructor = NativeTypedArrayConstructor;\n var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;\n var exported = {};\n\n var getter = function (that, index) {\n var data = getInternalState(that);\n return data.view[GETTER](index * BYTES + data.byteOffset, true);\n };\n\n var setter = function (that, index, value) {\n var data = getInternalState(that);\n if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF;\n data.view[SETTER](index * BYTES + data.byteOffset, value, true);\n };\n\n var addElement = function (that, index) {\n nativeDefineProperty(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n\n if (!NATIVE_ARRAY_BUFFER_VIEWS) {\n TypedArrayConstructor = wrapper(function (that, data, offset, $length) {\n anInstance(that, TypedArrayConstructor, CONSTRUCTOR_NAME);\n var index = 0;\n var byteOffset = 0;\n var buffer, byteLength, length;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new ArrayBuffer(byteLength);\n } else if (isArrayBuffer(data)) {\n buffer = data;\n byteOffset = toOffset(offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - byteOffset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (isTypedArray(data)) {\n return fromList(TypedArrayConstructor, data);\n } else {\n return typedArrayFrom.call(TypedArrayConstructor, data);\n }\n setInternalState(that, {\n buffer: buffer,\n byteOffset: byteOffset,\n byteLength: byteLength,\n length: length,\n view: new DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n\n if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);\n TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);\n } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {\n TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) {\n anInstance(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME);\n return inheritIfRequired(function () {\n if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data));\n if (isArrayBuffer(data)) return $length !== undefined\n ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length)\n : typedArrayOffset !== undefined\n ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES))\n : new NativeTypedArrayConstructor(data);\n if (isTypedArray(data)) return fromList(TypedArrayConstructor, data);\n return typedArrayFrom.call(TypedArrayConstructor, data);\n }(), dummy, TypedArrayConstructor);\n });\n\n if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);\n forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) {\n if (!(key in TypedArrayConstructor)) {\n createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);\n }\n });\n TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;\n }\n\n if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {\n createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor);\n }\n\n if (TYPED_ARRAY_TAG) {\n createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);\n }\n\n exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;\n\n $({\n global: true, forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS\n }, exported);\n\n if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {\n createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);\n }\n\n if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {\n createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);\n }\n\n setSpecies(CONSTRUCTOR_NAME);\n };\n} else module.exports = function () { /* empty */ };\n","var createTypedArrayConstructor = require('../internals/typed-array-constructor');\n\n// `Float32Array` constructor\n// https://tc39.github.io/ecma262/#sec-typedarray-objects\ncreateTypedArrayConstructor('Float32', function (init) {\n return function Float32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","var createTypedArrayConstructor = require('../internals/typed-array-constructor');\n\n// `Float64Array` constructor\n// https://tc39.github.io/ecma262/#sec-typedarray-objects\ncreateTypedArrayConstructor('Float64', function (init) {\n return function Float64Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","var createTypedArrayConstructor = require('../internals/typed-array-constructor');\n\n// `Int8Array` constructor\n// https://tc39.github.io/ecma262/#sec-typedarray-objects\ncreateTypedArrayConstructor('Int8', function (init) {\n return function Int8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","var createTypedArrayConstructor = require('../internals/typed-array-constructor');\n\n// `Int16Array` constructor\n// https://tc39.github.io/ecma262/#sec-typedarray-objects\ncreateTypedArrayConstructor('Int16', function (init) {\n return function Int16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","var createTypedArrayConstructor = require('../internals/typed-array-constructor');\n\n// `Int32Array` constructor\n// https://tc39.github.io/ecma262/#sec-typedarray-objects\ncreateTypedArrayConstructor('Int32', function (init) {\n return function Int32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","var createTypedArrayConstructor = require('../internals/typed-array-constructor');\n\n// `Uint8Array` constructor\n// https://tc39.github.io/ecma262/#sec-typedarray-objects\ncreateTypedArrayConstructor('Uint8', function (init) {\n return function Uint8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","var createTypedArrayConstructor = require('../internals/typed-array-constructor');\n\n// `Uint8ClampedArray` constructor\n// https://tc39.github.io/ecma262/#sec-typedarray-objects\ncreateTypedArrayConstructor('Uint8', function (init) {\n return function Uint8ClampedArray(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n}, true);\n","var createTypedArrayConstructor = require('../internals/typed-array-constructor');\n\n// `Uint16Array` constructor\n// https://tc39.github.io/ecma262/#sec-typedarray-objects\ncreateTypedArrayConstructor('Uint16', function (init) {\n return function Uint16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","var createTypedArrayConstructor = require('../internals/typed-array-constructor');\n\n// `Uint32Array` constructor\n// https://tc39.github.io/ecma262/#sec-typedarray-objects\ncreateTypedArrayConstructor('Uint32', function (init) {\n return function Uint32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $copyWithin = require('../internals/array-copy-within');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.copyWithin` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.copywithin\nexportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) {\n return $copyWithin.call(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $every = require('../internals/array-iteration').every;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.every` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.every\nexportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) {\n return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $fill = require('../internals/array-fill');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.fill` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.fill\n// eslint-disable-next-line no-unused-vars\nexportTypedArrayMethod('fill', function fill(value /* , start, end */) {\n return $fill.apply(aTypedArray(this), arguments);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $filter = require('../internals/array-iteration').filter;\nvar speciesConstructor = require('../internals/species-constructor');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.filter` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.filter\nexportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) {\n var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n var C = speciesConstructor(this, this.constructor);\n var index = 0;\n var length = list.length;\n var result = new (aTypedArrayConstructor(C))(length);\n while (length > index) result[index] = list[index++];\n return result;\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $find = require('../internals/array-iteration').find;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.find` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.find\nexportTypedArrayMethod('find', function find(predicate /* , thisArg */) {\n return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $findIndex = require('../internals/array-iteration').findIndex;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.findIndex` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.findindex\nexportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) {\n return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $forEach = require('../internals/array-iteration').forEach;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.forEach` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.foreach\nexportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) {\n $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');\nvar exportTypedArrayStaticMethod = require('../internals/array-buffer-view-core').exportTypedArrayStaticMethod;\nvar typedArrayFrom = require('../internals/typed-array-from');\n\n// `%TypedArray%.from` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.from\nexportTypedArrayStaticMethod('from', typedArrayFrom, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $includes = require('../internals/array-includes').includes;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.includes` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.includes\nexportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) {\n return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $indexOf = require('../internals/array-includes').indexOf;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.indexOf` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.indexof\nexportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */) {\n return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar global = require('../internals/global');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar ArrayIterators = require('../modules/es.array.iterator');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar Uint8Array = global.Uint8Array;\nvar arrayValues = ArrayIterators.values;\nvar arrayKeys = ArrayIterators.keys;\nvar arrayEntries = ArrayIterators.entries;\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR];\n\nvar CORRECT_ITER_NAME = !!nativeTypedArrayIterator\n && (nativeTypedArrayIterator.name == 'values' || nativeTypedArrayIterator.name == undefined);\n\nvar typedArrayValues = function values() {\n return arrayValues.call(aTypedArray(this));\n};\n\n// `%TypedArray%.prototype.entries` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.entries\nexportTypedArrayMethod('entries', function entries() {\n return arrayEntries.call(aTypedArray(this));\n});\n// `%TypedArray%.prototype.keys` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.keys\nexportTypedArrayMethod('keys', function keys() {\n return arrayKeys.call(aTypedArray(this));\n});\n// `%TypedArray%.prototype.values` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.values\nexportTypedArrayMethod('values', typedArrayValues, !CORRECT_ITER_NAME);\n// `%TypedArray%.prototype[@@iterator]` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype-@@iterator\nexportTypedArrayMethod(ITERATOR, typedArrayValues, !CORRECT_ITER_NAME);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar $join = [].join;\n\n// `%TypedArray%.prototype.join` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join\n// eslint-disable-next-line no-unused-vars\nexportTypedArrayMethod('join', function join(separator) {\n return $join.apply(aTypedArray(this), arguments);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $lastIndexOf = require('../internals/array-last-index-of');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.lastIndexOf` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.lastindexof\n// eslint-disable-next-line no-unused-vars\nexportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) {\n return $lastIndexOf.apply(aTypedArray(this), arguments);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $map = require('../internals/array-iteration').map;\nvar speciesConstructor = require('../internals/species-constructor');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.map` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.map\nexportTypedArrayMethod('map', function map(mapfn /* , thisArg */) {\n return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) {\n return new (aTypedArrayConstructor(speciesConstructor(O, O.constructor)))(length);\n });\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');\n\nvar aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;\nvar exportTypedArrayStaticMethod = ArrayBufferViewCore.exportTypedArrayStaticMethod;\n\n// `%TypedArray%.of` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.of\nexportTypedArrayStaticMethod('of', function of(/* ...items */) {\n var index = 0;\n var length = arguments.length;\n var result = new (aTypedArrayConstructor(this))(length);\n while (length > index) result[index] = arguments[index++];\n return result;\n}, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $reduce = require('../internals/array-reduce').left;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.reduce` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduce\nexportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */) {\n return $reduce(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $reduceRight = require('../internals/array-reduce').right;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.reduceRicht` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduceright\nexportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) {\n return $reduceRight(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar floor = Math.floor;\n\n// `%TypedArray%.prototype.reverse` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reverse\nexportTypedArrayMethod('reverse', function reverse() {\n var that = this;\n var length = aTypedArray(that).length;\n var middle = floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar toLength = require('../internals/to-length');\nvar toOffset = require('../internals/to-offset');\nvar toObject = require('../internals/to-object');\nvar fails = require('../internals/fails');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\nvar FORCED = fails(function () {\n // eslint-disable-next-line no-undef\n new Int8Array(1).set({});\n});\n\n// `%TypedArray%.prototype.set` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.set\nexportTypedArrayMethod('set', function set(arrayLike /* , offset */) {\n aTypedArray(this);\n var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);\n var length = this.length;\n var src = toObject(arrayLike);\n var len = toLength(src.length);\n var index = 0;\n if (len + offset > length) throw RangeError('Wrong length');\n while (index < len) this[offset + index] = src[index++];\n}, FORCED);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar speciesConstructor = require('../internals/species-constructor');\nvar fails = require('../internals/fails');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar $slice = [].slice;\n\nvar FORCED = fails(function () {\n // eslint-disable-next-line no-undef\n new Int8Array(1).slice();\n});\n\n// `%TypedArray%.prototype.slice` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.slice\nexportTypedArrayMethod('slice', function slice(start, end) {\n var list = $slice.call(aTypedArray(this), start, end);\n var C = speciesConstructor(this, this.constructor);\n var index = 0;\n var length = list.length;\n var result = new (aTypedArrayConstructor(C))(length);\n while (length > index) result[index] = list[index++];\n return result;\n}, FORCED);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $some = require('../internals/array-iteration').some;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.some` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some\nexportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) {\n return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar $sort = [].sort;\n\n// `%TypedArray%.prototype.sort` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.sort\nexportTypedArrayMethod('sort', function sort(comparefn) {\n return $sort.call(aTypedArray(this), comparefn);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar speciesConstructor = require('../internals/species-constructor');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.subarray` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.subarray\nexportTypedArrayMethod('subarray', function subarray(begin, end) {\n var O = aTypedArray(this);\n var length = O.length;\n var beginIndex = toAbsoluteIndex(begin, length);\n return new (speciesConstructor(O, O.constructor))(\n O.buffer,\n O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex)\n );\n});\n","'use strict';\nvar global = require('../internals/global');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar fails = require('../internals/fails');\n\nvar Int8Array = global.Int8Array;\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar $toLocaleString = [].toLocaleString;\nvar $slice = [].slice;\n\n// iOS Safari 6.x fails here\nvar TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {\n $toLocaleString.call(new Int8Array(1));\n});\n\nvar FORCED = fails(function () {\n return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString();\n}) || !fails(function () {\n Int8Array.prototype.toLocaleString.call([1, 2]);\n});\n\n// `%TypedArray%.prototype.toLocaleString` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tolocalestring\nexportTypedArrayMethod('toLocaleString', function toLocaleString() {\n return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray(this)) : aTypedArray(this), arguments);\n}, FORCED);\n","'use strict';\nvar exportTypedArrayMethod = require('../internals/array-buffer-view-core').exportTypedArrayMethod;\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\n\nvar Uint8Array = global.Uint8Array;\nvar Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {};\nvar arrayToString = [].toString;\nvar arrayJoin = [].join;\n\nif (fails(function () { arrayToString.call({}); })) {\n arrayToString = function toString() {\n return arrayJoin.call(this);\n };\n}\n\nvar IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString;\n\n// `%TypedArray%.prototype.toString` method\n// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tostring\nexportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD);\n","'use strict';\nvar redefineAll = require('../internals/redefine-all');\nvar getWeakData = require('../internals/internal-metadata').getWeakData;\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar anInstance = require('../internals/an-instance');\nvar iterate = require('../internals/iterate');\nvar ArrayIterationModule = require('../internals/array-iteration');\nvar $has = require('../internals/has');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\nvar find = ArrayIterationModule.find;\nvar findIndex = ArrayIterationModule.findIndex;\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (store) {\n return store.frozen || (store.frozen = new UncaughtFrozenStore());\n};\n\nvar UncaughtFrozenStore = function () {\n this.entries = [];\n};\n\nvar findUncaughtFrozen = function (store, key) {\n return find(store.entries, function (it) {\n return it[0] === key;\n });\n};\n\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.entries.push([key, value]);\n },\n 'delete': function (key) {\n var index = findIndex(this.entries, function (it) {\n return it[0] === key;\n });\n if (~index) this.entries.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, CONSTRUCTOR_NAME);\n setInternalState(that, {\n type: CONSTRUCTOR_NAME,\n id: id++,\n frozen: undefined\n });\n if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP);\n });\n\n var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);\n\n var define = function (that, key, value) {\n var state = getInternalState(that);\n var data = getWeakData(anObject(key), true);\n if (data === true) uncaughtFrozenStore(state).set(key, value);\n else data[state.id] = value;\n return that;\n };\n\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function (key) {\n var state = getInternalState(this);\n if (!isObject(key)) return false;\n var data = getWeakData(key);\n if (data === true) return uncaughtFrozenStore(state)['delete'](key);\n return data && $has(data, state.id) && delete data[state.id];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key) {\n var state = getInternalState(this);\n if (!isObject(key)) return false;\n var data = getWeakData(key);\n if (data === true) return uncaughtFrozenStore(state).has(key);\n return data && $has(data, state.id);\n }\n });\n\n redefineAll(C.prototype, IS_MAP ? {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key) {\n var state = getInternalState(this);\n if (isObject(key)) {\n var data = getWeakData(key);\n if (data === true) return uncaughtFrozenStore(state).get(key);\n return data ? data[state.id] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value) {\n return define(this, key, value);\n }\n } : {\n // 23.4.3.1 WeakSet.prototype.add(value)\n add: function add(value) {\n return define(this, value, true);\n }\n });\n\n return C;\n }\n};\n","'use strict';\nvar global = require('../internals/global');\nvar redefineAll = require('../internals/redefine-all');\nvar InternalMetadataModule = require('../internals/internal-metadata');\nvar collection = require('../internals/collection');\nvar collectionWeak = require('../internals/collection-weak');\nvar isObject = require('../internals/is-object');\nvar enforceIternalState = require('../internals/internal-state').enforce;\nvar NATIVE_WEAK_MAP = require('../internals/native-weak-map');\n\nvar IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;\nvar isExtensible = Object.isExtensible;\nvar InternalWeakMap;\n\nvar wrapper = function (init) {\n return function WeakMap() {\n return init(this, arguments.length ? arguments[0] : undefined);\n };\n};\n\n// `WeakMap` constructor\n// https://tc39.github.io/ecma262/#sec-weakmap-constructor\nvar $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak);\n\n// IE11 WeakMap frozen keys fix\n// We can't use feature detection because it crash some old IE builds\n// https://github.com/zloirock/core-js/issues/485\nif (NATIVE_WEAK_MAP && IS_IE11) {\n InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);\n InternalMetadataModule.REQUIRED = true;\n var WeakMapPrototype = $WeakMap.prototype;\n var nativeDelete = WeakMapPrototype['delete'];\n var nativeHas = WeakMapPrototype.has;\n var nativeGet = WeakMapPrototype.get;\n var nativeSet = WeakMapPrototype.set;\n redefineAll(WeakMapPrototype, {\n 'delete': function (key) {\n if (isObject(key) && !isExtensible(key)) {\n var state = enforceIternalState(this);\n if (!state.frozen) state.frozen = new InternalWeakMap();\n return nativeDelete.call(this, key) || state.frozen['delete'](key);\n } return nativeDelete.call(this, key);\n },\n has: function has(key) {\n if (isObject(key) && !isExtensible(key)) {\n var state = enforceIternalState(this);\n if (!state.frozen) state.frozen = new InternalWeakMap();\n return nativeHas.call(this, key) || state.frozen.has(key);\n } return nativeHas.call(this, key);\n },\n get: function get(key) {\n if (isObject(key) && !isExtensible(key)) {\n var state = enforceIternalState(this);\n if (!state.frozen) state.frozen = new InternalWeakMap();\n return nativeHas.call(this, key) ? nativeGet.call(this, key) : state.frozen.get(key);\n } return nativeGet.call(this, key);\n },\n set: function set(key, value) {\n if (isObject(key) && !isExtensible(key)) {\n var state = enforceIternalState(this);\n if (!state.frozen) state.frozen = new InternalWeakMap();\n nativeHas.call(this, key) ? nativeSet.call(this, key, value) : state.frozen.set(key, value);\n } else nativeSet.call(this, key, value);\n return this;\n }\n });\n}\n","'use strict';\nvar collection = require('../internals/collection');\nvar collectionWeak = require('../internals/collection-weak');\n\n// `WeakSet` constructor\n// https://tc39.github.io/ecma262/#sec-weakset-constructor\ncollection('WeakSet', function (init) {\n return function WeakSet() { return init(this, arguments.length ? arguments[0] : undefined); };\n}, collectionWeak);\n","// iterable DOM collections\n// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods\nmodule.exports = {\n CSSRuleList: 0,\n CSSStyleDeclaration: 0,\n CSSValueList: 0,\n ClientRectList: 0,\n DOMRectList: 0,\n DOMStringList: 0,\n DOMTokenList: 1,\n DataTransferItemList: 0,\n FileList: 0,\n HTMLAllCollection: 0,\n HTMLCollection: 0,\n HTMLFormElement: 0,\n HTMLSelectElement: 0,\n MediaList: 0,\n MimeTypeArray: 0,\n NamedNodeMap: 0,\n NodeList: 1,\n PaintRequestList: 0,\n Plugin: 0,\n PluginArray: 0,\n SVGLengthList: 0,\n SVGNumberList: 0,\n SVGPathSegList: 0,\n SVGPointList: 0,\n SVGStringList: 0,\n SVGTransformList: 0,\n SourceBufferList: 0,\n StyleSheetList: 0,\n TextTrackCueList: 0,\n TextTrackList: 0,\n TouchList: 0\n};\n","var global = require('../internals/global');\nvar DOMIterables = require('../internals/dom-iterables');\nvar forEach = require('../internals/array-for-each');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nfor (var COLLECTION_NAME in DOMIterables) {\n var Collection = global[COLLECTION_NAME];\n var CollectionPrototype = Collection && Collection.prototype;\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {\n createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);\n } catch (error) {\n CollectionPrototype.forEach = forEach;\n }\n}\n","var global = require('../internals/global');\nvar DOMIterables = require('../internals/dom-iterables');\nvar ArrayIteratorMethods = require('../modules/es.array.iterator');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar ArrayValues = ArrayIteratorMethods.values;\n\nfor (var COLLECTION_NAME in DOMIterables) {\n var Collection = global[COLLECTION_NAME];\n var CollectionPrototype = Collection && Collection.prototype;\n if (CollectionPrototype) {\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype[ITERATOR] !== ArrayValues) try {\n createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);\n } catch (error) {\n CollectionPrototype[ITERATOR] = ArrayValues;\n }\n if (!CollectionPrototype[TO_STRING_TAG]) {\n createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);\n }\n if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {\n createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);\n } catch (error) {\n CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];\n }\n }\n }\n}\n","var $ = require('../internals/export');\nvar global = require('../internals/global');\nvar task = require('../internals/task');\n\nvar FORCED = !global.setImmediate || !global.clearImmediate;\n\n// http://w3c.github.io/setImmediate/\n$({ global: true, bind: true, enumerable: true, forced: FORCED }, {\n // `setImmediate` method\n // http://w3c.github.io/setImmediate/#si-setImmediate\n setImmediate: task.set,\n // `clearImmediate` method\n // http://w3c.github.io/setImmediate/#si-clearImmediate\n clearImmediate: task.clear\n});\n","var $ = require('../internals/export');\nvar global = require('../internals/global');\nvar microtask = require('../internals/microtask');\nvar classof = require('../internals/classof-raw');\n\nvar process = global.process;\nvar isNode = classof(process) == 'process';\n\n// `queueMicrotask` method\n// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask\n$({ global: true, enumerable: true, noTargetGet: true }, {\n queueMicrotask: function queueMicrotask(fn) {\n var domain = isNode && process.domain;\n microtask(domain ? domain.bind(fn) : fn);\n }\n});\n","var fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = !fails(function () {\n var url = new URL('b?a=1&b=2&c=3', 'http://a');\n var searchParams = url.searchParams;\n var result = '';\n url.pathname = 'c%20d';\n searchParams.forEach(function (value, key) {\n searchParams['delete']('b');\n result += key + value;\n });\n return (IS_PURE && !url.toJSON)\n || !searchParams.sort\n || url.href !== 'http://a/c%20d?a=1&c=3'\n || searchParams.get('c') !== '3'\n || String(new URLSearchParams('?a=1')) !== 'a=1'\n || !searchParams[ITERATOR]\n // throws in Edge\n || new URL('https://a@b').username !== 'a'\n || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'\n // not punycoded in Edge\n || new URL('http://тест').host !== 'xn--e1aybc'\n // not escaped in Chrome 62-\n || new URL('http://a#б').hash !== '#%D0%B1'\n // fails in Chrome 66-\n || result !== 'a1c3'\n // throws in Safari\n || new URL('http://x', undefined).host !== 'x';\n});\n","'use strict';\n// based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js\nvar maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\nvar base = 36;\nvar tMin = 1;\nvar tMax = 26;\nvar skew = 38;\nvar damp = 700;\nvar initialBias = 72;\nvar initialN = 128; // 0x80\nvar delimiter = '-'; // '\\x2D'\nvar regexNonASCII = /[^\\0-\\u007E]/; // non-ASCII chars\nvar regexSeparators = /[.\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\nvar OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';\nvar baseMinusTMin = base - tMin;\nvar floor = Math.floor;\nvar stringFromCharCode = String.fromCharCode;\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n */\nvar ucs2decode = function (string) {\n var output = [];\n var counter = 0;\n var length = string.length;\n while (counter < length) {\n var value = string.charCodeAt(counter++);\n if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n // It's a high surrogate, and there is a next character.\n var extra = string.charCodeAt(counter++);\n if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n } else {\n // It's an unmatched surrogate; only append this code unit, in case the\n // next code unit is the high surrogate of a surrogate pair.\n output.push(value);\n counter--;\n }\n } else {\n output.push(value);\n }\n }\n return output;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n */\nvar digitToBasic = function (digit) {\n // 0..25 map to ASCII a..z or A..Z\n // 26..35 map to ASCII 0..9\n return digit + 22 + 75 * (digit < 26);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n */\nvar adapt = function (delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n for (; delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n */\n// eslint-disable-next-line max-statements\nvar encode = function (input) {\n var output = [];\n\n // Convert the input in UCS-2 to an array of Unicode code points.\n input = ucs2decode(input);\n\n // Cache the length.\n var inputLength = input.length;\n\n // Initialize the state.\n var n = initialN;\n var delta = 0;\n var bias = initialBias;\n var i, currentValue;\n\n // Handle the basic code points.\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue < 0x80) {\n output.push(stringFromCharCode(currentValue));\n }\n }\n\n var basicLength = output.length; // number of basic code points.\n var handledCPCount = basicLength; // number of code points that have been handled;\n\n // Finish the basic string with a delimiter unless it's empty.\n if (basicLength) {\n output.push(delimiter);\n }\n\n // Main encoding loop:\n while (handledCPCount < inputLength) {\n // All non-basic code points < n have been handled already. Find the next larger one:\n var m = maxInt;\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue >= n && currentValue < m) {\n m = currentValue;\n }\n }\n\n // Increase `delta` enough to advance the decoder's state to , but guard against overflow.\n var handledCPCountPlusOne = handledCPCount + 1;\n if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n throw RangeError(OVERFLOW_ERROR);\n }\n\n delta += (m - n) * handledCPCountPlusOne;\n n = m;\n\n for (i = 0; i < input.length; i++) {\n currentValue = input[i];\n if (currentValue < n && ++delta > maxInt) {\n throw RangeError(OVERFLOW_ERROR);\n }\n if (currentValue == n) {\n // Represent delta as a generalized variable-length integer.\n var q = delta;\n for (var k = base; /* no condition */; k += base) {\n var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n if (q < t) break;\n var qMinusT = q - t;\n var baseMinusT = base - t;\n output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));\n q = floor(qMinusT / baseMinusT);\n }\n\n output.push(stringFromCharCode(digitToBasic(q)));\n bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n delta = 0;\n ++handledCPCount;\n }\n }\n\n ++delta;\n ++n;\n }\n return output.join('');\n};\n\nmodule.exports = function (input) {\n var encoded = [];\n var labels = input.toLowerCase().replace(regexSeparators, '\\u002E').split('.');\n var i, label;\n for (i = 0; i < labels.length; i++) {\n label = labels[i];\n encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label);\n }\n return encoded.join('.');\n};\n","var anObject = require('../internals/an-object');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nmodule.exports = function (it) {\n var iteratorMethod = getIteratorMethod(it);\n if (typeof iteratorMethod != 'function') {\n throw TypeError(String(it) + ' is not iterable');\n } return anObject(iteratorMethod.call(it));\n};\n","'use strict';\n// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`\nrequire('../modules/es.array.iterator');\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar USE_NATIVE_URL = require('../internals/native-url');\nvar redefine = require('../internals/redefine');\nvar redefineAll = require('../internals/redefine-all');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar InternalStateModule = require('../internals/internal-state');\nvar anInstance = require('../internals/an-instance');\nvar hasOwn = require('../internals/has');\nvar bind = require('../internals/function-bind-context');\nvar classof = require('../internals/classof');\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $fetch = getBuiltIn('fetch');\nvar Headers = getBuiltIn('Headers');\nvar ITERATOR = wellKnownSymbol('iterator');\nvar URL_SEARCH_PARAMS = 'URLSearchParams';\nvar URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);\nvar getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);\n\nvar plus = /\\+/g;\nvar sequences = Array(4);\n\nvar percentSequence = function (bytes) {\n return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\\\da-f]{2}){' + bytes + '})', 'gi'));\n};\n\nvar percentDecode = function (sequence) {\n try {\n return decodeURIComponent(sequence);\n } catch (error) {\n return sequence;\n }\n};\n\nvar deserialize = function (it) {\n var result = it.replace(plus, ' ');\n var bytes = 4;\n try {\n return decodeURIComponent(result);\n } catch (error) {\n while (bytes) {\n result = result.replace(percentSequence(bytes--), percentDecode);\n }\n return result;\n }\n};\n\nvar find = /[!'()~]|%20/g;\n\nvar replace = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+'\n};\n\nvar replacer = function (match) {\n return replace[match];\n};\n\nvar serialize = function (it) {\n return encodeURIComponent(it).replace(find, replacer);\n};\n\nvar parseSearchParams = function (result, query) {\n if (query) {\n var attributes = query.split('&');\n var index = 0;\n var attribute, entry;\n while (index < attributes.length) {\n attribute = attributes[index++];\n if (attribute.length) {\n entry = attribute.split('=');\n result.push({\n key: deserialize(entry.shift()),\n value: deserialize(entry.join('='))\n });\n }\n }\n }\n};\n\nvar updateSearchParams = function (query) {\n this.entries.length = 0;\n parseSearchParams(this.entries, query);\n};\n\nvar validateArgumentsLength = function (passed, required) {\n if (passed < required) throw TypeError('Not enough arguments');\n};\n\nvar URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {\n setInternalState(this, {\n type: URL_SEARCH_PARAMS_ITERATOR,\n iterator: getIterator(getInternalParamsState(params).entries),\n kind: kind\n });\n}, 'Iterator', function next() {\n var state = getInternalIteratorState(this);\n var kind = state.kind;\n var step = state.iterator.next();\n var entry = step.value;\n if (!step.done) {\n step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];\n } return step;\n});\n\n// `URLSearchParams` constructor\n// https://url.spec.whatwg.org/#interface-urlsearchparams\nvar URLSearchParamsConstructor = function URLSearchParams(/* init */) {\n anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);\n var init = arguments.length > 0 ? arguments[0] : undefined;\n var that = this;\n var entries = [];\n var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;\n\n setInternalState(that, {\n type: URL_SEARCH_PARAMS,\n entries: entries,\n updateURL: function () { /* empty */ },\n updateSearchParams: updateSearchParams\n });\n\n if (init !== undefined) {\n if (isObject(init)) {\n iteratorMethod = getIteratorMethod(init);\n if (typeof iteratorMethod === 'function') {\n iterator = iteratorMethod.call(init);\n next = iterator.next;\n while (!(step = next.call(iterator)).done) {\n entryIterator = getIterator(anObject(step.value));\n entryNext = entryIterator.next;\n if (\n (first = entryNext.call(entryIterator)).done ||\n (second = entryNext.call(entryIterator)).done ||\n !entryNext.call(entryIterator).done\n ) throw TypeError('Expected sequence with length 2');\n entries.push({ key: first.value + '', value: second.value + '' });\n }\n } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' });\n } else {\n parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + '');\n }\n }\n};\n\nvar URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;\n\nredefineAll(URLSearchParamsPrototype, {\n // `URLSearchParams.prototype.appent` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-append\n append: function append(name, value) {\n validateArgumentsLength(arguments.length, 2);\n var state = getInternalParamsState(this);\n state.entries.push({ key: name + '', value: value + '' });\n state.updateURL();\n },\n // `URLSearchParams.prototype.delete` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-delete\n 'delete': function (name) {\n validateArgumentsLength(arguments.length, 1);\n var state = getInternalParamsState(this);\n var entries = state.entries;\n var key = name + '';\n var index = 0;\n while (index < entries.length) {\n if (entries[index].key === key) entries.splice(index, 1);\n else index++;\n }\n state.updateURL();\n },\n // `URLSearchParams.prototype.get` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-get\n get: function get(name) {\n validateArgumentsLength(arguments.length, 1);\n var entries = getInternalParamsState(this).entries;\n var key = name + '';\n var index = 0;\n for (; index < entries.length; index++) {\n if (entries[index].key === key) return entries[index].value;\n }\n return null;\n },\n // `URLSearchParams.prototype.getAll` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-getall\n getAll: function getAll(name) {\n validateArgumentsLength(arguments.length, 1);\n var entries = getInternalParamsState(this).entries;\n var key = name + '';\n var result = [];\n var index = 0;\n for (; index < entries.length; index++) {\n if (entries[index].key === key) result.push(entries[index].value);\n }\n return result;\n },\n // `URLSearchParams.prototype.has` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-has\n has: function has(name) {\n validateArgumentsLength(arguments.length, 1);\n var entries = getInternalParamsState(this).entries;\n var key = name + '';\n var index = 0;\n while (index < entries.length) {\n if (entries[index++].key === key) return true;\n }\n return false;\n },\n // `URLSearchParams.prototype.set` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-set\n set: function set(name, value) {\n validateArgumentsLength(arguments.length, 1);\n var state = getInternalParamsState(this);\n var entries = state.entries;\n var found = false;\n var key = name + '';\n var val = value + '';\n var index = 0;\n var entry;\n for (; index < entries.length; index++) {\n entry = entries[index];\n if (entry.key === key) {\n if (found) entries.splice(index--, 1);\n else {\n found = true;\n entry.value = val;\n }\n }\n }\n if (!found) entries.push({ key: key, value: val });\n state.updateURL();\n },\n // `URLSearchParams.prototype.sort` method\n // https://url.spec.whatwg.org/#dom-urlsearchparams-sort\n sort: function sort() {\n var state = getInternalParamsState(this);\n var entries = state.entries;\n // Array#sort is not stable in some engines\n var slice = entries.slice();\n var entry, entriesIndex, sliceIndex;\n entries.length = 0;\n for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {\n entry = slice[sliceIndex];\n for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {\n if (entries[entriesIndex].key > entry.key) {\n entries.splice(entriesIndex, 0, entry);\n break;\n }\n }\n if (entriesIndex === sliceIndex) entries.push(entry);\n }\n state.updateURL();\n },\n // `URLSearchParams.prototype.forEach` method\n forEach: function forEach(callback /* , thisArg */) {\n var entries = getInternalParamsState(this).entries;\n var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);\n var index = 0;\n var entry;\n while (index < entries.length) {\n entry = entries[index++];\n boundFunction(entry.value, entry.key, this);\n }\n },\n // `URLSearchParams.prototype.keys` method\n keys: function keys() {\n return new URLSearchParamsIterator(this, 'keys');\n },\n // `URLSearchParams.prototype.values` method\n values: function values() {\n return new URLSearchParamsIterator(this, 'values');\n },\n // `URLSearchParams.prototype.entries` method\n entries: function entries() {\n return new URLSearchParamsIterator(this, 'entries');\n }\n}, { enumerable: true });\n\n// `URLSearchParams.prototype[@@iterator]` method\nredefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries);\n\n// `URLSearchParams.prototype.toString` method\n// https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior\nredefine(URLSearchParamsPrototype, 'toString', function toString() {\n var entries = getInternalParamsState(this).entries;\n var result = [];\n var index = 0;\n var entry;\n while (index < entries.length) {\n entry = entries[index++];\n result.push(serialize(entry.key) + '=' + serialize(entry.value));\n } return result.join('&');\n}, { enumerable: true });\n\nsetToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);\n\n$({ global: true, forced: !USE_NATIVE_URL }, {\n URLSearchParams: URLSearchParamsConstructor\n});\n\n// Wrap `fetch` for correct work with polyfilled `URLSearchParams`\n// https://github.com/zloirock/core-js/issues/674\nif (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') {\n $({ global: true, enumerable: true, forced: true }, {\n fetch: function fetch(input /* , init */) {\n var args = [input];\n var init, body, headers;\n if (arguments.length > 1) {\n init = arguments[1];\n if (isObject(init)) {\n body = init.body;\n if (classof(body) === URL_SEARCH_PARAMS) {\n headers = init.headers ? new Headers(init.headers) : new Headers();\n if (!headers.has('content-type')) {\n headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n init = create(init, {\n body: createPropertyDescriptor(0, String(body)),\n headers: createPropertyDescriptor(0, headers)\n });\n }\n }\n args.push(init);\n } return $fetch.apply(this, args);\n }\n });\n}\n\nmodule.exports = {\n URLSearchParams: URLSearchParamsConstructor,\n getState: getInternalParamsState\n};\n","'use strict';\n// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`\nrequire('../modules/es.string.iterator');\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar USE_NATIVE_URL = require('../internals/native-url');\nvar global = require('../internals/global');\nvar defineProperties = require('../internals/object-define-properties');\nvar redefine = require('../internals/redefine');\nvar anInstance = require('../internals/an-instance');\nvar has = require('../internals/has');\nvar assign = require('../internals/object-assign');\nvar arrayFrom = require('../internals/array-from');\nvar codeAt = require('../internals/string-multibyte').codeAt;\nvar toASCII = require('../internals/string-punycode-to-ascii');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar URLSearchParamsModule = require('../modules/web.url-search-params');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar NativeURL = global.URL;\nvar URLSearchParams = URLSearchParamsModule.URLSearchParams;\nvar getInternalSearchParamsState = URLSearchParamsModule.getState;\nvar setInternalState = InternalStateModule.set;\nvar getInternalURLState = InternalStateModule.getterFor('URL');\nvar floor = Math.floor;\nvar pow = Math.pow;\n\nvar INVALID_AUTHORITY = 'Invalid authority';\nvar INVALID_SCHEME = 'Invalid scheme';\nvar INVALID_HOST = 'Invalid host';\nvar INVALID_PORT = 'Invalid port';\n\nvar ALPHA = /[A-Za-z]/;\nvar ALPHANUMERIC = /[\\d+-.A-Za-z]/;\nvar DIGIT = /\\d/;\nvar HEX_START = /^(0x|0X)/;\nvar OCT = /^[0-7]+$/;\nvar DEC = /^\\d+$/;\nvar HEX = /^[\\dA-Fa-f]+$/;\n// eslint-disable-next-line no-control-regex\nvar FORBIDDEN_HOST_CODE_POINT = /[\\u0000\\u0009\\u000A\\u000D #%/:?@[\\\\]]/;\n// eslint-disable-next-line no-control-regex\nvar FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\\u0000\\u0009\\u000A\\u000D #/:?@[\\\\]]/;\n// eslint-disable-next-line no-control-regex\nvar LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\\u0000-\\u001F ]+|[\\u0000-\\u001F ]+$/g;\n// eslint-disable-next-line no-control-regex\nvar TAB_AND_NEW_LINE = /[\\u0009\\u000A\\u000D]/g;\nvar EOF;\n\nvar parseHost = function (url, input) {\n var result, codePoints, index;\n if (input.charAt(0) == '[') {\n if (input.charAt(input.length - 1) != ']') return INVALID_HOST;\n result = parseIPv6(input.slice(1, -1));\n if (!result) return INVALID_HOST;\n url.host = result;\n // opaque host\n } else if (!isSpecial(url)) {\n if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;\n result = '';\n codePoints = arrayFrom(input);\n for (index = 0; index < codePoints.length; index++) {\n result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);\n }\n url.host = result;\n } else {\n input = toASCII(input);\n if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;\n result = parseIPv4(input);\n if (result === null) return INVALID_HOST;\n url.host = result;\n }\n};\n\nvar parseIPv4 = function (input) {\n var parts = input.split('.');\n var partsLength, numbers, index, part, radix, number, ipv4;\n if (parts.length && parts[parts.length - 1] == '') {\n parts.pop();\n }\n partsLength = parts.length;\n if (partsLength > 4) return input;\n numbers = [];\n for (index = 0; index < partsLength; index++) {\n part = parts[index];\n if (part == '') return input;\n radix = 10;\n if (part.length > 1 && part.charAt(0) == '0') {\n radix = HEX_START.test(part) ? 16 : 8;\n part = part.slice(radix == 8 ? 1 : 2);\n }\n if (part === '') {\n number = 0;\n } else {\n if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;\n number = parseInt(part, radix);\n }\n numbers.push(number);\n }\n for (index = 0; index < partsLength; index++) {\n number = numbers[index];\n if (index == partsLength - 1) {\n if (number >= pow(256, 5 - partsLength)) return null;\n } else if (number > 255) return null;\n }\n ipv4 = numbers.pop();\n for (index = 0; index < numbers.length; index++) {\n ipv4 += numbers[index] * pow(256, 3 - index);\n }\n return ipv4;\n};\n\n// eslint-disable-next-line max-statements\nvar parseIPv6 = function (input) {\n var address = [0, 0, 0, 0, 0, 0, 0, 0];\n var pieceIndex = 0;\n var compress = null;\n var pointer = 0;\n var value, length, numbersSeen, ipv4Piece, number, swaps, swap;\n\n var char = function () {\n return input.charAt(pointer);\n };\n\n if (char() == ':') {\n if (input.charAt(1) != ':') return;\n pointer += 2;\n pieceIndex++;\n compress = pieceIndex;\n }\n while (char()) {\n if (pieceIndex == 8) return;\n if (char() == ':') {\n if (compress !== null) return;\n pointer++;\n pieceIndex++;\n compress = pieceIndex;\n continue;\n }\n value = length = 0;\n while (length < 4 && HEX.test(char())) {\n value = value * 16 + parseInt(char(), 16);\n pointer++;\n length++;\n }\n if (char() == '.') {\n if (length == 0) return;\n pointer -= length;\n if (pieceIndex > 6) return;\n numbersSeen = 0;\n while (char()) {\n ipv4Piece = null;\n if (numbersSeen > 0) {\n if (char() == '.' && numbersSeen < 4) pointer++;\n else return;\n }\n if (!DIGIT.test(char())) return;\n while (DIGIT.test(char())) {\n number = parseInt(char(), 10);\n if (ipv4Piece === null) ipv4Piece = number;\n else if (ipv4Piece == 0) return;\n else ipv4Piece = ipv4Piece * 10 + number;\n if (ipv4Piece > 255) return;\n pointer++;\n }\n address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;\n numbersSeen++;\n if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;\n }\n if (numbersSeen != 4) return;\n break;\n } else if (char() == ':') {\n pointer++;\n if (!char()) return;\n } else if (char()) return;\n address[pieceIndex++] = value;\n }\n if (compress !== null) {\n swaps = pieceIndex - compress;\n pieceIndex = 7;\n while (pieceIndex != 0 && swaps > 0) {\n swap = address[pieceIndex];\n address[pieceIndex--] = address[compress + swaps - 1];\n address[compress + --swaps] = swap;\n }\n } else if (pieceIndex != 8) return;\n return address;\n};\n\nvar findLongestZeroSequence = function (ipv6) {\n var maxIndex = null;\n var maxLength = 1;\n var currStart = null;\n var currLength = 0;\n var index = 0;\n for (; index < 8; index++) {\n if (ipv6[index] !== 0) {\n if (currLength > maxLength) {\n maxIndex = currStart;\n maxLength = currLength;\n }\n currStart = null;\n currLength = 0;\n } else {\n if (currStart === null) currStart = index;\n ++currLength;\n }\n }\n if (currLength > maxLength) {\n maxIndex = currStart;\n maxLength = currLength;\n }\n return maxIndex;\n};\n\nvar serializeHost = function (host) {\n var result, index, compress, ignore0;\n // ipv4\n if (typeof host == 'number') {\n result = [];\n for (index = 0; index < 4; index++) {\n result.unshift(host % 256);\n host = floor(host / 256);\n } return result.join('.');\n // ipv6\n } else if (typeof host == 'object') {\n result = '';\n compress = findLongestZeroSequence(host);\n for (index = 0; index < 8; index++) {\n if (ignore0 && host[index] === 0) continue;\n if (ignore0) ignore0 = false;\n if (compress === index) {\n result += index ? ':' : '::';\n ignore0 = true;\n } else {\n result += host[index].toString(16);\n if (index < 7) result += ':';\n }\n }\n return '[' + result + ']';\n } return host;\n};\n\nvar C0ControlPercentEncodeSet = {};\nvar fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {\n ' ': 1, '\"': 1, '<': 1, '>': 1, '`': 1\n});\nvar pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {\n '#': 1, '?': 1, '{': 1, '}': 1\n});\nvar userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {\n '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\\\': 1, ']': 1, '^': 1, '|': 1\n});\n\nvar percentEncode = function (char, set) {\n var code = codeAt(char, 0);\n return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char);\n};\n\nvar specialSchemes = {\n ftp: 21,\n file: null,\n http: 80,\n https: 443,\n ws: 80,\n wss: 443\n};\n\nvar isSpecial = function (url) {\n return has(specialSchemes, url.scheme);\n};\n\nvar includesCredentials = function (url) {\n return url.username != '' || url.password != '';\n};\n\nvar cannotHaveUsernamePasswordPort = function (url) {\n return !url.host || url.cannotBeABaseURL || url.scheme == 'file';\n};\n\nvar isWindowsDriveLetter = function (string, normalized) {\n var second;\n return string.length == 2 && ALPHA.test(string.charAt(0))\n && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));\n};\n\nvar startsWithWindowsDriveLetter = function (string) {\n var third;\n return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (\n string.length == 2 ||\n ((third = string.charAt(2)) === '/' || third === '\\\\' || third === '?' || third === '#')\n );\n};\n\nvar shortenURLsPath = function (url) {\n var path = url.path;\n var pathSize = path.length;\n if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {\n path.pop();\n }\n};\n\nvar isSingleDot = function (segment) {\n return segment === '.' || segment.toLowerCase() === '%2e';\n};\n\nvar isDoubleDot = function (segment) {\n segment = segment.toLowerCase();\n return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';\n};\n\n// States:\nvar SCHEME_START = {};\nvar SCHEME = {};\nvar NO_SCHEME = {};\nvar SPECIAL_RELATIVE_OR_AUTHORITY = {};\nvar PATH_OR_AUTHORITY = {};\nvar RELATIVE = {};\nvar RELATIVE_SLASH = {};\nvar SPECIAL_AUTHORITY_SLASHES = {};\nvar SPECIAL_AUTHORITY_IGNORE_SLASHES = {};\nvar AUTHORITY = {};\nvar HOST = {};\nvar HOSTNAME = {};\nvar PORT = {};\nvar FILE = {};\nvar FILE_SLASH = {};\nvar FILE_HOST = {};\nvar PATH_START = {};\nvar PATH = {};\nvar CANNOT_BE_A_BASE_URL_PATH = {};\nvar QUERY = {};\nvar FRAGMENT = {};\n\n// eslint-disable-next-line max-statements\nvar parseURL = function (url, input, stateOverride, base) {\n var state = stateOverride || SCHEME_START;\n var pointer = 0;\n var buffer = '';\n var seenAt = false;\n var seenBracket = false;\n var seenPasswordToken = false;\n var codePoints, char, bufferCodePoints, failure;\n\n if (!stateOverride) {\n url.scheme = '';\n url.username = '';\n url.password = '';\n url.host = null;\n url.port = null;\n url.path = [];\n url.query = null;\n url.fragment = null;\n url.cannotBeABaseURL = false;\n input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');\n }\n\n input = input.replace(TAB_AND_NEW_LINE, '');\n\n codePoints = arrayFrom(input);\n\n while (pointer <= codePoints.length) {\n char = codePoints[pointer];\n switch (state) {\n case SCHEME_START:\n if (char && ALPHA.test(char)) {\n buffer += char.toLowerCase();\n state = SCHEME;\n } else if (!stateOverride) {\n state = NO_SCHEME;\n continue;\n } else return INVALID_SCHEME;\n break;\n\n case SCHEME:\n if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) {\n buffer += char.toLowerCase();\n } else if (char == ':') {\n if (stateOverride && (\n (isSpecial(url) != has(specialSchemes, buffer)) ||\n (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||\n (url.scheme == 'file' && !url.host)\n )) return;\n url.scheme = buffer;\n if (stateOverride) {\n if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;\n return;\n }\n buffer = '';\n if (url.scheme == 'file') {\n state = FILE;\n } else if (isSpecial(url) && base && base.scheme == url.scheme) {\n state = SPECIAL_RELATIVE_OR_AUTHORITY;\n } else if (isSpecial(url)) {\n state = SPECIAL_AUTHORITY_SLASHES;\n } else if (codePoints[pointer + 1] == '/') {\n state = PATH_OR_AUTHORITY;\n pointer++;\n } else {\n url.cannotBeABaseURL = true;\n url.path.push('');\n state = CANNOT_BE_A_BASE_URL_PATH;\n }\n } else if (!stateOverride) {\n buffer = '';\n state = NO_SCHEME;\n pointer = 0;\n continue;\n } else return INVALID_SCHEME;\n break;\n\n case NO_SCHEME:\n if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME;\n if (base.cannotBeABaseURL && char == '#') {\n url.scheme = base.scheme;\n url.path = base.path.slice();\n url.query = base.query;\n url.fragment = '';\n url.cannotBeABaseURL = true;\n state = FRAGMENT;\n break;\n }\n state = base.scheme == 'file' ? FILE : RELATIVE;\n continue;\n\n case SPECIAL_RELATIVE_OR_AUTHORITY:\n if (char == '/' && codePoints[pointer + 1] == '/') {\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n pointer++;\n } else {\n state = RELATIVE;\n continue;\n } break;\n\n case PATH_OR_AUTHORITY:\n if (char == '/') {\n state = AUTHORITY;\n break;\n } else {\n state = PATH;\n continue;\n }\n\n case RELATIVE:\n url.scheme = base.scheme;\n if (char == EOF) {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.query = base.query;\n } else if (char == '/' || (char == '\\\\' && isSpecial(url))) {\n state = RELATIVE_SLASH;\n } else if (char == '?') {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.query = base.query;\n url.fragment = '';\n state = FRAGMENT;\n } else {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n url.path = base.path.slice();\n url.path.pop();\n state = PATH;\n continue;\n } break;\n\n case RELATIVE_SLASH:\n if (isSpecial(url) && (char == '/' || char == '\\\\')) {\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n } else if (char == '/') {\n state = AUTHORITY;\n } else {\n url.username = base.username;\n url.password = base.password;\n url.host = base.host;\n url.port = base.port;\n state = PATH;\n continue;\n } break;\n\n case SPECIAL_AUTHORITY_SLASHES:\n state = SPECIAL_AUTHORITY_IGNORE_SLASHES;\n if (char != '/' || buffer.charAt(pointer + 1) != '/') continue;\n pointer++;\n break;\n\n case SPECIAL_AUTHORITY_IGNORE_SLASHES:\n if (char != '/' && char != '\\\\') {\n state = AUTHORITY;\n continue;\n } break;\n\n case AUTHORITY:\n if (char == '@') {\n if (seenAt) buffer = '%40' + buffer;\n seenAt = true;\n bufferCodePoints = arrayFrom(buffer);\n for (var i = 0; i < bufferCodePoints.length; i++) {\n var codePoint = bufferCodePoints[i];\n if (codePoint == ':' && !seenPasswordToken) {\n seenPasswordToken = true;\n continue;\n }\n var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);\n if (seenPasswordToken) url.password += encodedCodePoints;\n else url.username += encodedCodePoints;\n }\n buffer = '';\n } else if (\n char == EOF || char == '/' || char == '?' || char == '#' ||\n (char == '\\\\' && isSpecial(url))\n ) {\n if (seenAt && buffer == '') return INVALID_AUTHORITY;\n pointer -= arrayFrom(buffer).length + 1;\n buffer = '';\n state = HOST;\n } else buffer += char;\n break;\n\n case HOST:\n case HOSTNAME:\n if (stateOverride && url.scheme == 'file') {\n state = FILE_HOST;\n continue;\n } else if (char == ':' && !seenBracket) {\n if (buffer == '') return INVALID_HOST;\n failure = parseHost(url, buffer);\n if (failure) return failure;\n buffer = '';\n state = PORT;\n if (stateOverride == HOSTNAME) return;\n } else if (\n char == EOF || char == '/' || char == '?' || char == '#' ||\n (char == '\\\\' && isSpecial(url))\n ) {\n if (isSpecial(url) && buffer == '') return INVALID_HOST;\n if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;\n failure = parseHost(url, buffer);\n if (failure) return failure;\n buffer = '';\n state = PATH_START;\n if (stateOverride) return;\n continue;\n } else {\n if (char == '[') seenBracket = true;\n else if (char == ']') seenBracket = false;\n buffer += char;\n } break;\n\n case PORT:\n if (DIGIT.test(char)) {\n buffer += char;\n } else if (\n char == EOF || char == '/' || char == '?' || char == '#' ||\n (char == '\\\\' && isSpecial(url)) ||\n stateOverride\n ) {\n if (buffer != '') {\n var port = parseInt(buffer, 10);\n if (port > 0xFFFF) return INVALID_PORT;\n url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;\n buffer = '';\n }\n if (stateOverride) return;\n state = PATH_START;\n continue;\n } else return INVALID_PORT;\n break;\n\n case FILE:\n url.scheme = 'file';\n if (char == '/' || char == '\\\\') state = FILE_SLASH;\n else if (base && base.scheme == 'file') {\n if (char == EOF) {\n url.host = base.host;\n url.path = base.path.slice();\n url.query = base.query;\n } else if (char == '?') {\n url.host = base.host;\n url.path = base.path.slice();\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.host = base.host;\n url.path = base.path.slice();\n url.query = base.query;\n url.fragment = '';\n state = FRAGMENT;\n } else {\n if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {\n url.host = base.host;\n url.path = base.path.slice();\n shortenURLsPath(url);\n }\n state = PATH;\n continue;\n }\n } else {\n state = PATH;\n continue;\n } break;\n\n case FILE_SLASH:\n if (char == '/' || char == '\\\\') {\n state = FILE_HOST;\n break;\n }\n if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {\n if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);\n else url.host = base.host;\n }\n state = PATH;\n continue;\n\n case FILE_HOST:\n if (char == EOF || char == '/' || char == '\\\\' || char == '?' || char == '#') {\n if (!stateOverride && isWindowsDriveLetter(buffer)) {\n state = PATH;\n } else if (buffer == '') {\n url.host = '';\n if (stateOverride) return;\n state = PATH_START;\n } else {\n failure = parseHost(url, buffer);\n if (failure) return failure;\n if (url.host == 'localhost') url.host = '';\n if (stateOverride) return;\n buffer = '';\n state = PATH_START;\n } continue;\n } else buffer += char;\n break;\n\n case PATH_START:\n if (isSpecial(url)) {\n state = PATH;\n if (char != '/' && char != '\\\\') continue;\n } else if (!stateOverride && char == '?') {\n url.query = '';\n state = QUERY;\n } else if (!stateOverride && char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (char != EOF) {\n state = PATH;\n if (char != '/') continue;\n } break;\n\n case PATH:\n if (\n char == EOF || char == '/' ||\n (char == '\\\\' && isSpecial(url)) ||\n (!stateOverride && (char == '?' || char == '#'))\n ) {\n if (isDoubleDot(buffer)) {\n shortenURLsPath(url);\n if (char != '/' && !(char == '\\\\' && isSpecial(url))) {\n url.path.push('');\n }\n } else if (isSingleDot(buffer)) {\n if (char != '/' && !(char == '\\\\' && isSpecial(url))) {\n url.path.push('');\n }\n } else {\n if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {\n if (url.host) url.host = '';\n buffer = buffer.charAt(0) + ':'; // normalize windows drive letter\n }\n url.path.push(buffer);\n }\n buffer = '';\n if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) {\n while (url.path.length > 1 && url.path[0] === '') {\n url.path.shift();\n }\n }\n if (char == '?') {\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n }\n } else {\n buffer += percentEncode(char, pathPercentEncodeSet);\n } break;\n\n case CANNOT_BE_A_BASE_URL_PATH:\n if (char == '?') {\n url.query = '';\n state = QUERY;\n } else if (char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (char != EOF) {\n url.path[0] += percentEncode(char, C0ControlPercentEncodeSet);\n } break;\n\n case QUERY:\n if (!stateOverride && char == '#') {\n url.fragment = '';\n state = FRAGMENT;\n } else if (char != EOF) {\n if (char == \"'\" && isSpecial(url)) url.query += '%27';\n else if (char == '#') url.query += '%23';\n else url.query += percentEncode(char, C0ControlPercentEncodeSet);\n } break;\n\n case FRAGMENT:\n if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet);\n break;\n }\n\n pointer++;\n }\n};\n\n// `URL` constructor\n// https://url.spec.whatwg.org/#url-class\nvar URLConstructor = function URL(url /* , base */) {\n var that = anInstance(this, URLConstructor, 'URL');\n var base = arguments.length > 1 ? arguments[1] : undefined;\n var urlString = String(url);\n var state = setInternalState(that, { type: 'URL' });\n var baseState, failure;\n if (base !== undefined) {\n if (base instanceof URLConstructor) baseState = getInternalURLState(base);\n else {\n failure = parseURL(baseState = {}, String(base));\n if (failure) throw TypeError(failure);\n }\n }\n failure = parseURL(state, urlString, null, baseState);\n if (failure) throw TypeError(failure);\n var searchParams = state.searchParams = new URLSearchParams();\n var searchParamsState = getInternalSearchParamsState(searchParams);\n searchParamsState.updateSearchParams(state.query);\n searchParamsState.updateURL = function () {\n state.query = String(searchParams) || null;\n };\n if (!DESCRIPTORS) {\n that.href = serializeURL.call(that);\n that.origin = getOrigin.call(that);\n that.protocol = getProtocol.call(that);\n that.username = getUsername.call(that);\n that.password = getPassword.call(that);\n that.host = getHost.call(that);\n that.hostname = getHostname.call(that);\n that.port = getPort.call(that);\n that.pathname = getPathname.call(that);\n that.search = getSearch.call(that);\n that.searchParams = getSearchParams.call(that);\n that.hash = getHash.call(that);\n }\n};\n\nvar URLPrototype = URLConstructor.prototype;\n\nvar serializeURL = function () {\n var url = getInternalURLState(this);\n var scheme = url.scheme;\n var username = url.username;\n var password = url.password;\n var host = url.host;\n var port = url.port;\n var path = url.path;\n var query = url.query;\n var fragment = url.fragment;\n var output = scheme + ':';\n if (host !== null) {\n output += '//';\n if (includesCredentials(url)) {\n output += username + (password ? ':' + password : '') + '@';\n }\n output += serializeHost(host);\n if (port !== null) output += ':' + port;\n } else if (scheme == 'file') output += '//';\n output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';\n if (query !== null) output += '?' + query;\n if (fragment !== null) output += '#' + fragment;\n return output;\n};\n\nvar getOrigin = function () {\n var url = getInternalURLState(this);\n var scheme = url.scheme;\n var port = url.port;\n if (scheme == 'blob') try {\n return new URL(scheme.path[0]).origin;\n } catch (error) {\n return 'null';\n }\n if (scheme == 'file' || !isSpecial(url)) return 'null';\n return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');\n};\n\nvar getProtocol = function () {\n return getInternalURLState(this).scheme + ':';\n};\n\nvar getUsername = function () {\n return getInternalURLState(this).username;\n};\n\nvar getPassword = function () {\n return getInternalURLState(this).password;\n};\n\nvar getHost = function () {\n var url = getInternalURLState(this);\n var host = url.host;\n var port = url.port;\n return host === null ? ''\n : port === null ? serializeHost(host)\n : serializeHost(host) + ':' + port;\n};\n\nvar getHostname = function () {\n var host = getInternalURLState(this).host;\n return host === null ? '' : serializeHost(host);\n};\n\nvar getPort = function () {\n var port = getInternalURLState(this).port;\n return port === null ? '' : String(port);\n};\n\nvar getPathname = function () {\n var url = getInternalURLState(this);\n var path = url.path;\n return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';\n};\n\nvar getSearch = function () {\n var query = getInternalURLState(this).query;\n return query ? '?' + query : '';\n};\n\nvar getSearchParams = function () {\n return getInternalURLState(this).searchParams;\n};\n\nvar getHash = function () {\n var fragment = getInternalURLState(this).fragment;\n return fragment ? '#' + fragment : '';\n};\n\nvar accessorDescriptor = function (getter, setter) {\n return { get: getter, set: setter, configurable: true, enumerable: true };\n};\n\nif (DESCRIPTORS) {\n defineProperties(URLPrototype, {\n // `URL.prototype.href` accessors pair\n // https://url.spec.whatwg.org/#dom-url-href\n href: accessorDescriptor(serializeURL, function (href) {\n var url = getInternalURLState(this);\n var urlString = String(href);\n var failure = parseURL(url, urlString);\n if (failure) throw TypeError(failure);\n getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);\n }),\n // `URL.prototype.origin` getter\n // https://url.spec.whatwg.org/#dom-url-origin\n origin: accessorDescriptor(getOrigin),\n // `URL.prototype.protocol` accessors pair\n // https://url.spec.whatwg.org/#dom-url-protocol\n protocol: accessorDescriptor(getProtocol, function (protocol) {\n var url = getInternalURLState(this);\n parseURL(url, String(protocol) + ':', SCHEME_START);\n }),\n // `URL.prototype.username` accessors pair\n // https://url.spec.whatwg.org/#dom-url-username\n username: accessorDescriptor(getUsername, function (username) {\n var url = getInternalURLState(this);\n var codePoints = arrayFrom(String(username));\n if (cannotHaveUsernamePasswordPort(url)) return;\n url.username = '';\n for (var i = 0; i < codePoints.length; i++) {\n url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);\n }\n }),\n // `URL.prototype.password` accessors pair\n // https://url.spec.whatwg.org/#dom-url-password\n password: accessorDescriptor(getPassword, function (password) {\n var url = getInternalURLState(this);\n var codePoints = arrayFrom(String(password));\n if (cannotHaveUsernamePasswordPort(url)) return;\n url.password = '';\n for (var i = 0; i < codePoints.length; i++) {\n url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);\n }\n }),\n // `URL.prototype.host` accessors pair\n // https://url.spec.whatwg.org/#dom-url-host\n host: accessorDescriptor(getHost, function (host) {\n var url = getInternalURLState(this);\n if (url.cannotBeABaseURL) return;\n parseURL(url, String(host), HOST);\n }),\n // `URL.prototype.hostname` accessors pair\n // https://url.spec.whatwg.org/#dom-url-hostname\n hostname: accessorDescriptor(getHostname, function (hostname) {\n var url = getInternalURLState(this);\n if (url.cannotBeABaseURL) return;\n parseURL(url, String(hostname), HOSTNAME);\n }),\n // `URL.prototype.port` accessors pair\n // https://url.spec.whatwg.org/#dom-url-port\n port: accessorDescriptor(getPort, function (port) {\n var url = getInternalURLState(this);\n if (cannotHaveUsernamePasswordPort(url)) return;\n port = String(port);\n if (port == '') url.port = null;\n else parseURL(url, port, PORT);\n }),\n // `URL.prototype.pathname` accessors pair\n // https://url.spec.whatwg.org/#dom-url-pathname\n pathname: accessorDescriptor(getPathname, function (pathname) {\n var url = getInternalURLState(this);\n if (url.cannotBeABaseURL) return;\n url.path = [];\n parseURL(url, pathname + '', PATH_START);\n }),\n // `URL.prototype.search` accessors pair\n // https://url.spec.whatwg.org/#dom-url-search\n search: accessorDescriptor(getSearch, function (search) {\n var url = getInternalURLState(this);\n search = String(search);\n if (search == '') {\n url.query = null;\n } else {\n if ('?' == search.charAt(0)) search = search.slice(1);\n url.query = '';\n parseURL(url, search, QUERY);\n }\n getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);\n }),\n // `URL.prototype.searchParams` getter\n // https://url.spec.whatwg.org/#dom-url-searchparams\n searchParams: accessorDescriptor(getSearchParams),\n // `URL.prototype.hash` accessors pair\n // https://url.spec.whatwg.org/#dom-url-hash\n hash: accessorDescriptor(getHash, function (hash) {\n var url = getInternalURLState(this);\n hash = String(hash);\n if (hash == '') {\n url.fragment = null;\n return;\n }\n if ('#' == hash.charAt(0)) hash = hash.slice(1);\n url.fragment = '';\n parseURL(url, hash, FRAGMENT);\n })\n });\n}\n\n// `URL.prototype.toJSON` method\n// https://url.spec.whatwg.org/#dom-url-tojson\nredefine(URLPrototype, 'toJSON', function toJSON() {\n return serializeURL.call(this);\n}, { enumerable: true });\n\n// `URL.prototype.toString` method\n// https://url.spec.whatwg.org/#URL-stringification-behavior\nredefine(URLPrototype, 'toString', function toString() {\n return serializeURL.call(this);\n}, { enumerable: true });\n\nif (NativeURL) {\n var nativeCreateObjectURL = NativeURL.createObjectURL;\n var nativeRevokeObjectURL = NativeURL.revokeObjectURL;\n // `URL.createObjectURL` method\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL\n // eslint-disable-next-line no-unused-vars\n if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {\n return nativeCreateObjectURL.apply(NativeURL, arguments);\n });\n // `URL.revokeObjectURL` method\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL\n // eslint-disable-next-line no-unused-vars\n if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {\n return nativeRevokeObjectURL.apply(NativeURL, arguments);\n });\n}\n\nsetToStringTag(URLConstructor, 'URL');\n\n$({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {\n URL: URLConstructor\n});\n","'use strict';\nvar $ = require('../internals/export');\n\n// `URL.prototype.toJSON` method\n// https://url.spec.whatwg.org/#dom-url-tojson\n$({ target: 'URL', proto: true, enumerable: true }, {\n toJSON: function toJSON() {\n return URL.prototype.toString.call(this);\n }\n});\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","// http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript/\n/**\n *\n * @param {Event} ev\n * @returns {void}\n */\nfunction touchHandler (ev) {\n const {changedTouches} = ev,\n first = changedTouches[0];\n\n let type = '';\n switch (ev.type) {\n case 'touchstart': type = 'mousedown'; break;\n case 'touchmove': type = 'mousemove'; break;\n case 'touchend': type = 'mouseup'; break;\n default: return;\n }\n\n const {screenX, screenY, clientX, clientY} = first; // eslint-disable-line no-shadow\n const simulatedEvent = new MouseEvent(type, {\n // Event interface\n bubbles: true,\n cancelable: true,\n // UIEvent interface\n view: window,\n detail: 1, // click count\n // MouseEvent interface (customized)\n screenX, screenY, clientX, clientY,\n // MouseEvent interface (defaults) - these could be removed\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n button: 0, // main button (usually left)\n relatedTarget: null\n });\n if (changedTouches.length < 2) {\n first.target.dispatchEvent(simulatedEvent);\n ev.preventDefault();\n }\n}\n\ndocument.addEventListener('touchstart', touchHandler, true);\ndocument.addEventListener('touchmove', touchHandler, true);\ndocument.addEventListener('touchend', touchHandler, true);\ndocument.addEventListener('touchcancel', touchHandler, true);\n","/**\n * Namespaces or tools therefor.\n * @module namespaces\n * @license MIT\n*/\n\n/**\n* Common namepaces constants in alpha order.\n* @enum {string}\n* @type {PlainObject}\n* @memberof module:namespaces\n*/\nexport const NS = {\n HTML: 'http://www.w3.org/1999/xhtml',\n MATH: 'http://www.w3.org/1998/Math/MathML',\n SE: 'http://svg-edit.googlecode.com',\n SVG: 'http://www.w3.org/2000/svg',\n XLINK: 'http://www.w3.org/1999/xlink',\n XML: 'http://www.w3.org/XML/1998/namespace',\n XMLNS: 'http://www.w3.org/2000/xmlns/' // see http://www.w3.org/TR/REC-xml-names/#xmlReserved\n};\n\n/**\n* @function module:namespaces.getReverseNS\n* @returns {string} The NS with key values switched and lowercase\n*/\nexport const getReverseNS = function () {\n const reverseNS = {};\n Object.entries(NS).forEach(([name, URI]) => {\n reverseNS[URI] = name.toLowerCase();\n });\n return reverseNS;\n};\n","/* eslint-disable import/unambiguous, max-len */\n/* globals SVGPathSeg, SVGPathSegMovetoRel, SVGPathSegMovetoAbs,\n SVGPathSegMovetoRel, SVGPathSegLinetoRel, SVGPathSegLinetoAbs,\n SVGPathSegLinetoHorizontalRel, SVGPathSegLinetoHorizontalAbs,\n SVGPathSegLinetoVerticalRel, SVGPathSegLinetoVerticalAbs,\n SVGPathSegClosePath, SVGPathSegCurvetoCubicRel,\n SVGPathSegCurvetoCubicAbs, SVGPathSegCurvetoCubicSmoothRel,\n SVGPathSegCurvetoCubicSmoothAbs, SVGPathSegCurvetoQuadraticRel,\n SVGPathSegCurvetoQuadraticAbs, SVGPathSegCurvetoQuadraticSmoothRel,\n SVGPathSegCurvetoQuadraticSmoothAbs, SVGPathSegArcRel, SVGPathSegArcAbs */\n/**\n* SVGPathSeg API polyfill\n* https://github.com/progers/pathseg\n*\n* This is a drop-in replacement for the `SVGPathSeg` and `SVGPathSegList` APIs\n* that were removed from SVG2 ({@link https://lists.w3.org/Archives/Public/www-svg/2015Jun/0044.html}),\n* including the latest spec changes which were implemented in Firefox 43 and\n* Chrome 46.\n*/\n/* eslint-disable no-shadow, class-methods-use-this, jsdoc/require-jsdoc */\n// Linting: We avoid `no-shadow` as ESLint thinks these are still available globals\n// Linting: We avoid `class-methods-use-this` as this is a polyfill that must\n// follow the conventions\n(() => {\nif (!('SVGPathSeg' in window)) {\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSeg\n class SVGPathSeg {\n constructor (type, typeAsLetter, owningPathSegList) {\n this.pathSegType = type;\n this.pathSegTypeAsLetter = typeAsLetter;\n this._owningPathSegList = owningPathSegList;\n }\n // Notify owning PathSegList on any changes so they can be synchronized back to the path element.\n _segmentChanged () {\n if (this._owningPathSegList) {\n this._owningPathSegList.segmentChanged(this);\n }\n }\n }\n SVGPathSeg.prototype.classname = 'SVGPathSeg';\n\n SVGPathSeg.PATHSEG_UNKNOWN = 0;\n SVGPathSeg.PATHSEG_CLOSEPATH = 1;\n SVGPathSeg.PATHSEG_MOVETO_ABS = 2;\n SVGPathSeg.PATHSEG_MOVETO_REL = 3;\n SVGPathSeg.PATHSEG_LINETO_ABS = 4;\n SVGPathSeg.PATHSEG_LINETO_REL = 5;\n SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS = 6;\n SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL = 7;\n SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS = 8;\n SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL = 9;\n SVGPathSeg.PATHSEG_ARC_ABS = 10;\n SVGPathSeg.PATHSEG_ARC_REL = 11;\n SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS = 12;\n SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL = 13;\n SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS = 14;\n SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL = 15;\n SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16;\n SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17;\n SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18;\n SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19;\n\n class SVGPathSegClosePath extends SVGPathSeg {\n constructor (owningPathSegList) {\n super(SVGPathSeg.PATHSEG_CLOSEPATH, 'z', owningPathSegList);\n }\n toString () { return '[object SVGPathSegClosePath]'; }\n _asPathString () { return this.pathSegTypeAsLetter; }\n clone () { return new SVGPathSegClosePath(undefined); }\n }\n\n class SVGPathSegMovetoAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_MOVETO_ABS, 'M', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegMovetoAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegMovetoAbs(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegMovetoAbs.prototype, {\n x: {\n get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true\n },\n y: {\n get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true\n }\n });\n\n class SVGPathSegMovetoRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_MOVETO_REL, 'm', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegMovetoRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegMovetoRel(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegMovetoRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegLinetoAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_LINETO_ABS, 'L', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegLinetoAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegLinetoAbs(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegLinetoAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegLinetoRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_LINETO_REL, 'l', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegLinetoRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegLinetoRel(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegLinetoRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoCubicAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x1, y1, x2, y2) {\n super(SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS, 'C', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x1 = x1;\n this._y1 = y1;\n this._x2 = x2;\n this._y2 = y2;\n }\n toString () { return '[object SVGPathSegCurvetoCubicAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoCubicAbs(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); }\n }\n Object.defineProperties(SVGPathSegCurvetoCubicAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},\n y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true},\n x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},\n y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoCubicRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x1, y1, x2, y2) {\n super(SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, 'c', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x1 = x1;\n this._y1 = y1;\n this._x2 = x2;\n this._y2 = y2;\n }\n toString () { return '[object SVGPathSegCurvetoCubicRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoCubicRel(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); }\n }\n Object.defineProperties(SVGPathSegCurvetoCubicRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},\n y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true},\n x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},\n y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x1, y1) {\n super(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS, 'Q', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x1 = x1;\n this._y1 = y1;\n }\n toString () { return '[object SVGPathSegCurvetoQuadraticAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoQuadraticAbs(undefined, this._x, this._y, this._x1, this._y1); }\n }\n Object.defineProperties(SVGPathSegCurvetoQuadraticAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},\n y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoQuadraticRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x1, y1) {\n super(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL, 'q', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x1 = x1;\n this._y1 = y1;\n }\n toString () { return '[object SVGPathSegCurvetoQuadraticRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoQuadraticRel(undefined, this._x, this._y, this._x1, this._y1); }\n }\n Object.defineProperties(SVGPathSegCurvetoQuadraticRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},\n y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegArcAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {\n super(SVGPathSeg.PATHSEG_ARC_ABS, 'A', owningPathSegList);\n this._x = x;\n this._y = y;\n this._r1 = r1;\n this._r2 = r2;\n this._angle = angle;\n this._largeArcFlag = largeArcFlag;\n this._sweepFlag = sweepFlag;\n }\n toString () { return '[object SVGPathSegArcAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._r1 + ' ' + this._r2 + ' ' + this._angle + ' ' + (this._largeArcFlag ? '1' : '0') + ' ' + (this._sweepFlag ? '1' : '0') + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegArcAbs(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); }\n }\n Object.defineProperties(SVGPathSegArcAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n r1: {get () { return this._r1; }, set (r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true},\n r2: {get () { return this._r2; }, set (r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true},\n angle: {get () { return this._angle; }, set (angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true},\n largeArcFlag: {get () { return this._largeArcFlag; }, set (largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true},\n sweepFlag: {get () { return this._sweepFlag; }, set (sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegArcRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {\n super(SVGPathSeg.PATHSEG_ARC_REL, 'a', owningPathSegList);\n this._x = x;\n this._y = y;\n this._r1 = r1;\n this._r2 = r2;\n this._angle = angle;\n this._largeArcFlag = largeArcFlag;\n this._sweepFlag = sweepFlag;\n }\n toString () { return '[object SVGPathSegArcRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._r1 + ' ' + this._r2 + ' ' + this._angle + ' ' + (this._largeArcFlag ? '1' : '0') + ' ' + (this._sweepFlag ? '1' : '0') + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegArcRel(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); }\n }\n Object.defineProperties(SVGPathSegArcRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n r1: {get () { return this._r1; }, set (r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true},\n r2: {get () { return this._r2; }, set (r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true},\n angle: {get () { return this._angle; }, set (angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true},\n largeArcFlag: {get () { return this._largeArcFlag; }, set (largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true},\n sweepFlag: {get () { return this._sweepFlag; }, set (sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegLinetoHorizontalAbs extends SVGPathSeg {\n constructor (owningPathSegList, x) {\n super(SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, 'H', owningPathSegList);\n this._x = x;\n }\n toString () { return '[object SVGPathSegLinetoHorizontalAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x; }\n clone () { return new SVGPathSegLinetoHorizontalAbs(undefined, this._x); }\n }\n Object.defineProperty(SVGPathSegLinetoHorizontalAbs.prototype, 'x', {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true});\n\n class SVGPathSegLinetoHorizontalRel extends SVGPathSeg {\n constructor (owningPathSegList, x) {\n super(SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL, 'h', owningPathSegList);\n this._x = x;\n }\n toString () { return '[object SVGPathSegLinetoHorizontalRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x; }\n clone () { return new SVGPathSegLinetoHorizontalRel(undefined, this._x); }\n }\n Object.defineProperty(SVGPathSegLinetoHorizontalRel.prototype, 'x', {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true});\n\n class SVGPathSegLinetoVerticalAbs extends SVGPathSeg {\n constructor (owningPathSegList, y) {\n super(SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS, 'V', owningPathSegList);\n this._y = y;\n }\n toString () { return '[object SVGPathSegLinetoVerticalAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._y; }\n clone () { return new SVGPathSegLinetoVerticalAbs(undefined, this._y); }\n }\n Object.defineProperty(SVGPathSegLinetoVerticalAbs.prototype, 'y', {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true});\n\n class SVGPathSegLinetoVerticalRel extends SVGPathSeg {\n constructor (owningPathSegList, y) {\n super(SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL, 'v', owningPathSegList);\n this._y = y;\n }\n toString () { return '[object SVGPathSegLinetoVerticalRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._y; }\n clone () { return new SVGPathSegLinetoVerticalRel(undefined, this._y); }\n }\n Object.defineProperty(SVGPathSegLinetoVerticalRel.prototype, 'y', {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true});\n\n class SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x2, y2) {\n super(SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, 'S', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x2 = x2;\n this._y2 = y2;\n }\n toString () { return '[object SVGPathSegCurvetoCubicSmoothAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoCubicSmoothAbs(undefined, this._x, this._y, this._x2, this._y2); }\n }\n Object.defineProperties(SVGPathSegCurvetoCubicSmoothAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},\n y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x2, y2) {\n super(SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL, 's', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x2 = x2;\n this._y2 = y2;\n }\n toString () { return '[object SVGPathSegCurvetoCubicSmoothRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoCubicSmoothRel(undefined, this._x, this._y, this._x2, this._y2); }\n }\n Object.defineProperties(SVGPathSegCurvetoCubicSmoothRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},\n y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, 'T', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegCurvetoQuadraticSmoothAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegCurvetoQuadraticSmoothAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, 't', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegCurvetoQuadraticSmoothRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoQuadraticSmoothRel(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegCurvetoQuadraticSmoothRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}\n });\n\n // Add createSVGPathSeg* functions to SVGPathElement.\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathElement.\n SVGPathElement.prototype.createSVGPathSegClosePath = function () { return new SVGPathSegClosePath(undefined); };\n SVGPathElement.prototype.createSVGPathSegMovetoAbs = function (x, y) { return new SVGPathSegMovetoAbs(undefined, x, y); };\n SVGPathElement.prototype.createSVGPathSegMovetoRel = function (x, y) { return new SVGPathSegMovetoRel(undefined, x, y); };\n SVGPathElement.prototype.createSVGPathSegLinetoAbs = function (x, y) { return new SVGPathSegLinetoAbs(undefined, x, y); };\n SVGPathElement.prototype.createSVGPathSegLinetoRel = function (x, y) { return new SVGPathSegLinetoRel(undefined, x, y); };\n SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs = function (x, y, x1, y1, x2, y2) { return new SVGPathSegCurvetoCubicAbs(undefined, x, y, x1, y1, x2, y2); };\n SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel = function (x, y, x1, y1, x2, y2) { return new SVGPathSegCurvetoCubicRel(undefined, x, y, x1, y1, x2, y2); };\n SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs = function (x, y, x1, y1) { return new SVGPathSegCurvetoQuadraticAbs(undefined, x, y, x1, y1); };\n SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel = function (x, y, x1, y1) { return new SVGPathSegCurvetoQuadraticRel(undefined, x, y, x1, y1); };\n SVGPathElement.prototype.createSVGPathSegArcAbs = function (x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new SVGPathSegArcAbs(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); };\n SVGPathElement.prototype.createSVGPathSegArcRel = function (x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new SVGPathSegArcRel(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); };\n SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs = function (x) { return new SVGPathSegLinetoHorizontalAbs(undefined, x); };\n SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel = function (x) { return new SVGPathSegLinetoHorizontalRel(undefined, x); };\n SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs = function (y) { return new SVGPathSegLinetoVerticalAbs(undefined, y); };\n SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel = function (y) { return new SVGPathSegLinetoVerticalRel(undefined, y); };\n SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs = function (x, y, x2, y2) { return new SVGPathSegCurvetoCubicSmoothAbs(undefined, x, y, x2, y2); };\n SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel = function (x, y, x2, y2) { return new SVGPathSegCurvetoCubicSmoothRel(undefined, x, y, x2, y2); };\n SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs = function (x, y) { return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined, x, y); };\n SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel = function (x, y) { return new SVGPathSegCurvetoQuadraticSmoothRel(undefined, x, y); };\n\n if (!('getPathSegAtLength' in SVGPathElement.prototype)) {\n // Add getPathSegAtLength to SVGPathElement.\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-__svg__SVGPathElement__getPathSegAtLength\n // This polyfill requires SVGPathElement.getTotalLength to implement the distance-along-a-path algorithm.\n SVGPathElement.prototype.getPathSegAtLength = function (distance) {\n if (distance === undefined || !isFinite(distance)) {\n throw new Error('Invalid arguments.');\n }\n\n const measurementElement = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n measurementElement.setAttribute('d', this.getAttribute('d'));\n let lastPathSegment = measurementElement.pathSegList.numberOfItems - 1;\n\n // If the path is empty, return 0.\n if (lastPathSegment <= 0) {\n return 0;\n }\n\n do {\n measurementElement.pathSegList.removeItem(lastPathSegment);\n if (distance > measurementElement.getTotalLength()) {\n break;\n }\n lastPathSegment--;\n } while (lastPathSegment > 0);\n return lastPathSegment;\n };\n }\n\n window.SVGPathSeg = SVGPathSeg;\n window.SVGPathSegClosePath = SVGPathSegClosePath;\n window.SVGPathSegMovetoAbs = SVGPathSegMovetoAbs;\n window.SVGPathSegMovetoRel = SVGPathSegMovetoRel;\n window.SVGPathSegLinetoAbs = SVGPathSegLinetoAbs;\n window.SVGPathSegLinetoRel = SVGPathSegLinetoRel;\n window.SVGPathSegCurvetoCubicAbs = SVGPathSegCurvetoCubicAbs;\n window.SVGPathSegCurvetoCubicRel = SVGPathSegCurvetoCubicRel;\n window.SVGPathSegCurvetoQuadraticAbs = SVGPathSegCurvetoQuadraticAbs;\n window.SVGPathSegCurvetoQuadraticRel = SVGPathSegCurvetoQuadraticRel;\n window.SVGPathSegArcAbs = SVGPathSegArcAbs;\n window.SVGPathSegArcRel = SVGPathSegArcRel;\n window.SVGPathSegLinetoHorizontalAbs = SVGPathSegLinetoHorizontalAbs;\n window.SVGPathSegLinetoHorizontalRel = SVGPathSegLinetoHorizontalRel;\n window.SVGPathSegLinetoVerticalAbs = SVGPathSegLinetoVerticalAbs;\n window.SVGPathSegLinetoVerticalRel = SVGPathSegLinetoVerticalRel;\n window.SVGPathSegCurvetoCubicSmoothAbs = SVGPathSegCurvetoCubicSmoothAbs;\n window.SVGPathSegCurvetoCubicSmoothRel = SVGPathSegCurvetoCubicSmoothRel;\n window.SVGPathSegCurvetoQuadraticSmoothAbs = SVGPathSegCurvetoQuadraticSmoothAbs;\n window.SVGPathSegCurvetoQuadraticSmoothRel = SVGPathSegCurvetoQuadraticSmoothRel;\n}\n\n// Checking for SVGPathSegList in window checks for the case of an implementation without the\n// SVGPathSegList API.\n// The second check for appendItem is specific to Firefox 59+ which removed only parts of the\n// SVGPathSegList API (e.g., appendItem). In this case we need to re-implement the entire API\n// so the polyfill data (i.e., _list) is used throughout.\nif (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.prototype)) {\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList\n class SVGPathSegList {\n constructor (pathElement) {\n this._pathElement = pathElement;\n this._list = this._parsePath(this._pathElement.getAttribute('d'));\n\n // Use a MutationObserver to catch changes to the path's \"d\" attribute.\n this._mutationObserverConfig = {attributes: true, attributeFilter: ['d']};\n this._pathElementMutationObserver = new MutationObserver(this._updateListFromPathMutations.bind(this));\n this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);\n }\n // Process any pending mutations to the path element and update the list as needed.\n // This should be the first call of all public functions and is needed because\n // MutationObservers are not synchronous so we can have pending asynchronous mutations.\n _checkPathSynchronizedToList () {\n this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords());\n }\n\n _updateListFromPathMutations (mutationRecords) {\n if (!this._pathElement) {\n return;\n }\n let hasPathMutations = false;\n mutationRecords.forEach((record) => {\n if (record.attributeName === 'd') {\n hasPathMutations = true;\n }\n });\n if (hasPathMutations) {\n this._list = this._parsePath(this._pathElement.getAttribute('d'));\n }\n }\n\n // Serialize the list and update the path's 'd' attribute.\n _writeListToPath () {\n this._pathElementMutationObserver.disconnect();\n this._pathElement.setAttribute('d', SVGPathSegList._pathSegArrayAsString(this._list));\n this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);\n }\n\n // When a path segment changes the list needs to be synchronized back to the path element.\n segmentChanged (pathSeg) {\n this._writeListToPath();\n }\n\n clear () {\n this._checkPathSynchronizedToList();\n\n this._list.forEach((pathSeg) => {\n pathSeg._owningPathSegList = null;\n });\n this._list = [];\n this._writeListToPath();\n }\n\n initialize (newItem) {\n this._checkPathSynchronizedToList();\n\n this._list = [newItem];\n newItem._owningPathSegList = this;\n this._writeListToPath();\n return newItem;\n }\n\n _checkValidIndex (index) {\n if (isNaN(index) || index < 0 || index >= this.numberOfItems) {\n throw new Error('INDEX_SIZE_ERR');\n }\n }\n\n getItem (index) {\n this._checkPathSynchronizedToList();\n\n this._checkValidIndex(index);\n return this._list[index];\n }\n\n insertItemBefore (newItem, index) {\n this._checkPathSynchronizedToList();\n\n // Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.\n if (index > this.numberOfItems) {\n index = this.numberOfItems;\n }\n if (newItem._owningPathSegList) {\n // SVG2 spec says to make a copy.\n newItem = newItem.clone();\n }\n this._list.splice(index, 0, newItem);\n newItem._owningPathSegList = this;\n this._writeListToPath();\n return newItem;\n }\n\n replaceItem (newItem, index) {\n this._checkPathSynchronizedToList();\n\n if (newItem._owningPathSegList) {\n // SVG2 spec says to make a copy.\n newItem = newItem.clone();\n }\n this._checkValidIndex(index);\n this._list[index] = newItem;\n newItem._owningPathSegList = this;\n this._writeListToPath();\n return newItem;\n }\n\n removeItem (index) {\n this._checkPathSynchronizedToList();\n\n this._checkValidIndex(index);\n const item = this._list[index];\n this._list.splice(index, 1);\n this._writeListToPath();\n return item;\n }\n\n appendItem (newItem) {\n this._checkPathSynchronizedToList();\n\n if (newItem._owningPathSegList) {\n // SVG2 spec says to make a copy.\n newItem = newItem.clone();\n }\n this._list.push(newItem);\n newItem._owningPathSegList = this;\n // TODO: Optimize this to just append to the existing attribute.\n this._writeListToPath();\n return newItem;\n }\n\n // This closely follows SVGPathParser::parsePath from Source/core/svg/SVGPathParser.cpp.\n _parsePath (string) {\n if (!string || !string.length) {\n return [];\n }\n\n const owningPathSegList = this;\n\n class Builder {\n constructor () {\n this.pathSegList = [];\n }\n appendSegment (pathSeg) {\n this.pathSegList.push(pathSeg);\n }\n }\n\n class Source {\n constructor (string) {\n this._string = string;\n this._currentIndex = 0;\n this._endIndex = this._string.length;\n this._previousCommand = SVGPathSeg.PATHSEG_UNKNOWN;\n\n this._skipOptionalSpaces();\n }\n _isCurrentSpace () {\n const character = this._string[this._currentIndex];\n return character <= ' ' && (character === ' ' || character === '\\n' || character === '\\t' || character === '\\r' || character === '\\f');\n }\n\n _skipOptionalSpaces () {\n while (this._currentIndex < this._endIndex && this._isCurrentSpace()) {\n this._currentIndex++;\n }\n return this._currentIndex < this._endIndex;\n }\n\n _skipOptionalSpacesOrDelimiter () {\n if (this._currentIndex < this._endIndex && !this._isCurrentSpace() && this._string.charAt(this._currentIndex) !== ',') {\n return false;\n }\n if (this._skipOptionalSpaces()) {\n if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === ',') {\n this._currentIndex++;\n this._skipOptionalSpaces();\n }\n }\n return this._currentIndex < this._endIndex;\n }\n\n hasMoreData () {\n return this._currentIndex < this._endIndex;\n }\n\n peekSegmentType () {\n const lookahead = this._string[this._currentIndex];\n return this._pathSegTypeFromChar(lookahead);\n }\n\n _pathSegTypeFromChar (lookahead) {\n switch (lookahead) {\n case 'Z':\n case 'z':\n return SVGPathSeg.PATHSEG_CLOSEPATH;\n case 'M':\n return SVGPathSeg.PATHSEG_MOVETO_ABS;\n case 'm':\n return SVGPathSeg.PATHSEG_MOVETO_REL;\n case 'L':\n return SVGPathSeg.PATHSEG_LINETO_ABS;\n case 'l':\n return SVGPathSeg.PATHSEG_LINETO_REL;\n case 'C':\n return SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;\n case 'c':\n return SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;\n case 'Q':\n return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;\n case 'q':\n return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;\n case 'A':\n return SVGPathSeg.PATHSEG_ARC_ABS;\n case 'a':\n return SVGPathSeg.PATHSEG_ARC_REL;\n case 'H':\n return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;\n case 'h':\n return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;\n case 'V':\n return SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;\n case 'v':\n return SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;\n case 'S':\n return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;\n case 's':\n return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;\n case 'T':\n return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;\n case 't':\n return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;\n default:\n return SVGPathSeg.PATHSEG_UNKNOWN;\n }\n }\n\n _nextCommandHelper (lookahead, previousCommand) {\n // Check for remaining coordinates in the current command.\n if ((lookahead === '+' || lookahead === '-' || lookahead === '.' || (lookahead >= '0' && lookahead <= '9')) && previousCommand !== SVGPathSeg.PATHSEG_CLOSEPATH) {\n if (previousCommand === SVGPathSeg.PATHSEG_MOVETO_ABS) {\n return SVGPathSeg.PATHSEG_LINETO_ABS;\n }\n if (previousCommand === SVGPathSeg.PATHSEG_MOVETO_REL) {\n return SVGPathSeg.PATHSEG_LINETO_REL;\n }\n return previousCommand;\n }\n return SVGPathSeg.PATHSEG_UNKNOWN;\n }\n\n initialCommandIsMoveTo () {\n // If the path is empty it is still valid, so return true.\n if (!this.hasMoreData()) {\n return true;\n }\n const command = this.peekSegmentType();\n // Path must start with moveTo.\n return command === SVGPathSeg.PATHSEG_MOVETO_ABS || command === SVGPathSeg.PATHSEG_MOVETO_REL;\n }\n\n // Parse a number from an SVG path. This very closely follows genericParseNumber(...) from Source/core/svg/SVGParserUtilities.cpp.\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-PathDataBNF\n _parseNumber () {\n let exponent = 0;\n let integer = 0;\n let frac = 1;\n let decimal = 0;\n let sign = 1;\n let expsign = 1;\n\n const startIndex = this._currentIndex;\n\n this._skipOptionalSpaces();\n\n // Read the sign.\n if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === '+') {\n this._currentIndex++;\n } else if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === '-') {\n this._currentIndex++;\n sign = -1;\n }\n\n if (this._currentIndex === this._endIndex || ((this._string.charAt(this._currentIndex) < '0' || this._string.charAt(this._currentIndex) > '9') && this._string.charAt(this._currentIndex) !== '.')) {\n // The first character of a number must be one of [0-9+-.].\n return undefined;\n }\n\n // Read the integer part, build right-to-left.\n const startIntPartIndex = this._currentIndex;\n while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= '0' && this._string.charAt(this._currentIndex) <= '9') {\n this._currentIndex++; // Advance to first non-digit.\n }\n\n if (this._currentIndex !== startIntPartIndex) {\n let scanIntPartIndex = this._currentIndex - 1;\n let multiplier = 1;\n while (scanIntPartIndex >= startIntPartIndex) {\n integer += multiplier * (this._string.charAt(scanIntPartIndex--) - '0');\n multiplier *= 10;\n }\n }\n\n // Read the decimals.\n if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === '.') {\n this._currentIndex++;\n\n // There must be a least one digit following the .\n if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < '0' || this._string.charAt(this._currentIndex) > '9') {\n return undefined;\n }\n while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= '0' && this._string.charAt(this._currentIndex) <= '9') {\n frac *= 10;\n decimal += (this._string.charAt(this._currentIndex) - '0') / frac;\n this._currentIndex += 1;\n }\n }\n\n // Read the exponent part.\n if (this._currentIndex !== startIndex && this._currentIndex + 1 < this._endIndex && (this._string.charAt(this._currentIndex) === 'e' || this._string.charAt(this._currentIndex) === 'E') && (this._string.charAt(this._currentIndex + 1) !== 'x' && this._string.charAt(this._currentIndex + 1) !== 'm')) {\n this._currentIndex++;\n\n // Read the sign of the exponent.\n if (this._string.charAt(this._currentIndex) === '+') {\n this._currentIndex++;\n } else if (this._string.charAt(this._currentIndex) === '-') {\n this._currentIndex++;\n expsign = -1;\n }\n\n // There must be an exponent.\n if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < '0' || this._string.charAt(this._currentIndex) > '9') {\n return undefined;\n }\n\n while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= '0' && this._string.charAt(this._currentIndex) <= '9') {\n exponent *= 10;\n exponent += (this._string.charAt(this._currentIndex) - '0');\n this._currentIndex++;\n }\n }\n\n let number = integer + decimal;\n number *= sign;\n\n if (exponent) {\n number *= 10 ** (expsign * exponent);\n }\n\n if (startIndex === this._currentIndex) {\n return undefined;\n }\n\n this._skipOptionalSpacesOrDelimiter();\n\n return number;\n }\n\n _parseArcFlag () {\n if (this._currentIndex >= this._endIndex) {\n return undefined;\n }\n let flag = false;\n const flagChar = this._string.charAt(this._currentIndex++);\n if (flagChar === '0') {\n flag = false;\n } else if (flagChar === '1') {\n flag = true;\n } else {\n return undefined;\n }\n\n this._skipOptionalSpacesOrDelimiter();\n return flag;\n }\n\n parseSegment () {\n const lookahead = this._string[this._currentIndex];\n let command = this._pathSegTypeFromChar(lookahead);\n if (command === SVGPathSeg.PATHSEG_UNKNOWN) {\n // Possibly an implicit command. Not allowed if this is the first command.\n if (this._previousCommand === SVGPathSeg.PATHSEG_UNKNOWN) {\n return null;\n }\n command = this._nextCommandHelper(lookahead, this._previousCommand);\n if (command === SVGPathSeg.PATHSEG_UNKNOWN) {\n return null;\n }\n } else {\n this._currentIndex++;\n }\n\n this._previousCommand = command;\n\n switch (command) {\n case SVGPathSeg.PATHSEG_MOVETO_REL:\n return new SVGPathSegMovetoRel(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_MOVETO_ABS:\n return new SVGPathSegMovetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_REL:\n return new SVGPathSegLinetoRel(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_ABS:\n return new SVGPathSegLinetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:\n return new SVGPathSegLinetoHorizontalRel(owningPathSegList, this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:\n return new SVGPathSegLinetoHorizontalAbs(owningPathSegList, this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:\n return new SVGPathSegLinetoVerticalRel(owningPathSegList, this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:\n return new SVGPathSegLinetoVerticalAbs(owningPathSegList, this._parseNumber());\n case SVGPathSeg.PATHSEG_CLOSEPATH:\n this._skipOptionalSpaces();\n return new SVGPathSegClosePath(owningPathSegList);\n case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoCubicRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);\n } case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoCubicAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);\n } case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL: {\n const points = {x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoCubicSmoothRel(owningPathSegList, points.x, points.y, points.x2, points.y2);\n } case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: {\n const points = {x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoCubicSmoothAbs(owningPathSegList, points.x, points.y, points.x2, points.y2);\n } case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoQuadraticRel(owningPathSegList, points.x, points.y, points.x1, points.y1);\n } case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoQuadraticAbs(owningPathSegList, points.x, points.y, points.x1, points.y1);\n } case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:\n return new SVGPathSegCurvetoQuadraticSmoothRel(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:\n return new SVGPathSegCurvetoQuadraticSmoothAbs(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_ARC_REL: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegArcRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);\n } case SVGPathSeg.PATHSEG_ARC_ABS: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegArcAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);\n } default:\n throw new Error('Unknown path seg type.');\n }\n }\n }\n\n const builder = new Builder();\n const source = new Source(string);\n\n if (!source.initialCommandIsMoveTo()) {\n return [];\n }\n while (source.hasMoreData()) {\n const pathSeg = source.parseSegment();\n if (!pathSeg) {\n return [];\n }\n builder.appendSegment(pathSeg);\n }\n\n return builder.pathSegList;\n }\n\n // STATIC\n static _pathSegArrayAsString (pathSegArray) {\n let string = '';\n let first = true;\n pathSegArray.forEach((pathSeg) => {\n if (first) {\n first = false;\n string += pathSeg._asPathString();\n } else {\n string += ' ' + pathSeg._asPathString();\n }\n });\n return string;\n }\n }\n\n SVGPathSegList.prototype.classname = 'SVGPathSegList';\n\n Object.defineProperty(SVGPathSegList.prototype, 'numberOfItems', {\n get () {\n this._checkPathSynchronizedToList();\n return this._list.length;\n },\n enumerable: true\n });\n\n // Add the pathSegList accessors to SVGPathElement.\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData\n Object.defineProperties(SVGPathElement.prototype, {\n pathSegList: {\n get () {\n if (!this._pathSegList) {\n this._pathSegList = new SVGPathSegList(this);\n }\n return this._pathSegList;\n },\n enumerable: true\n },\n // TODO: The following are not implemented and simply return SVGPathElement.pathSegList.\n normalizedPathSegList: {get () { return this.pathSegList; }, enumerable: true},\n animatedPathSegList: {get () { return this.pathSegList; }, enumerable: true},\n animatedNormalizedPathSegList: {get () { return this.pathSegList; }, enumerable: true}\n });\n window.SVGPathSegList = SVGPathSegList;\n}\n})();\n","/* globals jQuery */\n/**\n * Browser detection.\n * @module browser\n * @license MIT\n *\n * @copyright 2010 Jeff Schiller, 2010 Alexis Deveria\n */\n\n// Dependencies:\n// 1) jQuery (for $.alert())\n\nimport './svgpathseg.js';\nimport {NS} from './namespaces.js';\n\nconst $ = jQuery;\n\nconst supportsSVG_ = (function () {\nreturn Boolean(document.createElementNS && document.createElementNS(NS.SVG, 'svg').createSVGRect);\n}());\n\n/**\n * @function module:browser.supportsSvg\n * @returns {boolean}\n*/\nexport const supportsSvg = () => supportsSVG_;\n\nconst {userAgent} = navigator;\nconst svg = document.createElementNS(NS.SVG, 'svg');\n\n// Note: Browser sniffing should only be used if no other detection method is possible\nconst isOpera_ = Boolean(window.opera);\nconst isWebkit_ = userAgent.includes('AppleWebKit');\nconst isGecko_ = userAgent.includes('Gecko/');\nconst isIE_ = userAgent.includes('MSIE');\nconst isChrome_ = userAgent.includes('Chrome/');\nconst isWindows_ = userAgent.includes('Windows');\nconst isMac_ = userAgent.includes('Macintosh');\nconst isTouch_ = 'ontouchstart' in window;\n\nconst supportsSelectors_ = (function () {\nreturn Boolean(svg.querySelector);\n}());\n\nconst supportsXpath_ = (function () {\nreturn Boolean(document.evaluate);\n}());\n\n// segList functions (for FF1.5 and 2.0)\nconst supportsPathReplaceItem_ = (function () {\nconst path = document.createElementNS(NS.SVG, 'path');\npath.setAttribute('d', 'M0,0 10,10');\nconst seglist = path.pathSegList;\nconst seg = path.createSVGPathSegLinetoAbs(5, 5);\ntry {\n seglist.replaceItem(seg, 1);\n return true;\n} catch (err) {}\nreturn false;\n}());\n\nconst supportsPathInsertItemBefore_ = (function () {\nconst path = document.createElementNS(NS.SVG, 'path');\npath.setAttribute('d', 'M0,0 10,10');\nconst seglist = path.pathSegList;\nconst seg = path.createSVGPathSegLinetoAbs(5, 5);\ntry {\n seglist.insertItemBefore(seg, 1);\n return true;\n} catch (err) {}\nreturn false;\n}());\n\n// text character positioning (for IE9 and now Chrome)\nconst supportsGoodTextCharPos_ = (function () {\nconst svgroot = document.createElementNS(NS.SVG, 'svg');\nconst svgcontent = document.createElementNS(NS.SVG, 'svg');\ndocument.documentElement.append(svgroot);\nsvgcontent.setAttribute('x', 5);\nsvgroot.append(svgcontent);\nconst text = document.createElementNS(NS.SVG, 'text');\ntext.textContent = 'a';\nsvgcontent.append(text);\ntry { // Chrome now fails here\n const pos = text.getStartPositionOfChar(0).x;\n return (pos === 0);\n} catch (err) {\n return false;\n} finally {\n svgroot.remove();\n}\n}());\n\nconst supportsPathBBox_ = (function () {\nconst svgcontent = document.createElementNS(NS.SVG, 'svg');\ndocument.documentElement.append(svgcontent);\nconst path = document.createElementNS(NS.SVG, 'path');\npath.setAttribute('d', 'M0,0 C0,0 10,10 10,0');\nsvgcontent.append(path);\nconst bbox = path.getBBox();\nsvgcontent.remove();\nreturn (bbox.height > 4 && bbox.height < 5);\n}());\n\n// Support for correct bbox sizing on groups with horizontal/vertical lines\nconst supportsHVLineContainerBBox_ = (function () {\nconst svgcontent = document.createElementNS(NS.SVG, 'svg');\ndocument.documentElement.append(svgcontent);\nconst path = document.createElementNS(NS.SVG, 'path');\npath.setAttribute('d', 'M0,0 10,0');\nconst path2 = document.createElementNS(NS.SVG, 'path');\npath2.setAttribute('d', 'M5,0 15,0');\nconst g = document.createElementNS(NS.SVG, 'g');\ng.append(path, path2);\nsvgcontent.append(g);\nconst bbox = g.getBBox();\nsvgcontent.remove();\n// Webkit gives 0, FF gives 10, Opera (correctly) gives 15\nreturn (bbox.width === 15);\n}());\n\nconst supportsEditableText_ = (function () {\n// TODO: Find better way to check support for this\nreturn isOpera_;\n}());\n\nconst supportsGoodDecimals_ = (function () {\n// Correct decimals on clone attributes (Opera < 10.5/win/non-en)\nconst rect = document.createElementNS(NS.SVG, 'rect');\nrect.setAttribute('x', 0.1);\nconst crect = rect.cloneNode(false);\nconst retValue = (!crect.getAttribute('x').includes(','));\nif (!retValue) {\n // Todo: i18nize or remove\n $.alert(\n 'NOTE: This version of Opera is known to contain bugs in SVG-edit.\\n' +\n 'Please upgrade to the latest version in which the problems have been fixed.'\n );\n}\nreturn retValue;\n}());\n\nconst supportsNonScalingStroke_ = (function () {\nconst rect = document.createElementNS(NS.SVG, 'rect');\nrect.setAttribute('style', 'vector-effect:non-scaling-stroke');\nreturn rect.style.vectorEffect === 'non-scaling-stroke';\n}());\n\nlet supportsNativeSVGTransformLists_ = (function () {\nconst rect = document.createElementNS(NS.SVG, 'rect');\nconst rxform = rect.transform.baseVal;\nconst t1 = svg.createSVGTransform();\nrxform.appendItem(t1);\nconst r1 = rxform.getItem(0);\nconst isSVGTransform = (o) => {\n // https://developer.mozilla.org/en-US/docs/Web/API/SVGTransform\n return o && typeof o === 'object' && typeof o.setMatrix === 'function' && 'angle' in o;\n};\nreturn isSVGTransform(r1) && isSVGTransform(t1) &&\n r1.type === t1.type && r1.angle === t1.angle &&\n r1.matrix.a === t1.matrix.a &&\n r1.matrix.b === t1.matrix.b &&\n r1.matrix.c === t1.matrix.c &&\n r1.matrix.d === t1.matrix.d &&\n r1.matrix.e === t1.matrix.e &&\n r1.matrix.f === t1.matrix.f;\n}());\n\n// Public API\n\n/**\n * @function module:browser.isOpera\n * @returns {boolean}\n*/\nexport const isOpera = () => isOpera_;\n/**\n * @function module:browser.isWebkit\n * @returns {boolean}\n*/\nexport const isWebkit = () => isWebkit_;\n/**\n * @function module:browser.isGecko\n * @returns {boolean}\n*/\nexport const isGecko = () => isGecko_;\n/**\n * @function module:browser.isIE\n * @returns {boolean}\n*/\nexport const isIE = () => isIE_;\n/**\n * @function module:browser.isChrome\n * @returns {boolean}\n*/\nexport const isChrome = () => isChrome_;\n/**\n * @function module:browser.isWindows\n * @returns {boolean}\n*/\nexport const isWindows = () => isWindows_;\n/**\n * @function module:browser.isMac\n * @returns {boolean}\n*/\nexport const isMac = () => isMac_;\n/**\n * @function module:browser.isTouch\n * @returns {boolean}\n*/\nexport const isTouch = () => isTouch_;\n\n/**\n * @function module:browser.supportsSelectors\n * @returns {boolean}\n*/\nexport const supportsSelectors = () => supportsSelectors_;\n\n/**\n * @function module:browser.supportsXpath\n * @returns {boolean}\n*/\nexport const supportsXpath = () => supportsXpath_;\n\n/**\n * @function module:browser.supportsPathReplaceItem\n * @returns {boolean}\n*/\nexport const supportsPathReplaceItem = () => supportsPathReplaceItem_;\n\n/**\n * @function module:browser.supportsPathInsertItemBefore\n * @returns {boolean}\n*/\nexport const supportsPathInsertItemBefore = () => supportsPathInsertItemBefore_;\n\n/**\n * @function module:browser.supportsPathBBox\n * @returns {boolean}\n*/\nexport const supportsPathBBox = () => supportsPathBBox_;\n\n/**\n * @function module:browser.supportsHVLineContainerBBox\n * @returns {boolean}\n*/\nexport const supportsHVLineContainerBBox = () => supportsHVLineContainerBBox_;\n\n/**\n * @function module:browser.supportsGoodTextCharPos\n * @returns {boolean}\n*/\nexport const supportsGoodTextCharPos = () => supportsGoodTextCharPos_;\n\n/**\n* @function module:browser.supportsEditableText\n * @returns {boolean}\n*/\nexport const supportsEditableText = () => supportsEditableText_;\n\n/**\n * @function module:browser.supportsGoodDecimals\n * @returns {boolean}\n*/\nexport const supportsGoodDecimals = () => supportsGoodDecimals_;\n\n/**\n* @function module:browser.supportsNonScalingStroke\n* @returns {boolean}\n*/\nexport const supportsNonScalingStroke = () => supportsNonScalingStroke_;\n\n/**\n* @function module:browser.supportsNativeTransformLists\n* @returns {boolean}\n*/\nexport const supportsNativeTransformLists = () => supportsNativeSVGTransformLists_;\n\n/**\n * Set `supportsNativeSVGTransformLists_` to `false` (for unit testing).\n * @function module:browser.disableSupportsNativeTransformLists\n * @returns {void}\n*/\nexport const disableSupportsNativeTransformLists = () => {\n supportsNativeSVGTransformLists_ = false;\n};\n","/**\n * A jQuery module to work with SVG attributes.\n * @module jQueryAttr\n * @license MIT\n */\n\n/**\n* This fixes `$(...).attr()` to work as expected with SVG elements.\n* Does not currently use `*AttributeNS()` since we rarely need that.\n* Adds {@link external:jQuery.fn.attr}.\n* See {@link https://api.jquery.com/attr/} for basic documentation of `.attr()`.\n*\n* Additional functionality:\n* - When getting attributes, a string that's a number is returned as type number.\n* - If an array is supplied as the first parameter, multiple values are returned\n* as an object with values for each given attribute.\n* @function module:jQueryAttr.jQueryAttr\n* @param {external:jQuery} $ The jQuery object to which to add the plug-in\n* @returns {external:jQuery}\n*/\nexport default function jQueryPluginSVG ($) {\n const proxied = $.fn.attr,\n svgns = 'http://www.w3.org/2000/svg';\n /**\n * @typedef {PlainObject} module:jQueryAttr.Attributes\n */\n /**\n * @function external:jQuery.fn.attr\n * @param {string|string[]|PlainObject} key\n * @param {string} value\n * @returns {external:jQuery|module:jQueryAttr.Attributes}\n */\n $.fn.attr = function (key, value) {\n const len = this.length;\n if (!len) { return proxied.call(this, key, value); }\n for (let i = 0; i < len; ++i) {\n const elem = this[i];\n // set/get SVG attribute\n if (elem.namespaceURI === svgns) {\n // Setting attribute\n if (value !== undefined) {\n elem.setAttribute(key, value);\n } else if (Array.isArray(key)) {\n // Getting attributes from array\n const obj = {};\n let j = key.length;\n\n while (j--) {\n const aname = key[j];\n let attr = elem.getAttribute(aname);\n // This returns a number when appropriate\n if (attr || attr === '0') {\n attr = isNaN(attr) ? attr : (attr - 0);\n }\n obj[aname] = attr;\n }\n return obj;\n }\n if (typeof key === 'object') {\n // Setting attributes from object\n for (const [name, val] of Object.entries(key)) {\n elem.setAttribute(name, val);\n }\n // Getting attribute\n } else {\n let attr = elem.getAttribute(key);\n if (attr || attr === '0') {\n attr = isNaN(attr) ? attr : (attr - 0);\n }\n return attr;\n }\n } else {\n return proxied.call(this, key, value);\n }\n }\n return this;\n };\n return $;\n}\n","/**\n * Partial polyfill of `SVGTransformList`\n * @module SVGTransformList\n *\n * @license MIT\n *\n * @copyright 2010 Alexis Deveria, 2010 Jeff Schiller\n */\n\nimport {NS} from './namespaces.js';\nimport {supportsNativeTransformLists} from './browser.js';\n\nconst svgroot = document.createElementNS(NS.SVG, 'svg');\n\n/**\n * Helper function to convert `SVGTransform` to a string.\n * @param {SVGTransform} xform\n * @returns {string}\n */\nfunction transformToString (xform) {\n const m = xform.matrix;\n let text = '';\n switch (xform.type) {\n case 1: // MATRIX\n text = 'matrix(' + [m.a, m.b, m.c, m.d, m.e, m.f].join(',') + ')';\n break;\n case 2: // TRANSLATE\n text = 'translate(' + m.e + ',' + m.f + ')';\n break;\n case 3: // SCALE\n if (m.a === m.d) {\n text = 'scale(' + m.a + ')';\n } else {\n text = 'scale(' + m.a + ',' + m.d + ')';\n }\n break;\n case 4: { // ROTATE\n let cx = 0;\n let cy = 0;\n // this prevents divide by zero\n if (xform.angle !== 0) {\n const K = 1 - m.a;\n cy = (K * m.f + m.b * m.e) / (K * K + m.b * m.b);\n cx = (m.e - m.b * cy) / K;\n }\n text = 'rotate(' + xform.angle + ' ' + cx + ',' + cy + ')';\n break;\n }\n }\n return text;\n}\n\n/**\n * Map of SVGTransformList objects.\n */\nlet listMap_ = {};\n\n/**\n* @interface module:SVGTransformList.SVGEditTransformList\n* @property {Integer} numberOfItems unsigned long\n*/\n/**\n* @function module:SVGTransformList.SVGEditTransformList#clear\n* @returns {void}\n*/\n/**\n* @function module:SVGTransformList.SVGEditTransformList#initialize\n* @param {SVGTransform} newItem\n* @returns {SVGTransform}\n*/\n/**\n* DOES NOT THROW DOMException, INDEX_SIZE_ERR.\n* @function module:SVGTransformList.SVGEditTransformList#getItem\n* @param {Integer} index unsigned long\n* @returns {SVGTransform}\n*/\n/**\n* DOES NOT THROW DOMException, INDEX_SIZE_ERR.\n* @function module:SVGTransformList.SVGEditTransformList#insertItemBefore\n* @param {SVGTransform} newItem\n* @param {Integer} index unsigned long\n* @returns {SVGTransform}\n*/\n/**\n* DOES NOT THROW DOMException, INDEX_SIZE_ERR.\n* @function module:SVGTransformList.SVGEditTransformList#replaceItem\n* @param {SVGTransform} newItem\n* @param {Integer} index unsigned long\n* @returns {SVGTransform}\n*/\n/**\n* DOES NOT THROW DOMException, INDEX_SIZE_ERR.\n* @function module:SVGTransformList.SVGEditTransformList#removeItem\n* @param {Integer} index unsigned long\n* @returns {SVGTransform}\n*/\n/**\n* @function module:SVGTransformList.SVGEditTransformList#appendItem\n* @param {SVGTransform} newItem\n* @returns {SVGTransform}\n*/\n/**\n* NOT IMPLEMENTED.\n* @ignore\n* @function module:SVGTransformList.SVGEditTransformList#createSVGTransformFromMatrix\n* @param {SVGMatrix} matrix\n* @returns {SVGTransform}\n*/\n/**\n* NOT IMPLEMENTED.\n* @ignore\n* @function module:SVGTransformList.SVGEditTransformList#consolidate\n* @returns {SVGTransform}\n*/\n\n/**\n* SVGTransformList implementation for Webkit.\n* These methods do not currently raise any exceptions.\n* These methods also do not check that transforms are being inserted. This is basically\n* implementing as much of SVGTransformList that we need to get the job done.\n* @implements {module:SVGTransformList.SVGEditTransformList}\n*/\nexport class SVGTransformList { // eslint-disable-line no-shadow\n /**\n * @param {Element} elem\n * @returns {SVGTransformList}\n */\n constructor (elem) {\n this._elem = elem || null;\n this._xforms = [];\n // TODO: how do we capture the undo-ability in the changed transform list?\n this._update = function () {\n let tstr = '';\n // /* const concatMatrix = */ svgroot.createSVGMatrix();\n for (let i = 0; i < this.numberOfItems; ++i) {\n const xform = this._list.getItem(i);\n tstr += transformToString(xform) + ' ';\n }\n this._elem.setAttribute('transform', tstr);\n };\n this._list = this;\n this._init = function () {\n // Transform attribute parser\n let str = this._elem.getAttribute('transform');\n if (!str) { return; }\n\n // TODO: Add skew support in future\n const re = /\\s*((scale|matrix|rotate|translate)\\s*\\(.*?\\))\\s*,?\\s*/;\n // const re = /\\s*(?(?:scale|matrix|rotate|translate)\\s*\\(.*?\\))\\s*,?\\s*/;\n let m = true;\n while (m) {\n m = str.match(re);\n str = str.replace(re, '');\n if (m && m[1]) {\n const x = m[1];\n const bits = x.split(/\\s*\\(/);\n const name = bits[0];\n const valBits = bits[1].match(/\\s*(.*?)\\s*\\)/);\n valBits[1] = valBits[1].replace(/(\\d)-/g, '$1 -');\n const valArr = valBits[1].split(/[, ]+/);\n const letters = 'abcdef'.split('');\n /*\n if (m && m.groups.xform) {\n const x = m.groups.xform;\n const [name, bits] = x.split(/\\s*\\(/);\n const valBits = bits.match(/\\s*(?.*?)\\s*\\)/);\n valBits.groups.nonWhitespace = valBits.groups.nonWhitespace.replace(\n /(?\\d)-/g, '$ -'\n );\n const valArr = valBits.groups.nonWhitespace.split(/[, ]+/);\n const letters = [...'abcdef'];\n */\n const mtx = svgroot.createSVGMatrix();\n Object.values(valArr).forEach(function (item, i) {\n valArr[i] = Number.parseFloat(item);\n if (name === 'matrix') {\n mtx[letters[i]] = valArr[i];\n }\n });\n const xform = svgroot.createSVGTransform();\n const fname = 'set' + name.charAt(0).toUpperCase() + name.slice(1);\n const values = name === 'matrix' ? [mtx] : valArr;\n\n if (name === 'scale' && values.length === 1) {\n values.push(values[0]);\n } else if (name === 'translate' && values.length === 1) {\n values.push(0);\n } else if (name === 'rotate' && values.length === 1) {\n values.push(0, 0);\n }\n xform[fname](...values);\n this._list.appendItem(xform);\n }\n }\n };\n this._removeFromOtherLists = function (item) {\n if (item) {\n // Check if this transform is already in a transformlist, and\n // remove it if so.\n Object.values(listMap_).some((tl) => {\n for (let i = 0, len = tl._xforms.length; i < len; ++i) {\n if (tl._xforms[i] === item) {\n tl.removeItem(i);\n return true;\n }\n }\n return false;\n });\n }\n };\n\n this.numberOfItems = 0;\n }\n /**\n * @returns {void}\n */\n clear () {\n this.numberOfItems = 0;\n this._xforms = [];\n }\n\n /**\n * @param {SVGTransform} newItem\n * @returns {void}\n */\n initialize (newItem) {\n this.numberOfItems = 1;\n this._removeFromOtherLists(newItem);\n this._xforms = [newItem];\n }\n\n /**\n * @param {Integer} index unsigned long\n * @throws {Error}\n * @returns {SVGTransform}\n */\n getItem (index) {\n if (index < this.numberOfItems && index >= 0) {\n return this._xforms[index];\n }\n const err = new Error('DOMException with code=INDEX_SIZE_ERR');\n err.code = 1;\n throw err;\n }\n\n /**\n * @param {SVGTransform} newItem\n * @param {Integer} index unsigned long\n * @returns {SVGTransform}\n */\n insertItemBefore (newItem, index) {\n let retValue = null;\n if (index >= 0) {\n if (index < this.numberOfItems) {\n this._removeFromOtherLists(newItem);\n const newxforms = new Array(this.numberOfItems + 1);\n // TODO: use array copying and slicing\n let i;\n for (i = 0; i < index; ++i) {\n newxforms[i] = this._xforms[i];\n }\n newxforms[i] = newItem;\n for (let j = i + 1; i < this.numberOfItems; ++j, ++i) {\n newxforms[j] = this._xforms[i];\n }\n this.numberOfItems++;\n this._xforms = newxforms;\n retValue = newItem;\n this._list._update();\n } else {\n retValue = this._list.appendItem(newItem);\n }\n }\n return retValue;\n }\n\n /**\n * @param {SVGTransform} newItem\n * @param {Integer} index unsigned long\n * @returns {SVGTransform}\n */\n replaceItem (newItem, index) {\n let retValue = null;\n if (index < this.numberOfItems && index >= 0) {\n this._removeFromOtherLists(newItem);\n this._xforms[index] = newItem;\n retValue = newItem;\n this._list._update();\n }\n return retValue;\n }\n\n /**\n * @param {Integer} index unsigned long\n * @throws {Error}\n * @returns {SVGTransform}\n */\n removeItem (index) {\n if (index < this.numberOfItems && index >= 0) {\n const retValue = this._xforms[index];\n const newxforms = new Array(this.numberOfItems - 1);\n let i;\n for (i = 0; i < index; ++i) {\n newxforms[i] = this._xforms[i];\n }\n for (let j = i; j < this.numberOfItems - 1; ++j, ++i) {\n newxforms[j] = this._xforms[i + 1];\n }\n this.numberOfItems--;\n this._xforms = newxforms;\n this._list._update();\n return retValue;\n }\n const err = new Error('DOMException with code=INDEX_SIZE_ERR');\n err.code = 1;\n throw err;\n }\n\n /**\n * @param {SVGTransform} newItem\n * @returns {SVGTransform}\n */\n appendItem (newItem) {\n this._removeFromOtherLists(newItem);\n this._xforms.push(newItem);\n this.numberOfItems++;\n this._list._update();\n return newItem;\n }\n}\n\n/**\n* @function module:SVGTransformList.resetListMap\n* @returns {void}\n*/\nexport const resetListMap = function () {\n listMap_ = {};\n};\n\n/**\n * Removes transforms of the given element from the map.\n * @function module:SVGTransformList.removeElementFromListMap\n * @param {Element} elem - a DOM Element\n * @returns {void}\n */\nexport let removeElementFromListMap = function (elem) { // eslint-disable-line import/no-mutable-exports\n if (elem.id && listMap_[elem.id]) {\n delete listMap_[elem.id];\n }\n};\n\n/**\n* Returns an object that behaves like a `SVGTransformList` for the given DOM element.\n* @function module:SVGTransformList.getTransformList\n* @param {Element} elem - DOM element to get a transformlist from\n* @todo The polyfill should have `SVGAnimatedTransformList` and this should use it\n* @returns {SVGAnimatedTransformList|SVGTransformList}\n*/\nexport const getTransformList = function (elem) {\n if (!supportsNativeTransformLists()) {\n const id = elem.id || 'temp';\n let t = listMap_[id];\n if (!t || id === 'temp') {\n listMap_[id] = new SVGTransformList(elem);\n listMap_[id]._init();\n t = listMap_[id];\n }\n return t;\n }\n if (elem.transform) {\n return elem.transform.baseVal;\n }\n if (elem.gradientTransform) {\n return elem.gradientTransform.baseVal;\n }\n if (elem.patternTransform) {\n return elem.patternTransform.baseVal;\n }\n\n return null;\n};\n\n/**\n* @callback module:SVGTransformList.removeElementFromListMap\n* @param {Element} elem\n* @returns {void}\n*/\n/**\n* Replace `removeElementFromListMap` for unit-testing.\n* @function module:SVGTransformList.changeRemoveElementFromListMap\n* @param {module:SVGTransformList.removeElementFromListMap} cb Passed a single argument `elem`\n* @returns {void}\n*/\n\nexport const changeRemoveElementFromListMap = function (cb) { // eslint-disable-line promise/prefer-await-to-callbacks\n removeElementFromListMap = cb;\n};\n","/**\n * Tools for working with units.\n * @module units\n * @license MIT\n *\n * @copyright 2010 Alexis Deveria, 2010 Jeff Schiller\n */\n\nimport {NS} from './namespaces.js';\n\nconst wAttrs = ['x', 'x1', 'cx', 'rx', 'width'];\nconst hAttrs = ['y', 'y1', 'cy', 'ry', 'height'];\nconst unitAttrs = ['r', 'radius', ...wAttrs, ...hAttrs];\n// unused\n/*\nconst unitNumMap = {\n '%': 2,\n em: 3,\n ex: 4,\n px: 5,\n cm: 6,\n mm: 7,\n in: 8,\n pt: 9,\n pc: 10\n};\n*/\n// Container of elements.\nlet elementContainer_;\n\n// Stores mapping of unit type to user coordinates.\nlet typeMap_ = {};\n\n/**\n * @interface module:units.ElementContainer\n */\n/**\n * @function module:units.ElementContainer#getBaseUnit\n * @returns {string} The base unit type of the container ('em')\n */\n/**\n * @function module:units.ElementContainer#getElement\n * @returns {?Element} An element in the container given an id\n */\n/**\n * @function module:units.ElementContainer#getHeight\n * @returns {Float} The container's height\n */\n/**\n * @function module:units.ElementContainer#getWidth\n * @returns {Float} The container's width\n */\n/**\n * @function module:units.ElementContainer#getRoundDigits\n * @returns {Integer} The number of digits number should be rounded to\n */\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * @typedef {PlainObject} module:units.TypeMap\n * @property {Float} em\n * @property {Float} ex\n * @property {Float} in\n * @property {Float} cm\n * @property {Float} mm\n * @property {Float} pt\n * @property {Float} pc\n * @property {Integer} px\n * @property {0} %\n */\n/* eslint-enable jsdoc/valid-types */\n\n/**\n * Initializes this module.\n *\n * @function module:units.init\n * @param {module:units.ElementContainer} elementContainer - An object implementing the ElementContainer interface.\n * @returns {void}\n */\nexport const init = function (elementContainer) {\n elementContainer_ = elementContainer;\n\n // Get correct em/ex values by creating a temporary SVG.\n const svg = document.createElementNS(NS.SVG, 'svg');\n document.body.append(svg);\n const rect = document.createElementNS(NS.SVG, 'rect');\n rect.setAttribute('width', '1em');\n rect.setAttribute('height', '1ex');\n rect.setAttribute('x', '1in');\n svg.append(rect);\n const bb = rect.getBBox();\n svg.remove();\n\n const inch = bb.x;\n typeMap_ = {\n em: bb.width,\n ex: bb.height,\n in: inch,\n cm: inch / 2.54,\n mm: inch / 25.4,\n pt: inch / 72,\n pc: inch / 6,\n px: 1,\n '%': 0\n };\n};\n\n/**\n* Group: Unit conversion functions.\n*/\n\n/**\n * @function module:units.getTypeMap\n * @returns {module:units.TypeMap} The unit object with values for each unit\n*/\nexport const getTypeMap = function () {\n return typeMap_;\n};\n\n/**\n* @typedef {GenericArray} module:units.CompareNumbers\n* @property {Integer} length 2\n* @property {Float} 0\n* @property {Float} 1\n*/\n\n/**\n* Rounds a given value to a float with number of digits defined in\n* `round_digits` of `saveOptions`\n*\n* @function module:units.shortFloat\n* @param {string|Float|module:units.CompareNumbers} val - The value (or Array of two numbers) to be rounded\n* @returns {Float|string} If a string/number was given, returns a Float. If an array, return a string\n* with comma-separated floats\n*/\nexport const shortFloat = function (val) {\n const digits = elementContainer_.getRoundDigits();\n if (!isNaN(val)) {\n return Number(Number(val).toFixed(digits));\n }\n if (Array.isArray(val)) {\n return shortFloat(val[0]) + ',' + shortFloat(val[1]);\n }\n return Number.parseFloat(val).toFixed(digits) - 0;\n};\n\n/**\n* Converts the number to given unit or baseUnit.\n* @function module:units.convertUnit\n* @param {string|Float} val\n* @param {\"em\"|\"ex\"|\"in\"|\"cm\"|\"mm\"|\"pt\"|\"pc\"|\"px\"|\"%\"} [unit]\n* @returns {Float}\n*/\nexport const convertUnit = function (val, unit) {\n unit = unit || elementContainer_.getBaseUnit();\n // baseVal.convertToSpecifiedUnits(unitNumMap[unit]);\n // const val = baseVal.valueInSpecifiedUnits;\n // baseVal.convertToSpecifiedUnits(1);\n return shortFloat(val / typeMap_[unit]);\n};\n\n/**\n* Sets an element's attribute based on the unit in its current value.\n*\n* @function module:units.setUnitAttr\n* @param {Element} elem - DOM element to be changed\n* @param {string} attr - Name of the attribute associated with the value\n* @param {string} val - Attribute value to convert\n* @returns {void}\n*/\nexport const setUnitAttr = function (elem, attr, val) {\n // if (!isNaN(val)) {\n // New value is a number, so check currently used unit\n // const oldVal = elem.getAttribute(attr);\n\n // Enable this for alternate mode\n // if (oldVal !== null && (isNaN(oldVal) || elementContainer_.getBaseUnit() !== 'px')) {\n // // Old value was a number, so get unit, then convert\n // let unit;\n // if (oldVal.substr(-1) === '%') {\n // const res = getResolution();\n // unit = '%';\n // val *= 100;\n // if (wAttrs.includes(attr)) {\n // val = val / res.w;\n // } else if (hAttrs.includes(attr)) {\n // val = val / res.h;\n // } else {\n // return val / Math.sqrt((res.w*res.w) + (res.h*res.h))/Math.sqrt(2);\n // }\n // } else {\n // if (elementContainer_.getBaseUnit() !== 'px') {\n // unit = elementContainer_.getBaseUnit();\n // } else {\n // unit = oldVal.substr(-2);\n // }\n // val = val / typeMap_[unit];\n // }\n //\n // val += unit;\n // }\n // }\n elem.setAttribute(attr, val);\n};\n\nconst attrsToConvert = {\n line: ['x1', 'x2', 'y1', 'y2'],\n circle: ['cx', 'cy', 'r'],\n ellipse: ['cx', 'cy', 'rx', 'ry'],\n foreignObject: ['x', 'y', 'width', 'height'],\n rect: ['x', 'y', 'width', 'height'],\n image: ['x', 'y', 'width', 'height'],\n use: ['x', 'y', 'width', 'height'],\n text: ['x', 'y']\n};\n\n/**\n* Converts all applicable attributes to the configured baseUnit.\n* @function module:units.convertAttrs\n* @param {Element} element - A DOM element whose attributes should be converted\n* @returns {void}\n*/\nexport const convertAttrs = function (element) {\n const elName = element.tagName;\n const unit = elementContainer_.getBaseUnit();\n const attrs = attrsToConvert[elName];\n if (!attrs) { return; }\n\n const len = attrs.length;\n for (let i = 0; i < len; i++) {\n const attr = attrs[i];\n const cur = element.getAttribute(attr);\n if (cur) {\n if (!isNaN(cur)) {\n element.setAttribute(attr, (cur / typeMap_[unit]) + unit);\n }\n // else {\n // Convert existing?\n // }\n }\n }\n};\n\n/**\n* Converts given values to numbers. Attributes must be supplied in\n* case a percentage is given.\n*\n* @function module:units.convertToNum\n* @param {string} attr - Name of the attribute associated with the value\n* @param {string} val - Attribute value to convert\n* @returns {Float} The converted number\n*/\nexport const convertToNum = function (attr, val) {\n // Return a number if that's what it already is\n if (!isNaN(val)) { return val - 0; }\n if (val.substr(-1) === '%') {\n // Deal with percentage, depends on attribute\n const num = val.substr(0, val.length - 1) / 100;\n const width = elementContainer_.getWidth();\n const height = elementContainer_.getHeight();\n\n if (wAttrs.includes(attr)) {\n return num * width;\n }\n if (hAttrs.includes(attr)) {\n return num * height;\n }\n return num * Math.sqrt((width * width) + (height * height)) / Math.sqrt(2);\n }\n const unit = val.substr(-2);\n const num = val.substr(0, val.length - 2);\n // Note that this multiplication turns the string into a number\n return num * typeMap_[unit];\n};\n\n/**\n* Check if an attribute's value is in a valid format.\n* @function module:units.isValidUnit\n* @param {string} attr - The name of the attribute associated with the value\n* @param {string} val - The attribute value to check\n* @param {Element} selectedElement\n* @returns {boolean} Whether the unit is valid\n*/\nexport const isValidUnit = function (attr, val, selectedElement) {\n if (unitAttrs.includes(attr)) {\n // True if it's just a number\n if (!isNaN(val)) {\n return true;\n }\n // Not a number, check if it has a valid unit\n val = val.toLowerCase();\n return Object.keys(typeMap_).some((unit) => {\n const re = new RegExp('^-?[\\\\d\\\\.]+' + unit + '$');\n return re.test(val);\n });\n }\n if (attr === 'id') {\n // if we're trying to change the id, make sure it's not already present in the doc\n // and the id value is valid.\n\n let result = false;\n // because getElem() can throw an exception in the case of an invalid id\n // (according to https://www.w3.org/TR/xml-id/ IDs must be a NCName)\n // we wrap it in an exception and only return true if the ID was valid and\n // not already present\n try {\n const elem = elementContainer_.getElement(val);\n result = (!elem || elem === selectedElement);\n } catch (e) {}\n return result;\n }\n return true;\n};\n","/**\n * Mathematical utilities.\n * @module math\n * @license MIT\n *\n * @copyright 2010 Alexis Deveria, 2010 Jeff Schiller\n */\n\n/**\n* @typedef {PlainObject} module:math.AngleCoord45\n* @property {Float} x - The angle-snapped x value\n* @property {Float} y - The angle-snapped y value\n* @property {Integer} a - The angle at which to snap\n*/\n\n/**\n* @typedef {PlainObject} module:math.XYObject\n* @property {Float} x\n* @property {Float} y\n*/\n\nimport {NS} from './namespaces.js';\nimport {getTransformList} from './svgtransformlist.js';\n\n// Constants\nconst NEAR_ZERO = 1e-14;\n\n// Throw away SVGSVGElement used for creating matrices/transforms.\nconst svg = document.createElementNS(NS.SVG, 'svg');\n\n/**\n * A (hopefully) quicker function to transform a point by a matrix\n * (this function avoids any DOM calls and just does the math).\n * @function module:math.transformPoint\n * @param {Float} x - Float representing the x coordinate\n * @param {Float} y - Float representing the y coordinate\n * @param {SVGMatrix} m - Matrix object to transform the point with\n * @returns {module:math.XYObject} An x, y object representing the transformed point\n*/\nexport const transformPoint = function (x, y, m) {\n return {x: m.a * x + m.c * y + m.e, y: m.b * x + m.d * y + m.f};\n};\n\n/**\n * Helper function to check if the matrix performs no actual transform\n * (i.e. exists for identity purposes).\n * @function module:math.isIdentity\n * @param {SVGMatrix} m - The matrix object to check\n * @returns {boolean} Indicates whether or not the matrix is 1,0,0,1,0,0\n*/\nexport const isIdentity = function (m) {\n return (m.a === 1 && m.b === 0 && m.c === 0 && m.d === 1 && m.e === 0 && m.f === 0);\n};\n\n/**\n * This function tries to return a `SVGMatrix` that is the multiplication `m1 * m2`.\n * We also round to zero when it's near zero.\n * @function module:math.matrixMultiply\n * @param {...SVGMatrix} args - Matrix objects to multiply\n * @returns {SVGMatrix} The matrix object resulting from the calculation\n*/\nexport const matrixMultiply = function (...args) {\n const m = args.reduceRight((prev, m1) => {\n return m1.multiply(prev);\n });\n\n if (Math.abs(m.a) < NEAR_ZERO) { m.a = 0; }\n if (Math.abs(m.b) < NEAR_ZERO) { m.b = 0; }\n if (Math.abs(m.c) < NEAR_ZERO) { m.c = 0; }\n if (Math.abs(m.d) < NEAR_ZERO) { m.d = 0; }\n if (Math.abs(m.e) < NEAR_ZERO) { m.e = 0; }\n if (Math.abs(m.f) < NEAR_ZERO) { m.f = 0; }\n\n return m;\n};\n\n/**\n * See if the given transformlist includes a non-indentity matrix transform.\n * @function module:math.hasMatrixTransform\n * @param {SVGTransformList} [tlist] - The transformlist to check\n * @returns {boolean} Whether or not a matrix transform was found\n*/\nexport const hasMatrixTransform = function (tlist) {\n if (!tlist) { return false; }\n let num = tlist.numberOfItems;\n while (num--) {\n const xform = tlist.getItem(num);\n if (xform.type === 1 && !isIdentity(xform.matrix)) { return true; }\n }\n return false;\n};\n\n/**\n* @typedef {PlainObject} module:math.TransformedBox An object with the following values\n* @property {module:math.XYObject} tl - The top left coordinate\n* @property {module:math.XYObject} tr - The top right coordinate\n* @property {module:math.XYObject} bl - The bottom left coordinate\n* @property {module:math.XYObject} br - The bottom right coordinate\n* @property {PlainObject} aabox - Object with the following values:\n* @property {Float} aabox.x - Float with the axis-aligned x coordinate\n* @property {Float} aabox.y - Float with the axis-aligned y coordinate\n* @property {Float} aabox.width - Float with the axis-aligned width coordinate\n* @property {Float} aabox.height - Float with the axis-aligned height coordinate\n*/\n\n/**\n * Transforms a rectangle based on the given matrix.\n * @function module:math.transformBox\n * @param {Float} l - Float with the box's left coordinate\n * @param {Float} t - Float with the box's top coordinate\n * @param {Float} w - Float with the box width\n * @param {Float} h - Float with the box height\n * @param {SVGMatrix} m - Matrix object to transform the box by\n * @returns {module:math.TransformedBox}\n*/\nexport const transformBox = function (l, t, w, h, m) {\n const tl = transformPoint(l, t, m),\n tr = transformPoint((l + w), t, m),\n bl = transformPoint(l, (t + h), m),\n br = transformPoint((l + w), (t + h), m),\n\n minx = Math.min(tl.x, tr.x, bl.x, br.x),\n maxx = Math.max(tl.x, tr.x, bl.x, br.x),\n miny = Math.min(tl.y, tr.y, bl.y, br.y),\n maxy = Math.max(tl.y, tr.y, bl.y, br.y);\n\n return {\n tl,\n tr,\n bl,\n br,\n aabox: {\n x: minx,\n y: miny,\n width: (maxx - minx),\n height: (maxy - miny)\n }\n };\n};\n\n/**\n * This returns a single matrix Transform for a given Transform List\n * (this is the equivalent of `SVGTransformList.consolidate()` but unlike\n * that method, this one does not modify the actual `SVGTransformList`).\n * This function is very liberal with its `min`, `max` arguments.\n * @function module:math.transformListToTransform\n * @param {SVGTransformList} tlist - The transformlist object\n * @param {Integer} [min=0] - Optional integer indicating start transform position\n * @param {Integer} [max] - Optional integer indicating end transform position;\n * defaults to one less than the tlist's `numberOfItems`\n * @returns {SVGTransform} A single matrix transform object\n*/\nexport const transformListToTransform = function (tlist, min, max) {\n if (!tlist) {\n // Or should tlist = null have been prevented before this?\n return svg.createSVGTransformFromMatrix(svg.createSVGMatrix());\n }\n min = min || 0;\n max = max || (tlist.numberOfItems - 1);\n min = Number.parseInt(min);\n max = Number.parseInt(max);\n if (min > max) { const temp = max; max = min; min = temp; }\n let m = svg.createSVGMatrix();\n for (let i = min; i <= max; ++i) {\n // if our indices are out of range, just use a harmless identity matrix\n const mtom = (i >= 0 && i < tlist.numberOfItems\n ? tlist.getItem(i).matrix\n : svg.createSVGMatrix());\n m = matrixMultiply(m, mtom);\n }\n return svg.createSVGTransformFromMatrix(m);\n};\n\n/**\n * Get the matrix object for a given element.\n * @function module:math.getMatrix\n * @param {Element} elem - The DOM element to check\n * @returns {SVGMatrix} The matrix object associated with the element's transformlist\n*/\nexport const getMatrix = function (elem) {\n const tlist = getTransformList(elem);\n return transformListToTransform(tlist).matrix;\n};\n\n/**\n * Returns a 45 degree angle coordinate associated with the two given\n * coordinates.\n * @function module:math.snapToAngle\n * @param {Integer} x1 - First coordinate's x value\n * @param {Integer} y1 - First coordinate's y value\n * @param {Integer} x2 - Second coordinate's x value\n * @param {Integer} y2 - Second coordinate's y value\n * @returns {module:math.AngleCoord45}\n*/\nexport const snapToAngle = function (x1, y1, x2, y2) {\n const snap = Math.PI / 4; // 45 degrees\n const dx = x2 - x1;\n const dy = y2 - y1;\n const angle = Math.atan2(dy, dx);\n const dist = Math.sqrt(dx * dx + dy * dy);\n const snapangle = Math.round(angle / snap) * snap;\n\n return {\n x: x1 + dist * Math.cos(snapangle),\n y: y1 + dist * Math.sin(snapangle),\n a: snapangle\n };\n};\n\n/**\n * Check if two rectangles (BBoxes objects) intersect each other.\n * @function module:math.rectsIntersect\n * @param {SVGRect} r1 - The first BBox-like object\n * @param {SVGRect} r2 - The second BBox-like object\n * @returns {boolean} True if rectangles intersect\n */\nexport const rectsIntersect = function (r1, r2) {\n return r2.x < (r1.x + r1.width) &&\n (r2.x + r2.width) > r1.x &&\n r2.y < (r1.y + r1.height) &&\n (r2.y + r2.height) > r1.y;\n};\n","/* globals jQuery */\n/**\n * Miscellaneous utilities.\n * @module utilities\n * @license MIT\n *\n * @copyright 2010 Alexis Deveria, 2010 Jeff Schiller\n */\n\nimport './svgpathseg.js';\nimport jQueryPluginSVG from './jQuery.attr.js'; // Needed for SVG attribute setting and array form with `attr`\nimport {NS} from './namespaces.js';\nimport {getTransformList} from './svgtransformlist.js';\nimport {setUnitAttr, getTypeMap} from './units.js';\nimport {\n hasMatrixTransform, transformListToTransform, transformBox\n} from './math.js';\nimport {\n isWebkit, supportsHVLineContainerBBox, supportsPathBBox, supportsXpath,\n supportsSelectors\n} from './browser.js';\n\n// Constants\nconst $ = jQueryPluginSVG(jQuery);\n\n// String used to encode base64.\nconst KEYSTR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n// Much faster than running getBBox() every time\nconst visElems = 'a,circle,ellipse,foreignObject,g,image,line,path,polygon,polyline,rect,svg,text,tspan,use,clipPath';\nconst visElemsArr = visElems.split(',');\n// const hidElems = 'defs,desc,feGaussianBlur,filter,linearGradient,marker,mask,metadata,pattern,radialGradient,stop,switch,symbol,title,textPath';\n\nlet editorContext_ = null;\nlet domdoc_ = null;\nlet domcontainer_ = null;\nlet svgroot_ = null;\n\n/**\n* Object with the following keys/values.\n* @typedef {PlainObject} module:utilities.SVGElementJSON\n* @property {string} element - Tag name of the SVG element to create\n* @property {PlainObject} attr - Has key-value attributes to assign to the new element. An `id` should be set so that {@link module:utilities.EditorContext#addSVGElementFromJson} can later re-identify the element for modification or replacement.\n* @property {boolean} [curStyles=false] - Indicates whether current style attributes should be applied first\n* @property {module:utilities.SVGElementJSON[]} [children] - Data objects to be added recursively as children\n* @property {string} [namespace=\"http://www.w3.org/2000/svg\"] - Indicate a (non-SVG) namespace\n*/\n\n/**\n * An object that creates SVG elements for the canvas.\n *\n * @interface module:utilities.EditorContext\n * @property {module:path.pathActions} pathActions\n */\n/**\n * @function module:utilities.EditorContext#getSVGContent\n * @returns {SVGSVGElement}\n */\n/**\n * Create a new SVG element based on the given object keys/values and add it\n * to the current layer.\n * The element will be run through `cleanupElement` before being returned.\n * @function module:utilities.EditorContext#addSVGElementFromJson\n * @param {module:utilities.SVGElementJSON} data\n * @returns {Element} The new element\n*/\n/**\n * @function module:utilities.EditorContext#getSelectedElements\n * @returns {Element[]} the array with selected DOM elements\n*/\n/**\n * @function module:utilities.EditorContext#getDOMDocument\n * @returns {HTMLDocument}\n*/\n/**\n * @function module:utilities.EditorContext#getDOMContainer\n * @returns {HTMLElement}\n*/\n/**\n * @function module:utilities.EditorContext#getSVGRoot\n * @returns {SVGSVGElement}\n*/\n/**\n * @function module:utilities.EditorContext#getBaseUnit\n * @returns {string}\n*/\n/**\n * @function module:utilities.EditorContext#getSnappingStep\n * @returns {Float|string}\n*/\n\n/**\n* @function module:utilities.init\n* @param {module:utilities.EditorContext} editorContext\n* @returns {void}\n*/\nexport const init = function (editorContext) {\n editorContext_ = editorContext;\n domdoc_ = editorContext.getDOMDocument();\n domcontainer_ = editorContext.getDOMContainer();\n svgroot_ = editorContext.getSVGRoot();\n};\n\n/**\n * Used to prevent the [Billion laughs attack]{@link https://en.wikipedia.org/wiki/Billion_laughs_attack}.\n * @function module:utilities.dropXMLInternalSubset\n * @param {string} str String to be processed\n * @returns {string} The string with entity declarations in the internal subset removed\n * @todo This might be needed in other places `parseFromString` is used even without LGTM flagging\n */\nexport const dropXMLInternalSubset = (str) => {\n return str.replace(/()/, '$1$2');\n // return str.replace(/(?\\?\\]>)/, '$$');\n};\n\n/**\n* Converts characters in a string to XML-friendly entities.\n* @function module:utilities.toXml\n* @example `&` becomes `&`\n* @param {string} str - The string to be converted\n* @returns {string} The converted string\n*/\nexport const toXml = function (str) {\n // ' is ok in XML, but not HTML\n // > does not normally need escaping, though it can if within a CDATA expression (and preceded by \"]]\")\n return str\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, '''); // Note: `'` is XML only\n};\n\n/**\n* Converts XML entities in a string to single characters.\n* @function module:utilities.fromXml\n* @example `&` becomes `&`\n* @param {string} str - The string to be converted\n* @returns {string} The converted string\n*/\nexport function fromXml (str) {\n return $('').html(str).text();\n}\n\n// This code was written by Tyler Akins and has been placed in the\n// public domain. It would be nice if you left this header intact.\n// Base64 code from Tyler Akins -- http://rumkin.com\n\n// schiller: Removed string concatenation in favour of Array.join() optimization,\n// also precalculate the size of the array needed.\n\n/**\n* Converts a string to base64.\n* @function module:utilities.encode64\n* @param {string} input\n* @returns {string} Base64 output\n*/\nexport function encode64 (input) {\n // base64 strings are 4/3 larger than the original string\n input = encodeUTF8(input); // convert non-ASCII characters\n // input = convertToXMLReferences(input);\n if (window.btoa) {\n return window.btoa(input); // Use native if available\n }\n const output = new Array(Math.floor((input.length + 2) / 3) * 4);\n\n let i = 0,\n p = 0;\n do {\n const chr1 = input.charCodeAt(i++);\n const chr2 = input.charCodeAt(i++);\n const chr3 = input.charCodeAt(i++);\n\n /* eslint-disable no-bitwise */\n const enc1 = chr1 >> 2;\n const enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n\n let enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n let enc4 = chr3 & 63;\n /* eslint-enable no-bitwise */\n\n if (Number.isNaN(chr2)) {\n enc3 = 64;\n enc4 = 64;\n } else if (Number.isNaN(chr3)) {\n enc4 = 64;\n }\n\n output[p++] = KEYSTR.charAt(enc1);\n output[p++] = KEYSTR.charAt(enc2);\n output[p++] = KEYSTR.charAt(enc3);\n output[p++] = KEYSTR.charAt(enc4);\n } while (i < input.length);\n\n return output.join('');\n}\n\n/**\n* Converts a string from base64.\n* @function module:utilities.decode64\n* @param {string} input Base64-encoded input\n* @returns {string} Decoded output\n*/\nexport function decode64 (input) {\n if (window.atob) {\n return decodeUTF8(window.atob(input));\n }\n\n // remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n input = input.replace(/[^A-Za-z\\d+/=]/g, '');\n\n let output = '';\n let i = 0;\n\n do {\n const enc1 = KEYSTR.indexOf(input.charAt(i++));\n const enc2 = KEYSTR.indexOf(input.charAt(i++));\n const enc3 = KEYSTR.indexOf(input.charAt(i++));\n const enc4 = KEYSTR.indexOf(input.charAt(i++));\n\n /* eslint-disable no-bitwise */\n const chr1 = (enc1 << 2) | (enc2 >> 4);\n const chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n const chr3 = ((enc3 & 3) << 6) | enc4;\n /* eslint-enable no-bitwise */\n\n output += String.fromCharCode(chr1);\n\n if (enc3 !== 64) {\n output += String.fromCharCode(chr2);\n }\n if (enc4 !== 64) {\n output += String.fromCharCode(chr3);\n }\n } while (i < input.length);\n return decodeUTF8(output);\n}\n\n/**\n* @function module:utilities.decodeUTF8\n* @param {string} argString\n* @returns {string}\n*/\nexport function decodeUTF8 (argString) {\n return decodeURIComponent(escape(argString));\n}\n\n// codedread:does not seem to work with webkit-based browsers on OSX // Brettz9: please test again as function upgraded\n/**\n* @function module:utilities.encodeUTF8\n* @param {string} argString\n* @returns {string}\n*/\nexport const encodeUTF8 = function (argString) {\n return unescape(encodeURIComponent(argString));\n};\n\n/**\n * Convert dataURL to object URL.\n * @function module:utilities.dataURLToObjectURL\n * @param {string} dataurl\n * @returns {string} object URL or empty string\n */\nexport const dataURLToObjectURL = function (dataurl) {\n if (typeof Uint8Array === 'undefined' || typeof Blob === 'undefined' || typeof URL === 'undefined' || !URL.createObjectURL) {\n return '';\n }\n const arr = dataurl.split(','),\n mime = arr[0].match(/:(.*?);/)[1],\n bstr = atob(arr[1]);\n /*\n const [prefix, suffix] = dataurl.split(','),\n {groups: {mime}} = prefix.match(/:(?.*?);/),\n bstr = atob(suffix);\n */\n let n = bstr.length;\n const u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n const blob = new Blob([u8arr], {type: mime});\n return URL.createObjectURL(blob);\n};\n\n/**\n * Get object URL for a blob object.\n * @function module:utilities.createObjectURL\n * @param {Blob} blob A Blob object or File object\n * @returns {string} object URL or empty string\n */\nexport const createObjectURL = function (blob) {\n if (!blob || typeof URL === 'undefined' || !URL.createObjectURL) {\n return '';\n }\n return URL.createObjectURL(blob);\n};\n\n/**\n * @property {string} blankPageObjectURL\n */\nexport const blankPageObjectURL = (function () {\n if (typeof Blob === 'undefined') {\n return '';\n }\n const blob = new Blob(['SVG-edit '], {type: 'text/html'});\n return createObjectURL(blob);\n})();\n\n/**\n* Converts a string to use XML references (for non-ASCII).\n* @function module:utilities.convertToXMLReferences\n* @param {string} input\n* @returns {string} Decimal numeric character references\n*/\nexport const convertToXMLReferences = function (input) {\n let output = '';\n [...input].forEach((ch) => {\n const c = ch.charCodeAt();\n if (c <= 127) {\n output += ch;\n } else {\n output += `${c};`;\n }\n });\n return output;\n};\n\n/**\n* Cross-browser compatible method of converting a string to an XML tree.\n* Found this function [here]{@link http://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f}.\n* @function module:utilities.text2xml\n* @param {string} sXML\n* @throws {Error}\n* @returns {XMLDocument}\n*/\nexport const text2xml = function (sXML) {\n if (sXML.includes('`\n* - ``\n* - ``\n* @function module:utilities.getUrlFromAttr\n* @param {string} attrVal The attribute value as a string\n* @returns {string} String with just the URL, like \"someFile.svg#foo\"\n*/\nexport const getUrlFromAttr = function (attrVal) {\n if (attrVal) {\n // url('#somegrad')\n if (attrVal.startsWith('url(\"')) {\n return attrVal.substring(5, attrVal.indexOf('\"', 6));\n }\n // url('#somegrad')\n if (attrVal.startsWith(\"url('\")) {\n return attrVal.substring(5, attrVal.indexOf(\"'\", 6));\n }\n if (attrVal.startsWith('url(')) {\n return attrVal.substring(4, attrVal.indexOf(')'));\n }\n }\n return null;\n};\n\n/**\n* @function module:utilities.getHref\n* @param {Element} elem\n* @returns {string} The given element's `xlink:href` value\n*/\nexport let getHref = function (elem) { // eslint-disable-line import/no-mutable-exports\n return elem.getAttributeNS(NS.XLINK, 'href');\n};\n\n/**\n* Sets the given element's `xlink:href` value.\n* @function module:utilities.setHref\n* @param {Element} elem\n* @param {string} val\n* @returns {void}\n*/\nexport let setHref = function (elem, val) { // eslint-disable-line import/no-mutable-exports\n elem.setAttributeNS(NS.XLINK, 'xlink:href', val);\n};\n\n/**\n* @function module:utilities.findDefs\n* @returns {SVGDefsElement} The document's `` element, creating it first if necessary\n*/\nexport const findDefs = function () {\n const svgElement = editorContext_.getSVGContent();\n let defs = svgElement.getElementsByTagNameNS(NS.SVG, 'defs');\n if (defs.length > 0) {\n defs = defs[0];\n } else {\n defs = svgElement.ownerDocument.createElementNS(NS.SVG, 'defs');\n if (svgElement.firstChild) {\n // first child is a comment, so call nextSibling\n svgElement.insertBefore(defs, svgElement.firstChild.nextSibling);\n // svgElement.firstChild.nextSibling.before(defs); // Not safe\n } else {\n svgElement.append(defs);\n }\n }\n return defs;\n};\n\n// TODO(codedread): Consider moving the next to functions to bbox.js\n\n/**\n* Get correct BBox for a path in Webkit.\n* Converted from code found [here]{@link http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html}.\n* @function module:utilities.getPathBBox\n* @param {SVGPathElement} path - The path DOM element to get the BBox for\n* @returns {module:utilities.BBoxObject} A BBox-like object\n*/\nexport const getPathBBox = function (path) {\n const seglist = path.pathSegList;\n const tot = seglist.numberOfItems;\n\n const bounds = [[], []];\n const start = seglist.getItem(0);\n let P0 = [start.x, start.y];\n\n const getCalc = function (j, P1, P2, P3) {\n return function (t) {\n return 1 - t ** 3 * P0[j] +\n 3 * 1 - t ** 2 * t * P1[j] +\n 3 * (1 - t) * t ** 2 * P2[j] +\n t ** 3 * P3[j];\n };\n };\n\n for (let i = 0; i < tot; i++) {\n const seg = seglist.getItem(i);\n\n if (seg.x === undefined) { continue; }\n\n // Add actual points to limits\n bounds[0].push(P0[0]);\n bounds[1].push(P0[1]);\n\n if (seg.x1) {\n const P1 = [seg.x1, seg.y1],\n P2 = [seg.x2, seg.y2],\n P3 = [seg.x, seg.y];\n\n for (let j = 0; j < 2; j++) {\n const calc = getCalc(j, P1, P2, P3);\n\n const b = 6 * P0[j] - 12 * P1[j] + 6 * P2[j];\n const a = -3 * P0[j] + 9 * P1[j] - 9 * P2[j] + 3 * P3[j];\n const c = 3 * P1[j] - 3 * P0[j];\n\n if (a === 0) {\n if (b === 0) { continue; }\n const t = -c / b;\n if (t > 0 && t < 1) {\n bounds[j].push(calc(t));\n }\n continue;\n }\n const b2ac = b ** 2 - 4 * c * a;\n if (b2ac < 0) { continue; }\n const t1 = (-b + Math.sqrt(b2ac)) / (2 * a);\n if (t1 > 0 && t1 < 1) { bounds[j].push(calc(t1)); }\n const t2 = (-b - Math.sqrt(b2ac)) / (2 * a);\n if (t2 > 0 && t2 < 1) { bounds[j].push(calc(t2)); }\n }\n P0 = P3;\n } else {\n bounds[0].push(seg.x);\n bounds[1].push(seg.y);\n }\n }\n\n const x = Math.min.apply(null, bounds[0]);\n const w = Math.max.apply(null, bounds[0]) - x;\n const y = Math.min.apply(null, bounds[1]);\n const h = Math.max.apply(null, bounds[1]) - y;\n return {\n x,\n y,\n width: w,\n height: h\n };\n};\n\n/**\n* Get the given/selected element's bounding box object, checking for\n* horizontal/vertical lines (see issue 717)\n* Note that performance is currently terrible, so some way to improve would\n* be great.\n* @param {Element} selected - Container or `