Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

selecto

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

selecto - npm Package Compare versions

Comparing version 1.11.1 to 1.12.0

4

declaration/consts.d.ts
import { SelectoOptions } from "./types";
export declare const injector: import("css-styled").StyledInjector;
export declare const CLASS_NAME: string;
export declare const PROPERTIES: readonly ["boundContainer", "selectableTargets", "selectByClick", "selectFromInside", "continueSelect", "toggleContinueSelect", "keyContainer", "hitRate", "scrollOptions", "checkInput", "preventDefault", "ratio", "getElementRect", "preventDragFromInside"];
export declare const OPTIONS: readonly ["dragContainer", "cspNonce", ...("boundContainer" | "selectableTargets" | "selectByClick" | "selectFromInside" | "continueSelect" | "toggleContinueSelect" | "keyContainer" | "hitRate" | "scrollOptions" | "checkInput" | "preventDefault" | "ratio" | "getElementRect" | "preventDragFromInside")[]];
export declare const PROPERTIES: readonly ["boundContainer", "selectableTargets", "selectByClick", "selectFromInside", "continueSelect", "toggleContinueSelect", "keyContainer", "hitRate", "scrollOptions", "checkInput", "preventDefault", "ratio", "getElementRect", "preventDragFromInside", "rootContainer", "dragCondition"];
export declare const OPTIONS: readonly ["dragContainer", "cspNonce", ...("boundContainer" | "selectableTargets" | "selectByClick" | "selectFromInside" | "continueSelect" | "toggleContinueSelect" | "keyContainer" | "hitRate" | "scrollOptions" | "checkInput" | "preventDefault" | "ratio" | "getElementRect" | "preventDragFromInside" | "rootContainer" | "dragCondition")[]];
export declare const OPTION_TYPES: {

@@ -7,0 +7,0 @@ [key in keyof SelectoOptions]: any;

@@ -9,2 +9,3 @@ import { IObject } from "@daybrush/utils";

container: HTMLElement | null;
rootContainer: HTMLElement | null;
dragContainer: Element | Window | Element[] | string;

@@ -26,2 +27,3 @@ selectableTargets: Array<HTMLElement | string>;

getElementRect: getElementRectFunction;
dragCondition: ((e: OnParentDragStart) => boolean) | null;
}

@@ -28,0 +30,0 @@ export interface BoundContainer {

@@ -7,3 +7,3 @@ /*

repository: git+https://github.com/daybrush/selecto.git
version: 1.11.1
version: 1.12.0
*/

@@ -20,2 +20,3 @@ 'use strict';

var overlapArea = require('overlap-area');
var cssToMat = require('css-to-mat');
var styled = require('css-styled');

@@ -247,3 +248,3 @@

var injector = styled("\n:host {\n position: fixed;\n display: none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n z-index: 100;\n}\n");
var injector = styled("\n:host {\n position: fixed;\n display: none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n z-index: 100;\n}\n:host {\n position: absolute;\n}\n");
/**

@@ -254,3 +255,3 @@ * @memberof Selecto

var CLASS_NAME = "selecto-selection " + injector.className;
var PROPERTIES = ["boundContainer", "selectableTargets", "selectByClick", "selectFromInside", "continueSelect", "toggleContinueSelect", "keyContainer", "hitRate", "scrollOptions", "checkInput", "preventDefault", "ratio", "getElementRect", "preventDragFromInside"];
var PROPERTIES = ["boundContainer", "selectableTargets", "selectByClick", "selectFromInside", "continueSelect", "toggleContinueSelect", "keyContainer", "hitRate", "scrollOptions", "checkInput", "preventDefault", "ratio", "getElementRect", "preventDragFromInside", "rootContainer", "dragCondition"];
/**

@@ -280,3 +281,5 @@ * @memberof Selecto

getElementRect: Function,
preventDragFromInside: Boolean
preventDragFromInside: Boolean,
rootContainer: Object,
dragCondition: Function
};

@@ -328,9 +331,18 @@ /**

selectByClick = _a.selectByClick,
rootContainer = _a.rootContainer,
boundContainer = _a.boundContainer,
_b = _a.preventDragFromInside,
preventDragFromInside = _b === void 0 ? true : _b;
preventDragFromInside = _b === void 0 ? true : _b,
dragCondition = _a.dragCondition;
if (dragCondition && !dragCondition(e)) {
e.stop();
}
_this.findSelectableTargets(datas);
datas.startSelectedTargets = _this.selectedTargets;
datas.scaleMatrix = cssToMat.createMatrix();
datas.containerX = 0;
datas.containerY = 0;
var boundArea = {

@@ -343,2 +355,10 @@ left: -Infinity,

if (rootContainer) {
var containerRect = _this.container.getBoundingClientRect();
datas.containerX = containerRect.left;
datas.containerY = containerRect.top;
datas.scaleMatrix = cssToMat.getDistElementMatrix(_this.container, rootContainer);
}
if (boundContainer) {

@@ -473,3 +493,4 @@ var boundInfo = utils.isObject(boundContainer) && "element" in boundContainer ? __assign({

datas.preventDragFromInside = false;
datas.boundsArea = _this.target.style.cssText += "left:0px;top:0px;transform: translate(" + clientX + "px, " + clientY + "px)";
var offsetPos = cssToMat.calculateMatrixDist(datas.scaleMatrix, [clientX - datas.containerX, clientY - datas.containerY]);
datas.boundsArea = _this.target.style.cssText += "position: " + (rootContainer ? "absolute" : "fixed") + ";" + "left:0px;top:0px;" + ("transform: translate(" + offsetPos[0] + "px, " + offsetPos[1] + "px)");

@@ -663,2 +684,4 @@ if (isPreventSelect && selectByClick) {

preventDragFromInside: true,
dragCondition: null,
rootContainer: null,
getElementRect: getDefaultElementRect,

@@ -1140,2 +1163,7 @@ cspNonce: "",

var selectFlag = datas.selectFlag;
var containerX = datas.containerX,
containerY = datas.containerY,
scaleMatrix = datas.scaleMatrix;
var offsetPos = cssToMat.calculateMatrixDist(scaleMatrix, [left - containerX, top - containerY]);
var offsetSize = cssToMat.calculateMatrixDist(scaleMatrix, [width, height]);
var prevSelectedTargets = [];

@@ -1145,3 +1173,3 @@ var selectedTargets = [];

if (selectFlag) {
this.target.style.cssText += "display: block;" + "left:0px;top:0px;" + ("transform: translate(" + left + "px, " + top + "px);") + ("width:" + width + "px;height:" + height + "px;");
this.target.style.cssText += "display: block;" + "left:0px;top:0px;" + ("transform: translate(" + offsetPos[0] + "px, " + offsetPos[1] + "px);") + ("width:" + offsetSize[0] + "px;height:" + offsetSize[1] + "px;");
var passedTargets = this.hitTest(rect, datas.startX, datas.startY, datas.selectableTargets, datas.selectablePoints);

@@ -1148,0 +1176,0 @@ prevSelectedTargets = this.selectedTargets;

@@ -7,3 +7,3 @@ /*

repository: git+https://github.com/daybrush/selecto.git
version: 1.11.1
version: 1.12.0
*/

@@ -18,2 +18,3 @@ import EventEmitter from '@scena/event-emitter';

import { fitPoints, isInside, getOverlapPoints, getAreaSize } from 'overlap-area';
import { createMatrix, getDistElementMatrix, calculateMatrixDist } from 'css-to-mat';
import styled from 'css-styled';

@@ -245,3 +246,3 @@

var injector = styled("\n:host {\n position: fixed;\n display: none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n z-index: 100;\n}\n");
var injector = styled("\n:host {\n position: fixed;\n display: none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n z-index: 100;\n}\n:host {\n position: absolute;\n}\n");
/**

@@ -252,3 +253,3 @@ * @memberof Selecto

var CLASS_NAME = "selecto-selection " + injector.className;
var PROPERTIES = ["boundContainer", "selectableTargets", "selectByClick", "selectFromInside", "continueSelect", "toggleContinueSelect", "keyContainer", "hitRate", "scrollOptions", "checkInput", "preventDefault", "ratio", "getElementRect", "preventDragFromInside"];
var PROPERTIES = ["boundContainer", "selectableTargets", "selectByClick", "selectFromInside", "continueSelect", "toggleContinueSelect", "keyContainer", "hitRate", "scrollOptions", "checkInput", "preventDefault", "ratio", "getElementRect", "preventDragFromInside", "rootContainer", "dragCondition"];
/**

@@ -278,3 +279,5 @@ * @memberof Selecto

getElementRect: Function,
preventDragFromInside: Boolean
preventDragFromInside: Boolean,
rootContainer: Object,
dragCondition: Function
};

@@ -326,9 +329,18 @@ /**

selectByClick = _a.selectByClick,
rootContainer = _a.rootContainer,
boundContainer = _a.boundContainer,
_b = _a.preventDragFromInside,
preventDragFromInside = _b === void 0 ? true : _b;
preventDragFromInside = _b === void 0 ? true : _b,
dragCondition = _a.dragCondition;
if (dragCondition && !dragCondition(e)) {
e.stop();
}
_this.findSelectableTargets(datas);
datas.startSelectedTargets = _this.selectedTargets;
datas.scaleMatrix = createMatrix();
datas.containerX = 0;
datas.containerY = 0;
var boundArea = {

@@ -341,2 +353,10 @@ left: -Infinity,

if (rootContainer) {
var containerRect = _this.container.getBoundingClientRect();
datas.containerX = containerRect.left;
datas.containerY = containerRect.top;
datas.scaleMatrix = getDistElementMatrix(_this.container, rootContainer);
}
if (boundContainer) {

@@ -471,3 +491,4 @@ var boundInfo = isObject(boundContainer) && "element" in boundContainer ? __assign({

datas.preventDragFromInside = false;
datas.boundsArea = _this.target.style.cssText += "left:0px;top:0px;transform: translate(" + clientX + "px, " + clientY + "px)";
var offsetPos = calculateMatrixDist(datas.scaleMatrix, [clientX - datas.containerX, clientY - datas.containerY]);
datas.boundsArea = _this.target.style.cssText += "position: " + (rootContainer ? "absolute" : "fixed") + ";" + "left:0px;top:0px;" + ("transform: translate(" + offsetPos[0] + "px, " + offsetPos[1] + "px)");

@@ -661,2 +682,4 @@ if (isPreventSelect && selectByClick) {

preventDragFromInside: true,
dragCondition: null,
rootContainer: null,
getElementRect: getDefaultElementRect,

@@ -1138,2 +1161,7 @@ cspNonce: "",

var selectFlag = datas.selectFlag;
var containerX = datas.containerX,
containerY = datas.containerY,
scaleMatrix = datas.scaleMatrix;
var offsetPos = calculateMatrixDist(scaleMatrix, [left - containerX, top - containerY]);
var offsetSize = calculateMatrixDist(scaleMatrix, [width, height]);
var prevSelectedTargets = [];

@@ -1143,3 +1171,3 @@ var selectedTargets = [];

if (selectFlag) {
this.target.style.cssText += "display: block;" + "left:0px;top:0px;" + ("transform: translate(" + left + "px, " + top + "px);") + ("width:" + width + "px;height:" + height + "px;");
this.target.style.cssText += "display: block;" + "left:0px;top:0px;" + ("transform: translate(" + offsetPos[0] + "px, " + offsetPos[1] + "px);") + ("width:" + offsetSize[0] + "px;height:" + offsetSize[1] + "px;");
var passedTargets = this.hitTest(rect, datas.startX, datas.startY, datas.selectableTargets, datas.selectablePoints);

@@ -1146,0 +1174,0 @@ prevSelectedTargets = this.selectedTargets;

@@ -7,5 +7,5 @@ /*

repository: git+https://github.com/daybrush/selecto.git
version: 1.11.1
version: 1.12.0
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Selecto=e()}(this,function(){"use strict";var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var T=function(){return(T=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};var e="object",P="string",l=['"',"'",'\\"',"\\'"],i=1e-7;function x(t){return t&&typeof t===e}function f(t,e,n,r){for(var i=n;i<r;++i){var o=e[i].trim();if(o===t)return i;var a=i;if("("===o?a=f(")",e,i+1,r):-1<l.indexOf(o)&&(a=f(o,e,i+1,r)),-1===a)break;i=a}return-1}function s(t){return function(t,e){for(var n=new RegExp("(\\s*"+(e||",")+"\\s*|\\(|\\)|\"|'|\\\\\"|\\\\'|\\s+)","g"),r=t.split(n).filter(Boolean),i=r.length,o=[],a=[],s=0;s<i;++s){var c=r[s].trim(),u=s;if("("===c)u=f(")",r,s+1,i);else{if(")"===c)throw new Error("invalid format");if(-1<l.indexOf(c))u=f(c,r,s+1,i);else if(c===e){a.length&&(o.push(a.join("")),a=[]);continue}}-1===u&&(u=i-1),a.push(r.slice(s,u+1).join("")),s=u}return a.length&&o.push(a.join("")),o}(t,",")}function C(){return Date.now?Date.now():(new Date).getTime()}function m(t,e,n){void 0===n&&(n=-1);for(var r=t.length,i=0;i<r;++i)if(e(t[i],i,t))return i;return n}function v(t,e,n){return Math.max(e,Math.min(t,n))}function a(t,e){return e?Math.round(t/e)*e:t}function y(t,n,r){return[[a(n[0],i),a(n[0]*t[1]/t[0],i)],[a(n[1]*t[0]/t[1],i),a(n[1],i)]].filter(function(t){return t.every(function(t,e){return r?t<=n[e]:t>=n[e]})})[0]||t}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=Math.atan2(r,n);return 0<=i?i:i+2*Math.PI}function u(t){return[0,1].map(function(e){return function(t){for(var e=t.length,n=0,r=e-1;0<=r;--r)n+=t[r];return e?n/e:0}(t.map(function(t){return t[e]}))})}function g(t){var e=u(t),n=c(e,t[0]),r=c(e,t[1]);return n<r&&r-n<Math.PI||r<n&&r-n<-Math.PI?1:-1}function p(t,e){return Math.sqrt(Math.pow((e?e[0]:0)-t[0],2)+Math.pow((e?e[1]:0)-t[1],2))}function b(t,e,n,r){t.addEventListener(e,n,r)}function E(t,e,n){t.removeEventListener(e,n)}var h=function(){return(h=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};var t=function(){function t(){this._events={}}var e=t.prototype;return e.on=function(t,e){if(x(t))for(var n in t)this.on(n,t[n]);else this._addEvent(t,e,{});return this},e.off=function(t,e){if(t)if(x(t))for(var n in t)this.off(n);else if(e){var r=this._events[t];if(r){var i=m(r,function(t){return t.listener===e});-1<i&&r.splice(i,1)}}else this._events[t]=[];else this._events={};return this},e.once=function(e,t){var n=this;return t&&this._addEvent(e,t,{once:!0}),new Promise(function(t){n._addEvent(e,t,{once:!0})})},e.emit=function(e,n){var r=this;void 0===n&&(n={});var t=this._events[e];if(!e||!t)return!0;var i=!1;return n.eventType=e,n.stop=function(){i=!0},n.currentTarget=this,function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}(t).forEach(function(t){t.listener(n),t.once&&r.off(e,t.listener)}),!i},e.trigger=function(t,e){return void 0===e&&(e={}),this.emit(t,e)},e._addEvent=function(t,e,n){var r=this._events;r[t]=r[t]||[],r[t].push(h({listener:e},n))},t}(),d=function(t,e){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var S=function(){return(S=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function n(t){return 180*(e=[t[0].clientX,t[0].clientY],n=[t[1].clientX,t[1].clientY],r=n[0]-e[0],i=n[1]-e[1],(0<=(o=Math.atan2(i,r))?o:o+2*Math.PI)/Math.PI);var e,n,r,i,o}function w(t){return t.touches?function(t){for(var e=Math.min(t.length,2),n=[],r=0;r<e;++r)n.push(O(t[r]));return n}(t.touches):[O(t)]}function D(t,e,n){var r=n.length,i=_(t,r),o=i.clientX,a=i.clientY,s=i.originalClientX,c=i.originalClientY,u=_(e,r),l=u.clientX,f=u.clientY,h=_(n,r);return{clientX:s,clientY:c,deltaX:o-l,deltaY:a-f,distX:o-h.clientX,distY:a-h.clientY}}function k(t){return Math.sqrt(Math.pow(t[0].clientX-t[1].clientX,2)+Math.pow(t[0].clientY-t[1].clientY,2))}function O(t){return{clientX:t.clientX,clientY:t.clientY}}function _(t,e){void 0===e&&(e=t.length);for(var n={clientX:0,clientY:0,originalClientX:0,originalClientY:0},r=0;r<e;++r){var i=t[r];n.originalClientX+="originalClientX"in i?i.originalClientX:i.clientX,n.originalClientY+="originalClientY"in i?i.originalClientY:i.clientY,n.clientX+=i.clientX,n.clientY+=i.clientY}return e?{clientX:n.clientX/e,clientY:n.clientY/e,originalClientX:n.originalClientX/e,originalClientY:n.originalClientY/e}:n}var M=function(){function t(t){this.prevClients=[],this.startClients=[],this.movement=0,this.length=0,this.startClients=t,this.prevClients=t,this.length=t.length}var e=t.prototype;return e.addClients=function(t){void 0===t&&(t=this.prevClients);var e=this.getPosition(t),n=e.deltaX,r=e.deltaY;return this.movement+=Math.sqrt(n*n+r*r),this.prevClients=t,e},e.getAngle=function(t){return void 0===t&&(t=this.prevClients),n(t)},e.getRotation=function(t){return void 0===t&&(t=this.prevClients),n(t)-n(this.startClients)},e.getPosition=function(t){return D(t||this.prevClients,this.prevClients,this.startClients)},e.getPositions=function(n){void 0===n&&(n=this.prevClients);var r=this.prevClients;return this.startClients.map(function(t,e){return D([n[e]],[r[e]],[t])})},e.getMovement=function(t){var e=this.movement;if(!t)return e;var n=_(t,this.length),r=_(this.prevClients,this.length),i=n.clientX-r.clientX,o=n.clientY-r.clientY;return Math.sqrt(i*i+o*o)+e},e.getDistance=function(t){return void 0===t&&(t=this.prevClients),k(t)},e.getScale=function(t){return void 0===t&&(t=this.prevClients),k(t)/k(this.startClients)},e.move=function(e,n){this.startClients.forEach(function(t){t.clientX-=e,t.clientY-=n}),this.prevClients.forEach(function(t){t.clientX-=e,t.clientY-=n})},t}(),Y=["textarea","input"],X=function(c){function t(){this.constructor=e}var e,n;function r(t,e){void 0===e&&(e={});var y=c.call(this)||this;y.options={},y.flag=!1,y.pinchFlag=!1,y.datas={},y.isDrag=!1,y.isPinch=!1,y.isMouse=!1,y.isTouch=!1,y.clientStores=[],y.targets=[],y.prevTime=0,y.doubleFlag=!1,y.onDragStart=function(t,e){if(void 0===e&&(e=!0),y.flag||!1!==t.cancelable){var n=y.options,r=n.container,i=n.pinchOutside,o=n.preventRightClick,a=n.preventDefault,s=n.checkInput,c=y.isTouch,u=!y.flag;if(u){var l=document.activeElement,f=t.target,h=f.tagName.toLowerCase(),g=-1<Y.indexOf(h),p=f.isContentEditable;if(g||p){if(s||l===f)return!1;if(l&&p&&l.isContentEditable&&l.contains(f))return!1}else if((a||"touchstart"===t.type)&&l){var d=l.tagName;(l.isContentEditable||-1<Y.indexOf(d))&&l.blur()}if(y.clientStores=[new M(w(t))],y.flag=!0,y.isDrag=!1,y.datas={},o&&(3===t.which||2===t.button))return y.initDrag(),!1;y.doubleFlag=C()-y.prevTime<200,!1===y.emit("dragStart",S({datas:y.datas,inputEvent:t,isTrusted:e,isDouble:y.doubleFlag},y.getCurrentStore().getPosition()))&&y.initDrag(),y.flag&&a&&t.preventDefault()}if(!y.flag)return!1;var v,m=0;if(u&&c&&i&&(m=setTimeout(function(){b(r,"touchstart",y.onDragStart,{passive:!1})})),!u&&c&&i&&E(r,"touchstart",y.onDragStart),y.flag&&((v=t).touches&&2<=v.touches.length)){if(clearTimeout(m),u&&t.touches.length!==t.changedTouches.length)return;y.pinchFlag||y.onPinchStart(t)}}},y.onDrag=function(t,e){if(y.flag){var n=w(t),r=y.moveClients(n,t,!1);(y.pinchFlag||r.deltaX||r.deltaY)&&y.emit("drag",S({},r,{isScroll:!!e,inputEvent:t})),y.pinchFlag&&y.onPinch(t,n),y.getCurrentStore().addClients(n)}},y.onDragEnd=function(t){if(y.flag){var e=y.options,n=e.pinchOutside,r=e.container;y.isTouch&&n&&E(r,"touchstart",y.onDragStart),y.flag=!1;var i=y.getCurrentStore().getPosition(),o=C(),a=!y.isDrag&&y.doubleFlag;y.prevTime=y.isDrag||a?0:o,y.emit("dragEnd",S({datas:y.datas,isDouble:a,isDrag:y.isDrag,inputEvent:t},i)),y.pinchFlag&&y.onPinchEnd(t),y.clientStores=[]}},y.onBlur=function(){y.onDragEnd()};var n=[].concat(t);y.options=S({checkInput:!1,container:1<n.length?window:n[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},e);var r=y.options,i=r.container,o=r.events,a=r.checkWindowBlur;if(y.isTouch=-1<o.indexOf("touch"),y.isMouse=-1<o.indexOf("mouse"),y.targets=n,y.isMouse&&(n.forEach(function(t){b(t,"mousedown",y.onDragStart)}),b(i,"mousemove",y.onDrag),b(i,"mouseup",y.onDragEnd),b(i,"contextmenu",y.onDragEnd)),a&&b(window,"blur",y.onBlur),y.isTouch){var s={passive:!1};n.forEach(function(t){b(t,"touchstart",y.onDragStart,s)}),b(i,"touchmove",y.onDrag,s),b(i,"touchend",y.onDragEnd,s),b(i,"touchcancel",y.onDragEnd,s)}return y}d(e=r,n=c),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t);var i=r.prototype;return i.getMovement=function(t){return this.getCurrentStore().getMovement(t)+this.clientStores.slice(1).reduce(function(t,e){return t+e.movement},0)},i.isDragging=function(){return this.isDrag},i.isFlag=function(){return this.flag},i.isPinchFlag=function(){return this.pinchFlag},i.isDoubleFlag=function(){return this.doubleFlag},i.isPinching=function(){return this.isPinch},i.scrollBy=function(t,e,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(t,e),r&&this.onDrag(n,!0))},i.move=function(t,e){var r=t[0],i=t[1],n=this.getCurrentStore().prevClients;return this.moveClients(n.map(function(t){var e=t.clientX,n=t.clientY;return{clientX:e+r,clientY:n+i,originalClientX:e,originalClientY:n}}),e,!0)},i.triggerDragStart=function(t){this.onDragStart(t,!1)},i.setEventDatas=function(t){var e=this.datas;for(var n in t)e[n]=t[n];return this},i.getEventDatas=function(){return this.datas},i.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),E(window,"blur",this.onBlur),this.isMouse&&(t.forEach(function(t){E(t,"mousedown",e.onDragStart)}),E(n,"mousemove",this.onDrag),E(n,"mouseup",this.onDragEnd),E(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach(function(t){E(t,"touchstart",e.onDragStart)}),E(n,"touchstart",this.onDragStart),E(n,"touchmove",this.onDrag),E(n,"touchend",this.onDragEnd),E(n,"touchcancel",this.onDragEnd))},i.onPinchStart=function(t){var e=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>e)){var n=new M(w(t));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",S({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:t}))&&(this.pinchFlag=!1)}},i.onPinch=function(t,e){if(this.flag&&this.pinchFlag&&!(e.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",S({datas:this.datas,movement:this.getMovement(e),angle:n.getAngle(e),rotation:n.getRotation(e),touches:n.getPositions(e),scale:n.getScale(e),distance:n.getDistance(e)},n.getPosition(e),{inputEvent:t}))}},i.onPinchEnd=function(t){if(this.pinchFlag){var e=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",S({datas:this.datas,isPinch:e,touches:n.getPositions()},n.getPosition(),{inputEvent:t})),this.isPinch=!1,this.pinchFlag=!1}},i.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1},i.getCurrentStore=function(){return this.clientStores[0]},i.moveClients=function(t,e,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](t);return this.isDrag=!0,S({datas:this.datas},r,{movement:this.getMovement(t),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:e})},r}(t);var j=function(){function t(){this.keys=[],this.values=[]}var e=t.prototype;return e.get=function(t){return this.values[this.keys.indexOf(t)]},e.set=function(t,e){var n=this.keys,r=this.values,i=n.indexOf(t),o=-1===i?n.length:i;n[o]=t,r[o]=e},t}(),F=function(){function t(){this.object={}}var e=t.prototype;return e.get=function(t){return this.object[t]},e.set=function(t,e){this.object[t]=e},t}(),K="function"==typeof Map,I=function(){function t(){}var e=t.prototype;return e.connect=function(t,e){this.prev=t,this.next=e,t&&(t.next=this),e&&(e.prev=this)},e.disconnect=function(){var t=this.prev,e=this.next;t&&(t.next=e),e&&(e.prev=t)},e.getIndex=function(){for(var t=this,e=-1;t;)t=t.prev,++e;return e},t}();var A=function(){function t(t,e,n,r,i,o,a,s){this.prevList=t,this.list=e,this.added=n,this.removed=r,this.changed=i,this.maintained=o,this.changedBeforeAdded=a,this.fixed=s}var e=t.prototype;return Object.defineProperty(e,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(e,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),e.caculateOrdered=function(){var t,n,s,c,e=(t=this.changedBeforeAdded,n=this.fixed,s=[],c=[],t.forEach(function(t){var e=t[0],n=t[1],r=new I;s[e]=r,c[n]=r}),s.forEach(function(t,e){t.connect(s[e-1])}),t.filter(function(t,e){return!n[e]}).map(function(t,e){var n=t[0],r=t[1];if(n===r)return[0,0];var i=s[n],o=c[r-1],a=i.getIndex();return i.disconnect(),o?i.connect(o,o.next):i.connect(void 0,s[0]),[a,i.getIndex()]})),u=this.changed,l=[];this.cacheOrdered=e.filter(function(t,e){var n=t[0],r=t[1],i=u[e],o=i[0],a=i[1];if(n!==r)return l.push([o,a]),!0}),this.cachePureChanged=l},t}();var R,B="function"==typeof Map?void 0:(R=0,function(t){return t.__DIFF_KEY__||(t.__DIFF_KEY__=++R)});function N(t,e){return n=t,r=e,i=B,o=K?Map:i?F:j,a=i||function(t){return t},s=[],c=[],u=[],l=n.map(a),f=r.map(a),h=new o,g=new o,p=[],d=[],v={},m=[],b=y=0,l.forEach(function(t,e){h.set(t,e)}),f.forEach(function(t,e){g.set(t,e)}),l.forEach(function(t,e){var n=g.get(t);void 0===n?(++b,c.push(e)):v[n]=b}),f.forEach(function(t,e){var n=h.get(t);void 0===n?(s.push(e),++y):(u.push([n,e]),b=v[e]||0,p.push([n-b,e-y]),d.push(e===n),n!==e&&m.push([n,e]))}),c.reverse(),new A(n,r,s,c,m,u,p,d);var n,r,i,o,a,s,c,u,l,f,h,g,p,d,v,m,y,b}var L=function(t,e){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function q(t){var e=t.container;return[e.scrollLeft,e.scrollTop]}var W=function(e){function t(){this.constructor=n}var n,r;function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.startRect=null,t.startPos=[],t.prevTime=0,t.timer=0,t}L(n=i,r=e),n.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t);var o=i.prototype;return o.dragStart=function(t,e){var n=e.container,r=0,i=0,o=0,a=0;if(n===document.body)o=window.innerWidth,a=window.innerHeight;else{var s=n.getBoundingClientRect();r=s.top,i=s.left,o=s.width,a=s.height}this.startPos=[t.clientX,t.clientY],this.startRect={top:r,left:i,width:o,height:a}},o.drag=function(t,e){var n=this,r=t.clientX,i=t.clientY,o=e.container,a=e.threshold,s=void 0===a?0:a,c=e.throttleTime,u=void 0===c?0:c,l=e.getScrollPosition,f=void 0===l?q:l,h=this.startRect,g=this.startPos,p=C(),d=Math.max(u+this.prevTime-p,0),v=[0,0];if(h.top>i-s?(g[1]>h.top||i<g[1])&&(v[1]=-1):h.top+h.height<i+s&&(g[1]<h.top+h.height||i>g[1])&&(v[1]=1),h.left>r-s?(g[0]>h.left||r<g[0])&&(v[0]=-1):h.left+h.width<r+s&&(g[0]<h.left+h.width||r>g[0])&&(v[0]=1),clearTimeout(this.timer),!v[0]&&!v[1])return!1;if(0<d)return this.timer=window.setTimeout(function(){n.drag(t,e)},d),!1;this.prevTime=p;var m=f({container:o,direction:v});this.trigger("scroll",{container:o,direction:v,inputEvent:t});var y=f({container:o,direction:v}),b=y[0]-m[0],E=y[1]-m[1];return!(!b&&!E)&&(this.trigger("move",{offsetX:v[0]?b:0,offsetY:v[1]?E:0,inputEvent:t}),u&&(this.timer=window.setTimeout(function(){n.drag(t,e)},u)),!0)},o.dragEnd=function(){clearTimeout(this.timer)},i}(t),H=function(t,e){return(H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function U(t){return t&&"object"==typeof t}function z(t){return Array.isArray(t)}function G(t){return"string"==typeof t}function V(t,e,n,r){t.addEventListener(e,n,r)}function $(t,e,n){t.removeEventListener(e,n)}var J=function(){return(J=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};var Q=function(){function t(){this._events={}}var e=t.prototype;return e.on=function(t,e){if(U(t))for(var n in t)this.on(n,t[n]);else this._addEvent(t,e,{});return this},e.off=function(t,e){if(t)if(U(t))for(var n in t)this.off(n);else if(e){var r=this._events[t];if(r){var i=function(t,e,n){void 0===n&&(n=-1);for(var r=t.length,i=0;i<r;++i)if(e(t[i],i,t))return i;return n}(r,function(t){return t.listener===e});-1<i&&r.splice(i,1)}}else this._events[t]=[];else this._events={};return this},e.once=function(e,t){var n=this;return t&&this._addEvent(e,t,{once:!0}),new Promise(function(t){n._addEvent(e,t,{once:!0})})},e.emit=function(e,n){var r=this;void 0===n&&(n={});var t=this._events[e];if(!e||!t)return!0;var i=!1;return n.eventType=e,n.stop=function(){i=!0},n.currentTarget=this,function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}(t).forEach(function(t){t.listener(n),t.once&&r.off(e,t.listener)}),!i},e.trigger=function(t,e){return void 0===e&&(e={}),this.emit(t,e)},e._addEvent=function(t,e,n){var r=this._events;r[t]=r[t]||[],r[t].push(J({listener:e},n))},t}();var Z,tt,et=(function(t,e){function n(t){if(t&&"object"==typeof t){var e=t.which||t.keyCode||t.charCode;e&&(t=e)}if("number"==typeof t)return a[t];var n,r=String(t);return(n=i[r.toLowerCase()])?n:(n=o[r.toLowerCase()])||(1===r.length?r.charCodeAt(0):void 0)}n.isEventKey=function(t,e){if(t&&"object"==typeof t){var n=t.which||t.keyCode||t.charCode;if(null==n)return!1;if("string"==typeof e){var r;if(r=i[e.toLowerCase()])return r===n;if(r=o[e.toLowerCase()])return r===n}else if("number"==typeof e)return e===n;return!1}};var i=(e=t.exports=n).code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(r=97;r<123;r++)i[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)i[r-48]=r;for(r=1;r<13;r++)i["f"+r]=r+111;for(r=0;r<10;r++)i["numpad "+r]=r+96;var a=e.names=e.title={};for(r in i)a[i[r]]=r;for(var s in o)i[s]=o[s]}(Z={exports:{}},Z.exports),Z.exports),nt=(et.code,et.codes,et.aliases,et.names),rt=(et.title,{"+":"plus","left command":"meta","right command":"meta"}),it={shift:1,ctrl:2,alt:3,meta:4};function ot(t){var e=nt[t]||"";for(var n in rt)e=e.replace(n,rt[n]);return e.replace(/\s/g,"")}function at(t,e){void 0===e&&(e=ot(t.keyCode));var n,r=[(n=t).shiftKey&&"shift",n.ctrlKey&&"ctrl",n.altKey&&"alt",n.metaKey&&"meta"].filter(Boolean);return-1===r.indexOf(e)&&r.push(e),r.filter(Boolean)}function st(t){var e=t.slice();return e.sort(function(t,e){return(it[t]||5)-(it[e]||5)}),e}var ct=function(n){function t(){this.constructor=e}var e,r;function i(t){void 0===t&&(t=window);var e=n.call(this)||this;return e.container=t,e.ctrlKey=!1,e.altKey=!1,e.shiftKey=!1,e.metaKey=!1,e.clear=function(){return e.ctrlKey=!1,e.altKey=!1,e.shiftKey=!1,e.metaKey=!1,e},e.keydownEvent=function(t){e.triggerEvent("keydown",t)},e.keyupEvent=function(t){e.triggerEvent("keyup",t)},e.blur=function(){e.clear(),e.trigger("blur")},V(t,"blur",e.blur),V(t,"keydown",e.keydownEvent),V(t,"keyup",e.keyupEvent),e}H(e=i,r=n),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t);var o=i.prototype;return Object.defineProperty(i,"global",{get:function(){return tt=tt||new i},enumerable:!1,configurable:!0}),i.setGlobal=function(){return this.global},o.destroy=function(){var t=this.container;this.clear(),this.off(),$(t,"blur",this.blur),$(t,"keydown",this.keydownEvent),$(t,"keyup",this.keyupEvent)},o.keydown=function(t,e){return this.addEvent("keydown",t,e)},o.offKeydown=function(t,e){return this.removeEvent("keydown",t,e)},o.offKeyup=function(t,e){return this.removeEvent("keyup",t,e)},o.keyup=function(t,e){return this.addEvent("keyup",t,e)},o.addEvent=function(t,e,n){return z(e)?this.on(t+"."+st(e).join("."),n):G(e)?this.on(t+"."+e,n):this.on(t,e),this},o.removeEvent=function(t,e,n){return z(e)?this.off(t+"."+st(e).join("."),n):G(e)?this.off(t+"."+e,n):this.off(t,e),this},o.triggerEvent=function(t,e){this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey;var n=ot(e.keyCode),r={key:n,isToggle:"ctrl"===n||"shift"===n||"meta"===n||"alt"===n,inputEvent:e,keyCode:e.keyCode,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey};this.trigger(t,r),this.trigger(t+"."+n,r);var i=at(e,n);1<i.length&&this.trigger(t+"."+i.join("."),r)},i}(Q);function ut(r){return r.length<3?0:Math.abs(function(t){for(var e=0,n=t.length-1;0<=n;--n)e+=t[n];return e}(r.map(function(t,e){var n=r[e+1]||r[0];return t[0]*n[1]-n[0]*t[1]})))/2}function lt(t){var e=t.map(function(t){return t[0]}),n=t.map(function(t){return t[1]});return{minX:Math.min.apply(Math,e),minY:Math.min.apply(Math,n),maxX:Math.max.apply(Math,e),maxY:Math.max.apply(Math,n)}}function ft(t,e,n){var i=t[0],o=t[1],r=lt(e),a=r.minX,s=r.minY,c=r.maxX,u=r.maxY,l=[[a,o],[c,o]],f=[[i,s],[i,u]],h=ht(l[0],l[1]),g=ht(f[0],f[1]),p=dt(e),d=[],v=[];return p.forEach(function(t){var e=ht(t[0],t[1]),n=pt(gt(h,e),[l,t]),r=pt(gt(g,e),[f,t]);1===n.length&&t[0][1]===o||d.push.apply(d,n),1===r.length&&t[0][0]===i||v.push.apply(v,r),e[0]||d.push.apply(d,n),e[1]||v.push.apply(v,r)}),!n&&(-1<m(d,function(t){return t[0]===i})||-1<m(v,function(t){return t[1]===o}))||!!(d.filter(function(t){return t[0]>i}).length%2&&v.filter(function(t){return t[1]>o}).length%2)}function ht(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];if(n===i&&r===o)return[0,0,0];if(n===i)return[1,0,-n];if(r===o)return[0,1,-r];var a=(i-n)/(r-o);return[1,a,-n-a*r]}function gt(t,e){var n,r,i=t[0],o=t[1],a=t[2],s=e[0],c=e[1],u=e[2],l=0===i&&0===s,f=0===o&&0===c;if(l&&f)return[];if(l){var h=-a/o;return h!=-u/c?[]:[[-1/0,h],[1/0,h]]}if(f){var g=-a/i;return g!=-u/s?[]:[[g,-1/0],[g,1/0]]}return 0!==i?0!==s?0!==o?0!==c?[[n=(o*u-c*a)/(c*i-o*s),r=-(i*n+a)/o]]:[[n=-u/s,r=-(i*n+a)/o]]:[[n=-a/i,r=-(s*n+u)/c]]:[[n=-(o*(r=-u/c)+a)/i,r]]:[[n=-(c*(r=-a/o)+u)/s,r]]}function pt(t,e){var n=e.map(function(e){return[0,1].map(function(t){return[Math.min(e[0][t],e[1][t]),Math.max(e[0][t],e[1][t])]})});if(2===t.length){var r=t[0],i=r[0],o=r[1];if(i===t[1][0]){var a=Math.max.apply(Math,n.map(function(t){return t[1][0]})),s=Math.min.apply(Math,n.map(function(t){return t[1][1]}));return s<a?[]:[[i,a],[i,s]]}if(o===t[1][1]){var c=Math.max.apply(Math,n.map(function(t){return t[0][0]})),u=Math.min.apply(Math,n.map(function(t){return t[0][1]}));return u<c?[]:[[c,o],[u,o]]}}return t.filter(function(e){return n.every(function(t){return t[0][0]<=e[0]&&e[0]<=t[0][1]&&t[1][0]<=e[1]&&e[1]<=t[1][1]})})}function dt(n){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}(n.slice(1),[n[0]]).map(function(t,e){return[n[e],t]})}function vt(t,e,n){var r=t.tag,i=t.children,o=t.attributes,a=t.className,s=t.style,c=e||document.createElement(r);for(var u in o)c.setAttribute(u,o[u]);var l=c.children;if(i.forEach(function(t,e){vt(t,l[e],c)}),a&&a.split(" ").forEach(function(t){var e,n,r,i;i=t,((r=c).classList?r.classList.contains(i):r.className.match(new RegExp("(\\s|^)"+i+"(\\s|$)")))||(n=t,(e=c).classList?e.classList.add(n):e.className+=" "+n)}),s){var f=c.style;for(var u in s)f[u]=s[u]}return!e&&n&&n.appendChild(c),c}function mt(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=e||{},o=i.className,a=i.style;return{tag:t,className:void 0===o?"":o,style:void 0===a?{}:a,attributes:function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(i,["className","style"]),children:n}}function yt(t,e,n){t!==e&&n(t,e)}function bt(t,e,n){var r;void 0===n&&(n=t.datas.boundArea);var i=t.distX,o=void 0===i?0:i,a=t.distY,s=void 0===a?0:a,c=t.datas,u=c.startX,l=c.startY;if(0<e){var f=Math.sqrt((o*o+s*s)/(1+e*e));o=(0<=o?1:-1)*(e*f),s=(0<=s?1:-1)*f}var h=Math.abs(o),g=Math.abs(s);o=(0<=o?1:-1)*(h=(r=function(t,n,r,e){if(!e)return t.map(function(t,e){return v(t,n[e],r[e])});var i=t[0],o=t[1],a=y(t,n,!1),s=a[0],c=a[1],u=y(t,r,!0),l=u[0],f=u[1];return i<s||o<c?(i=s,o=c):(l<i||f<o)&&(i=l,o=f),[i,o]}([h,g],[0,0],[o<0?u-n.left:n.right-u,s<0?l-n.top:n.bottom-l],!!e))[0]),s=(0<=s?1:-1)*(g=r[1]);var p=u+Math.min(0,o),d=l+Math.min(0,s);return{left:p,top:d,right:p+h,bottom:d+g,width:h,height:g}}function Et(t){var e=t.getBoundingClientRect(),n=e.left,r=e.top,i=e.width,o=e.height;return{pos1:[n,r],pos2:[n+i,r],pos3:[n,r+o],pos4:[n+i,r+o]}}function Ct(t,e){var n=N(t,e),r=n.list,i=n.prevList,o=n.added,a=n.removed;return o.map(function(t){return r[t]}).concat(a.map(function(t){return i[t]}))}function St(t,e,n,r){var i,o,a=document.createElement("style");return a.setAttribute("type","text/css"),a.setAttribute("data-styled-id",t),n.nonce&&a.setAttribute("nonce",n.nonce),a.innerHTML=(i=t,o=e,n.original?o:o.replace(/([^};{\s}][^};{]*|^\s*){/gm,function(t,e){var n=e.trim();return(n?s(n):[""]).map(function(t){var e=t.trim();return 0===e.indexOf("@")?e:-1<e.indexOf(":global")?e.replace(/\:global/g,""):-1<e.indexOf(":host")?""+e.replace(/\:host/g,"."+i):e?"."+i+" "+e:"."+i}).join(", ")+" {"})),(r||document.head||document.body).appendChild(a),a}var wt,Dt,kt,Tt,Pt=(kt="rCS"+function(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return e>>>0}(wt="\n:host {\n position: fixed;\n display: none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n z-index: 100;\n}\n").toString(36),Tt=0,{className:kt,inject:function(t,e){void 0===e&&(e={});var n,r=function(t){if(t&&t.getRootNode){var e=t.getRootNode();if(11===e.nodeType)return e}}(t),i=0===Tt;return(r||i)&&(n=St(kt,wt,e,r)),i&&(Dt=n),r||++Tt,{destroy:function(){r?(t.removeChild(n),n=null):(0<Tt&&--Tt,0===Tt&&Dt&&(Dt.parentNode.removeChild(Dt),Dt=null))}}}}),xt="selecto-selection "+Pt.className,Ot=["boundContainer","selectableTargets","selectByClick","selectFromInside","continueSelect","toggleContinueSelect","keyContainer","hitRate","scrollOptions","checkInput","preventDefault","ratio","getElementRect","preventDragFromInside"],_t=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}(["dragContainer","cspNonce"],Ot),Mt={boundContainer:null,target:null,container:null,dragContainer:null,selectableTargets:Array,selectByClick:Boolean,selectFromInside:Boolean,continueSelect:Boolean,toggleContinueSelect:Array,keyContainer:null,hitRate:Number,scrollOptions:Object,checkInput:Boolean,preventDefault:Boolean,cspNonce:String,ratio:Number,getElementRect:Function,preventDragFromInside:Boolean},Yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(function(e){function t(t){void 0===t&&(t={});var k=e.call(this)||this;return k.selectedTargets=[],k.dragScroll=new W,k.onDragStart=function(t,e){var n=t.datas,r=t.clientX,i=t.clientY,o=t.inputEvent,a=k.options,s=a.continueSelect,c=a.selectFromInside,u=a.selectByClick,l=a.boundContainer,f=a.preventDragFromInside,h=void 0===f||f;k.findSelectableTargets(n),n.startSelectedTargets=k.selectedTargets;var g={left:-1/0,top:-1/0,right:1/0,bottom:1/0};if(l){var p=x(l)&&"element"in l?T({left:!0,top:!0,bottom:!0,right:!0},l):{element:l,left:!0,top:!0,bottom:!0,right:!0},d=p.element;if(d){var v=(typeof d===P?document.querySelector(d):!0===d?k.container:d).getBoundingClientRect();p.left&&(g.left=v.left),p.top&&(g.top=v.top),p.right&&(g.right=v.right),p.bottom&&(g.bottom=v.bottom)}}n.boundArea=g;var m={left:r,top:i,right:r,bottom:i,width:0,height:0},y=[];if(!c||u){for(var b=e||document.elementFromPoint(r,i);b&&!(-1<n.selectableTargets.indexOf(b));)b=b.parentElement;y=b?[b]:[]}var E=0<y.length,C=!c&&E;if(C&&!u)return t.stop(),!1;var S=o.type,w="mousedown"===S||"touchstart"===S;if(!(!(!t.isClick&&w)||k.trigger("dragStart",T({},t))))return t.stop(),!1;if(s?(y=Ct(k.selectedTargets,y),n.startPassedTargets=k.selectedTargets):n.startPassedTargets=[],k.select(k.selectedTargets,y,m,o,!0),n.startX=r,n.startY=i,n.selectFlag=!1,n.preventDragFromInside=!1,n.boundsArea=k.target.style.cssText+="left:0px;top:0px;transform: translate("+r+"px, "+i+"px)",C&&u)o.preventDefault(),h&&(k.selectEnd(n.startSelectedTargets,n.startPassedTargets,m,t),n.preventDragFromInside=!0);else{n.selectFlag=!0,"touchstart"===S&&o.preventDefault();var D=k.options.scrollOptions;D&&D.container&&k.dragScroll.dragStart(t,D)}return!0},k.onDrag=function(t){if(t.datas.selectFlag){var e=k.options.scrollOptions;if(e&&e.container&&k.dragScroll.drag(t,e))return}k.check(t)},k.onDragEnd=function(t){var e=t.datas,n=t.inputEvent,r=bt(t,k.options.ratio),i=e.selectFlag;n&&!t.isClick&&k.trigger("dragEnd",T(T({isDouble:!!t.isDouble,isDrag:!1,isSelect:i},t),{rect:r})),k.target.style.cssText+="display: none;",i&&(e.selectFlag=!1,k.dragScroll.dragEnd()),e.preventDragFromInside||k.selectEnd(e.startSelectedTargets,e.startPassedTargets,r,t)},k.onKeyDown=function(t){k.sameCombiKey(t)&&(k.continueSelect=!0,k.trigger("keydown",{}))},k.onKeyUp=function(t){k.sameCombiKey(t,!0)&&(k.continueSelect=!1,k.trigger("keyup",{}))},k.onBlur=function(){k.toggleContinueSelect&&k.continueSelect&&(k.continueSelect=!1,k.trigger("keyup",{}))},k.onDocumentSelectStart=function(e){if(k.gesto.isFlag()){var t=k.dragContainer;t===window&&(t=document.documentElement);var n=t instanceof Element?[t]:[].slice.call(t),r=e.target;n.some(function(t){if(t===r||t.contains(r))return e.preventDefault(),!0})}},k.target=t.target,k.container=t.container||document.body,k.options=T({target:null,container:null,dragContainer:null,selectableTargets:[],selectByClick:!0,selectFromInside:!0,hitRate:100,continueSelect:!1,toggleContinueSelect:null,keyContainer:null,scrollOptions:void 0,checkInput:!1,preventDefault:!1,boundContainer:!1,preventDragFromInside:!0,getElementRect:Et,cspNonce:"",ratio:0},t),k.initElement(),k.initDragScroll(),k.setKeyController(),k}o(t,e);var n,r,i=t.prototype;return i.setSelectedTargets=function(t){return this.selectedTargets=t,this},i.getSelectedTargets=function(){return this.selectedTargets},i.setKeyContainer=function(t){var e=this,n=this.options;yt(n.keyContainer,t,function(){n.keyContainer=t,e.setKeyController()})},i.setToggleContinueSelect=function(t){var e=this,n=this.options;yt(n.toggleContinueSelect,t,function(){n.toggleContinueSelect=t,e.setKeyEvent()})},i.setPreventDefault=function(t){this.gesto.options.preventDefault=t},i.setCheckInput=function(t){this.gesto.options.checkInput=t},i.triggerDragStart=function(t){return this.gesto.triggerDragStart(t),this},i.destroy=function(){this.off(),this.keycon&&this.keycon.destroy(),this.gesto.unset(),this.injectResult.destroy(),E(document,"selectstart",this.onDocumentSelectStart),this.keycon=null,this.gesto=null,this.injectResult=null,this.target=null,this.container=null,this.options=null},i.getElementPoints=function(t){var e,n,r,i,o,a,s,c,u,l,f,h,g,p=this.getElementRect||Et,d=p(t),v=[d.pos1,d.pos2,d.pos4,d.pos3];if(p===Et)return v;var m=t.getBoundingClientRect();return e=v,r=(n=m).width,i=n.height,o=n.left,a=n.top,s=lt(e),c=s.minX,u=s.minY,l=s.maxX,f=s.maxY,h=r/(l-c),g=i/(f-u),e.map(function(t){return[o+(t[0]-c)*h,a+(t[1]-u)*g]})},i.getSelectableElements=function(){var e=[];return this.options.selectableTargets.forEach(function(t){x(t)?e.push(t):[].slice.call(document.querySelectorAll(t)).forEach(function(t){e.push(t)})}),e},i.findSelectableTargets=function(t){var e=this;void 0===t&&(t=this.gesto.getEventDatas());var n=this.getSelectableElements(),r=n.map(function(t){return e.getElementPoints(t)});t.selectableTargets=n,t.selectablePoints=r},i.clickTarget=function(t,e){var n=function(t){if("touches"in t){var e=t.touches[0]||t.changedTouches[0];return{clientX:e.clientX,clientY:e.clientY}}return{clientX:t.clientX,clientY:t.clientY}}(t),r={datas:{selectFlag:!1},clientX:n.clientX,clientY:n.clientY,inputEvent:t,isClick:!0,stop:function(){return!1}};return this.onDragStart(r,e)&&this.onDragEnd(r),this},i.setKeyController=function(){var t=this.options,e=t.keyContainer,n=t.toggleContinueSelect;this.keycon&&(this.keycon.destroy(),this.keycon=null),n&&(this.keycon=new ct(e||window),this.keycon.keydown(this.onKeyDown).keyup(this.onKeyUp).on("blur",this.onBlur))},i.setKeyEvent=function(){this.options.toggleContinueSelect&&!this.keycon&&this.setKeyController()},i.initElement=function(){this.target=vt(mt("div",{className:xt}),this.target,this.container);var t=this.target,e=this.options,n=e.dragContainer,r=e.checkInput,i=e.preventDefault;this.dragContainer="string"==typeof n?[].slice.call(document.querySelectorAll(n)):this.options.dragContainer||this.target.parentNode,this.gesto=new X(this.dragContainer,{checkWindowBlur:!0,container:window,checkInput:r,preventDefault:i}).on({dragStart:this.onDragStart,drag:this.onDrag,dragEnd:this.onDragEnd}),b(document,"selectstart",this.onDocumentSelectStart),this.injectResult=Pt.inject(t,{nonce:this.options.cspNonce})},i.hitTest=function(t,s,c,e,u){var n=this.options,l=n.hitRate,f=n.selectByClick,r=t.left,i=t.top,o=t.right,a=t.bottom,h=[[r,i],[o,i],[o,a],[r,a]];return e.filter(function(t,e){var n=u[e],r=ft([s,c],n);if(f&&r)return!0;var i=function(t,e){var n=t.slice(),s=e.slice();-1===g(n)&&n.reverse(),-1===g(s)&&s.reverse();var c=dt(n),u=dt(s),r=c.map(function(t){return ht(t[0],t[1])}),l=u.map(function(t){return ht(t[0],t[1])}),f=[];r.forEach(function(r,i){var o=c[i],a=[];l.forEach(function(t,e){var n=pt(gt(r,t),[o,u[e]]);a.push.apply(a,n.map(function(t){return{index1:i,index2:e,pos:t}}))}),a.sort(function(t,e){return p(o[0],t.pos)-p(o[0],e.pos)}),f.push.apply(f,a),ft(o[1],s)&&f.push({index1:i,index2:-1,pos:o[1]})}),u.forEach(function(t,r){if(ft(t[1],n)){var i=!1,e=m(f,function(t){return t.index2===r?!(i=!0):!!i});-1===e&&(i=!1,e=m(f,function(t){var e=t.index1,n=t.index2;return-1===e&&n+1===r?!(i=!0):!!i})),-1===e?f.push({index1:-1,index2:r,pos:t[1]}):f.splice(e,0,{index1:-1,index2:r,pos:t[1]})}});var i=f.map(function(t){return t.pos}),o={};return i.filter(function(t){var e=t[0]+"x"+t[1];return!o[e]&&(o[e]=!0)})}(h,n);if(!i.length)return!1;var o=ut(i),a=ut(n);return v(Math.round(o/a*100),0,100)>=Math.min(100,l)})},i.initDragScroll=function(){var o=this;this.dragScroll.on("scroll",function(t){var e=t.container,n=t.direction;o.trigger("scroll",{container:e,direction:n})}).on("move",function(t){var e=t.offsetX,n=t.offsetY,r=t.inputEvent,i=r.datas;i.startX-=e,i.startY-=n,i.selectablePoints.forEach(function(t){t.forEach(function(t){t[0]-=e,t[1]-=n})}),o.gesto.scrollBy(e,n,r.inputEvent,!1),r.distX+=e,r.distY+=n,o.check(r)})},i.select=function(t,e,n,r,i){var o=N(t,e),a=o.added,s=o.removed,c=o.prevList,u=o.list;this.selectedTargets=e,i&&this.trigger("selectStart",{selected:e,added:a.map(function(t){return u[t]}),removed:s.map(function(t){return c[t]}),rect:n,inputEvent:r}),(a.length||s.length)&&this.trigger("select",{selected:e,added:a.map(function(t){return u[t]}),removed:s.map(function(t){return c[t]}),rect:n,inputEvent:r})},i.selectEnd=function(t,e,n,r){var i=r.inputEvent,o=r.isDouble,a=N(t,this.selectedTargets),s=a.added,c=a.removed,u=a.prevList,l=a.list,f=N(e,this.selectedTargets),h=f.added,g=f.removed,p=f.prevList,d=f.list,v=i&&i.type,m="mousedown"===v||"touchstart"===v;this.trigger("selectEnd",{selected:this.selectedTargets,added:s.map(function(t){return l[t]}),removed:c.map(function(t){return u[t]}),afterAdded:h.map(function(t){return d[t]}),afterRemoved:g.map(function(t){return p[t]}),isDragStart:m,isDouble:!!o,rect:n,inputEvent:i})},i.check=function(t,e){void 0===e&&(e=bt(t,this.options.ratio));var n=t.datas,r=t.inputEvent,i=e.top,o=e.left,a=e.width,s=e.height,c=n.selectFlag,u=[],l=[];if(c){this.target.style.cssText+="display: block;left:0px;top:0px;transform: translate("+o+"px, "+i+"px);width:"+a+"px;height:"+s+"px;";var f=this.hitTest(e,n.startX,n.startY,n.selectableTargets,n.selectablePoints);u=this.selectedTargets,l=Ct(n.startPassedTargets,f),this.selectedTargets=l}this.trigger("drag",T(T({},t),{isSelect:c,rect:e})),c&&this.select(u,l,e,r)},i.sameCombiKey=function(t,e){var n,r=[].concat(this.options.toggleContinueSelect),i=at(t.inputEvent,t.key),o=(n=r[0],Array.isArray(n)?r:[r]);if(e){var a=t.key;return o.some(function(t){return t.some(function(t){return t===a})})}return o.some(function(t){return t.every(function(t){return-1<i.indexOf(t)})})},t=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(a=(o<3?i(a):3<o?i(e,n,a):i(e,n))||a);return 3<o&&a&&Object.defineProperty(e,n,a),a}([(n=Ot,r=function(t,e){var n={enumerable:!0,configurable:!0,get:function(){return this.options[e]}},r=("set "+e).replace(/[\s-_]([a-z])/g,function(t,e){return e.toUpperCase()});t[r]?n.set=function(t){this[r](t)}:n.set=function(t){this.options[e]=t},Object.defineProperty(t,e,n)},function(t){var e=t.prototype;n.forEach(function(t){r(e,t)})})],t)}(t)),Xt={__proto__:null,default:Yt,OPTIONS:_t,OPTION_TYPES:Mt,PROPERTIES:Ot,EVENTS:["dragStart","drag","dragEnd","selectStart","select","selectEnd","keydown","keyup","scroll"],METHODS:["clickTarget","getSelectableElements","setSelectedTargets","getElementPoints","getSelectedTargets","findSelectableTargets","triggerDragStart"],CLASS_NAME:xt};for(var jt in Xt)Yt[jt]=Xt[jt];return Yt});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Selecto=e()}(this,function(){"use strict";var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var O=function(){return(O=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};var e="object",_="string",l=['"',"'",'\\"',"\\'"],u=1e-7;function Y(t){return t&&typeof t===e}function a(t){return Array.isArray(t)}function f(t,e,n,r){for(var i=n;i<r;++i){var o=e[i].trim();if(o===t)return i;var a=i;if("("===o?a=f(")",e,i+1,r):-1<l.indexOf(o)&&(a=f(o,e,i+1,r)),-1===a)break;i=a}return-1}function i(t,e){for(var n=new RegExp("(\\s*"+(e||",")+"\\s*|\\(|\\)|\"|'|\\\\\"|\\\\'|\\s+)","g"),r=t.split(n).filter(Boolean),i=r.length,o=[],a=[],s=0;s<i;++s){var c=r[s].trim(),u=s;if("("===c)u=f(")",r,s+1,i);else{if(")"===c)throw new Error("invalid format");if(-1<l.indexOf(c))u=f(c,r,s+1,i);else if(c===e){a.length&&(o.push(a.join("")),a=[]);continue}}-1===u&&(u=i-1),a.push(r.slice(s,u+1).join("")),s=u}return a.length&&o.push(a.join("")),o}function S(t){return i(t,",")}function E(){return Date.now?Date.now():(new Date).getTime()}function m(t,e,n){void 0===n&&(n=-1);for(var r=t.length,i=0;i<r;++i)if(e(t[i],i,t))return i;return n}function v(t,e,n){return Math.max(e,Math.min(t,n))}function h(t,e){return e?Math.round(t/e)*e:t}function y(t,n,r){return[[h(n[0],u),h(n[0]*t[1]/t[0],u)],[h(n[1]*t[0]/t[1],u),h(n[1],u)]].filter(function(t){return t.every(function(t,e){return r?t<=n[e]:t>=n[e]})})[0]||t}function s(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=Math.atan2(r,n);return 0<=i?i:i+2*Math.PI}function c(t){return[0,1].map(function(e){return function(t){for(var e=t.length,n=0,r=e-1;0<=r;--r)n+=t[r];return e?n/e:0}(t.map(function(t){return t[e]}))})}function d(t){var e=c(t),n=s(e,t[0]),r=s(e,t[1]);return n<r&&r-n<Math.PI||r<n&&r-n<-Math.PI?1:-1}function g(t,e){return Math.sqrt(Math.pow((e?e[0]:0)-t[0],2)+Math.pow((e?e[1]:0)-t[1],2))}function b(t,e,n,r){t.addEventListener(e,n,r)}function C(t,e,n){t.removeEventListener(e,n)}var p=function(){return(p=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};var t=function(){function t(){this._events={}}var e=t.prototype;return e.on=function(t,e){if(Y(t))for(var n in t)this.on(n,t[n]);else this._addEvent(t,e,{});return this},e.off=function(t,e){if(t)if(Y(t))for(var n in t)this.off(n);else if(e){var r=this._events[t];if(r){var i=m(r,function(t){return t.listener===e});-1<i&&r.splice(i,1)}}else this._events[t]=[];else this._events={};return this},e.once=function(e,t){var n=this;return t&&this._addEvent(e,t,{once:!0}),new Promise(function(t){n._addEvent(e,t,{once:!0})})},e.emit=function(e,n){var r=this;void 0===n&&(n={});var t=this._events[e];if(!e||!t)return!0;var i=!1;return n.eventType=e,n.stop=function(){i=!0},n.currentTarget=this,function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}(t).forEach(function(t){t.listener(n),t.once&&r.off(e,t.listener)}),!i},e.trigger=function(t,e){return void 0===e&&(e={}),this.emit(t,e)},e._addEvent=function(t,e,n){var r=this._events;r[t]=r[t]||[],r[t].push(p({listener:e},n))},t}(),w=function(t,e){return(w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var D=function(){return(D=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function n(t){return 180*(e=[t[0].clientX,t[0].clientY],n=[t[1].clientX,t[1].clientY],r=n[0]-e[0],i=n[1]-e[1],(0<=(o=Math.atan2(i,r))?o:o+2*Math.PI)/Math.PI);var e,n,r,i,o}function x(t){return t.touches?function(t){for(var e=Math.min(t.length,2),n=[],r=0;r<e;++r)n.push(T(t[r]));return n}(t.touches):[T(t)]}function k(t,e,n){var r=n.length,i=M(t,r),o=i.clientX,a=i.clientY,s=i.originalClientX,c=i.originalClientY,u=M(e,r),l=u.clientX,f=u.clientY,h=M(n,r);return{clientX:s,clientY:c,deltaX:o-l,deltaY:a-f,distX:o-h.clientX,distY:a-h.clientY}}function P(t){return Math.sqrt(Math.pow(t[0].clientX-t[1].clientX,2)+Math.pow(t[0].clientY-t[1].clientY,2))}function T(t){return{clientX:t.clientX,clientY:t.clientY}}function M(t,e){void 0===e&&(e=t.length);for(var n={clientX:0,clientY:0,originalClientX:0,originalClientY:0},r=0;r<e;++r){var i=t[r];n.originalClientX+="originalClientX"in i?i.originalClientX:i.clientX,n.originalClientY+="originalClientY"in i?i.originalClientY:i.clientY,n.clientX+=i.clientX,n.clientY+=i.clientY}return e?{clientX:n.clientX/e,clientY:n.clientY/e,originalClientX:n.originalClientX/e,originalClientY:n.originalClientY/e}:n}var X=function(){function t(t){this.prevClients=[],this.startClients=[],this.movement=0,this.length=0,this.startClients=t,this.prevClients=t,this.length=t.length}var e=t.prototype;return e.addClients=function(t){void 0===t&&(t=this.prevClients);var e=this.getPosition(t),n=e.deltaX,r=e.deltaY;return this.movement+=Math.sqrt(n*n+r*r),this.prevClients=t,e},e.getAngle=function(t){return void 0===t&&(t=this.prevClients),n(t)},e.getRotation=function(t){return void 0===t&&(t=this.prevClients),n(t)-n(this.startClients)},e.getPosition=function(t){return k(t||this.prevClients,this.prevClients,this.startClients)},e.getPositions=function(n){void 0===n&&(n=this.prevClients);var r=this.prevClients;return this.startClients.map(function(t,e){return k([n[e]],[r[e]],[t])})},e.getMovement=function(t){var e=this.movement;if(!t)return e;var n=M(t,this.length),r=M(this.prevClients,this.length),i=n.clientX-r.clientX,o=n.clientY-r.clientY;return Math.sqrt(i*i+o*o)+e},e.getDistance=function(t){return void 0===t&&(t=this.prevClients),P(t)},e.getScale=function(t){return void 0===t&&(t=this.prevClients),P(t)/P(this.startClients)},e.move=function(e,n){this.startClients.forEach(function(t){t.clientX-=e,t.clientY-=n}),this.prevClients.forEach(function(t){t.clientX-=e,t.clientY-=n})},t}(),F=["textarea","input"],j=function(c){function t(){this.constructor=e}var e,n;function r(t,e){void 0===e&&(e={});var y=c.call(this)||this;y.options={},y.flag=!1,y.pinchFlag=!1,y.datas={},y.isDrag=!1,y.isPinch=!1,y.isMouse=!1,y.isTouch=!1,y.clientStores=[],y.targets=[],y.prevTime=0,y.doubleFlag=!1,y.onDragStart=function(t,e){if(void 0===e&&(e=!0),y.flag||!1!==t.cancelable){var n=y.options,r=n.container,i=n.pinchOutside,o=n.preventRightClick,a=n.preventDefault,s=n.checkInput,c=y.isTouch,u=!y.flag;if(u){var l=document.activeElement,f=t.target,h=f.tagName.toLowerCase(),d=-1<F.indexOf(h),g=f.isContentEditable;if(d||g){if(s||l===f)return!1;if(l&&g&&l.isContentEditable&&l.contains(f))return!1}else if((a||"touchstart"===t.type)&&l){var p=l.tagName;(l.isContentEditable||-1<F.indexOf(p))&&l.blur()}if(y.clientStores=[new X(x(t))],y.flag=!0,y.isDrag=!1,y.datas={},o&&(3===t.which||2===t.button))return y.initDrag(),!1;y.doubleFlag=E()-y.prevTime<200,!1===y.emit("dragStart",D({datas:y.datas,inputEvent:t,isTrusted:e,isDouble:y.doubleFlag},y.getCurrentStore().getPosition()))&&y.initDrag(),y.flag&&a&&t.preventDefault()}if(!y.flag)return!1;var v,m=0;if(u&&c&&i&&(m=setTimeout(function(){b(r,"touchstart",y.onDragStart,{passive:!1})})),!u&&c&&i&&C(r,"touchstart",y.onDragStart),y.flag&&((v=t).touches&&2<=v.touches.length)){if(clearTimeout(m),u&&t.touches.length!==t.changedTouches.length)return;y.pinchFlag||y.onPinchStart(t)}}},y.onDrag=function(t,e){if(y.flag){var n=x(t),r=y.moveClients(n,t,!1);(y.pinchFlag||r.deltaX||r.deltaY)&&y.emit("drag",D({},r,{isScroll:!!e,inputEvent:t})),y.pinchFlag&&y.onPinch(t,n),y.getCurrentStore().addClients(n)}},y.onDragEnd=function(t){if(y.flag){var e=y.options,n=e.pinchOutside,r=e.container;y.isTouch&&n&&C(r,"touchstart",y.onDragStart),y.flag=!1;var i=y.getCurrentStore().getPosition(),o=E(),a=!y.isDrag&&y.doubleFlag;y.prevTime=y.isDrag||a?0:o,y.emit("dragEnd",D({datas:y.datas,isDouble:a,isDrag:y.isDrag,inputEvent:t},i)),y.pinchFlag&&y.onPinchEnd(t),y.clientStores=[]}},y.onBlur=function(){y.onDragEnd()};var n=[].concat(t);y.options=D({checkInput:!1,container:1<n.length?window:n[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},e);var r=y.options,i=r.container,o=r.events,a=r.checkWindowBlur;if(y.isTouch=-1<o.indexOf("touch"),y.isMouse=-1<o.indexOf("mouse"),y.targets=n,y.isMouse&&(n.forEach(function(t){b(t,"mousedown",y.onDragStart)}),b(i,"mousemove",y.onDrag),b(i,"mouseup",y.onDragEnd),b(i,"contextmenu",y.onDragEnd)),a&&b(window,"blur",y.onBlur),y.isTouch){var s={passive:!1};n.forEach(function(t){b(t,"touchstart",y.onDragStart,s)}),b(i,"touchmove",y.onDrag,s),b(i,"touchend",y.onDragEnd,s),b(i,"touchcancel",y.onDragEnd,s)}return y}w(e=r,n=c),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t);var i=r.prototype;return i.getMovement=function(t){return this.getCurrentStore().getMovement(t)+this.clientStores.slice(1).reduce(function(t,e){return t+e.movement},0)},i.isDragging=function(){return this.isDrag},i.isFlag=function(){return this.flag},i.isPinchFlag=function(){return this.pinchFlag},i.isDoubleFlag=function(){return this.doubleFlag},i.isPinching=function(){return this.isPinch},i.scrollBy=function(t,e,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(t,e),r&&this.onDrag(n,!0))},i.move=function(t,e){var r=t[0],i=t[1],n=this.getCurrentStore().prevClients;return this.moveClients(n.map(function(t){var e=t.clientX,n=t.clientY;return{clientX:e+r,clientY:n+i,originalClientX:e,originalClientY:n}}),e,!0)},i.triggerDragStart=function(t){this.onDragStart(t,!1)},i.setEventDatas=function(t){var e=this.datas;for(var n in t)e[n]=t[n];return this},i.getEventDatas=function(){return this.datas},i.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),C(window,"blur",this.onBlur),this.isMouse&&(t.forEach(function(t){C(t,"mousedown",e.onDragStart)}),C(n,"mousemove",this.onDrag),C(n,"mouseup",this.onDragEnd),C(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach(function(t){C(t,"touchstart",e.onDragStart)}),C(n,"touchstart",this.onDragStart),C(n,"touchmove",this.onDrag),C(n,"touchend",this.onDragEnd),C(n,"touchcancel",this.onDragEnd))},i.onPinchStart=function(t){var e=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>e)){var n=new X(x(t));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",D({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:t}))&&(this.pinchFlag=!1)}},i.onPinch=function(t,e){if(this.flag&&this.pinchFlag&&!(e.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",D({datas:this.datas,movement:this.getMovement(e),angle:n.getAngle(e),rotation:n.getRotation(e),touches:n.getPositions(e),scale:n.getScale(e),distance:n.getDistance(e)},n.getPosition(e),{inputEvent:t}))}},i.onPinchEnd=function(t){if(this.pinchFlag){var e=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",D({datas:this.datas,isPinch:e,touches:n.getPositions()},n.getPosition(),{inputEvent:t})),this.isPinch=!1,this.pinchFlag=!1}},i.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1},i.getCurrentStore=function(){return this.clientStores[0]},i.moveClients=function(t,e,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](t);return this.isDrag=!0,D({datas:this.datas},r,{movement:this.getMovement(t),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:e})},r}(t);var K=function(){function t(){this.keys=[],this.values=[]}var e=t.prototype;return e.get=function(t){return this.values[this.keys.indexOf(t)]},e.set=function(t,e){var n=this.keys,r=this.values,i=n.indexOf(t),o=-1===i?n.length:i;n[o]=t,r[o]=e},t}(),I=function(){function t(){this.object={}}var e=t.prototype;return e.get=function(t){return this.object[t]},e.set=function(t,e){this.object[t]=e},t}(),A="function"==typeof Map,R=function(){function t(){}var e=t.prototype;return e.connect=function(t,e){this.prev=t,this.next=e,t&&(t.next=this),e&&(e.prev=this)},e.disconnect=function(){var t=this.prev,e=this.next;t&&(t.next=e),e&&(e.prev=t)},e.getIndex=function(){for(var t=this,e=-1;t;)t=t.prev,++e;return e},t}();var B=function(){function t(t,e,n,r,i,o,a,s){this.prevList=t,this.list=e,this.added=n,this.removed=r,this.changed=i,this.maintained=o,this.changedBeforeAdded=a,this.fixed=s}var e=t.prototype;return Object.defineProperty(e,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(e,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),e.caculateOrdered=function(){var t,n,s,c,e=(t=this.changedBeforeAdded,n=this.fixed,s=[],c=[],t.forEach(function(t){var e=t[0],n=t[1],r=new R;s[e]=r,c[n]=r}),s.forEach(function(t,e){t.connect(s[e-1])}),t.filter(function(t,e){return!n[e]}).map(function(t,e){var n=t[0],r=t[1];if(n===r)return[0,0];var i=s[n],o=c[r-1],a=i.getIndex();return i.disconnect(),o?i.connect(o,o.next):i.connect(void 0,s[0]),[a,i.getIndex()]})),u=this.changed,l=[];this.cacheOrdered=e.filter(function(t,e){var n=t[0],r=t[1],i=u[e],o=i[0],a=i[1];if(n!==r)return l.push([o,a]),!0}),this.cachePureChanged=l},t}();var N,L="function"==typeof Map?void 0:(N=0,function(t){return t.__DIFF_KEY__||(t.__DIFF_KEY__=++N)});function q(t,e){return n=t,r=e,i=L,o=A?Map:i?I:K,a=i||function(t){return t},s=[],c=[],u=[],l=n.map(a),f=r.map(a),h=new o,d=new o,g=[],p=[],v={},m=[],b=y=0,l.forEach(function(t,e){h.set(t,e)}),f.forEach(function(t,e){d.set(t,e)}),l.forEach(function(t,e){var n=d.get(t);void 0===n?(++b,c.push(e)):v[n]=b}),f.forEach(function(t,e){var n=h.get(t);void 0===n?(s.push(e),++y):(u.push([n,e]),b=v[e]||0,g.push([n-b,e-y]),p.push(e===n),n!==e&&m.push([n,e]))}),c.reverse(),new B(n,r,s,c,m,u,g,p);var n,r,i,o,a,s,c,u,l,f,h,d,g,p,v,m,y,b}var Z=function(t,e){return(Z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function W(t){var e=t.container;return[e.scrollLeft,e.scrollTop]}var H=function(e){function t(){this.constructor=n}var n,r;function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.startRect=null,t.startPos=[],t.prevTime=0,t.timer=0,t}Z(n=i,r=e),n.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t);var o=i.prototype;return o.dragStart=function(t,e){var n=e.container,r=0,i=0,o=0,a=0;if(n===document.body)o=window.innerWidth,a=window.innerHeight;else{var s=n.getBoundingClientRect();r=s.top,i=s.left,o=s.width,a=s.height}this.startPos=[t.clientX,t.clientY],this.startRect={top:r,left:i,width:o,height:a}},o.drag=function(t,e){var n=this,r=t.clientX,i=t.clientY,o=e.container,a=e.threshold,s=void 0===a?0:a,c=e.throttleTime,u=void 0===c?0:c,l=e.getScrollPosition,f=void 0===l?W:l,h=this.startRect,d=this.startPos,g=E(),p=Math.max(u+this.prevTime-g,0),v=[0,0];if(h.top>i-s?(d[1]>h.top||i<d[1])&&(v[1]=-1):h.top+h.height<i+s&&(d[1]<h.top+h.height||i>d[1])&&(v[1]=1),h.left>r-s?(d[0]>h.left||r<d[0])&&(v[0]=-1):h.left+h.width<r+s&&(d[0]<h.left+h.width||r>d[0])&&(v[0]=1),clearTimeout(this.timer),!v[0]&&!v[1])return!1;if(0<p)return this.timer=window.setTimeout(function(){n.drag(t,e)},p),!1;this.prevTime=g;var m=f({container:o,direction:v});this.trigger("scroll",{container:o,direction:v,inputEvent:t});var y=f({container:o,direction:v}),b=y[0]-m[0],C=y[1]-m[1];return!(!b&&!C)&&(this.trigger("move",{offsetX:v[0]?b:0,offsetY:v[1]?C:0,inputEvent:t}),u&&(this.timer=window.setTimeout(function(){n.drag(t,e)},u)),!0)},o.dragEnd=function(){clearTimeout(this.timer)},i}(t),U=function(t,e){return(U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function V(t){return t&&"object"==typeof t}function z(t){return Array.isArray(t)}function $(t){return"string"==typeof t}function G(t,e,n,r){t.addEventListener(e,n,r)}function J(t,e,n){t.removeEventListener(e,n)}var Q=function(){return(Q=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};var tt=function(){function t(){this._events={}}var e=t.prototype;return e.on=function(t,e){if(V(t))for(var n in t)this.on(n,t[n]);else this._addEvent(t,e,{});return this},e.off=function(t,e){if(t)if(V(t))for(var n in t)this.off(n);else if(e){var r=this._events[t];if(r){var i=function(t,e,n){void 0===n&&(n=-1);for(var r=t.length,i=0;i<r;++i)if(e(t[i],i,t))return i;return n}(r,function(t){return t.listener===e});-1<i&&r.splice(i,1)}}else this._events[t]=[];else this._events={};return this},e.once=function(e,t){var n=this;return t&&this._addEvent(e,t,{once:!0}),new Promise(function(t){n._addEvent(e,t,{once:!0})})},e.emit=function(e,n){var r=this;void 0===n&&(n={});var t=this._events[e];if(!e||!t)return!0;var i=!1;return n.eventType=e,n.stop=function(){i=!0},n.currentTarget=this,function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}(t).forEach(function(t){t.listener(n),t.once&&r.off(e,t.listener)}),!i},e.trigger=function(t,e){return void 0===e&&(e={}),this.emit(t,e)},e._addEvent=function(t,e,n){var r=this._events;r[t]=r[t]||[],r[t].push(Q({listener:e},n))},t}();var et,nt,rt=(function(t,e){function n(t){if(t&&"object"==typeof t){var e=t.which||t.keyCode||t.charCode;e&&(t=e)}if("number"==typeof t)return a[t];var n,r=String(t);return(n=i[r.toLowerCase()])?n:(n=o[r.toLowerCase()])||(1===r.length?r.charCodeAt(0):void 0)}n.isEventKey=function(t,e){if(t&&"object"==typeof t){var n=t.which||t.keyCode||t.charCode;if(null==n)return!1;if("string"==typeof e){var r;if(r=i[e.toLowerCase()])return r===n;if(r=o[e.toLowerCase()])return r===n}else if("number"==typeof e)return e===n;return!1}};var i=(e=t.exports=n).code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(r=97;r<123;r++)i[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)i[r-48]=r;for(r=1;r<13;r++)i["f"+r]=r+111;for(r=0;r<10;r++)i["numpad "+r]=r+96;var a=e.names=e.title={};for(r in i)a[i[r]]=r;for(var s in o)i[s]=o[s]}(et={exports:{}},et.exports),et.exports),it=(rt.code,rt.codes,rt.aliases,rt.names),ot=(rt.title,{"+":"plus","left command":"meta","right command":"meta"}),at={shift:1,ctrl:2,alt:3,meta:4};function st(t){var e=it[t]||"";for(var n in ot)e=e.replace(n,ot[n]);return e.replace(/\s/g,"")}function ct(t,e){void 0===e&&(e=st(t.keyCode));var n,r=[(n=t).shiftKey&&"shift",n.ctrlKey&&"ctrl",n.altKey&&"alt",n.metaKey&&"meta"].filter(Boolean);return-1===r.indexOf(e)&&r.push(e),r.filter(Boolean)}function ut(t){var e=t.slice();return e.sort(function(t,e){return(at[t]||5)-(at[e]||5)}),e}var lt=function(n){function t(){this.constructor=e}var e,r;function i(t){void 0===t&&(t=window);var e=n.call(this)||this;return e.container=t,e.ctrlKey=!1,e.altKey=!1,e.shiftKey=!1,e.metaKey=!1,e.clear=function(){return e.ctrlKey=!1,e.altKey=!1,e.shiftKey=!1,e.metaKey=!1,e},e.keydownEvent=function(t){e.triggerEvent("keydown",t)},e.keyupEvent=function(t){e.triggerEvent("keyup",t)},e.blur=function(){e.clear(),e.trigger("blur")},G(t,"blur",e.blur),G(t,"keydown",e.keydownEvent),G(t,"keyup",e.keyupEvent),e}U(e=i,r=n),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t);var o=i.prototype;return Object.defineProperty(i,"global",{get:function(){return nt=nt||new i},enumerable:!1,configurable:!0}),i.setGlobal=function(){return this.global},o.destroy=function(){var t=this.container;this.clear(),this.off(),J(t,"blur",this.blur),J(t,"keydown",this.keydownEvent),J(t,"keyup",this.keyupEvent)},o.keydown=function(t,e){return this.addEvent("keydown",t,e)},o.offKeydown=function(t,e){return this.removeEvent("keydown",t,e)},o.offKeyup=function(t,e){return this.removeEvent("keyup",t,e)},o.keyup=function(t,e){return this.addEvent("keyup",t,e)},o.addEvent=function(t,e,n){return z(e)?this.on(t+"."+ut(e).join("."),n):$(e)?this.on(t+"."+e,n):this.on(t,e),this},o.removeEvent=function(t,e,n){return z(e)?this.off(t+"."+ut(e).join("."),n):$(e)?this.off(t+"."+e,n):this.off(t,e),this},o.triggerEvent=function(t,e){this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey;var n=st(e.keyCode),r={key:n,isToggle:"ctrl"===n||"shift"===n||"meta"===n||"alt"===n,inputEvent:e,keyCode:e.keyCode,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey};this.trigger(t,r),this.trigger(t+"."+n,r);var i=ct(e,n);1<i.length&&this.trigger(t+"."+i.join("."),r)},i}(tt);function ft(r){return r.length<3?0:Math.abs(function(t){for(var e=0,n=t.length-1;0<=n;--n)e+=t[n];return e}(r.map(function(t,e){var n=r[e+1]||r[0];return t[0]*n[1]-n[0]*t[1]})))/2}function ht(t){var e=t.map(function(t){return t[0]}),n=t.map(function(t){return t[1]});return{minX:Math.min.apply(Math,e),minY:Math.min.apply(Math,n),maxX:Math.max.apply(Math,e),maxY:Math.max.apply(Math,n)}}function dt(t,e,n){var i=t[0],o=t[1],r=ht(e),a=r.minX,s=r.minY,c=r.maxX,u=r.maxY,l=[[a,o],[c,o]],f=[[i,s],[i,u]],h=gt(l[0],l[1]),d=gt(f[0],f[1]),g=mt(e),p=[],v=[];return g.forEach(function(t){var e=gt(t[0],t[1]),n=vt(pt(h,e),[l,t]),r=vt(pt(d,e),[f,t]);1===n.length&&t[0][1]===o||p.push.apply(p,n),1===r.length&&t[0][0]===i||v.push.apply(v,r),e[0]||p.push.apply(p,n),e[1]||v.push.apply(v,r)}),!n&&(-1<m(p,function(t){return t[0]===i})||-1<m(v,function(t){return t[1]===o}))||!!(p.filter(function(t){return t[0]>i}).length%2&&v.filter(function(t){return t[1]>o}).length%2)}function gt(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];if(n===i&&r===o)return[0,0,0];if(n===i)return[1,0,-n];if(r===o)return[0,1,-r];var a=(i-n)/(r-o);return[1,a,-n-a*r]}function pt(t,e){var n,r,i=t[0],o=t[1],a=t[2],s=e[0],c=e[1],u=e[2],l=0===i&&0===s,f=0===o&&0===c;if(l&&f)return[];if(l){var h=-a/o;return h!=-u/c?[]:[[-1/0,h],[1/0,h]]}if(f){var d=-a/i;return d!=-u/s?[]:[[d,-1/0],[d,1/0]]}return 0!==i?0!==s?0!==o?0!==c?[[n=(o*u-c*a)/(c*i-o*s),r=-(i*n+a)/o]]:[[n=-u/s,r=-(i*n+a)/o]]:[[n=-a/i,r=-(s*n+u)/c]]:[[n=-(o*(r=-u/c)+a)/i,r]]:[[n=-(c*(r=-a/o)+u)/s,r]]}function vt(t,e){var n=e.map(function(e){return[0,1].map(function(t){return[Math.min(e[0][t],e[1][t]),Math.max(e[0][t],e[1][t])]})});if(2===t.length){var r=t[0],i=r[0],o=r[1];if(i===t[1][0]){var a=Math.max.apply(Math,n.map(function(t){return t[1][0]})),s=Math.min.apply(Math,n.map(function(t){return t[1][1]}));return s<a?[]:[[i,a],[i,s]]}if(o===t[1][1]){var c=Math.max.apply(Math,n.map(function(t){return t[0][0]})),u=Math.min.apply(Math,n.map(function(t){return t[0][1]}));return u<c?[]:[[c,o],[u,o]]}}return t.filter(function(e){return n.every(function(t){return t[0][0]<=e[0]&&e[0]<=t[0][1]&&t[1][0]<=e[1]&&e[1]<=t[1][1]})})}function mt(n){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}(n.slice(1),[n[0]]).map(function(t,e){return[n[e],t]})}function yt(t,e,n,r,i,o){for(var a=0;a<i;++a){var s=n+a*i,c=r+a*i;t[s]+=t[c]*o,e[s]+=e[c]*o}}function bt(t,e,n,r,i){for(var o=0;o<i;++o){var a=n+o*i,s=r+o*i,c=t[a],u=e[a];t[a]=t[s],t[s]=c,e[a]=e[s],e[s]=u}}function Ct(t,e,n,r,i){for(var o=0;o<r;++o){var a=n+o*r;t[a]/=i,e[a]/=i}}function Et(t,e,n){void 0===n&&(n=Math.sqrt(t.length));var r=[],i=t.length/n,o=e.length/i;if(!i)return e;if(!o)return t;for(var a=0;a<n;++a)for(var s=0;s<o;++s)for(var c=r[s*n+a]=0;c<i;++c)r[s*n+a]+=t[c*n+a]*e[s*i+c];return r}function St(t,e){return Et(t,[1,0,0,0,0,Math.cos(e),Math.sin(e),0,0,-Math.sin(e),Math.cos(e),0,0,0,0,1],4)}function wt(t,e){return Et(t,[Math.cos(e),0,-Math.sin(e),0,0,1,0,0,Math.sin(e),0,Math.cos(e),0,0,0,0,1],4)}function Dt(t,e){return Et(t,(n=e,r=4,i=Math.cos(n),o=Math.sin(n),(a=Tt(r))[0]=i,a[1]=o,a[r]=-o,a[r+1]=i,a));var n,r,i,o,a}function xt(t,e){var n=e[0],r=void 0===n?1:n,i=e[1],o=void 0===i?1:i,a=e[2];return Et(t,[r,0,0,0,0,o,0,0,0,0,void 0===a?1:a,0,0,0,0,1],4)}function kt(t,e){var n=e[0],r=void 0===n?0:n,i=e[1],o=void 0===i?0:i,a=e[2];return Et(t,[1,0,0,0,0,1,0,0,0,0,1,0,r,o,void 0===a?0:a,1],4)}function Pt(t,e){return Et(t,e,4)}function Tt(t){for(var e=t*t,n=[],r=0;r<e;++r)n[r]=r%(t+1)?0:1;return n}function Mt(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Ot(t){return e=(a(n=t)?n:function(t){return i(t,"")}(n)).map(function(t){var e,n=!(e=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(t))||e.length<4?{}:{prefix:e[1],value:e[2],suffix:e[3]},r=n.prefix,i=n.value,o=null,a=r,s="";if("translate"===r||"translateX"===r||"translate3d"===r){var c=S(i).map(function(t){return parseFloat(t)}),u=c[0],l=c[1],f=void 0===l?0:l,h=c[2];o=kt,s=[u,f,void 0===h?0:h]}else if("translateY"===r)o=kt,s=[0,f=parseFloat(i),0];else if("translateZ"===r)o=kt,s=[0,0,parseFloat(i)];else if("scale"===r||"scale3d"===r){var d=S(i).map(function(t){return parseFloat(t)}),g=d[0],p=d[1],v=void 0===p?g:p,m=d[2];o=xt,s=[g,v,void 0===m?1:m]}else if("scaleX"===r)o=xt,s=[g=parseFloat(i),1,1];else if("scaleY"===r)o=xt,s=[1,v=parseFloat(i),1];else if("scaleZ"===r)o=xt,s=[1,1,parseFloat(i)];else if("rotate"===r||"rotateZ"===r||"rotateX"===r||"rotateY"===r){var y=function(t){var e=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(t);if(!e)return{prefix:"",unit:"",value:NaN};var n=e[1],r=e[2];return{prefix:n,unit:e[3],value:parseFloat(r)}}(i),b=y.unit,C=y.value;"rotate"===r||"rotateZ"===r?(a="rotateZ",o=Dt):"rotateX"===r?o=St:"rotateY"===r&&(o=wt),s="rad"===b?C:C*Math.PI/180}else if("matrix3d"===r)o=Pt,s=S(i).map(function(t){return parseFloat(t)});else if("matrix"===r){var E=S(i).map(function(t){return parseFloat(t)});o=Pt,s=[E[0],E[1],0,0,E[2],E[3],0,0,0,0,1,0,E[4],E[5],0,1]}else a="";return{name:r,functionName:a,value:i,matrixFunction:o,functionValue:s}}),r=Mt(),e.forEach(function(t){var e=t.matrixFunction,n=t.functionValue;e&&(r=e(r,n))}),r;var e,r,n}function _t(t,e){var n=function(t,e,n){void 0===n&&(n=e.length);var r=Et(t,e,n),i=r[n-1];return r.map(function(t){return t/i})}(t,[e[0],e[1]||0,e[2]||0,1],4),r=n[3]||1;return[n[0]/r,n[1]/r,n[2]/r]}function Yt(t,e){void 0===e&&(e=document.body);for(var n=t,r=Mt();n;){if(r=Pt(Ot(getComputedStyle(n).transform),r),n===e)break;n=n.parentElement}return(r=function(t,e){void 0===e&&(e=Math.sqrt(t.length));for(var n=t.slice(),r=Tt(e),i=0;i<e;++i){var o=e*i+i;if(!h(n[o],u))for(var a=i+1;a<e;++a)if(n[e*i+a]){bt(n,r,i,a,e);break}if(!h(n[o],u))return[];Ct(n,r,i,e,n[o]);for(a=0;a<e;++a){var s=a,c=n[a+i*e];h(c,u)&&i!==a&&yt(n,r,s,i,e,-c)}}return r}(r,4))[12]=0,r[13]=0,r[14]=0,r}function Xt(t,e,n){var r=t.tag,i=t.children,o=t.attributes,a=t.className,s=t.style,c=e||document.createElement(r);for(var u in o)c.setAttribute(u,o[u]);var l=c.children;if(i.forEach(function(t,e){Xt(t,l[e],c)}),a&&a.split(" ").forEach(function(t){var e,n,r,i;i=t,((r=c).classList?r.classList.contains(i):r.className.match(new RegExp("(\\s|^)"+i+"(\\s|$)")))||(n=t,(e=c).classList?e.classList.add(n):e.className+=" "+n)}),s){var f=c.style;for(var u in s)f[u]=s[u]}return!e&&n&&n.appendChild(c),c}function Ft(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=e||{},o=i.className,a=i.style;return{tag:t,className:void 0===o?"":o,style:void 0===a?{}:a,attributes:function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(i,["className","style"]),children:n}}function jt(t,e,n){t!==e&&n(t,e)}function Kt(t,e,n){var r;void 0===n&&(n=t.datas.boundArea);var i=t.distX,o=void 0===i?0:i,a=t.distY,s=void 0===a?0:a,c=t.datas,u=c.startX,l=c.startY;if(0<e){var f=Math.sqrt((o*o+s*s)/(1+e*e));o=(0<=o?1:-1)*(e*f),s=(0<=s?1:-1)*f}var h=Math.abs(o),d=Math.abs(s);o=(0<=o?1:-1)*(h=(r=function(t,n,r,e){if(!e)return t.map(function(t,e){return v(t,n[e],r[e])});var i=t[0],o=t[1],a=y(t,n,!1),s=a[0],c=a[1],u=y(t,r,!0),l=u[0],f=u[1];return i<s||o<c?(i=s,o=c):(l<i||f<o)&&(i=l,o=f),[i,o]}([h,d],[0,0],[o<0?u-n.left:n.right-u,s<0?l-n.top:n.bottom-l],!!e))[0]),s=(0<=s?1:-1)*(d=r[1]);var g=u+Math.min(0,o),p=l+Math.min(0,s);return{left:g,top:p,right:g+h,bottom:p+d,width:h,height:d}}function It(t){var e=t.getBoundingClientRect(),n=e.left,r=e.top,i=e.width,o=e.height;return{pos1:[n,r],pos2:[n+i,r],pos3:[n,r+o],pos4:[n+i,r+o]}}function At(t,e){var n=q(t,e),r=n.list,i=n.prevList,o=n.added,a=n.removed;return o.map(function(t){return r[t]}).concat(a.map(function(t){return i[t]}))}function Rt(t,e,n,r){var i,o,a=document.createElement("style");return a.setAttribute("type","text/css"),a.setAttribute("data-styled-id",t),n.nonce&&a.setAttribute("nonce",n.nonce),a.innerHTML=(i=t,o=e,n.original?o:o.replace(/([^};{\s}][^};{]*|^\s*){/gm,function(t,e){var n=e.trim();return(n?S(n):[""]).map(function(t){var e=t.trim();return 0===e.indexOf("@")?e:-1<e.indexOf(":global")?e.replace(/\:global/g,""):-1<e.indexOf(":host")?""+e.replace(/\:host/g,"."+i):e?"."+i+" "+e:"."+i}).join(", ")+" {"})),(r||document.head||document.body).appendChild(a),a}var Bt,Nt,Lt,qt,Zt=(Lt="rCS"+function(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return e>>>0}(Bt="\n:host {\n position: fixed;\n display: none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n z-index: 100;\n}\n:host {\n position: absolute;\n}\n").toString(36),qt=0,{className:Lt,inject:function(t,e){void 0===e&&(e={});var n,r=function(t){if(t&&t.getRootNode){var e=t.getRootNode();if(11===e.nodeType)return e}}(t),i=0===qt;return(r||i)&&(n=Rt(Lt,Bt,e,r)),i&&(Nt=n),r||++qt,{destroy:function(){r?(t.removeChild(n),n=null):(0<qt&&--qt,0===qt&&Nt&&(Nt.parentNode.removeChild(Nt),Nt=null))}}}}),Wt="selecto-selection "+Zt.className,Ht=["boundContainer","selectableTargets","selectByClick","selectFromInside","continueSelect","toggleContinueSelect","keyContainer","hitRate","scrollOptions","checkInput","preventDefault","ratio","getElementRect","preventDragFromInside","rootContainer","dragCondition"],Ut=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}(["dragContainer","cspNonce"],Ht),Vt={boundContainer:null,target:null,container:null,dragContainer:null,selectableTargets:Array,selectByClick:Boolean,selectFromInside:Boolean,continueSelect:Boolean,toggleContinueSelect:Array,keyContainer:null,hitRate:Number,scrollOptions:Object,checkInput:Boolean,preventDefault:Boolean,cspNonce:String,ratio:Number,getElementRect:Function,preventDragFromInside:Boolean,rootContainer:Object,dragCondition:Function},zt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(function(e){function t(t){void 0===t&&(t={});var M=e.call(this)||this;return M.selectedTargets=[],M.dragScroll=new H,M.onDragStart=function(t,e){var n=t.datas,r=t.clientX,i=t.clientY,o=t.inputEvent,a=M.options,s=a.continueSelect,c=a.selectFromInside,u=a.selectByClick,l=a.rootContainer,f=a.boundContainer,h=a.preventDragFromInside,d=void 0===h||h,g=a.dragCondition;g&&!g(t)&&t.stop(),M.findSelectableTargets(n),n.startSelectedTargets=M.selectedTargets,n.scaleMatrix=Mt(),n.containerX=0;var p={left:-1/(n.containerY=0),top:-1/0,right:1/0,bottom:1/0};if(l){var v=M.container.getBoundingClientRect();n.containerX=v.left,n.containerY=v.top,n.scaleMatrix=Yt(M.container,l)}if(f){var m=Y(f)&&"element"in f?O({left:!0,top:!0,bottom:!0,right:!0},f):{element:f,left:!0,top:!0,bottom:!0,right:!0},y=m.element;if(y){var b=(typeof y===_?document.querySelector(y):!0===y?M.container:y).getBoundingClientRect();m.left&&(p.left=b.left),m.top&&(p.top=b.top),m.right&&(p.right=b.right),m.bottom&&(p.bottom=b.bottom)}}n.boundArea=p;var C={left:r,top:i,right:r,bottom:i,width:0,height:0},E=[];if(!c||u){for(var S=e||document.elementFromPoint(r,i);S&&!(-1<n.selectableTargets.indexOf(S));)S=S.parentElement;E=S?[S]:[]}var w=0<E.length,D=!c&&w;if(D&&!u)return t.stop(),!1;var x=o.type,k="mousedown"===x||"touchstart"===x;if(!(!(!t.isClick&&k)||M.trigger("dragStart",O({},t))))return t.stop(),!1;s?(E=At(M.selectedTargets,E),n.startPassedTargets=M.selectedTargets):n.startPassedTargets=[],M.select(M.selectedTargets,E,C,o,!0),n.startX=r,n.startY=i,n.selectFlag=!1,n.preventDragFromInside=!1;var P=_t(n.scaleMatrix,[r-n.containerX,i-n.containerY]);if(n.boundsArea=M.target.style.cssText+="position: "+(l?"absolute":"fixed")+";left:0px;top:0px;transform: translate("+P[0]+"px, "+P[1]+"px)",D&&u)o.preventDefault(),d&&(M.selectEnd(n.startSelectedTargets,n.startPassedTargets,C,t),n.preventDragFromInside=!0);else{n.selectFlag=!0,"touchstart"===x&&o.preventDefault();var T=M.options.scrollOptions;T&&T.container&&M.dragScroll.dragStart(t,T)}return!0},M.onDrag=function(t){if(t.datas.selectFlag){var e=M.options.scrollOptions;if(e&&e.container&&M.dragScroll.drag(t,e))return}M.check(t)},M.onDragEnd=function(t){var e=t.datas,n=t.inputEvent,r=Kt(t,M.options.ratio),i=e.selectFlag;n&&!t.isClick&&M.trigger("dragEnd",O(O({isDouble:!!t.isDouble,isDrag:!1,isSelect:i},t),{rect:r})),M.target.style.cssText+="display: none;",i&&(e.selectFlag=!1,M.dragScroll.dragEnd()),e.preventDragFromInside||M.selectEnd(e.startSelectedTargets,e.startPassedTargets,r,t)},M.onKeyDown=function(t){M.sameCombiKey(t)&&(M.continueSelect=!0,M.trigger("keydown",{}))},M.onKeyUp=function(t){M.sameCombiKey(t,!0)&&(M.continueSelect=!1,M.trigger("keyup",{}))},M.onBlur=function(){M.toggleContinueSelect&&M.continueSelect&&(M.continueSelect=!1,M.trigger("keyup",{}))},M.onDocumentSelectStart=function(e){if(M.gesto.isFlag()){var t=M.dragContainer;t===window&&(t=document.documentElement);var n=t instanceof Element?[t]:[].slice.call(t),r=e.target;n.some(function(t){if(t===r||t.contains(r))return e.preventDefault(),!0})}},M.target=t.target,M.container=t.container||document.body,M.options=O({target:null,container:null,dragContainer:null,selectableTargets:[],selectByClick:!0,selectFromInside:!0,hitRate:100,continueSelect:!1,toggleContinueSelect:null,keyContainer:null,scrollOptions:void 0,checkInput:!1,preventDefault:!1,boundContainer:!1,preventDragFromInside:!0,dragCondition:null,rootContainer:null,getElementRect:It,cspNonce:"",ratio:0},t),M.initElement(),M.initDragScroll(),M.setKeyController(),M}o(t,e);var n,r,i=t.prototype;return i.setSelectedTargets=function(t){return this.selectedTargets=t,this},i.getSelectedTargets=function(){return this.selectedTargets},i.setKeyContainer=function(t){var e=this,n=this.options;jt(n.keyContainer,t,function(){n.keyContainer=t,e.setKeyController()})},i.setToggleContinueSelect=function(t){var e=this,n=this.options;jt(n.toggleContinueSelect,t,function(){n.toggleContinueSelect=t,e.setKeyEvent()})},i.setPreventDefault=function(t){this.gesto.options.preventDefault=t},i.setCheckInput=function(t){this.gesto.options.checkInput=t},i.triggerDragStart=function(t){return this.gesto.triggerDragStart(t),this},i.destroy=function(){this.off(),this.keycon&&this.keycon.destroy(),this.gesto.unset(),this.injectResult.destroy(),C(document,"selectstart",this.onDocumentSelectStart),this.keycon=null,this.gesto=null,this.injectResult=null,this.target=null,this.container=null,this.options=null},i.getElementPoints=function(t){var e,n,r,i,o,a,s,c,u,l,f,h,d,g=this.getElementRect||It,p=g(t),v=[p.pos1,p.pos2,p.pos4,p.pos3];if(g===It)return v;var m=t.getBoundingClientRect();return e=v,r=(n=m).width,i=n.height,o=n.left,a=n.top,s=ht(e),c=s.minX,u=s.minY,l=s.maxX,f=s.maxY,h=r/(l-c),d=i/(f-u),e.map(function(t){return[o+(t[0]-c)*h,a+(t[1]-u)*d]})},i.getSelectableElements=function(){var e=[];return this.options.selectableTargets.forEach(function(t){Y(t)?e.push(t):[].slice.call(document.querySelectorAll(t)).forEach(function(t){e.push(t)})}),e},i.findSelectableTargets=function(t){var e=this;void 0===t&&(t=this.gesto.getEventDatas());var n=this.getSelectableElements(),r=n.map(function(t){return e.getElementPoints(t)});t.selectableTargets=n,t.selectablePoints=r},i.clickTarget=function(t,e){var n=function(t){if("touches"in t){var e=t.touches[0]||t.changedTouches[0];return{clientX:e.clientX,clientY:e.clientY}}return{clientX:t.clientX,clientY:t.clientY}}(t),r={datas:{selectFlag:!1},clientX:n.clientX,clientY:n.clientY,inputEvent:t,isClick:!0,stop:function(){return!1}};return this.onDragStart(r,e)&&this.onDragEnd(r),this},i.setKeyController=function(){var t=this.options,e=t.keyContainer,n=t.toggleContinueSelect;this.keycon&&(this.keycon.destroy(),this.keycon=null),n&&(this.keycon=new lt(e||window),this.keycon.keydown(this.onKeyDown).keyup(this.onKeyUp).on("blur",this.onBlur))},i.setKeyEvent=function(){this.options.toggleContinueSelect&&!this.keycon&&this.setKeyController()},i.initElement=function(){this.target=Xt(Ft("div",{className:Wt}),this.target,this.container);var t=this.target,e=this.options,n=e.dragContainer,r=e.checkInput,i=e.preventDefault;this.dragContainer="string"==typeof n?[].slice.call(document.querySelectorAll(n)):this.options.dragContainer||this.target.parentNode,this.gesto=new j(this.dragContainer,{checkWindowBlur:!0,container:window,checkInput:r,preventDefault:i}).on({dragStart:this.onDragStart,drag:this.onDrag,dragEnd:this.onDragEnd}),b(document,"selectstart",this.onDocumentSelectStart),this.injectResult=Zt.inject(t,{nonce:this.options.cspNonce})},i.hitTest=function(t,s,c,e,u){var n=this.options,l=n.hitRate,f=n.selectByClick,r=t.left,i=t.top,o=t.right,a=t.bottom,h=[[r,i],[o,i],[o,a],[r,a]];return e.filter(function(t,e){var n=u[e],r=dt([s,c],n);if(f&&r)return!0;var i=function(t,e){var n=t.slice(),s=e.slice();-1===d(n)&&n.reverse(),-1===d(s)&&s.reverse();var c=mt(n),u=mt(s),r=c.map(function(t){return gt(t[0],t[1])}),l=u.map(function(t){return gt(t[0],t[1])}),f=[];r.forEach(function(r,i){var o=c[i],a=[];l.forEach(function(t,e){var n=vt(pt(r,t),[o,u[e]]);a.push.apply(a,n.map(function(t){return{index1:i,index2:e,pos:t}}))}),a.sort(function(t,e){return g(o[0],t.pos)-g(o[0],e.pos)}),f.push.apply(f,a),dt(o[1],s)&&f.push({index1:i,index2:-1,pos:o[1]})}),u.forEach(function(t,r){if(dt(t[1],n)){var i=!1,e=m(f,function(t){return t.index2===r?!(i=!0):!!i});-1===e&&(i=!1,e=m(f,function(t){var e=t.index1,n=t.index2;return-1===e&&n+1===r?!(i=!0):!!i})),-1===e?f.push({index1:-1,index2:r,pos:t[1]}):f.splice(e,0,{index1:-1,index2:r,pos:t[1]})}});var i=f.map(function(t){return t.pos}),o={};return i.filter(function(t){var e=t[0]+"x"+t[1];return!o[e]&&(o[e]=!0)})}(h,n);if(!i.length)return!1;var o=ft(i),a=ft(n);return v(Math.round(o/a*100),0,100)>=Math.min(100,l)})},i.initDragScroll=function(){var o=this;this.dragScroll.on("scroll",function(t){var e=t.container,n=t.direction;o.trigger("scroll",{container:e,direction:n})}).on("move",function(t){var e=t.offsetX,n=t.offsetY,r=t.inputEvent,i=r.datas;i.startX-=e,i.startY-=n,i.selectablePoints.forEach(function(t){t.forEach(function(t){t[0]-=e,t[1]-=n})}),o.gesto.scrollBy(e,n,r.inputEvent,!1),r.distX+=e,r.distY+=n,o.check(r)})},i.select=function(t,e,n,r,i){var o=q(t,e),a=o.added,s=o.removed,c=o.prevList,u=o.list;this.selectedTargets=e,i&&this.trigger("selectStart",{selected:e,added:a.map(function(t){return u[t]}),removed:s.map(function(t){return c[t]}),rect:n,inputEvent:r}),(a.length||s.length)&&this.trigger("select",{selected:e,added:a.map(function(t){return u[t]}),removed:s.map(function(t){return c[t]}),rect:n,inputEvent:r})},i.selectEnd=function(t,e,n,r){var i=r.inputEvent,o=r.isDouble,a=q(t,this.selectedTargets),s=a.added,c=a.removed,u=a.prevList,l=a.list,f=q(e,this.selectedTargets),h=f.added,d=f.removed,g=f.prevList,p=f.list,v=i&&i.type,m="mousedown"===v||"touchstart"===v;this.trigger("selectEnd",{selected:this.selectedTargets,added:s.map(function(t){return l[t]}),removed:c.map(function(t){return u[t]}),afterAdded:h.map(function(t){return p[t]}),afterRemoved:d.map(function(t){return g[t]}),isDragStart:m,isDouble:!!o,rect:n,inputEvent:i})},i.check=function(t,e){void 0===e&&(e=Kt(t,this.options.ratio));var n=t.datas,r=t.inputEvent,i=e.top,o=e.left,a=e.width,s=e.height,c=n.selectFlag,u=n.containerX,l=n.containerY,f=n.scaleMatrix,h=_t(f,[o-u,i-l]),d=_t(f,[a,s]),g=[],p=[];if(c){this.target.style.cssText+="display: block;left:0px;top:0px;transform: translate("+h[0]+"px, "+h[1]+"px);width:"+d[0]+"px;height:"+d[1]+"px;";var v=this.hitTest(e,n.startX,n.startY,n.selectableTargets,n.selectablePoints);g=this.selectedTargets,p=At(n.startPassedTargets,v),this.selectedTargets=p}this.trigger("drag",O(O({},t),{isSelect:c,rect:e})),c&&this.select(g,p,e,r)},i.sameCombiKey=function(t,e){var n=[].concat(this.options.toggleContinueSelect),r=ct(t.inputEvent,t.key),i=a(n[0])?n:[n];if(e){var o=t.key;return i.some(function(t){return t.some(function(t){return t===o})})}return i.some(function(t){return t.every(function(t){return-1<r.indexOf(t)})})},t=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(a=(o<3?i(a):3<o?i(e,n,a):i(e,n))||a);return 3<o&&a&&Object.defineProperty(e,n,a),a}([(n=Ht,r=function(t,e){var n={enumerable:!0,configurable:!0,get:function(){return this.options[e]}},r=("set "+e).replace(/[\s-_]([a-z])/g,function(t,e){return e.toUpperCase()});t[r]?n.set=function(t){this[r](t)}:n.set=function(t){this.options[e]=t},Object.defineProperty(t,e,n)},function(t){var e=t.prototype;n.forEach(function(t){r(e,t)})})],t)}(t)),$t={__proto__:null,default:zt,OPTIONS:Ut,OPTION_TYPES:Vt,PROPERTIES:Ht,EVENTS:["dragStart","drag","dragEnd","selectStart","select","selectEnd","keydown","keyup","scroll"],METHODS:["clickTarget","getSelectableElements","setSelectedTargets","getElementPoints","getSelectedTargets","findSelectableTargets","triggerDragStart"],CLASS_NAME:Wt};for(var Gt in $t)zt[Gt]=$t[Gt];return zt});
//# sourceMappingURL=selecto.min.js.map
{
"name": "selecto",
"version": "1.11.1",
"version": "1.12.0",
"description": "Selecto.js is a component that allows you to select elements in the drag area using the mouse or touch.",

@@ -51,2 +51,3 @@ "main": "./dist/selecto.cjs.js",

"css-styled": "^1.0.0",
"css-to-mat": "^1.0.3",
"framework-utils": "^1.1.0",

@@ -53,0 +54,0 @@ "gesto": "^1.3.0",

@@ -48,2 +48,4 @@

container: document.body,
// Selecto's root container (No transformed container. (default: null)
rootContainer: null,
// The area to drag selection element (default: container)

@@ -50,0 +52,0 @@ dragContainer: Element,

@@ -12,2 +12,5 @@ import styled from "css-styled";

}
:host {
position: absolute;
}
`);

@@ -35,2 +38,4 @@

"preventDragFromInside",
"rootContainer",
"dragCondition",
] as const;

@@ -66,2 +71,4 @@ /**

preventDragFromInside: Boolean,
rootContainer: Object,
dragCondition: Function,
};

@@ -68,0 +75,0 @@

@@ -16,2 +16,3 @@ import { IObject } from "@daybrush/utils";

* @property - The container to add a selection element for vanilla
* @property - Selecto's root container (No transformed container. (default: null)
* @property - The area to drag selection element (default: container)

@@ -36,2 +37,3 @@ * @property - Targets to select. You can register a queryselector or an Element. (default: [])

container: HTMLElement | null;
rootContainer: HTMLElement | null;
dragContainer: Element | Window | Element[] | string;

@@ -53,2 +55,3 @@ selectableTargets: Array<HTMLElement | string>;

getElementRect: getElementRectFunction;
dragCondition: ((e: OnParentDragStart) => boolean) | null;
}

@@ -55,0 +58,0 @@ /**

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc