: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
clearSelection: function clearSelection() {
window.getSelection().removeAllRanges();
* Default `action` lookup function.
* @param {Element} trigger
value: function defaultAction(trigger) {
return getAttributeValue('action', trigger);
* Default `target` lookup function.
* @param {Element} trigger
value: function defaultTarget(trigger) {
var selector = getAttributeValue('target', trigger);
return document.querySelector(selector);
* Allow fire programmatically a copy action
* @param {String|HTMLElement} target
* @param {Object} options
* Default `text` lookup function.
* @param {Element} trigger
value: function defaultText(trigger) {
return getAttributeValue('text', trigger);
value: function destroy() {
value: function copy(target) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
return actions_copy(target, options);
* Allow fire programmatically a cut action
* @param {String|HTMLElement} target
value: function cut(target) {
return actions_cut(target);
* Returns the support of the given action, or all actions if no action is
* @param {String} [action]
value: function isSupported() {
var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
var actions = typeof action === 'string' ? [action] : action;
var support = !!document.queryCommandSupported;
actions.forEach(function (action) {
support = support && !!document.queryCommandSupported(action);
}((tiny_emitter_default()));
/* harmony default export */ var clipboard = (Clipboard);
/***/ (function(module) {
var DOCUMENT_NODE_TYPE = 9;
* A polyfill for Element.matches()
if (typeof Element !== 'undefined' && !Element.prototype.matches) {
var proto = Element.prototype;
proto.matches = proto.matchesSelector ||
proto.mozMatchesSelector ||
proto.msMatchesSelector ||
proto.oMatchesSelector ||
proto.webkitMatchesSelector;
* Finds the closest parent that matches a selector.
* @param {Element} element
* @param {String} selector
function closest (element, selector) {
while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
if (typeof element.matches === 'function' &&
element.matches(selector)) {
element = element.parentNode;
module.exports = closest;
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_15749__) {
var closest = __nested_webpack_require_15749__(828);
* Delegates event to a selector.
* @param {Element} element
* @param {String} selector
* @param {Function} callback
* @param {Boolean} useCapture
function _delegate(element, selector, type, callback, useCapture) {
var listenerFn = listener.apply(this, arguments);
element.addEventListener(type, listenerFn, useCapture);
element.removeEventListener(type, listenerFn, useCapture);
* Delegates event to a selector.
* @param {Element|String|Array} [elements]
* @param {String} selector
* @param {Function} callback
* @param {Boolean} useCapture
function delegate(elements, selector, type, callback, useCapture) {
// Handle the regular Element usage
if (typeof elements.addEventListener === 'function') {
return _delegate.apply(null, arguments);
// Handle Element-less usage, it defaults to global delegation
if (typeof type === 'function') {
// Use `document` as the first parameter, then apply arguments
// This is a short way to .unshift `arguments` without running into deoptimizations
return _delegate.bind(null, document).apply(null, arguments);
// Handle Selector-based usage
if (typeof elements === 'string') {
elements = document.querySelectorAll(elements);
// Handle Array-like based usage
return Array.prototype.map.call(elements, function (element) {
return _delegate(element, selector, type, callback, useCapture);
* Finds closest match and invokes callback.
* @param {Element} element
* @param {String} selector
* @param {Function} callback
function listener(element, selector, type, callback) {
e.delegateTarget = closest(e.target, selector);
callback.call(element, e);
module.exports = delegate;
/***/ (function(__unused_webpack_module, exports) {
* Check if argument is a HTML element.
exports.node = function(value) {
return value !== undefined
&& value instanceof HTMLElement
* Check if argument is a list of HTML elements.
exports.nodeList = function(value) {
var type = Object.prototype.toString.call(value);
return value !== undefined
&& (type === '[object NodeList]' || type === '[object HTMLCollection]')
&& (value.length === 0 || exports.node(value[0]));
* Check if argument is a string.
exports.string = function(value) {
return typeof value === 'string'
|| value instanceof String;
* Check if argument is a function.
exports.fn = function(value) {
var type = Object.prototype.toString.call(value);
return type === '[object Function]';
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_19113__) {
var is = __nested_webpack_require_19113__(879);
var delegate = __nested_webpack_require_19113__(438);
* Validates all params and calls the right
* listener function based on its target type.
* @param {String|HTMLElement|HTMLCollection|NodeList} target
* @param {Function} callback
function listen(target, type, callback) {
if (!target && !type && !callback) {
throw new Error('Missing required arguments');
throw new TypeError('Second argument must be a String');
throw new TypeError('Third argument must be a Function');
return listenNode(target, type, callback);
else if (is.nodeList(target)) {
return listenNodeList(target, type, callback);
else if (is.string(target)) {
return listenSelector(target, type, callback);
throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
* Adds an event listener to a HTML element
* and returns a remove listener function.
* @param {HTMLElement} node
* @param {Function} callback
function listenNode(node, type, callback) {
node.addEventListener(type, callback);
node.removeEventListener(type, callback);
* Add an event listener to a list of HTML elements
* and returns a remove listener function.
* @param {NodeList|HTMLCollection} nodeList
* @param {Function} callback
function listenNodeList(nodeList, type, callback) {
Array.prototype.forEach.call(nodeList, function(node) {
node.addEventListener(type, callback);
Array.prototype.forEach.call(nodeList, function(node) {
node.removeEventListener(type, callback);
* Add an event listener to a selector
* and returns a remove listener function.
* @param {String} selector
* @param {Function} callback
function listenSelector(selector, type, callback) {
return delegate(document.body, selector, type, callback);
/***/ (function(module) {
function select(element) {
if (element.nodeName === 'SELECT') {
selectedText = element.value;
else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
var isReadOnly = element.hasAttribute('readonly');
element.setAttribute('readonly', '');
element.setSelectionRange(0, element.value.length);
element.removeAttribute('readonly');
selectedText = element.value;
if (element.hasAttribute('contenteditable')) {
var selection = window.getSelection();
var range = document.createRange();
range.selectNodeContents(element);
selection.removeAllRanges();
selection.addRange(range);
selectedText = selection.toString();
/***/ (function(module) {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});
(e[name] || (e[name] = [])).push({
once: function (name, callback, ctx) {
self.off(name, listener);
callback.apply(ctx, arguments);
return this.on(name, listener, ctx);
var data = [].slice.call(arguments, 1);
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
evtArr[i].fn.apply(evtArr[i].ctx, data);
off: function (name, callback) {
var e = this.e || (this.e = {});
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
liveEvents.push(evts[i]);
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910