Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-inclu.../js/dist
File: compose.js
/******/ (() => { // webpackBootstrap
[0] Fix | Delete
/******/ var __webpack_modules__ = ({
[1] Fix | Delete
[2] Fix | Delete
/***/ 6689:
[3] Fix | Delete
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
[4] Fix | Delete
[5] Fix | Delete
"use strict";
[6] Fix | Delete
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
[7] Fix | Delete
/* harmony export */ createUndoManager: () => (/* binding */ createUndoManager)
[8] Fix | Delete
/* harmony export */ });
[9] Fix | Delete
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(923);
[10] Fix | Delete
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0__);
[11] Fix | Delete
/**
[12] Fix | Delete
* WordPress dependencies
[13] Fix | Delete
*/
[14] Fix | Delete
[15] Fix | Delete
[16] Fix | Delete
/** @typedef {import('./types').HistoryRecord} HistoryRecord */
[17] Fix | Delete
/** @typedef {import('./types').HistoryChange} HistoryChange */
[18] Fix | Delete
/** @typedef {import('./types').HistoryChanges} HistoryChanges */
[19] Fix | Delete
/** @typedef {import('./types').UndoManager} UndoManager */
[20] Fix | Delete
[21] Fix | Delete
/**
[22] Fix | Delete
* Merge changes for a single item into a record of changes.
[23] Fix | Delete
*
[24] Fix | Delete
* @param {Record< string, HistoryChange >} changes1 Previous changes
[25] Fix | Delete
* @param {Record< string, HistoryChange >} changes2 NextChanges
[26] Fix | Delete
*
[27] Fix | Delete
* @return {Record< string, HistoryChange >} Merged changes
[28] Fix | Delete
*/
[29] Fix | Delete
function mergeHistoryChanges(changes1, changes2) {
[30] Fix | Delete
/**
[31] Fix | Delete
* @type {Record< string, HistoryChange >}
[32] Fix | Delete
*/
[33] Fix | Delete
const newChanges = {
[34] Fix | Delete
...changes1
[35] Fix | Delete
};
[36] Fix | Delete
Object.entries(changes2).forEach(([key, value]) => {
[37] Fix | Delete
if (newChanges[key]) {
[38] Fix | Delete
newChanges[key] = {
[39] Fix | Delete
...newChanges[key],
[40] Fix | Delete
to: value.to
[41] Fix | Delete
};
[42] Fix | Delete
} else {
[43] Fix | Delete
newChanges[key] = value;
[44] Fix | Delete
}
[45] Fix | Delete
});
[46] Fix | Delete
return newChanges;
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
/**
[50] Fix | Delete
* Adds history changes for a single item into a record of changes.
[51] Fix | Delete
*
[52] Fix | Delete
* @param {HistoryRecord} record The record to merge into.
[53] Fix | Delete
* @param {HistoryChanges} changes The changes to merge.
[54] Fix | Delete
*/
[55] Fix | Delete
const addHistoryChangesIntoRecord = (record, changes) => {
[56] Fix | Delete
const existingChangesIndex = record?.findIndex(({
[57] Fix | Delete
id: recordIdentifier
[58] Fix | Delete
}) => {
[59] Fix | Delete
return typeof recordIdentifier === 'string' ? recordIdentifier === changes.id : _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default()(recordIdentifier, changes.id);
[60] Fix | Delete
});
[61] Fix | Delete
const nextRecord = [...record];
[62] Fix | Delete
if (existingChangesIndex !== -1) {
[63] Fix | Delete
// If the edit is already in the stack leave the initial "from" value.
[64] Fix | Delete
nextRecord[existingChangesIndex] = {
[65] Fix | Delete
id: changes.id,
[66] Fix | Delete
changes: mergeHistoryChanges(nextRecord[existingChangesIndex].changes, changes.changes)
[67] Fix | Delete
};
[68] Fix | Delete
} else {
[69] Fix | Delete
nextRecord.push(changes);
[70] Fix | Delete
}
[71] Fix | Delete
return nextRecord;
[72] Fix | Delete
};
[73] Fix | Delete
[74] Fix | Delete
/**
[75] Fix | Delete
* Creates an undo manager.
[76] Fix | Delete
*
[77] Fix | Delete
* @return {UndoManager} Undo manager.
[78] Fix | Delete
*/
[79] Fix | Delete
function createUndoManager() {
[80] Fix | Delete
/**
[81] Fix | Delete
* @type {HistoryRecord[]}
[82] Fix | Delete
*/
[83] Fix | Delete
let history = [];
[84] Fix | Delete
/**
[85] Fix | Delete
* @type {HistoryRecord}
[86] Fix | Delete
*/
[87] Fix | Delete
let stagedRecord = [];
[88] Fix | Delete
/**
[89] Fix | Delete
* @type {number}
[90] Fix | Delete
*/
[91] Fix | Delete
let offset = 0;
[92] Fix | Delete
const dropPendingRedos = () => {
[93] Fix | Delete
history = history.slice(0, offset || undefined);
[94] Fix | Delete
offset = 0;
[95] Fix | Delete
};
[96] Fix | Delete
const appendStagedRecordToLatestHistoryRecord = () => {
[97] Fix | Delete
var _history$index;
[98] Fix | Delete
const index = history.length === 0 ? 0 : history.length - 1;
[99] Fix | Delete
let latestRecord = (_history$index = history[index]) !== null && _history$index !== void 0 ? _history$index : [];
[100] Fix | Delete
stagedRecord.forEach(changes => {
[101] Fix | Delete
latestRecord = addHistoryChangesIntoRecord(latestRecord, changes);
[102] Fix | Delete
});
[103] Fix | Delete
stagedRecord = [];
[104] Fix | Delete
history[index] = latestRecord;
[105] Fix | Delete
};
[106] Fix | Delete
[107] Fix | Delete
/**
[108] Fix | Delete
* Checks whether a record is empty.
[109] Fix | Delete
* A record is considered empty if it the changes keep the same values.
[110] Fix | Delete
* Also updates to function values are ignored.
[111] Fix | Delete
*
[112] Fix | Delete
* @param {HistoryRecord} record
[113] Fix | Delete
* @return {boolean} Whether the record is empty.
[114] Fix | Delete
*/
[115] Fix | Delete
const isRecordEmpty = record => {
[116] Fix | Delete
const filteredRecord = record.filter(({
[117] Fix | Delete
changes
[118] Fix | Delete
}) => {
[119] Fix | Delete
return Object.values(changes).some(({
[120] Fix | Delete
from,
[121] Fix | Delete
to
[122] Fix | Delete
}) => typeof from !== 'function' && typeof to !== 'function' && !_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default()(from, to));
[123] Fix | Delete
});
[124] Fix | Delete
return !filteredRecord.length;
[125] Fix | Delete
};
[126] Fix | Delete
return {
[127] Fix | Delete
/**
[128] Fix | Delete
* Record changes into the history.
[129] Fix | Delete
*
[130] Fix | Delete
* @param {HistoryRecord=} record A record of changes to record.
[131] Fix | Delete
* @param {boolean} isStaged Whether to immediately create an undo point or not.
[132] Fix | Delete
*/
[133] Fix | Delete
addRecord(record, isStaged = false) {
[134] Fix | Delete
const isEmpty = !record || isRecordEmpty(record);
[135] Fix | Delete
if (isStaged) {
[136] Fix | Delete
if (isEmpty) {
[137] Fix | Delete
return;
[138] Fix | Delete
}
[139] Fix | Delete
record.forEach(changes => {
[140] Fix | Delete
stagedRecord = addHistoryChangesIntoRecord(stagedRecord, changes);
[141] Fix | Delete
});
[142] Fix | Delete
} else {
[143] Fix | Delete
dropPendingRedos();
[144] Fix | Delete
if (stagedRecord.length) {
[145] Fix | Delete
appendStagedRecordToLatestHistoryRecord();
[146] Fix | Delete
}
[147] Fix | Delete
if (isEmpty) {
[148] Fix | Delete
return;
[149] Fix | Delete
}
[150] Fix | Delete
history.push(record);
[151] Fix | Delete
}
[152] Fix | Delete
},
[153] Fix | Delete
undo() {
[154] Fix | Delete
if (stagedRecord.length) {
[155] Fix | Delete
dropPendingRedos();
[156] Fix | Delete
appendStagedRecordToLatestHistoryRecord();
[157] Fix | Delete
}
[158] Fix | Delete
const undoRecord = history[history.length - 1 + offset];
[159] Fix | Delete
if (!undoRecord) {
[160] Fix | Delete
return;
[161] Fix | Delete
}
[162] Fix | Delete
offset -= 1;
[163] Fix | Delete
return undoRecord;
[164] Fix | Delete
},
[165] Fix | Delete
redo() {
[166] Fix | Delete
const redoRecord = history[history.length + offset];
[167] Fix | Delete
if (!redoRecord) {
[168] Fix | Delete
return;
[169] Fix | Delete
}
[170] Fix | Delete
offset += 1;
[171] Fix | Delete
return redoRecord;
[172] Fix | Delete
},
[173] Fix | Delete
hasUndo() {
[174] Fix | Delete
return !!history[history.length - 1 + offset];
[175] Fix | Delete
},
[176] Fix | Delete
hasRedo() {
[177] Fix | Delete
return !!history[history.length + offset];
[178] Fix | Delete
}
[179] Fix | Delete
};
[180] Fix | Delete
}
[181] Fix | Delete
[182] Fix | Delete
[183] Fix | Delete
/***/ }),
[184] Fix | Delete
[185] Fix | Delete
/***/ 3758:
[186] Fix | Delete
/***/ (function(module) {
[187] Fix | Delete
[188] Fix | Delete
/*!
[189] Fix | Delete
* clipboard.js v2.0.11
[190] Fix | Delete
* https://clipboardjs.com/
[191] Fix | Delete
*
[192] Fix | Delete
* Licensed MIT © Zeno Rocha
[193] Fix | Delete
*/
[194] Fix | Delete
(function webpackUniversalModuleDefinition(root, factory) {
[195] Fix | Delete
if(true)
[196] Fix | Delete
module.exports = factory();
[197] Fix | Delete
else {}
[198] Fix | Delete
})(this, function() {
[199] Fix | Delete
return /******/ (function() { // webpackBootstrap
[200] Fix | Delete
/******/ var __webpack_modules__ = ({
[201] Fix | Delete
[202] Fix | Delete
/***/ 686:
[203] Fix | Delete
/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_623__) {
[204] Fix | Delete
[205] Fix | Delete
"use strict";
[206] Fix | Delete
[207] Fix | Delete
// EXPORTS
[208] Fix | Delete
__nested_webpack_require_623__.d(__nested_webpack_exports__, {
[209] Fix | Delete
"default": function() { return /* binding */ clipboard; }
[210] Fix | Delete
});
[211] Fix | Delete
[212] Fix | Delete
// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js
[213] Fix | Delete
var tiny_emitter = __nested_webpack_require_623__(279);
[214] Fix | Delete
var tiny_emitter_default = /*#__PURE__*/__nested_webpack_require_623__.n(tiny_emitter);
[215] Fix | Delete
// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js
[216] Fix | Delete
var listen = __nested_webpack_require_623__(370);
[217] Fix | Delete
var listen_default = /*#__PURE__*/__nested_webpack_require_623__.n(listen);
[218] Fix | Delete
// EXTERNAL MODULE: ./node_modules/select/src/select.js
[219] Fix | Delete
var src_select = __nested_webpack_require_623__(817);
[220] Fix | Delete
var select_default = /*#__PURE__*/__nested_webpack_require_623__.n(src_select);
[221] Fix | Delete
;// CONCATENATED MODULE: ./src/common/command.js
[222] Fix | Delete
/**
[223] Fix | Delete
* Executes a given operation type.
[224] Fix | Delete
* @param {String} type
[225] Fix | Delete
* @return {Boolean}
[226] Fix | Delete
*/
[227] Fix | Delete
function command(type) {
[228] Fix | Delete
try {
[229] Fix | Delete
return document.execCommand(type);
[230] Fix | Delete
} catch (err) {
[231] Fix | Delete
return false;
[232] Fix | Delete
}
[233] Fix | Delete
}
[234] Fix | Delete
;// CONCATENATED MODULE: ./src/actions/cut.js
[235] Fix | Delete
[236] Fix | Delete
[237] Fix | Delete
/**
[238] Fix | Delete
* Cut action wrapper.
[239] Fix | Delete
* @param {String|HTMLElement} target
[240] Fix | Delete
* @return {String}
[241] Fix | Delete
*/
[242] Fix | Delete
[243] Fix | Delete
var ClipboardActionCut = function ClipboardActionCut(target) {
[244] Fix | Delete
var selectedText = select_default()(target);
[245] Fix | Delete
command('cut');
[246] Fix | Delete
return selectedText;
[247] Fix | Delete
};
[248] Fix | Delete
[249] Fix | Delete
/* harmony default export */ var actions_cut = (ClipboardActionCut);
[250] Fix | Delete
;// CONCATENATED MODULE: ./src/common/create-fake-element.js
[251] Fix | Delete
/**
[252] Fix | Delete
* Creates a fake textarea element with a value.
[253] Fix | Delete
* @param {String} value
[254] Fix | Delete
* @return {HTMLElement}
[255] Fix | Delete
*/
[256] Fix | Delete
function createFakeElement(value) {
[257] Fix | Delete
var isRTL = document.documentElement.getAttribute('dir') === 'rtl';
[258] Fix | Delete
var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS
[259] Fix | Delete
[260] Fix | Delete
fakeElement.style.fontSize = '12pt'; // Reset box model
[261] Fix | Delete
[262] Fix | Delete
fakeElement.style.border = '0';
[263] Fix | Delete
fakeElement.style.padding = '0';
[264] Fix | Delete
fakeElement.style.margin = '0'; // Move element out of screen horizontally
[265] Fix | Delete
[266] Fix | Delete
fakeElement.style.position = 'absolute';
[267] Fix | Delete
fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically
[268] Fix | Delete
[269] Fix | Delete
var yPosition = window.pageYOffset || document.documentElement.scrollTop;
[270] Fix | Delete
fakeElement.style.top = "".concat(yPosition, "px");
[271] Fix | Delete
fakeElement.setAttribute('readonly', '');
[272] Fix | Delete
fakeElement.value = value;
[273] Fix | Delete
return fakeElement;
[274] Fix | Delete
}
[275] Fix | Delete
;// CONCATENATED MODULE: ./src/actions/copy.js
[276] Fix | Delete
[277] Fix | Delete
[278] Fix | Delete
[279] Fix | Delete
/**
[280] Fix | Delete
* Create fake copy action wrapper using a fake element.
[281] Fix | Delete
* @param {String} target
[282] Fix | Delete
* @param {Object} options
[283] Fix | Delete
* @return {String}
[284] Fix | Delete
*/
[285] Fix | Delete
[286] Fix | Delete
var fakeCopyAction = function fakeCopyAction(value, options) {
[287] Fix | Delete
var fakeElement = createFakeElement(value);
[288] Fix | Delete
options.container.appendChild(fakeElement);
[289] Fix | Delete
var selectedText = select_default()(fakeElement);
[290] Fix | Delete
command('copy');
[291] Fix | Delete
fakeElement.remove();
[292] Fix | Delete
return selectedText;
[293] Fix | Delete
};
[294] Fix | Delete
/**
[295] Fix | Delete
* Copy action wrapper.
[296] Fix | Delete
* @param {String|HTMLElement} target
[297] Fix | Delete
* @param {Object} options
[298] Fix | Delete
* @return {String}
[299] Fix | Delete
*/
[300] Fix | Delete
[301] Fix | Delete
[302] Fix | Delete
var ClipboardActionCopy = function ClipboardActionCopy(target) {
[303] Fix | Delete
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
[304] Fix | Delete
container: document.body
[305] Fix | Delete
};
[306] Fix | Delete
var selectedText = '';
[307] Fix | Delete
[308] Fix | Delete
if (typeof target === 'string') {
[309] Fix | Delete
selectedText = fakeCopyAction(target, options);
[310] Fix | Delete
} else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) {
[311] Fix | Delete
// If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange
[312] Fix | Delete
selectedText = fakeCopyAction(target.value, options);
[313] Fix | Delete
} else {
[314] Fix | Delete
selectedText = select_default()(target);
[315] Fix | Delete
command('copy');
[316] Fix | Delete
}
[317] Fix | Delete
[318] Fix | Delete
return selectedText;
[319] Fix | Delete
};
[320] Fix | Delete
[321] Fix | Delete
/* harmony default export */ var actions_copy = (ClipboardActionCopy);
[322] Fix | Delete
;// CONCATENATED MODULE: ./src/actions/default.js
[323] Fix | Delete
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
[324] Fix | Delete
[325] Fix | Delete
[326] Fix | Delete
[327] Fix | Delete
/**
[328] Fix | Delete
* Inner function which performs selection from either `text` or `target`
[329] Fix | Delete
* properties and then executes copy or cut operations.
[330] Fix | Delete
* @param {Object} options
[331] Fix | Delete
*/
[332] Fix | Delete
[333] Fix | Delete
var ClipboardActionDefault = function ClipboardActionDefault() {
[334] Fix | Delete
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
[335] Fix | Delete
// Defines base properties passed from constructor.
[336] Fix | Delete
var _options$action = options.action,
[337] Fix | Delete
action = _options$action === void 0 ? 'copy' : _options$action,
[338] Fix | Delete
container = options.container,
[339] Fix | Delete
target = options.target,
[340] Fix | Delete
text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'.
[341] Fix | Delete
[342] Fix | Delete
if (action !== 'copy' && action !== 'cut') {
[343] Fix | Delete
throw new Error('Invalid "action" value, use either "copy" or "cut"');
[344] Fix | Delete
} // Sets the `target` property using an element that will be have its content copied.
[345] Fix | Delete
[346] Fix | Delete
[347] Fix | Delete
if (target !== undefined) {
[348] Fix | Delete
if (target && _typeof(target) === 'object' && target.nodeType === 1) {
[349] Fix | Delete
if (action === 'copy' && target.hasAttribute('disabled')) {
[350] Fix | Delete
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
[351] Fix | Delete
}
[352] Fix | Delete
[353] Fix | Delete
if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
[354] Fix | Delete
throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
[355] Fix | Delete
}
[356] Fix | Delete
} else {
[357] Fix | Delete
throw new Error('Invalid "target" value, use a valid Element');
[358] Fix | Delete
}
[359] Fix | Delete
} // Define selection strategy based on `text` property.
[360] Fix | Delete
[361] Fix | Delete
[362] Fix | Delete
if (text) {
[363] Fix | Delete
return actions_copy(text, {
[364] Fix | Delete
container: container
[365] Fix | Delete
});
[366] Fix | Delete
} // Defines which selection strategy based on `target` property.
[367] Fix | Delete
[368] Fix | Delete
[369] Fix | Delete
if (target) {
[370] Fix | Delete
return action === 'cut' ? actions_cut(target) : actions_copy(target, {
[371] Fix | Delete
container: container
[372] Fix | Delete
});
[373] Fix | Delete
}
[374] Fix | Delete
};
[375] Fix | Delete
[376] Fix | Delete
/* harmony default export */ var actions_default = (ClipboardActionDefault);
[377] Fix | Delete
;// CONCATENATED MODULE: ./src/clipboard.js
[378] Fix | Delete
function clipboard_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return clipboard_typeof(obj); }
[379] Fix | Delete
[380] Fix | Delete
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
[381] Fix | Delete
[382] Fix | Delete
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
[383] Fix | Delete
[384] Fix | Delete
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
[385] Fix | Delete
[386] Fix | Delete
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
[387] Fix | Delete
[388] Fix | Delete
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
[389] Fix | Delete
[390] Fix | Delete
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
[391] Fix | Delete
[392] Fix | Delete
function _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
[393] Fix | Delete
[394] Fix | Delete
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
[395] Fix | Delete
[396] Fix | Delete
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
[397] Fix | Delete
[398] Fix | Delete
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
[399] Fix | Delete
[400] Fix | Delete
[401] Fix | Delete
[402] Fix | Delete
[403] Fix | Delete
[404] Fix | Delete
[405] Fix | Delete
/**
[406] Fix | Delete
* Helper function to retrieve attribute value.
[407] Fix | Delete
* @param {String} suffix
[408] Fix | Delete
* @param {Element} element
[409] Fix | Delete
*/
[410] Fix | Delete
[411] Fix | Delete
function getAttributeValue(suffix, element) {
[412] Fix | Delete
var attribute = "data-clipboard-".concat(suffix);
[413] Fix | Delete
[414] Fix | Delete
if (!element.hasAttribute(attribute)) {
[415] Fix | Delete
return;
[416] Fix | Delete
}
[417] Fix | Delete
[418] Fix | Delete
return element.getAttribute(attribute);
[419] Fix | Delete
}
[420] Fix | Delete
/**
[421] Fix | Delete
* Base class which takes one or more elements, adds event listeners to them,
[422] Fix | Delete
* and instantiates a new `ClipboardAction` on each click.
[423] Fix | Delete
*/
[424] Fix | Delete
[425] Fix | Delete
[426] Fix | Delete
var Clipboard = /*#__PURE__*/function (_Emitter) {
[427] Fix | Delete
_inherits(Clipboard, _Emitter);
[428] Fix | Delete
[429] Fix | Delete
var _super = _createSuper(Clipboard);
[430] Fix | Delete
[431] Fix | Delete
/**
[432] Fix | Delete
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
[433] Fix | Delete
* @param {Object} options
[434] Fix | Delete
*/
[435] Fix | Delete
function Clipboard(trigger, options) {
[436] Fix | Delete
var _this;
[437] Fix | Delete
[438] Fix | Delete
_classCallCheck(this, Clipboard);
[439] Fix | Delete
[440] Fix | Delete
_this = _super.call(this);
[441] Fix | Delete
[442] Fix | Delete
_this.resolveOptions(options);
[443] Fix | Delete
[444] Fix | Delete
_this.listenClick(trigger);
[445] Fix | Delete
[446] Fix | Delete
return _this;
[447] Fix | Delete
}
[448] Fix | Delete
/**
[449] Fix | Delete
* Defines if attributes would be resolved using internal setter functions
[450] Fix | Delete
* or custom functions that were passed in the constructor.
[451] Fix | Delete
* @param {Object} options
[452] Fix | Delete
*/
[453] Fix | Delete
[454] Fix | Delete
[455] Fix | Delete
_createClass(Clipboard, [{
[456] Fix | Delete
key: "resolveOptions",
[457] Fix | Delete
value: function resolveOptions() {
[458] Fix | Delete
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
[459] Fix | Delete
this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
[460] Fix | Delete
this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
[461] Fix | Delete
this.text = typeof options.text === 'function' ? options.text : this.defaultText;
[462] Fix | Delete
this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;
[463] Fix | Delete
}
[464] Fix | Delete
/**
[465] Fix | Delete
* Adds a click event listener to the passed trigger.
[466] Fix | Delete
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
[467] Fix | Delete
*/
[468] Fix | Delete
[469] Fix | Delete
}, {
[470] Fix | Delete
key: "listenClick",
[471] Fix | Delete
value: function listenClick(trigger) {
[472] Fix | Delete
var _this2 = this;
[473] Fix | Delete
[474] Fix | Delete
this.listener = listen_default()(trigger, 'click', function (e) {
[475] Fix | Delete
return _this2.onClick(e);
[476] Fix | Delete
});
[477] Fix | Delete
}
[478] Fix | Delete
/**
[479] Fix | Delete
* Defines a new `ClipboardAction` on each click event.
[480] Fix | Delete
* @param {Event} e
[481] Fix | Delete
*/
[482] Fix | Delete
[483] Fix | Delete
}, {
[484] Fix | Delete
key: "onClick",
[485] Fix | Delete
value: function onClick(e) {
[486] Fix | Delete
var trigger = e.delegateTarget || e.currentTarget;
[487] Fix | Delete
var action = this.action(trigger) || 'copy';
[488] Fix | Delete
var text = actions_default({
[489] Fix | Delete
action: action,
[490] Fix | Delete
container: this.container,
[491] Fix | Delete
target: this.target(trigger),
[492] Fix | Delete
text: this.text(trigger)
[493] Fix | Delete
}); // Fires an event based on the copy operation result.
[494] Fix | Delete
[495] Fix | Delete
this.emit(text ? 'success' : 'error', {
[496] Fix | Delete
action: action,
[497] Fix | Delete
text: text,
[498] Fix | Delete
trigger: trigger,
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function