From 20a67607d293446a52eb9e7f5e6c84be735cc162 Mon Sep 17 00:00:00 2001 From: daybrush Date: Mon, 16 Nov 2020 06:06:46 +0900 Subject: [PATCH] chore: Release 0.21.1 --- .gitignore | 2 +- CHANGELOG.md | 11 + demo/index.html | 2 +- demo/static/js/2.1a502f65.chunk.js | 3 - demo/static/js/2.1a502f65.chunk.js.map | 1 - demo/static/js/2.4f099a54.chunk.js | 3 + ...SE.txt => 2.4f099a54.chunk.js.LICENSE.txt} | 0 demo/static/js/2.4f099a54.chunk.js.map | 1 + demo/static/js/main.2ae3dd2f.chunk.js | 2 - demo/static/js/main.2ae3dd2f.chunk.js.map | 1 - demo/static/js/main.b4f396a0.chunk.js | 2 + demo/static/js/main.b4f396a0.chunk.js.map | 1 + dist/moveable.cjs.js | 505 + dist/moveable.cjs.js.map | 1 + dist/moveable.esm.js | 489 + dist/moveable.esm.js.map | 1 + dist/moveable.js | 18484 ++++++++++++++++ dist/moveable.js.map | 1 + dist/moveable.min.js | 10 + dist/moveable.min.js.map | 1 + package-lock.json | 22 +- package.json | 4 +- .../projects/ngx-moveable/package-lock.json | 36 +- .../projects/ngx-moveable/package.json | 4 +- packages/preact-moveable/package-lock.json | 20 +- packages/preact-moveable/package.json | 4 +- .../react-compat-moveable/package-lock.json | 20 +- packages/react-compat-moveable/package.json | 4 +- packages/react-moveable/package-lock.json | 2 +- packages/react-moveable/package.json | 2 +- packages/svelte-moveable/package-lock.json | 36 +- packages/svelte-moveable/package.json | 4 +- storybook/package-lock.json | 18 +- storybook/package.json | 2 +- 34 files changed, 19601 insertions(+), 98 deletions(-) delete mode 100644 demo/static/js/2.1a502f65.chunk.js delete mode 100644 demo/static/js/2.1a502f65.chunk.js.map create mode 100644 demo/static/js/2.4f099a54.chunk.js rename demo/static/js/{2.1a502f65.chunk.js.LICENSE.txt => 2.4f099a54.chunk.js.LICENSE.txt} (100%) create mode 100644 demo/static/js/2.4f099a54.chunk.js.map delete mode 100644 demo/static/js/main.2ae3dd2f.chunk.js delete mode 100644 demo/static/js/main.2ae3dd2f.chunk.js.map create mode 100644 demo/static/js/main.b4f396a0.chunk.js create mode 100644 demo/static/js/main.b4f396a0.chunk.js.map create mode 100644 dist/moveable.cjs.js create mode 100644 dist/moveable.cjs.js.map create mode 100644 dist/moveable.esm.js create mode 100644 dist/moveable.esm.js.map create mode 100644 dist/moveable.js create mode 100644 dist/moveable.js.map create mode 100644 dist/moveable.min.js create mode 100644 dist/moveable.min.js.map diff --git a/.gitignore b/.gitignore index 5e70f72a6..14bf40b31 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ node_modules/ *.DS_Store .DS_Store doc/ -dist/ + demo/dist/ packages/*/dist/ release/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 83287ba2d..87d4e2a45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * Expand the functions of `translate` and `rotate` properties. +## [0.21.1] - 2020-11-16 +* `moveable` 0.21.1 +* `react-moveable` 0.24.1 +* `preact-moveable` 0.23.1 +* `ngx-moveable` 0.17.1 +* `svelte-moveable` 0.12.1 + +### Fixed +* Fix rotataionPosition's calculation #353 +* Fix zoom pixel cracking problem + ## [0.21.0] - 2020-11-08 * `moveable` 0.21.0 diff --git a/demo/index.html b/demo/index.html index e76e8de9a..191138377 100644 --- a/demo/index.html +++ b/demo/index.html @@ -1 +1 @@ -Moveable is Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable!
\ No newline at end of file +Moveable is Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable!
\ No newline at end of file diff --git a/demo/static/js/2.1a502f65.chunk.js b/demo/static/js/2.1a502f65.chunk.js deleted file mode 100644 index 9d917410d..000000000 --- a/demo/static/js/2.1a502f65.chunk.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see 2.1a502f65.chunk.js.LICENSE.txt */ -(this["webpackJsonp@scena/react-editor"]=this["webpackJsonp@scena/react-editor"]||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(121)},function(e,t,n){"use strict";n.d(t,"a",(function(){return B})),n.d(t,"b",(function(){return g})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return v})),n.d(t,"e",(function(){return l})),n.d(t,"f",(function(){return F})),n.d(t,"g",(function(){return S})),n.d(t,"h",(function(){return x})),n.d(t,"i",(function(){return U})),n.d(t,"j",(function(){return O})),n.d(t,"k",(function(){return u})),n.d(t,"l",(function(){return s})),n.d(t,"m",(function(){return a})),n.d(t,"n",(function(){return A})),n.d(t,"o",(function(){return Q})),n.d(t,"p",(function(){return h})),n.d(t,"q",(function(){return f})),n.d(t,"r",(function(){return d})),n.d(t,"s",(function(){return p})),n.d(t,"t",(function(){return y})),n.d(t,"u",(function(){return m})),n.d(t,"v",(function(){return b})),n.d(t,"w",(function(){return w})),n.d(t,"x",(function(){return E})),n.d(t,"y",(function(){return C}));n(2);function r(e,t,n,r,i,o){for(var a=0;a-1&&(a=F(o,t,i+1,r)),-1===a)break;i=a}return-1}function U(e,t){for(var n=new RegExp("(\\s*"+(t||",")+"\\s*|\\(|\\)|\"|'|\\\\\"|\\\\'|\\s+)","g"),r=e.split(n).filter(Boolean),i=r.length,o=[],a=[],A=0;A-1)u=F(s,r,A+1,i);else if(s===t){a.length&&(o.push(a.join("")),a=[]);continue}}-1===u&&(u=i-1),a.push(r.slice(A,u+1).join("")),A=u}return a.length&&o.push(a.join("")),o}function S(e){return U(e,"")}function O(e){return U(e,",")}function H(e){var t=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(e);return!t||t.length<4?{}:{prefix:t[1],value:t[2],suffix:t[3]}}function T(e){var t=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(e);if(!t)return{prefix:"",unit:"",value:NaN};var n=t[1],r=t[2];return{prefix:n,unit:t[3],value:parseFloat(r)}}function N(e){return e.replace(/[\s-_]([a-z])/g,(function(e,t){return t.toUpperCase()}))}function _(e,t){return void 0===t&&(t="-"),e.replace(/([a-z])([A-Z])/g,(function(e,n,r){return""+n+t+r.toLowerCase()}))}function M(e){return[].slice.call(e)}function D(){return Date.now?Date.now():(new Date).getTime()}function R(e,t,n){void 0===n&&(n=-1);for(var r=e.length,i=0;i-1?e[r]:n}var k=function(){var e=D(),t=c&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame);return t?t.bind(window):function(t){var n=D();return window.setTimeout((function(){t(n-e)}),1e3/60)}}(),I=function(){var e=c&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame);return e?e.bind(window):function(e){clearTimeout(e)}}();function K(e){if(Object.keys)return Object.keys(e);var t=[];for(var n in t)t.push(n);return t}function L(e,t){void 0===t&&(t=[]),e.sort((function(e,n){var r=t.indexOf(e),i=t.indexOf(n);return-1===i&&-1===r?0:-1===r?1:-1===i?-1:r-i}))}function z(e,t,n){return Math.max(t,Math.min(e,n))}function j(e){for(var t=e.length,n=0,r=t-1;r>=0;--r)n+=e[r];return t?n/t:0}function X(e){var t=function(e){return e.replace("#","")}(e),n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16),o=parseInt(t.substring(6,8),16)/255;return isNaN(o)&&(o=1),[n,r,i,o]}function G(e){if("#"===e.charAt(0))return 4===e.length||5===e.length?X(function(e){var t=e.charAt(1),n=e.charAt(2),r=e.charAt(3),i=e.charAt(4);return["#",t,t,n,n,r,r,i,i].join("")}(e)):X(e);if(-1!==e.indexOf("(")){var t=H(e),n=t.prefix,i=t.value;if(!n||!i)return;var o=O(i),a=[0,0,0,1],A=o.length;switch(n){case"rgb":case r:for(var s=0;s1?t-1:0),a=1;a>>0};function o(e,t,n,i){var o=document.createElement("style");return o.setAttribute("type","text/css"),o.setAttribute("data-styled-id",e),n.nonce&&o.setAttribute("nonce",n.nonce),o.innerHTML=function(e,t,n){return n.original?t:t.replace(/([^};{\s}][^};{]*|^\s*){/gm,(function(t,n){var i=n.trim();return(i?Object(r.N)(i):[""]).map((function(t){var n=t.trim();return 0===n.indexOf("@")?n:n.indexOf(":global")>-1?n.replace(/\:global/g,""):n.indexOf(":host")>-1?""+n.replace(/\:host/g,"."+e):n?"."+e+" "+n:"."+e})).join(", ")+" {"}))}(e,t,n),(i||document.head||document.body).appendChild(o),o}var a=function(e){var t,n="rCS"+i(e).toString(36),r=0;return{className:n,inject:function(i,a){void 0===a&&(a={});var A,s=function(e){if(e&&e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t}}(i),u=0===r;return(s||u)&&(A=o(n,e,a,s)),u&&(t=A),s||++r,{destroy:function(){s?(i.removeChild(A),A=null):(r>0&&--r,0===r&&t&&(t.parentNode.removeChild(t),t=null))}}}}},A=n(0),s=n(8),u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function l(e,t){function n(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var c=function(){return(c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1&&o.splice(a,1)}}else this._events[e]=[];else this._events={};return this},t.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})}))},t.emit=function(e,t){var n=this;void 0===t&&(t={});var r=this._events[e];if(!e||!r)return!0;var i=!1;return t.eventType=e,t.stop=function(){i=!0},t.currentTarget=this,function(){for(var e=0,t=0,n=arguments.length;t=0?i:i+2*Math.PI}function o(e){var t=function(e){return[0,1].map((function(t){return function(e){for(var t=e.length,n=0,r=t-1;r>=0;--r)n+=e[r];return t?n/t:0}(e.map((function(e){return e[t]})))}))}(e),n=i(t,e[0]),r=i(t,e[1]);return nr&&r-n<-Math.PI?1:-1}function a(e,t){return Math.sqrt(Math.pow((t?t[0]:0)-e[0],2)+Math.pow((t?t[1]:0)-e[1],2))}function A(e){return e.length<3?0:Math.abs(function(e){for(var t=0,n=e.length-1;n>=0;--n)t+=e[n];return t}(e.map((function(t,n){var r=e[n+1]||e[0];return t[0]*r[1]-r[0]*t[1]}))))/2}function s(e,t){var n=t.width,r=t.height,i=t.left,o=t.top,a=u(e),A=a.minX,s=a.minY,l=a.maxX,c=a.maxY,f=n/(l-A),d=r/(c-s);return e.map((function(e){return[i+(e[0]-A)*f,o+(e[1]-s)*d]}))}function u(e){var t=e.map((function(e){return e[0]})),n=e.map((function(e){return e[1]}));return{minX:Math.min.apply(Math,t),minY:Math.min.apply(Math,n),maxX:Math.max.apply(Math,t),maxY:Math.max.apply(Math,n)}}function l(e,t,n){var i=e[0],o=e[1],a=u(t),A=a.minX,s=a.minY,l=a.maxX,h=a.maxY,g=[[A,o],[l,o]],v=[[i,s],[i,h]],B=c(g[0],g[1]),m=c(v[0],v[1]),b=p(t),w=[],E=[];return b.forEach((function(e){var t=c(e[0],e[1]),n=d(f(B,t),[g,e]),r=d(f(m,t),[v,e]);1===n.length&&e[0][1]===o||w.push.apply(w,n),1===r.length&&e[0][0]===i||E.push.apply(E,r),t[0]||w.push.apply(w,n),t[1]||E.push.apply(E,r)})),!n&&(r(w,(function(e){return e[0]===i}))>-1||r(E,(function(e){return e[1]===o}))>-1)||!!(w.filter((function(e){return e[0]>i})).length%2&&E.filter((function(e){return e[1]>o})).length%2)}function c(e,t){var n=e[0],r=e[1],i=t[0],o=t[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 f(e,t){var n,r,i=e[0],o=e[1],a=e[2],A=t[0],s=t[1],u=t[2],l=0===i&&0===A,c=0===o&&0===s;if(l&&c)return[];if(l){var f=-a/o;return f!==-u/s?[]:[[-1/0,f],[1/0,f]]}if(c){var d=-a/i;return d!==-u/A?[]:[[d,-1/0],[d,1/0]]}return 0===i?[[n=-(s*(r=-a/o)+u)/A,r]]:0===A?[[n=-(o*(r=-u/s)+a)/i,r]]:0===o?[[n=-a/i,r=-(A*n+u)/s]]:0===s?[[n=-u/A,r=-(i*n+a)/o]]:[[n=(o*u-s*a)/(s*i-o*A),r=-(i*n+a)/o]]}function d(e,t){var n=t.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===e.length){var r=e[0],i=r[0],o=r[1];if(i===e[1][0]){var a=Math.max.apply(Math,n.map((function(e){return e[1][0]}))),A=Math.min.apply(Math,n.map((function(e){return e[1][1]})));return a>A?[]:[[i,a],[i,A]]}if(o===e[1][1]){var s=Math.max.apply(Math,n.map((function(e){return e[0][0]}))),u=Math.min.apply(Math,n.map((function(e){return e[0][1]})));return s>u?[]:[[s,o],[u,o]]}}return e.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 p(e){return function(){for(var e=0,t=0,n=arguments.length;t=128?"#000":"#fff"},t.red={hsl:{a:1,h:0,l:.5,s:1},hex:"#ff0000",rgb:{r:255,g:0,b:0,a:1},hsv:{h:0,s:1,v:1,a:1}};t.default=t},function(e,t,n){var r=n(85),i=n(141),o=n(199),a=n(16);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},function(e,t,n){e.exports=n(127)},function(e,t,n){var r=n(35),i=n(132),o=n(133),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},function(e,t,n){var r=n(154),i=n(157);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){"use strict";n.d(t,"b",(function(){return we}));var r=n(32),i=n(8),o=("undefined"!==typeof document&&document,['"',"'",'\\"',"\\'"]),a={cm:function(e){return 96*e/2.54},mm:function(e){return 96*e/254},in:function(e){return 96*e},pt:function(e){return 96*e/72},pc:function(e){return 96*e/6},"%":function(e,t){return e*t/100},vw:function(e,t){return void 0===t&&(t=window.innerWidth),e/100*t},vh:function(e,t){return void 0===t&&(t=window.innerHeight),e/100*t},vmax:function(e,t){return void 0===t&&(t=Math.max(window.innerWidth,window.innerHeight)),e/100*t},vmin:function(e,t){return void 0===t&&(t=Math.min(window.innerWidth,window.innerHeight)),e/100*t}};function A(e){return"undefined"===typeof e}function s(e){return e&&"object"===typeof e}function u(e){return Array.isArray(e)}function l(e){return"string"===typeof e}function c(e,t,n,r){for(var i=n;i-1&&(A=c(a,t,i+1,r)),-1===A)break;i=A}return-1}function f(e,t){for(var n=new RegExp("(\\s*"+(t||",")+"\\s*|\\(|\\)|\"|'|\\\\\"|\\\\'|\\s+)","g"),r=e.split(n).filter(Boolean),i=r.length,a=[],A=[],s=0;s-1)l=c(u,r,s+1,i);else if(u===t){A.length&&(a.push(A.join("")),A=[]);continue}}-1===l&&(l=i-1),A.push(r.slice(s,l+1).join("")),s=l}return A.length&&a.push(A.join("")),a}function d(e){return f(e,"")}function p(e){return f(e,",")}function h(e){var t=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(e);return!t||t.length<4?{}:{prefix:t[1],value:t[2],suffix:t[3]}}function g(e){var t=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(e);if(!t)return{prefix:"",unit:"",value:NaN};var n=t[1],r=t[2];return{prefix:n,unit:t[3],value:parseFloat(r)}}function v(){return Date.now?Date.now():(new Date).getTime()}function B(e,t,n){void 0===n&&(n=-1);for(var r=e.length,i=0;i=t[r]}))}))[0]||e}function E(e,t,n,r){if(!r)return e.map((function(e,r){return function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t[r],n[r])}));var i=e[0],o=e[1],a=w(e,t,!1),A=a[0],s=a[1],u=w(e,n,!0),l=u[0],c=u[1];return il||o>c)&&(i=l,o=c),[i,o]}function y(e){for(var t=e.length,n=0,r=t-1;r>=0;--r)n+=e[r];return t?n/t:0}function C(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=Math.atan2(r,n);return i>=0?i:i+2*Math.PI}function Q(e){var t=function(e){return[0,1].map((function(t){return y(e.map((function(e){return e[t]})))}))}(e),n=C(t,e[0]),r=C(t,e[1]);return nr&&r-n<-Math.PI?1:-1}function x(e,t){return e.classList?e.classList.contains(t):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function F(e,t,n,r){e.addEventListener(t,n,r)}function U(e,t,n){e.removeEventListener(t,n)}var S=n(1);function O(e){return H(T(e))}function H(e){var t=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return e.forEach((function(e){var n=e.matrixFunction,r=e.functionValue;n&&(t=n(t,r))})),t}function T(e){return(u(e)?e:d(e)).map((function(e){var t=h(e),n=t.prefix,r=t.value,i=null,o=n,a="";if("translate"===n||"translateX"===n||"translate3d"===n){var A=p(r).map((function(e){return parseFloat(e)})),s=A[0],u=A[1],l=void 0===u?0:u,c=A[2],f=void 0===c?0:c;i=S.y,a=[s,l,f]}else if("translateY"===n){l=parseFloat(r);i=S.y,a=[0,l,0]}else if("translateZ"===n){f=parseFloat(r);i=S.y,a=[0,0,f]}else if("scale"===n||"scale3d"===n){var d=p(r).map((function(e){return parseFloat(e)})),v=d[0],B=d[1],m=void 0===B?v:B,b=d[2],w=void 0===b?1:b;i=S.x,a=[v,m,w]}else if("scaleX"===n){v=parseFloat(r);i=S.x,a=[v,1,1]}else if("scaleY"===n){m=parseFloat(r);i=S.x,a=[1,m,1]}else if("scaleZ"===n){w=parseFloat(r);i=S.x,a=[1,1,w]}else if("rotate"===n||"rotateZ"===n||"rotateX"===n||"rotateY"===n){var E=g(r),y=E.unit,C=E.value,Q="rad"===y?C:C*Math.PI/180;"rotate"===n||"rotateZ"===n?(o="rotateZ",i=S.w):"rotateX"===n?i=S.u:"rotateY"===n&&(i=S.v),a=Q}else if("matrix3d"===n)i=S.o,a=p(r).map((function(e){return parseFloat(e)}));else if("matrix"===n){var x=p(r).map((function(e){return parseFloat(e)}));i=S.o,a=[x[0],x[1],0,0,x[2],x[3],0,0,0,0,1,0,x[4],x[5],0,1]}else o="";return{name:n,functionName:o,value:r,matrixFunction:i,functionValue:a}}))}var N=n(19),_=n(56),M=n(0),D=n(13),R=function(e,t){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var P=function(){return(P=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0?i:i+2*Math.PI}([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function I(e){return e.touches?function(e){for(var t=Math.min(e.length,2),n=[],r=0;r-1,h=f.isContentEditable;if(p||h){if(s||c===f)return!1;if(c&&h&&c.isContentEditable&&c.contains(f))return!1}else if((A||"touchstart"===e.type)&&c){var g=c.tagName;(c.isContentEditable||G.indexOf(g)>-1)&&c.blur()}if(r.clientStores=[new X(I(e))],r.flag=!0,r.isDrag=!1,r.datas={},a&&(3===e.which||2===e.button))return r.initDrag(),!1;!1===r.emit("dragStart",P({datas:r.datas,inputEvent:e,isTrusted:t},r.getCurrentStore().getPosition()))&&r.initDrag(),r.isDouble=v()-r.prevTime<200,r.flag&&A&&e.preventDefault()}if(!r.flag)return!1;var B=0;if(l&&u&&o&&(B=setTimeout((function(){F(i,"touchstart",r.onDragStart,{passive:!1})}))),!l&&u&&o&&U(i,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(B),l&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=I(e),i=r.moveClients(n,e,!1);(r.pinchFlag||i.deltaX||i.deltaY)&&r.emit("drag",P({},i,{isScroll:!!t,inputEvent:e})),r.pinchFlag&&r.onPinch(e,n),r.getCurrentStore().addClients(n)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,i=t.container;r.isTouch&&n&&U(i,"touchstart",r.onDragStart),r.flag=!1;var o=r.getCurrentStore().getPosition(),a=v(),A=!r.isDrag&&r.isDouble;r.prevTime=r.isDrag||A?0:a,r.emit("dragEnd",P({datas:r.datas,isDouble:A,isDrag:r.isDrag,inputEvent:e},o)),r.pinchFlag&&r.onPinchEnd(e),r.clientStores=[]}},r.onBlur=function(){r.onDragEnd()};var i=[].concat(t);r.options=P({checkInput:!1,container:i.length>1?window:i[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},n);var o=r.options,a=o.container,A=o.events,s=o.checkWindowBlur;if(r.isTouch=A.indexOf("touch")>-1,r.isMouse=A.indexOf("mouse")>-1,r.targets=i,r.isMouse&&(i.forEach((function(e){F(e,"mousedown",r.onDragStart)})),F(a,"mousemove",r.onDrag),F(a,"mouseup",r.onDragEnd),F(a,"contextmenu",r.onDragEnd)),s&&F(window,"blur",r.onBlur),r.isTouch){var u={passive:!1};i.forEach((function(e){F(e,"touchstart",r.onDragStart,u)})),F(a,"touchmove",r.onDrag,u),F(a,"touchend",r.onDragEnd,u),F(a,"touchcancel",r.onDragEnd,u)}return r}!function(e,t){function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(e){var t=e.clientX,i=e.clientY;return{clientX:t+n,clientY:i+r,originalClientX:t,originalClientY:i}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),U(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){U(t,"mousedown",e.onDragStart)})),U(n,"mousemove",this.onDrag),U(n,"mouseup",this.onDragEnd),U(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){U(t,"touchstart",e.onDragStart)})),U(n,"touchstart",this.onDragStart),U(n,"touchmove",this.onDrag),U(n,"touchend",this.onDragEnd),U(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new X(I(e));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",P({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",P({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",P({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition(),{inputEvent:e})),this.isPinch=!1,this.pinchFlag=!1}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](e);return this.isDrag=!0,P({datas:this.datas},r,{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},t}(D.a),Y=n(29),W=n(11),J=function(e,t){return(J=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function q(e,t){function n(){this.constructor=e}J(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var $=function(){return($=Object.assign||function(e){for(var t,n=1,r=arguments.length;n'}var te=Object(r.a)().browser.webkit,ne=te&&function(){var e=/applewebkit\/([^\s]+)/g.exec(navigator.userAgent.toLowerCase());return!!e&&parseFloat(e[1])<605}(),re="moveable-",ie="\n{\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tleft: 0;\n\ttop: 0;\n z-index: 3000;\n --zoom: 1;\n --zoompx: 1px;\n}\n.control-box {\n z-index: 0;\n}\n.line, .control {\n\tleft: 0;\n top: 0;\n will-change: transform;\n}\n.control {\n\tposition: absolute;\n\twidth: 14px;\n\theight: 14px;\n\tborder-radius: 50%;\n\tborder: 2px solid #fff;\n\tbox-sizing: border-box;\n\tbackground: #4af;\n\tmargin-top: -7px;\n margin-left: -7px;\n width: calc(14 * var(--zoompx));\n height: calc(14 * var(--zoompx));\n margin-top: calc(-7 * var(--zoompx));\n margin-left: calc(-7 * var(--zoompx));\n border: calc(2 * var(--zoompx)) solid #fff;\n z-index: 10;\n}\n.padding {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100px;\n height: 100px;\n transform-origin: 0 0;\n}\n.line {\n\tposition: absolute;\n\twidth: 1px;\n height: 1px;\n width: var(--zoompx);\n height: var(--zoompx);\n\tbackground: #4af;\n\ttransform-origin: 0px 50%;\n}\n.line.dashed {\n box-sizing: border-box;\n background: transparent;\n}\n.line.dashed.horizontal {\n border-top: 1px dashed #4af;\n border-top: var(--zoompx) dashed #4af;\n}\n.line.dashed.vertical {\n border-left: 1px dashed #4af;\n border-left: var(--zoompx) dashed #4af;\n}\n.line.dashed:before {\n position: absolute;\n content: attr(data-size);\n color: #4af;\n font-size: 12px;\n font-weight: bold;\n}\n.line.dashed.horizontal:before, .line.gap.horizontal:before {\n left: 50%;\n transform: translateX(-50%);\n bottom: 5px;\n}\n.line.dashed.vertical:before, .line.gap.vertical:before {\n top: 50%;\n transform: translateY(-50%);\n left: 5px;\n}\n.line.vertical {\n transform: translateX(-50%);\n}\n.line.horizontal {\n transform: translateY(-50%);\n}\n.line.vertical.bold {\n width: 2px;\n width: calc(2 * var(--zoompx));\n}\n.line.horizontal.bold {\n height: 2px;\n height: calc(2 * var(--zoompx));\n}\n\n.line.gap {\n background: #f55;\n}\n.line.gap:before {\n position: absolute;\n content: attr(data-size);\n color: #f55;\n font-size: 12px;\n font-weight: bold;\n}\n.control.origin {\n\tborder-color: #f55;\n\tbackground: #fff;\n\twidth: 12px;\n\theight: 12px;\n\tmargin-top: -6px;\n margin-left: -6px;\n width: calc(12 * var(--zoompx));\n height: calc(12 * var(--zoompx));\n margin-top: calc(-6 * var(--zoompx));\n margin-left: calc(-6 * var(--zoompx));\n\tpointer-events: none;\n}\n"+[0,15,30,45,60,75,90,105,120,135,150,165].map((function(e){return'\n.direction[data-rotation="'+e+'"] {\n\t'+function(e){var t=ee(1,e),n=ee(2,e),r=45*Math.round(e/45)%180,i=135===r?"nwse-resize":45===r?"nesw-resize":90===r?"ew-resize":"ns-resize";return"cursor:"+i+";cursor: url('"+t+"') 16 16, "+i+";cursor: -webkit-image-set(url('"+t+"') 1x, url('"+n+"') 2x) 16 16, "+i+";"}(e)+"\n}\n"})).join("\n")+"\n.group {\n z-index: -1;\n}\n.area {\n position: absolute;\n}\n.area-pieces {\n position: absolute;\n top: 0;\n left: 0;\n display: none;\n}\n.area.avoid, .area.pass {\n pointer-events: none;\n}\n.area.avoid+.area-pieces {\n display: block;\n}\n.area-piece {\n position: absolute;\n}\n\n"+(ne?':global svg *:before {\n\tcontent:"";\n\ttransform-origin: inherit;\n}':"")+"\n",oe=[[0,1,2],[1,0,3],[2,0,3],[3,1,2]],ae=Math.pow(10,10),Ae=-ae,se=["n","w","s","e","nw","ne","sw","se"],ue={n:[0,1],s:[2,3],w:[2,0],e:[1,3],nw:[0],ne:[1],sw:[2],se:[3]},le={n:0,s:180,w:270,e:90,nw:315,ne:45,sw:225,se:135},ce=["isMoveableElement","updateRect","updateTarget","destroy","dragStart","isInside","hitTest","setState","getRect","request","isDragging","getManager"];function fe(){for(var e=[],t=0;t0?a[0]:a[1],u>0?a[1]:a[0])}var B=r?4:3;return $({width:l,height:c,rotation:f,rootMatrix:Object(S.f)(B),beforeMatrix:Object(S.f)(B),offsetMatrix:Object(S.f)(B),allMatrix:Object(S.f)(B),targetMatrix:Object(S.f)(B),targetTransform:"",transformOrigin:[0,0],targetOrigin:[0,0],is3d:!!r,left:0,top:0,right:0,bottom:0,origin:[0,0],pos1:[0,0],pos2:[0,0],pos3:[0,0],pos4:[0,0],direction:1},d)}function we(e,t,n){return void 0===n&&(n=t),be(e,t,n,!0)}function Ee(e,t){return void 0===t&&(t=e.length>9),(t?"matrix3d":"matrix")+"("+Object(S.d)(e,!t).join(",")+")"}function ye(e){var t=e.clientWidth,n=e.clientHeight,r=e.viewBox,i=r&&r.baseVal||{x:0,y:0,width:0,height:0};return{x:i.x,y:i.y,width:i.width||t,height:i.height||n}}function Ce(e,t){var n=e.clientWidth,r=e.clientHeight,i=ye(e),o=i.width,a=i.height,A=n/o,s=r/a,u=e.preserveAspectRatio.baseVal,l=u.align,c=u.meetOrSlice,f=[0,0],d=[A,s],p=[0,0];if(1!==l){var h=(l-2)%3,g=Math.floor((l-2)/3);f[0]=o*h/2,f[1]=a*g/2;var v=2===c?Math.max(s,A):Math.min(A,s);d[0]=v,d[1]=v,p[0]=(n-o)/2*h,p[1]=(r-a)/2*g}var B=Object(S.i)(d,t);return B[t*(t-1)]=p[0],B[t*(t-1)+1]=p[1],de(B,t,f)}function Qe(e,t,n){return Object(S.a)(e,Object(S.e)(t,n),n)}function xe(e,t,n,r){return[[0,0],[t,0],[0,n],[t,n]].map((function(t){return Qe(e,t,r)}))}function Fe(e){var t=e.map((function(e){return e[0]})),n=e.map((function(e){return e[1]})),r=Math.min.apply(Math,t),i=Math.min.apply(Math,n),o=Math.max.apply(Math,t),a=Math.max.apply(Math,n);return{left:r,top:i,right:o,bottom:a,width:o-r,height:a-i}}function Ue(e,t,n,r){return Fe(xe(e,t,n,r))}function Se(e,t,n,r){var i=16===e.length?4:3,o=xe(e,n,r,i),a=o[0],A=a[0],s=a[1],u=o[1],l=u[0],c=u[1],f=o[2],d=f[0],p=f[1],h=o[3],g=h[0],v=h[1],B=Qe(e,t,i),m=B[0],b=B[1],w=Math.min(A,l,d,g),E=Math.min(s,c,p,v),y=Math.max(A,l,d,g);return A=A-w||0,{left:w,top:E,right:y,bottom:Math.max(s,c,p,v),origin:[m=m-w||0,b=b-E||0],pos1:[A,s=s-E||0],pos2:[l=l-w||0,c=c-E||0],pos3:[d=d-w||0,p=p-E||0],pos4:[g=g-w||0,v=v-E||0],direction:Q(o)}}function Oe(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function He(e,t){return Oe([t[0]-e[0],t[1]-e[1]])}function Te(e,t,n){void 0===n&&(n=C(e,t));var r=He(e,t);return{transform:"translateY(-50%) translate("+e[0]+"px, "+e[1]+"px) rotate("+n+"rad)",width:r+"px"}}function Ne(e){for(var t=[],n=1;n-1&&(n[0]=-1),t.indexOf("e")>-1&&(n[0]=1),t.indexOf("n")>-1&&(n[1]=-1),t.indexOf("s")>-1&&(n[1]=1),n}}}function Pe(e,t){return[Object(S.s)(t,e[0]),Object(S.s)(t,e[1]),Object(S.s)(t,e[2]),Object(S.s)(t,e[3])]}function ke(e){var t=e.left,n=e.top;return Pe([e.pos1,e.pos2,e.pos3,e.pos4],[t,n])}function Ie(e,t){return t?Math.round(e/t)*t:e}function Ke(e,t){return e.forEach((function(n,r){e[r]=Ie(e[r],t)})),e}function Le(e,t){e[t]&&(e[t].unset(),e[t]=null)}function ze(e,t,n){var r=t.datas;r.datas||(r.datas={});var i=$($({},n),{target:e.state.target,clientX:t.clientX,clientY:t.clientY,inputEvent:t.inputEvent,currentTarget:e,datas:r.datas});return r.isStartEvent?r.lastEvent=i:r.isStartEvent=!0,i}function je(e,t,n){var r=t.datas,i="isDrag"in n?n.isDrag:t.isDrag;return r.datas||(r.datas={}),$($({isDrag:i},n),{target:e.state.target,clientX:t.clientX,clientY:t.clientY,inputEvent:t.inputEvent,currentTarget:e,lastEvent:r.lastEvent,isDouble:t.isDouble,datas:r.datas})}function Xe(e,t,n,r){return e.triggerEvent(t,n,r)}function Ge(e,t){return window.getComputedStyle(e,t)}function Ve(e,t,n){var r={},i={};return e.filter((function(e){var o=e.name;if(r[o]||!t.some((function(t){return e[t]})))return!1;if(!n&&e.ableGroup){if(i[e.ableGroup])return!1;i[e.ableGroup]=!0}return r[o]=!0,!0}))}function Ye(e,t,n){return e*(t?n:1/n)}function We(e,t,n){return e*(t?1/n:n)}function Je(e,t){return e===t||null==e&&null==t}function qe(e,t){var n=[],r=[];return e.forEach((function(i,o){var a=t(i,o,e),A=r.indexOf(a),s=n[A]||[];-1===A&&(r.push(a),n.push(s)),s.push(i)})),n}function $e(e){return e.reduce((function(e,t){return e.concat(t)}),[])}function Ze(){for(var e=[],t=0;t-1}))).filter((function(e){return e.canPinch&&e[l]})),f=ze(e,t,{});r&&(f.targets=r);var d=Xe(e,u,f);n.isPinch=!1!==d,n.ables=c;var p=n.isPinch;return!!p&&(c.forEach((function(n){if(o[n.name]=o[n.name]||{},n[l]){var r=$($({},t),{datas:o[n.name],parentRotate:i,isPinch:!0});n[l](e,r)}})),e.state.snapRenderInfo={request:t.isRequest,direction:[0,0]},p)},pinch:function(e,t){var n=t.datas,r=t.scale,i=t.distance,o=t.originalDatas,a=t.inputEvent,A=t.targets,s=t.angle;if(n.isPinch){var u=i*(1-1/r),l=ze(e,t,{});A&&(l.targets=A),Xe(e,"onPinch"+(A?"Group":""),l);var c=n.ables,f="drag"+(A?"Group":"")+"Control";return c.forEach((function(n){n[f]&&n[f](e,$($({},t),{datas:o[n.name],inputEvent:a,parentDistance:u,parentRotate:s,isPinch:!0}))})),l}},pinchEnd:function(e,t){var n=t.datas,r=t.isPinch,i=t.inputEvent,o=t.targets,a=t.originalDatas;if(n.isPinch){var A="onPinch"+(o?"Group":"")+"End",s=je(e,t,{isDrag:r});o&&(s.targets=o),Xe(e,A,s);var u=n.ables,l="drag"+(o?"Group":"")+"ControlEnd";return u.forEach((function(n){n[l]&&n[l](e,$($({},t),{isDrag:r,datas:a[n.name],inputEvent:i,isPinch:!0}))})),r}},pinchGroupStart:function(e,t){return this.pinchStart(e,$($({},t),{targets:e.props.targets}))},pinchGroup:function(e,t){return this.pinch(e,$($({},t),{targets:e.props.targets}))},pinchGroupEnd:function(e,t){return this.pinchEnd(e,$($({},t),{targets:e.props.targets}))}};function ut(e,t,n,r,i){var o=t.gesto.move(n,e.inputEvent),a=o.originalDatas||o.datas,A=a.draggable||(a.draggable={});return $($({},i?tt(t,o):o),{isDrag:!0,isPinch:!!r,parentEvent:!0,datas:A,originalDatas:e.originalDatas})}var lt=function(){function e(){this.prevX=0,this.prevY=0,this.startX=0,this.startY=0,this.isDrag=!1,this.isFlag=!1,this.datas={draggable:{}}}var t=e.prototype;return t.dragStart=function(e,t){this.isDrag=!1,this.isFlag=!1;var n=t.originalDatas;return this.datas=n,n.draggable||(n.draggable={}),$($({},this.move(e,t.inputEvent)),{type:"dragstart"})},t.drag=function(e,t){return this.move([e[0]-this.prevX,e[1]-this.prevY],t)},t.move=function(e,t){var n,r;return this.isFlag?(n=this.prevX+e[0],r=this.prevY+e[1],this.isDrag=!0):(this.prevX=e[0],this.prevY=e[1],this.startX=e[0],this.startY=e[1],n=e[0],r=e[1],this.isFlag=!0),this.prevX=n,this.prevY=r,{type:"drag",clientX:n,clientY:r,inputEvent:t,isDrag:this.isDrag,distX:n-this.startX,distY:r-this.startY,deltaX:e[0],deltaY:e[1],datas:this.datas.draggable,originalDatas:this.datas,parentEvent:!0,parentGesto:this}},e}();function ct(e,t,n){var r=n.originalDatas;r.groupable=r.groupable||{};var i=r.groupable;i.childDatas=i.childDatas||[];var o=i.childDatas,a=n.inputEvent,A=n.isPinch,s=n.clientX,u=n.clientY,l=n.distX,c=n.distY;return e.moveables.map((function(e,n){return o[n]=o[n]||{},o[n][t]=o[n][t]||{},{inputEvent:a,datas:o[n][t],originalDatas:o[n],isPinch:A,clientX:s,clientY:u,distX:l,distY:c}}))}function ft(e,t,n,r,i,o){var a=!!n.match(/Start$/g),A=!!n.match(/End$/g),s=i.isPinch,u=i.datas,l=ct(e,t.name,i),c=e.moveables,f=l.map((function(e,i){var l=c[i],f=e;a?f=(new lt).dragStart(r,e):(l.state.gesto||(l.state.gesto=u.childGestos[i]),f=ut(e,l.state,r,s,o));var d=t[n](l,$($({},f),{parentFlag:!0}));return A&&(l.state.gesto=null),d}));return a&&(u.childGestos=c.map((function(e){return e.state.gesto}))),f}function dt(e,t,n,r,i,o){void 0===i&&(i=function(e,t){return t});var a=!!n.match(/End$/g),A=ct(e,t.name,r),s=e.moveables;return A.map((function(e,r){var A,u=s[r];A=i(u,e);var l=t[n](u,$($({},A),{parentFlag:!0}));return l&&o&&o(u,e,l,r),a&&(u.state.gesto=null),l}))}function pt(e,t){var n=t.clientX,r=t.clientY,i=t.datas,o=e.state,a=o.moveableClientRect,A=o.rootMatrix,s=o.is3d,u=o.pos1,l=a.left,c=a.top,f=s?4:3,d=Object(S.p)(et(A,[n-l,r-c],f),u),p=bt({datas:i,distX:d[0],distY:d[1]});return[p[0],p[1]]}function ht(e,t){var n=t.datas,r=e.state,i=r.allMatrix,o=r.beforeMatrix,a=r.is3d,A=r.left,s=r.top,u=r.origin,l=r.offsetMatrix,c=r.targetMatrix,f=r.transformOrigin,d=a?4:3;n.is3d=a,n.matrix=i,n.targetMatrix=c,n.beforeMatrix=o,n.offsetMatrix=l,n.transformOrigin=f,n.inverseMatrix=Object(S.n)(i,d),n.inverseBeforeMatrix=Object(S.n)(o,d),n.absoluteOrigin=Object(S.e)(Object(S.s)([A,s],u),d),n.startDragBeforeDist=Object(S.a)(n.inverseBeforeMatrix,n.absoluteOrigin,d),n.startDragDist=Object(S.a)(n.inverseMatrix,n.absoluteOrigin,d)}function gt(e,t){var n=e.datas,r=e.originalDatas.beforeRenderable,i=n.transformIndex,o=r.nextTransforms,a=r.nextTransformAppendedIndexes,A=-1===i?o.length:i+a.filter((function(e){return e=0&&(e[0]>=0&&t.push(3),e[0]<=0&&t.push(2)),e[1]<=0&&(e[0]>=0&&t.push(1),e[0]<=0&&t.push(0)),t}function Et(e,t){return wt(t).map((function(t){return e[t]}))}function yt(e,t){var n=Et(e,t);return[y(n.map((function(e){return e[0]}))),y(n.map((function(e){return e[1]})))]}function Ct(e,t){return yt(e,t.map((function(e){return-e})))}function Qt(e,t,n,r){return Object(S.r)(e,de(t,r,n),r)}function xt(e){var t=e.originalDatas.beforeRenderable;return{setTransform:function(n,r){void 0===r&&(r=-1),t.startTransforms=u(n)?n:d(n),Ut(e,r)},setTransformIndex:function(t){Ut(e,t)}}}function Ft(e){Ut(e,-1)}function Ut(e,t){var n=e.originalDatas.beforeRenderable,r=e.datas;if(r.transformIndex=t,-1!==t){var i=n.startTransforms[t];if(i){var o=T([i]);r.startValue=o[0].functionValue}}}function St(e,t){e.originalDatas.beforeRenderable.nextTransforms=d(t)}function Ot(e,t,n,r,i){return St(i,t),{transform:t,drag:_n.drag(e,ut(i,e.state,n,r,!1))}}function Ht(e,t,n,r,i){var o=e.state,a=o.left,A=o.top,s=e.props.groupable,u=s?a:0,l=s?A:0,c=Nt(e,r,function(e,t,n){var r=e.transformOrigin,i=e.offsetMatrix,o=e.is3d,a=t.beforeTransform,A=t.afterTransform,s=o?4:3,u=O([n]);return Qt(i,Object(S.c)(Object(S.r)(Object(S.r)(a,u,4),A,4),4,s),r,s)}(e.state,i,t)),f=Object(S.p)(n,c);return Object(S.p)(f,[u,l])}function Tt(e){var t=e.state,n=t.width,r=t.height,i=t.transformOrigin;return[i[0]/(n/2)-1,i[1]/(r/2)-1]}function Nt(e,t,n){void 0===n&&(n=e.state.allMatrix);var r=e.state,i=r.width,o=r.height,a=r.is3d?4:3;return Qe(n,[i/2*(1+t[0]),o/2*(1+t[1])],a)}function _t(e,t,n,r,i,o){var a=e.props.groupable,A=e.state,s=A.transformOrigin,u=A.targetMatrix,l=A.offsetMatrix,c=A.is3d,f=A.width,d=A.height,p=A.left,h=A.top,v=c?4:3,B=a?p:0,m=a?h:0,b=function(e,t,n,r,i,o){var a=Ct(xe(t,n,r,i),o);return[e[0]-a[0],e[1]-a[1]]}(i,Qt(l,u,function(e,t,n,r,i,o){return void 0===r&&(r=t),void 0===i&&(i=n),void 0===o&&(o=[0,0]),e?e.map((function(e,a){var A=g(e),s=A.value,u=A.unit,l=a?i:r,c=a?n:t;return"%"===e||isNaN(s)?c*(l?o[a]/l:0):"%"!==u?s:c*s/100})):o}(o,t,n,f,d,s),v),t,n,v,r);return Object(S.p)(b,[B,m])}function Mt(e,t){if(!t[0]&&!t[1])return[0,0];var n=[-1,-1];return[t[0]?t[0]:-1*n[0],t[1]?t[1]:-1*n[1]]}function Dt(e,t){return Ct(ke(e.state),t)}function Rt(e,t,n,r,i,o){var a=i[0],A=i[1],s=o[0],u=o[1],l=[],c=r?0:1,f="vertical"===t?"horizontal":"vertical",d=qe(e.filter((function(e){return e.type===t})),(function(e){return e.element})).map((function(e){return e[0]})).filter((function(e){var t=e.pos,n=e.sizes;return t[c]<=u&&s<=t[c]+n[c]}));return d.forEach((function(e){var t=e.pos[r],i=t+e.sizes[r];d.forEach((function(e){var o=e.pos,s=e.sizes,u=e.element,c=o[r],p=c+s[r],h=0,g=0,v=!0;if(i<=c)a<(h=p-(g=i-c))-n&&(v=!1);else{if(!(p<=t))return;A>(h=c-(g=t-p))+n&&(v=!1)}if(v&&l.push({pos:"vertical"===f?[h,o[1]]:[o[0],h],element:u,sizes:s,size:0,type:f,gap:g,gapGuidelines:d}),i<=a&&A<=c){var B=(c+i-(A-a))/2;Ie(a-(B-n),.1)>=0&&l.push({pos:"vertical"===f?[B,o[1]]:[o[0],B],element:u,sizes:s,size:0,type:f,gap:i-a,gapGuidelines:d})}}))})),l}function Pt(e,t,n,r,i){return r&&r.forEach((function(n){e.push({type:"horizontal",pos:[0,Ie(n,.1)],size:t})})),i&&i.forEach((function(t){e.push({type:"vertical",pos:[Ie(t,.1),0],size:n})})),e}function kt(e,t,n,r,i){var o=function(e){var t=e.state,n=t.guidelines,r=t.containerClientRect,i=r.scrollHeight,o=r.scrollWidth,a=e.props,A=a.snapHorizontal,s=void 0===A||A,u=a.snapVertical,l=void 0===u||u,c=a.snapGap,f=void 0===c||c,d=a.verticalGuidelines,p=a.horizontalGuidelines,h=a.snapThreshold,g=void 0===h?5:h,v=Z(n);if(f){var B=Fe(ke(e.state)),m=B.top,b=B.left,w=B.bottom,E=B.right,y=n.filter((function(e){return e.element}));v.push.apply(v,Z(Rt(y,"horizontal",g,0,[b,E],[m,w]),Rt(y,"vertical",g,1,[m,w],[b,E])))}return Pt(v,o,i,s&&p,l&&d),v}(e),a=e.props,s=a.snapElement,u=void 0===s||s;return It(o,t,n,{snapThreshold:function(){for(var e=[],t=0;ta)})).sort((function(e,t){return e.dist-t.dist}));return{pos:n,index:r,guidelineInfos:i}})).filter((function(e){return e.guidelineInfos.length>0})).sort((function(e,t){return e.guidelineInfos[0].dist-t.guidelineInfos[0].dist})),c=l.length>0;return{isSnap:c,index:c?l[0].index:-1,posInfos:l}}function jt(e,t){var n=Math.abs(e.offset),r=Math.abs(t.offset);return e.isBound&&t.isBound?r-n:e.isBound?-1:t.isBound?1:e.isSnap&&t.isSnap?r-n:e.isSnap?-1:t.isSnap||n<1e-7?1:r<1e-7?-1:n-r}function Xt(e,t){return e.slice().sort((function(e,n){var r=e.sign[t],i=n.sign[t],o=e.offset[t],a=n.offset[t];return r?i?jt({isBound:e.isBound,isSnap:e.isSnap,offset:o},{isBound:n.isBound,isSnap:n.isSnap,offset:a}):-1:1}))[0]}function Gt(e,t){var n=y([t[0][0],t[1][0]]),r=y([t[0][1],t[1][1]]);return{vertical:n<=e[0],horizontal:r<=e[1]}}function Vt(e,t){var n,r,i=t[0],o=t[1],a=o[0]-i[0],A=o[1]-i[1];if(Math.abs(a)<1e-7&&(a=0),Math.abs(A)<1e-7&&(A=0),a)if(A){n=A/a*(e[0]-i[0])+i[1],r=e[1]}else n=i[1],r=e[1];else n=i[0],r=e[0];return n-r}function Yt(e,t,n){void 0===n&&(n=1e-7);var r=Vt(e[0],t)<=0;return e.slice(1).every((function(e){var i=Vt(e,t);return i<=0===r||Math.abs(i)<=n}))}function Wt(e,t,n,r,i){return void 0===i&&(i=0),r&&t-i<=e||!r&&e<=n+i?{isBound:!0,offset:r?t-e:n-e}:{isBound:!1,offset:0}}function Jt(e,t,n,r,i){var o=e[0],a=e[1],A=t[0],s=t[1],u=it(a[1]-o[1]),l=it(a[0]-o[0]),c=it(s[1]-A[1]);if(!it(s[0]-A[0])){if(i&&!u)return{isBound:!1,offset:0};if(l)return Wt(u/l*(A[0]-o[0])+o[1],A[1],s[1],n,r);var f=A[0]-o[0];return{isBound:d=Math.abs(f)<=(r||0),offset:d?f:0}}if(!c){if(i&&!l)return{isBound:!1,offset:0};if(u)return Wt((A[1]-o[1])/(u/l)+o[0],A[0],s[0],n,r);var d;f=A[1]-o[1];return{isBound:d=Math.abs(f)<=(r||0),offset:d?f:0}}return{isBound:!1,offset:0}}function qt(e,t,n,r){return t.map((function(t){var i=t[0],o=t[1],a=t[2],A=function(e,t,n){var r=e.props.innerBounds;if(!r)return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var i=r.left,o=r.top,a=r.width,A=r.height,s=[[i,o],[i,o+A]],u=[[i,o],[i+a,o]],l=[[i+a,o],[i+a,o+A]],c=[[i,o+A],[i+a,o+A]],f=Gt(n,t),d=f.horizontal,p=f.vertical;if(Yt([n,[i,o],[i+a,o],[i,o+A],[i+a,o+A]],t))return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var h=Jt(t,u,p),g=Jt(t,c,p),v=Jt(t,s,d),B=Jt(t,l,d),m=h.isBound&&g.isBound,b=h.isBound||g.isBound,w=v.isBound&&B.isBound,E=v.isBound||B.isBound,y=Ze(h.offset,g.offset),C=Ze(v.offset,B.offset),Q=[0,0],x=!1,F=!1;return Math.abs(C)o&&A.push({isBound:!0,offset:o-r,pos:r}),i-1.1||e[0]>t.right&&Math.abs(e[0]-t.right)>.1||e[1].1||e[1]>t.bottom&&Math.abs(e[1]-t.bottom)>.1}))}function an(e,t,n,r,i){var o=e.props.bounds,a=i*Math.PI/180;if(!o)return[];var A=o.left,s=void 0===A?-1/0:A,u=o.top,l=void 0===u?-1/0:u,c=o.right,f=void 0===c?1/0:c,d=o.bottom,p=void 0===d?1/0:d,h=s-r[0],g=f-r[0],v=l-r[1],B=p-r[1],m={left:h,top:v,right:g,bottom:B};if(!on(n,m,0))return[];var b=[];return[[h,0],[g,0],[v,1],[B,1]].forEach((function(e,r){var i=e[0],o=e[1];n.forEach((function(e){var n=C([0,0],e);b.push.apply(b,function(e,t,n){var r=Oe(e),i=Math.sqrt(r*r-t*t)||0;return[i,-i].sort((function(t,r){return Math.abs(t-e[n?0:1])-Math.abs(r-e[n?0:1])})).map((function(e){return C([0,0],n?[e,t]:[t,e])}))}(e,i,o).map((function(e){return a+e-n})).filter((function(e){return!on(t,m,e)})).map((function(e){return Ie(180*e/Math.PI,1e-7)})))}))})),b}function An(e,t,n){var r=Qe(e,[t.clientLeft,t.clientTop],n);return[t.left+r[0],t.top+r[1]]}function sn(e){var t=e.state;if(!t.guidelines||!t.guidelines.length){var n=e.props,r=n.horizontalGuidelines,i=void 0===r?[]:r,o=n.verticalGuidelines,a=void 0===o?[]:o,A=n.elementGuidelines,s=void 0===A?[]:A,u=n.bounds,l=n.innerBounds,c=n.snapCenter;if(l||u||i.length||a.length||s.length){var f=t.containerClientRect,d=t.targetClientRect,p=d.top,h=d.left,g=t.rootMatrix,v=t.is3d?4:3,B=An(g,f,v),m=B[0],b=B[1],w=ke(t),E=Object(N.c)(w),y=E.minX,C=E.minY,Q=Object(S.p)([y,C],et(g,[h-m,p-b],v)).map((function(e){return t=e,Math.round(t%1===-.5?t-1:t);var t})),x=Q[0],F=Q[1],U=[];s.forEach((function(e){var t=e.getBoundingClientRect(),n=t.left-m,r=t.top-b,i=r+t.height,o=n+t.width,a=et(g,[n,r],v),A=a[0],s=a[1],u=et(g,[o,i],v),l=u[0],f=u[1],d=l-A,p=f-s,h=[d,p];U.push({type:"vertical",element:e,pos:[Ie(A+x,.1),s],size:p,sizes:h}),U.push({type:"vertical",element:e,pos:[Ie(l+x,.1),s],size:p,sizes:h}),U.push({type:"horizontal",element:e,pos:[A,Ie(s+F,.1)],size:d,sizes:h}),U.push({type:"horizontal",element:e,pos:[A,Ie(f+F,.1)],size:d,sizes:h}),c&&(U.push({type:"vertical",element:e,pos:[Ie((A+l)/2+x,.1),s],size:p,sizes:h,center:!0}),U.push({type:"horizontal",element:e,pos:[A,Ie((s+f)/2+F,.1)],size:d,sizes:h,center:!0}))})),t.guidelines=U,t.enableSnap=!0}}}function un(e,t){var n=e.props,r=n.snappable,i=n.bounds,o=n.innerBounds,a=n.verticalGuidelines,A=n.horizontalGuidelines,s=e.state,u=s.guidelines,l=s.enableSnap;return!(!r||!l||t&&!0!==r&&r.indexOf(t)<0)&&!!(i||o||u&&u.length||a&&a.length||A&&A.length)}function ln(e,t,n,r,i){var o=function(e,t,n,r){var i=t[0]-e[0],o=t[1]-e[1];Math.abs(i)<1e-7&&(i=0);Math.abs(o)<1e-7&&(o=0);if(!i)return r?[0,0]:[0,n];if(!o)return r?[n,0]:[0,0];var a=o/i,A=e[1]-a*e[0];if(r){var s=a*(t[0]+n)+A;return[n,s-t[1]]}return[(t[1]+n-A)/a-t[0],n]}(e,t,n,r);if(!o)return[0,0];var a=bt({datas:i,distX:o[0],distY:o[1]});return[a[0],a[1]]}function cn(e,t,n,r,i,o){var a=xe(e,t,n,o?4:3),A=Ct(a,i);return Pe(a,Object(S.p)(r,A))}function fn(e,t){return e.isBound?e.offset:t.isSnap?t.offset:0}function dn(e,t){return e.isBound?e.offset:t.isSnap?Lt(t).offset:0}function pn(e,t,n,r){var i=function(e,t,n){var r=e.props.bounds||{},i=r.left,o=void 0===i?-1/0:i,a=r.top,A=void 0===a?-1/0:a,s=r.right,u=void 0===s?1/0:s,l=r.bottom,c=void 0===l?1/0:l,f=n[0],d=n[1],p=Object(S.p)(n,t),h=p[0],g=p[1];Math.abs(h)<1e-7&&(h=0),Math.abs(g)<1e-7&&(g=0);var v=g>0,B=h>0,m={isBound:!1,offset:0,pos:0},b={isBound:!1,offset:0,pos:0};if(0===h&&0===g)return{vertical:m,horizontal:b};if(0===h)v?cd&&(b.pos=A,b.offset=d-A);else if(0===g)B?uf&&(m.pos=o,m.offset=f-o);else{var w=g/h,E=n[1]-w*f,y=0,C=0,Q=!1;B&&u<=f?(y=w*u+E,C=u,Q=!0):!B&&f<=o&&(y=w*o+E,C=o,Q=!0),Q&&(yc)&&(Q=!1),Q||(v&&c<=d?(C=((y=c)-E)/w,Q=!0):!v&&d<=A&&(C=((y=A)-E)/w,Q=!0)),Q&&(m.isBound=!0,m.pos=C,m.offset=f-C,b.isBound=!0,b.pos=y,b.offset=d-y)}return{vertical:m,horizontal:b}}(e,t,n),o=i.horizontal,a=i.vertical,A=r?{horizontal:{isSnap:!1},vertical:{isSnap:!1}}:function(e,t,n){var r=n[0],i=n[1],o=t[0],a=t[1],A=Object(S.p)(n,t),s=A[0],u=A[1],l=u>0,c=s>0;s=it(s),u=it(u);var f={isSnap:!1,offset:0,pos:0},d={isSnap:!1,offset:0,pos:0};if(0===s&&0===u)return{vertical:f,horizontal:d};var p=kt(e,s?[r]:[],u?[i]:[]),h=p.vertical,g=p.horizontal;h.posInfos.filter((function(e){var t=e.pos;return c?t>=o:t<=o})),g.posInfos.filter((function(e){var t=e.pos;return l?t>=a:t<=a})),h.isSnap=h.posInfos.length>0,g.isSnap=g.posInfos.length>0;var v=Lt(h),B=v.isSnap,m=v.guideline,b=Lt(g),w=b.isSnap,E=b.guideline,y=w?E.pos[1]:0,C=B?m.pos[0]:0;if(0===s)w&&(d.isSnap=!0,d.pos=E.pos[1],d.offset=i-d.pos);else if(0===u)B&&(f.isSnap=!0,f.pos=C,f.offset=r-C);else{var Q=u/s,x=n[1]-Q*r,F=0,U=0,O=!1;B?(F=Q*(U=C)+x,O=!0):w&&(U=((F=y)-x)/Q,O=!0),O&&(f.isSnap=!0,f.pos=U,f.offset=r-U,d.isSnap=!0,d.pos=F,d.offset=i-F)}return{vertical:f,horizontal:d}}(e,t,n),s=A.horizontal,u=A.vertical,l=fn(o,s),c=fn(a,u),f=Math.abs(l),d=Math.abs(c);return{horizontal:{isBound:o.isBound,isSnap:s.isSnap,offset:l,dist:f},vertical:{isBound:a.isBound,isSnap:u.isSnap,offset:c,dist:d}}}function hn(e,t,n,r){void 0===r&&(r=n);var i=nn(e.props.bounds,r.map((function(e){return e[0]})),r.map((function(e){return e[1]}))),o=i.horizontal,a=i.vertical,A=t?{horizontal:{isSnap:!1,index:-1},vertical:{isSnap:!1,index:-1}}:kt(e,n.map((function(e){return e[0]})),n.map((function(e){return e[1]}))),s=A.horizontal,u=A.vertical,l=dn(o[0],s),c=dn(a[0],u),f=Math.abs(l),d=Math.abs(c);return{horizontal:{isBound:o[0].isBound,isSnap:s.isSnap,snapIndex:s.index,offset:l,dist:f,bounds:o,snap:s},vertical:{isBound:a[0].isBound,isSnap:u.isSnap,snapIndex:u.index,offset:c,dist:d,bounds:a,snap:u}}}function gn(e,t,n,r,i){void 0===i&&(i={});var o=nn(t,n,r),a=o.horizontal,A=o.vertical,s=i.isRequest?{horizontal:{isSnap:!1,index:-1},vertical:{isSnap:!1,index:-1}}:It(e,n,r,i),u=s.horizontal,l=s.vertical,c=dn(a[0],u),f=dn(A[0],l),d=Math.abs(c),p=Math.abs(f);return{horizontal:{isBound:a[0].isBound,isSnap:u.isSnap,snapIndex:u.index,offset:c,dist:d,bounds:a,snap:u},vertical:{isBound:A[0].isBound,isSnap:l.isSnap,snapIndex:l.index,offset:f,dist:p,bounds:A,snap:l}}}function vn(e){return e?e/Math.abs(e):0}function Bn(e,t,n,r,i,o){return n.map((function(n){var a=n[0],A=n[1],s=yt(t,a),u=yt(t,A),l=r?pn(e,s,u,i):hn(e,i,[u]),c=l.horizontal,f=c.offset,d=c.isBound,p=c.isSnap,h=l.vertical,g=h.offset,v=h.isBound,B=h.isSnap,m=Object(S.p)(A,a);if(!g&&!f)return{isBound:v||d,isSnap:B||p,sign:m,offset:[0,0]};var b=function(e,t,n,r){var i=C(e,t)/Math.PI*180,o=n.vertical,a=o.isBound,A=o.isSnap,s=o.dist,u=n.horizontal,l=u.isBound,c=u.isSnap,f=i%180,d=f<3||f>177,p=f>87&&f<93;return u.dist1e-7)d=-g[0],p=a*Math.abs(o+d)/Math.abs(o)-a;else if(g[1]&&Math.abs(a)>1e-7){var v=a;p=-g[1],d=o*Math.abs(a+p)/Math.abs(v)-o}if(e&&s&&A)if(Math.abs(d)>1e-7&&Math.abs(d)1e-7&&Math.abs(p)-1||t.push(n)}))})),t}function Qn(e,t,n,r){var i=e-n,o=i<0?i+t:r;return{size:(i<0?0:i)-o,pos:o}}function xn(e,t,n,r){var i=[],o=qe(e.filter((function(e){var t=e.element,n=e.gap;return t&&!n})),(function(e){var n=e.element,o=e.pos,a=o[r],A=(Math.min(0,a-t)<0?-1:1)+"_"+o[r?0:1],s=function(e,t,n){var r=B(e,t);return r>-1?e[r]:n}(i,(function(e){var t=e[0],r=e[1];return n===t&&a===r}));return s?s[2]:(i.push([n,a,A]),A)}));return o.forEach((function(e){e.sort((function(e,i){return Qn(e.pos[r],e.size,t,n).size-Qn(i.pos[r],e.size,t,n).size||e.pos[r?0:1]-i.pos[r?0:1]}))})),o}function Fn(e,t,n,r,i,o,a,A,s,u,l,c){var f=t[0],d=t[1],p=t[2],h=t[3];return $e(e.map((function(e,t){var g=!0;return e.map((function(e,v){var B,m=e.pos,b=e.size,w=Qn(m[u],b,r,i),E=w.pos,y=w.size;if(y0?l(Q):"",key:f+"LinkGuideline"+t+"-"+v,style:(B={},B[d]=n+E+"px",B[p]=-o+m[u?0:1]+"px",B[h]=y+"px",B)})}))})))}function Un(e,t,n,r,i,o){var a=t[0],A=t[1],s=t[2],u=t[3];return e.map((function(e,t){var l,c=e.type,f=e.pos;return o.createElement("div",{className:fe("line",a,"guideline","target","bold",c),key:a+"TargetGuideline"+t,style:(l={},l[A]=n+"px",l[s]=-r+f+"px",l[u]=i+"px",l)})}))}function Sn(e,t,n,r,i,o){var a=t[0],A=t[1],s=t[2],u=t[3];return e.map((function(e,t){var l,c=e.pos,f=e.size,d=e.element;return o.createElement("div",{className:fe("line",a,"guideline",d?"bold":""),key:a+"Guideline"+t,style:(l={},l[A]=-n+c[i]+"px",l[s]=-r+c[i?0:1]+"px",l[u]=f+"px",l)})}))}function On(e,t,n,r){var i=e.filter((function(e){var n=e.element,r=e.gap,i=e.type;return n&&r&&i===t})),o="vertical"===t?[0,1]:[1,0],a=o[0],A=o[1];return $e(i.map((function(e,t){var i=e.pos,o=e.gap,s=e.gapGuidelines,u=e.sizes,l=function(){for(var e=[],t=0;t0&&l>c?l=2*(l-c/2):l<0&&l<-c&&(l=2*(l+c/2));var f=(l>0?0:r[A])+l/2;return Z(function(e,t,n,r,i,o,a){var A=Math.abs(o),s=i[t]+(o>0?r[0]:0);return e.filter((function(e){return e.pos[t]<=n[t]})).sort((function(e,n){var r=e.pos;return n.pos[t]-r[t]})).filter((function(e){var n=e.pos,r=e.sizes,i=n[t];return Ie(i+r[t],1e-4)===Ie(s-A,1e-4)&&(s=i,!0)})).map((function(e){var r=-n[t]+e.pos[t]+e.sizes[t];return $($({},e),{gap:o,renderPos:t?[a,r]:[r,a]})}))}(s,a,n,r,i,o,f),function(e,t,n,r,i,o,a){var A=Math.abs(o),s=i[t]+(o<0?r[t]:0);return e.filter((function(e){return e.pos[t]>n[t]})).sort((function(e,n){var r=e.pos,i=n.pos;return r[t]-i[t]})).filter((function(e){var n=e.pos,r=e.sizes,i=n[t];return Ie(i,1e-4)===Ie(s+A,1e-4)&&(s=i+r[t],!0)})).map((function(e){var r=-n[t]+e.pos[t]-A;return $($({},e),{gap:o,renderPos:t?[a,r]:[r,a]})}))}(s,a,n,r,i,o,f))})))}function Hn(e,t,n,r,i,o){var a=r[0],A=r[1],s=r[2],u=r[3],l=e.props,c=l.snapDigit,f=void 0===c?0:c,d=l.isDisplaySnapDigit,p=void 0===d||d,h="vertical"===n?"horizontal":"vertical",g="vertical"===n?[0,1]:[1,0],v=g[0],B=g[1];return t.map((function(e,t){var n,r=e.renderPos,l=e.gap,c=Math.abs(l),d=p?parseFloat(c.toFixed(f)):0;return o.createElement("div",{className:fe("line",a,"guideline","gap"),"data-size":d>0?i(d):"",key:h+"GapGuideline"+t,style:(n={},n[A]=r[v]+"px",n[s]=r[B]+"px",n[u]=c+"px",n)})}))}function Tn(e,t,n,r,i,o){var a=nn(o||e.props.bounds,t,n),A=a.vertical,s=a.horizontal;A.forEach((function(e){e.isBound&&r.push({type:"bounds",pos:e.pos})})),s.forEach((function(e){e.isBound&&i.push({type:"bounds",pos:e.pos})}));var u=function(e){var t=e.props.innerBounds;if(!t)return{vertical:[],horizontal:[]};var n=e.getRect(),r=n.pos1,i=n.pos2,o=n.pos3,a=n.pos4,A=yt([r,i,o,a],[0,0]),s=t.left,u=t.top,l=t.width,c=t.height,f=[[s,u],[s,u+c]],d=[[s,u],[s+l,u]],p=[[s+l,u],[s+l,u+c]],h=[[s,u+c],[s+l,u+c]],g=[],v=[],B={top:!1,bottom:!1,left:!1,right:!1};return[[r,i],[i,a],[a,o],[o,r]].forEach((function(e){var t=Gt(A,e),n=t.horizontal,r=t.vertical,i=Jt(e,d,r,1,!0),o=Jt(e,h,r,1,!0),a=Jt(e,f,n,1,!0),m=Jt(e,p,n,1,!0);i.isBound&&!B.top&&(g.push(u),B.top=!0),o.isBound&&!B.bottom&&(g.push(u+c),B.bottom=!0),a.isBound&&!B.left&&(v.push(s),B.left=!0),m.isBound&&!B.right&&(v.push(s+l),B.right=!0)})),{horizontal:g,vertical:v}}(e),l=u.vertical,c=u.horizontal;l.forEach((function(e){B(r,(function(t){var n=t.type,r=t.pos;return"bounds"===n&&r===e}))>=0||r.push({type:"bounds",pos:e})})),c.forEach((function(e){B(i,(function(t){var n=t.type,r=t.pos;return"bounds"===n&&r===e}))>=0||i.push({type:"bounds",pos:e})}))}var Nn={name:"snappable",props:{snappable:[Boolean,Array],snapCenter:Boolean,snapHorizontal:Boolean,snapVertical:Boolean,snapElement:Boolean,snapGap:Boolean,isDisplaySnapDigit:Boolean,snapDigit:Number,snapThreshold:Number,horizontalGuidelines:Array,verticalGuidelines:Array,elementGuidelines:Array,bounds:Object,innerBounds:Object,snapDistFormat:Function},events:{onSnap:"snap"},css:[":host {\n --bounds-color: #d66;\n}",".guideline {\npointer-events: none;\nz-index: 2;\n}",".line.guideline.bounds {\n background: #d66;\n background: var(--bounds-color);\n}"],render:function(e,t){var n=e.state,r=n.top,i=n.left,o=n.pos1,a=n.pos2,A=n.pos3,s=n.pos4,u=n.snapRenderInfo,l=n.targetClientRect,c=n.containerClientRect,f=n.is3d,d=n.rootMatrix;if(!u||!un(e,""))return[];var p=f?4:3,h=Math.min(o[0],a[0],A[0],s[0]),g=Math.min(o[1],a[1],A[1],s[1]),v=An(d,c,p),B=et(d,[l.left-v[0],l.top-v[1]],p),m=B[0],b=B[1],w=e.props,E=w.snapThreshold,y=void 0===E?5:E,C=w.snapDigit,Q=void 0===C?0:C,x=w.isDisplaySnapDigit,F=void 0===x||x,U=w.snapDistFormat,S=void 0===U?function(e){return e}:U,O=u.externalPoses||[],H=ke(e.state),T=[],N=[],_=[],M=[],D=[],R=Fe(H),P=R.width,k=R.height,I=R.top,K=R.left,L=R.bottom,z=R.right,j=O.length>0,X=j?Fe(O):{};if(!u.request){if(u.direction&&D.push(function(e,t,n){var r=[];if(n[0]&&n[1])r=[n,[-n[0],n[1]],[n[0],-n[1]]].map((function(e){return yt(t,e)}));else if(n[0]||n[1])e.props.keepRatio?r=[[-1,-1],[-1,1],[1,-1],[1,1],n].map((function(e){return yt(t,e)})):(r=Et(t,n)).length>1&&r.push([(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2]);else for(var i=[t[0],t[1],t[3],t[2],t[0]],o=0;o<4;++o)r.push(i[o]),r.push([(i[o][0]+i[o+1][0])/2,(i[o][1]+i[o+1][1])/2]);return kt(e,r.map((function(e){return e[0]})),r.map((function(e){return e[1]})),!0,1)}(e,H,u.direction)),u.snap){var G=Fe(H);u.center&&(G.middle=(G.top+G.bottom)/2,G.center=(G.left+G.right)/2),D.push(Kt(e,G,!0,1))}j&&(u.center&&(X.middle=(X.top+X.bottom)/2,X.center=(X.left+X.right)/2),D.push(Kt(e,X,!0,1))),D.forEach((function(e){var t=e.vertical.posInfos,n=e.horizontal.posInfos;T.push.apply(T,t.map((function(e){return{type:"snap",pos:e.pos}}))),N.push.apply(N,n.map((function(e){return{type:"snap",pos:e.pos}}))),_.push.apply(_,Cn(t)),M.push.apply(M,Cn(n))}))}Tn(e,[K,z],[I,L],T,N),j&&Tn(e,[X.left,X.right],[X.top,X.bottom],T,N,u.externalBounds);var V=xn(M,m,P,0),Y=xn(_,b,k,1),W=["horizontal","left","top","width"],J=["vertical","top","left","height"],q=On(_,"vertical",[i,r],[P,k]),$=On(M,"horizontal",[i,r],[P,k]),ee=Z(_,M);return Xe(e,"onSnap",{guidelines:ee.filter((function(e){return!e.element})),elements:qe(ee.filter((function(e){return e.element})),(function(e){return e.element})),gaps:Z(q,$)},!0),Z(Hn(e,q,"vertical",W,S,t),Hn(e,$,"horizontal",J,S,t),Fn(V,W,h,m,P,r,y,F,Q,0,S,t),Fn(Y,J,g,b,k,i,y,F,Q,1,S,t),Un(N,W,h,r,P,t),Un(T,J,g,i,k,t),Sn(M,W,i,r,0,t),Sn(_,J,r,i,1,t))},dragStart:function(e,t){e.state.snapRenderInfo={request:t.isRequest,snap:!0,center:!0},sn(e)},pinchStart:function(e){this.unset(e)},dragEnd:function(e){this.unset(e)},dragControlCondition:function(e){return!(!ot(e)&&!kn(e))||(!e.isRequest&&e.inputEvent?x(e.inputEvent.target,fe("snap-control")):void 0)},dragControlStart:function(e,t){e.state.snapRenderInfo=null,sn(e)},dragControlEnd:function(e){this.unset(e)},dragGroupStart:function(e,t){this.dragStart(e,t)},dragGroupEnd:function(e){this.unset(e)},dragGroupControlStart:function(e,t){e.state.snapRenderInfo=null,sn(e)},dragGroupControlEnd:function(e){this.unset(e)},unset:function(e){var t=e.state;t.enableSnap=!1,t.guidelines=[],t.snapRenderInfo=null}},_n={name:"draggable",props:{draggable:Boolean,throttleDrag:Number,throttleDragRotate:Number,startDragRotate:Number,edgeDraggable:Boolean},events:{onDragStart:"dragStart",onDrag:"drag",onDragEnd:"dragEnd",onDragGroupStart:"dragGroupStart",onDragGroup:"dragGroup",onDragGroupEnd:"dragGroupEnd"},render:function(e,t){var n=e.props.throttleDragRotate,r=e.state,i=r.dragInfo,o=r.beforeOrigin;if(!n||!i)return[];var a=i.dist;if(!a[0]&&!a[1])return[];var A=Oe(a),s=C(a,[0,0]);return[t.createElement("div",{className:fe("line","horizontal","dragline","dashed"),key:"dragRotateGuideline",style:{width:A+"px",transform:"translate("+o[0]+"px, "+o[1]+"px) rotate("+s+"rad)"}})]},dragStart:function(e,t){var n=t.datas,r=t.parentEvent,i=t.parentGesto,o=e.state,a=o.target;if(o.gesto)return!1;o.gesto=i||e.targetGesto;var A=window.getComputedStyle(a);n.datas={},n.left=parseFloat(A.left||"")||0,n.top=parseFloat(A.top||"")||0,n.bottom=parseFloat(A.bottom||"")||0,n.right=parseFloat(A.right||"")||0,n.startValue=[0,0],ht(e,t),Ft(t),function(e,t){t.absolutePoses=ke(e.state)}(e,n),n.prevDist=[0,0],n.prevBeforeDist=[0,0],n.isDrag=!1;var s=ze(e,t,$({set:function(e){n.startValue=e}},xt(t)));return!1!==(r||Xe(e,"onDragStart",s))?(n.isDrag=!0,e.state.dragInfo={startRect:e.getRect(),dist:[0,0]}):(o.gesto=null,n.isPinch=!1),!!n.isDrag&&s},drag:function(e,t){gt(t,"translate");var n=t.datas,r=t.parentEvent,i=t.parentFlag,o=t.isPinch,a=t.isRequest,A=t.distX,s=t.distY,u=n.isDrag,l=n.prevDist,c=n.prevBeforeDist,f=n.startValue;if(u){var d=e.props,p=d.parentMoveable,h=r?0:d.throttleDrag||0,g=r?0:d.throttleDragRotate||0,v=!1,B=0;if(!r&&g>0&&(A||s)){var m=d.startDragRotate||0,b=Ie(m+180*C([0,0],[A,s])/Math.PI,g)-m,w=s*Math.abs(Math.cos((b-90)/180*Math.PI)),E=Oe([A*Math.abs(Math.cos(b/180*Math.PI)),w]);B=b*Math.PI/180,A=E*Math.cos(B),s=E*Math.sin(B)}if(!o&&!r&&!i&&(!g||A||s)){var y=yn(e,A,s,g,a,n),Q=y[0],x=y[1],F=Q.isSnap,U=Q.isBound,O=Q.offset,H=x.isSnap,T=x.isBound;v=F||H||U||T,A+=O,s+=x.offset}n.passDeltaX=A-(n.passDistX||0),n.passDeltaY=s-(n.passDistY||0),n.passDistX=A,n.passDistY=s;var N=Object(S.s)(mt({datas:n,distX:A,distY:s}),f),_=Object(S.s)(function(e){var t=e.datas,n=mt({datas:t,distX:e.distX,distY:e.distY}),r=n[0],i=n[1],o=Bt(t,Object(S.k)([r,i],4));return Object(S.a)(o,Object(S.e)([0,0,0],4),4)}({datas:n,distX:A,distY:s}),f);g||v||(Ke(_,h),Ke(N,h));var M=Object(S.p)(N,f),D=Object(S.p)(_,f),R=Object(S.p)(D,l),P=Object(S.p)(M,c);n.prevDist=D,n.prevBeforeDist=M;var k=n.left+M[0],I=n.top+M[1],K=n.right-M[0],L=n.bottom-M[1],z=vt(n,"translate("+_[0]+"px, "+_[1]+"px)","translate("+D[0]+"px, "+D[1]+"px)");if(e.state.dragInfo.dist=r?[0,0]:D,r||p||!R.every((function(e){return!e}))||!P.some((function(e){return!e}))){var j=e.state,X=ze(e,t,{transform:z,dist:D,delta:R,translate:_,beforeDist:M,beforeDelta:P,beforeTranslate:N,left:k,top:I,right:K,bottom:L,width:j.width,height:j.height,isPinch:o});return!r&&Xe(e,"onDrag",X),X}}},dragEnd:function(e,t){var n=t.parentEvent,r=t.datas,i=t.isDrag;if(e.state.gesto=null,e.state.dragInfo=null,r.isDrag)return r.isDrag=!1,!n&&Xe(e,"onDragEnd",je(e,t,{})),i},dragGroupStart:function(e,t){var n=t.datas,r=t.clientX,i=t.clientY,o=this.dragStart(e,t);if(!o)return!1;var a=ft(e,this,"dragStart",[r||0,i||0],t,!1),A=Xe(e,"onDragGroupStart",$($({},o),{targets:e.props.targets,events:a}));return n.isDrag=!1!==A,!!n.isDrag&&o},dragGroup:function(e,t){if(t.datas.isDrag){var n=this.drag(e,t),r=t.datas,i=ft(e,this,"drag",[r.passDeltaX,r.passDeltaY],t,!1);if(n){var o=$({targets:e.props.targets,events:i},n);return Xe(e,"onDragGroup",o),o}}},dragGroupEnd:function(e,t){var n=t.isDrag;if(t.datas.isDrag)return this.dragEnd(e,t),ft(e,this,"dragEnd",[0,0],t,!1),Xe(e,"onDragGroupEnd",je(e,t,{targets:e.props.targets})),n},request:function(e){var t={},n=e.getRect(),r=0,i=0;return{isControl:!1,requestStart:function(){return{datas:t}},request:function(e){return"x"in e?r=e.x-n.left:"deltaX"in e&&(r+=e.deltaX),"y"in e?i=e.y-n.top:"deltaY"in e&&(i+=e.deltaY),{datas:t,distX:r,distY:i}},requestEnd:function(){return{datas:t,isDrag:!0}}}},unset:function(e){e.state.dragInfo=null}};function Mn(e,t,n,r,i,o){var a=e.state.is3d?4:3,A=Qe(e.state.rootMatrix,i,a),s=Object(S.s)([o.left,o.top],A);t.startAbsoluteOrigin=s,t.prevDeg=C(s,[n,r])/Math.PI*180,t.prevSnapDeg=t.prevDeg,t.startDeg=t.prevDeg,t.loop=0}function Dn(e,t,n,r,i,o){var a=n.prevDeg,A=wn(e,t,n.origin,r);return n.prevDeg=A,[A-a,A,o+A]}function Rn(e,t,n,r,i,o,a,A){var s=n.prevDeg,u=n.prevSnapDeg,l=n.startDeg,c=n.loop;s>r&&s>270&&r<90?++n.loop:s270&&--n.loop;var f=n.loop,d=360*c+u-l+o,p=360*f+r-l+o;n.prevDeg=p-360*f+l-o;var h=i*((p=Ie(p,a))-o);return A&&(p=(h=wn(e,t,n.origin,h))/i+o),n.prevSnapDeg=p-360*f+l-o,[i*(p-d),h,o+h]}function Pn(e,t,n,r,i,o,a,A){return Rn(e,t,n,C(n.startAbsoluteOrigin,[i,o])/Math.PI*180,r,a,A,!0)}function kn(e){return e.isRequest?"rotatable"===e.requestAble:x(e.inputEvent.target,fe("rotation"))}var In={name:"rotatable",canPinch:!0,props:{rotatable:Boolean,rotationPosition:String,throttleRotate:Number},events:{onRotateStart:"rotateStart",onRotate:"rotate",onRotateEnd:"rotateEnd",onRotateGroupStart:"rotateGroupStart",onRotateGroup:"rotateGroup",onRotateGroupEnd:"rotateGroupEnd"},css:[".line.rotation-line {\n height: 40px;\n width: 1px;\n transform-origin: 50% calc(100% - 0.5px);\n top: -40px;\n width: var(--zoompx);\n height: calc(40 * var(--zoompx));\n top: calc(-40 * var(--zoompx));\n transform-origin: 50% calc(100% - 0.5 * var(--zoompx));\n }\n .line.rotation-line .control {\n border-color: #4af;\n background:#fff;\n cursor: alias;\n left: 50%;\n }"],render:function(e,t){var n=e.props,r=n.rotatable,i=n.rotationPosition,o=e.state,a=o.rotation,A=o.renderPoses;if(!r)return null;var s=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=(e||"top").split("-"),A=a[0],s=a[1],u=[n,r];"left"===A?u=[i,n]:"right"===A?u=[r,o]:"bottom"===A&&(u=[o,i]);var l=[(u[0][0]+u[1][0])/2,(u[0][1]+u[1][1])/2];if(s){var c="top"===s||"left"===s,f="bottom"===A||"left"===A;l=u[c&&!f||!c&&f?0:1]}return l}(i,A);return t.createElement("div",{key:"rotation",className:fe("line rotation-line"),style:{transform:"translate(-50%) translate("+s[0]+"px, "+s[1]+"px) rotate("+a+"rad)"}},t.createElement("div",{className:fe("control","rotation")}))},dragControlCondition:kn,dragControlStart:function(e,t){var n=t.datas,r=t.clientX,i=t.clientY,o=t.parentRotate,a=t.parentFlag,A=t.isPinch,s=t.isRequest,u=e.state,l=u.target,c=u.left,f=u.top,d=u.origin,p=u.beforeOrigin,h=u.direction,g=u.beforeDirection,v=u.targetTransform;if(!s&&!l)return!1;var B=e.getRect();if(n.rect=B,n.transform=v,n.left=c,n.top=f,n.fixedPosition=Nt(e,Tt(e)),s||A||a){var m=o||0;n.beforeInfo={origin:B.beforeOrigin,prevDeg:m,startDeg:m,prevSnapDeg:m,loop:0},n.afterInfo={origin:B.origin,prevDeg:m,startDeg:m,prevSnapDeg:m,loop:0}}else{n.beforeInfo={origin:B.beforeOrigin},n.afterInfo={origin:B.origin};var b=De(e.controlBox.getElement());Mn(e,n.beforeInfo,r,i,p,b),Mn(e,n.afterInfo,r,i,d,b)}n.direction=h,n.beforeDirection=g,n.startValue=0,n.datas={},Ft(t);var w=ze(e,t,$($({set:function(e){n.startValue=e*Math.PI/180}},xt(t)),{dragStart:_n.dragStart(e,(new lt).dragStart([0,0],t))})),E=Xe(e,"onRotateStart",w);return n.isRotate=!1!==E,e.state.snapRenderInfo={request:t.isRequest},!!n.isRotate&&w},dragControl:function(e,t){var n,r,i,o,a,A,s=t.datas,u=t.clientX,l=t.clientY,c=t.parentRotate,f=t.parentFlag,d=t.isPinch,p=t.groupDelta,h=s.beforeDirection,g=s.beforeInfo,v=s.afterInfo,B=s.isRotate,m=s.startValue,b=s.rect;if(B){gt(t,"rotate");var w,E,y,C,Q,x,F=h*function(e){return Se(e.datas.beforeTransform,[50,50],100,100).direction}(t),U=e.props,O=U.throttleRotate,H=void 0===O?0:O,T=U.parentMoveable,N=180/Math.PI*m;if(!f&&"parentDist"in t){var _=t.parentDist;w=(n=Dn(e,b,v,_,0,N))[0],E=n[1],y=n[2],C=(r=Dn(e,b,g,_,0,N))[0],Q=r[1],x=r[2]}else d||f?(w=(i=Rn(e,b,v,c,F,N,H))[0],E=i[1],y=i[2],C=(o=Rn(e,b,g,c,h,N,H))[0],Q=o[1],x=o[2]):(w=(a=Pn(e,b,v,F,u,l,N,H))[0],E=a[1],y=a[2],C=(A=Pn(e,b,g,h,u,l,N,H))[0],Q=A[1],x=A[2]);if(w||C||T){var M=vt(s,"rotate("+y+"deg)","rotate("+E+"deg)"),D=function(e,t,n,r){return Ht(e,"rotate("+t+"deg)",n,Tt(e),r)}(e,E,s.fixedPosition,s),R=Object(S.p)(Object(S.s)(p||[0,0],D),s.prevInverseDist||[0,0]);s.prevInverseDist=D;var P=ze(e,t,$({delta:w,dist:E,rotate:y,beforeDist:Q,beforeDelta:C,beforeRotate:x,isPinch:!!d},Ot(e,M,R,d,t)));return Xe(e,"onRotate",P),P}}},dragControlEnd:function(e,t){var n=t.datas,r=t.isDrag;return!!n.isRotate&&(n.isRotate=!1,Xe(e,"onRotateEnd",je(e,t,{})),r)},dragGroupControlCondition:kn,dragGroupControlStart:function(e,t){var n=t.datas,r=e.state,i=r.left,o=r.top,a=r.beforeOrigin,A=this.dragControlStart(e,t);if(!A)return!1;A.set(n.beforeDirection*e.rotation);var s=dt(e,this,"dragControlStart",t,(function(e,t){var n=e.state,r=n.left,A=n.top,s=n.beforeOrigin,u=Object(S.s)(Object(S.p)([r,A],[i,o]),Object(S.p)(s,a));return t.datas.groupClient=u,$($({},t),{parentRotate:0})})),u=Xe(e,"onRotateGroupStart",$($({},A),{targets:e.props.targets,events:s}));return n.isRotate=!1!==u,!!n.isRotate&&A},dragGroupControl:function(e,t){var n=t.datas;if(n.isRotate){var r=this.dragControl(e,t);if(r){var i=n.beforeDirection,o=r.beforeDist,a=r.beforeDelta/180*Math.PI,A=dt(e,this,"dragControl",t,(function(e,t){var n=t.datas.groupClient,r=n[0],A=n[1],s=Object(S.t)([r,A],a*i),u=s[0],l=s[1],c=[u-r,l-A];return t.datas.groupClient=[u,l],$($({},t),{parentRotate:o,groupDelta:c})}));e.rotation=i*r.beforeRotate;var s=$({targets:e.props.targets,events:A,set:function(t){e.rotation=t}},r);return Xe(e,"onRotateGroup",s),s}}},dragGroupControlEnd:function(e,t){var n=t.isDrag;if(t.datas.isRotate)return this.dragControlEnd(e,t),dt(e,this,"dragControlEnd",t),Xe(e,"onRotateGroupEnd",je(e,t,{targets:e.props.targets})),n},request:function(e){var t={},n=0,r=e.getRotation();return{isControl:!0,requestStart:function(e){return{datas:t}},request:function(e){return"deltaRotate"in e?n+=e.deltaRotate:"rotate"in e&&(n=e.rotate-r),{datas:t,parentDist:n}},requestEnd:function(){return{datas:t,isDrag:!0}}}}};function Kn(e,t,n){var r=e.state,i=r.renderPoses,o=r.rotation,a=e.props.renderDirections,A=void 0===a?t:a,s=e.state.direction,u={};return A.forEach((function(e){u[e]=!0})),A.map((function(e){var t=ue[e];if(!t||!u[e])return null;var r=Ie(o/Math.PI*180,15)+le[e];return s<1&&(r=360-r),r%=180,n.createElement("div",{className:fe("control","direction",e),"data-rotation":r,"data-direction":e,key:"direction-"+e,style:Ne.apply(void 0,Z([o],t.map((function(e){return i[e]}))))})}))}function Ln(e,t,n,r,i){for(var o=[],a=5;a0&&(V[0]=1)),m||(K[1]<0?V[1]=-1:K[1]>0&&(V[1]=1)),T=V,N=V,I=Mt(0,V),M=N[0]*K[0],D=N[1]*K[1]}}var Y=N[0]||R?Math.max(B+M,1e-7):B,W=N[1]||R?Math.max(m+D,1e-7):m;R&&B&&m&&(W=Y*m/B);var J=[0,0];if(A||(J=function(e,t,n,r,i,o,a){if(!un(e,"resizable"))return[0,0];var A=e.state,s=A.allMatrix,u=A.is3d;return bn(e,(function(e,o){return cn(s,t+e,n+o,i,r,u)}),t,n,r,i,o,a)}(e,Y,W,T,r.fixedOriginalPosition,d,r)),f&&(!f[0]&&(J[0]=0),!f[1]&&(J[1]=0)),R){N[0]&&N[1]&&J[0]&&J[1]&&(Math.abs(J[0])>Math.abs(J[1])?J[1]=0:J[0]=0);var q=!J[0]&&!J[1];q&&(P?Y=Ie(Y,U):W=Ie(W,U)),N[0]&&!N[1]||J[0]&&!J[1]||q&&P?W=Ye(Y+=J[0],P,k):(!N[0]&&N[1]||!J[0]&&J[1]||q&&!P)&&(Y=We(W+=J[1],P,k))}else B+M<-H&&(J[0]=0),B+D<-H&&(J[1]=0),Y+=J[0],W+=J[1],J[0]||(Y=Ie(Y,U)),J[1]||(W=Ie(W,U));Y=(n=E([Y,W],y,Q,R))[0],W=n[1];var $=[(M=(Y=Math.round(Y))-B)-b,(D=(W=Math.round(W))-m)-w];r.prevWidth=M,r.prevHeight=D;var ee=_t(e,Y,W,I,_,h);if(S||!$.every((function(e){return!e}))||!ee.every((function(e){return!e}))){var te=ze(e,t,{width:g+M,height:v+D,offsetWidth:Y,offsetHeight:W,direction:T,dist:[M,D],delta:$,isPinch:!!A,drag:_n.drag(e,ut(t,e.state,ee,!!A,!1))});return Xe(e,"onResize",te),te}}},dragControlAfter:function(e,t){var n=t.datas,r=n.isResize,i=n.startOffsetWidth,o=n.startOffsetHeight,a=n.prevWidth,A=n.prevHeight;if(r){var s=e.state,u=s.width-(i+a),l=s.height-(o+A),c=Math.abs(u)>3,f=Math.abs(l)>3;return c&&(n.startWidth+=u,n.startOffsetWidth+=u,n.prevWidth+=u),f&&(n.startHeight+=l,n.startOffsetHeight+=l,n.prevHeight+=l),c||f?(this.dragControl(e,t),!0):void 0}},dragControlEnd:function(e,t){var n=t.datas,r=t.isDrag;return!!n.isResize&&(n.isResize=!1,Xe(e,"onResizeEnd",je(e,t,{})),r)},dragGroupControlCondition:ot,dragGroupControlStart:function(e,t){var n=t.datas,r=this.dragControlStart(e,t);if(!r)return!1;var i=r.direction,o=n.fixedOriginalPosition,a=dt(e,this,"dragControlStart",t,(function(t,n){var r=Dt(t,i),a=Object(S.a)(Object(S.h)(-e.rotation/180*Math.PI,3),[r[0]-o[0],r[1]-o[1],1],3),A=a[0],s=a[1];return n.datas.originalX=A,n.datas.originalY=s,n})),A=$($({},r),{targets:e.props.targets,events:a}),s=Xe(e,"onResizeGroupStart",A);return n.isResize=!1!==s,!!n.isResize&&r},dragGroupControl:function(e,t){var n=t.datas;if(n.isResize){var r=this.dragControl(e,t);if(r){var i=r.offsetWidth,o=r.offsetHeight,a=r.dist,A=e.props.keepRatio,s=[i/(i-a[0]),o/(o-a[1])],u=n.fixedOriginalPosition,l=dt(e,this,"dragControl",t,(function(t,n){var r=Object(S.a)(Object(S.h)(e.rotation/180*Math.PI,3),[n.datas.originalX*s[0],n.datas.originalY*s[1],1],3),i=r[0],o=r[1];return $($({},n),{parentDist:null,parentScale:s,dragClient:Object(S.s)(u,[i,o]),parentKeepRatio:A})})),c=$({targets:e.props.targets,events:l},r);return Xe(e,"onResizeGroup",c),c}}},dragGroupControlEnd:function(e,t){var n=t.isDrag;if(t.datas.isResize)return this.dragControlEnd(e,t),dt(e,this,"dragControlEnd",t),Xe(e,"onResizeGroupEnd",je(e,t,{targets:e.props.targets})),n},request:function(e){var t={},n=0,r=0,i=e.getRect();return{isControl:!0,requestStart:function(e){return{datas:t,parentDirection:e.direction||[1,1]}},request:function(e){return"offsetWidth"in e?n=e.offsetWidth-i.offsetWidth:"deltaWidth"in e&&(n+=e.deltaWidth),"offsetHeight"in e?r=e.offsetHeight-i.offsetHeight:"deltaHeight"in e&&(r+=e.deltaHeight),{datas:t,parentDist:[n,r]}},requestEnd:function(){return{datas:t,isDrag:!0}}}}},Gn={name:"scalable",ableGroup:"size",canPinch:!0,props:{scalable:Boolean,throttleScale:Number,renderDirections:String,keepRatio:Boolean},events:{onScaleStart:"scaleStart",onScale:"scale",onScaleEnd:"scaleEnd",onScaleGroupStart:"scaleGroupStart",onScaleGroup:"scaleGroup",onScaleGroupEnd:"scaleGroupEnd"},render:function(e,t){var n=e.props,r=n.resizable,i=n.scalable,o=n.edge;if(!r&&i)return o?jn(e,t):zn(e,t)},dragControlCondition:ot,dragControlStart:function(e,t){var n=t.datas,r=t.isPinch,i=t.inputEvent,o=t.parentDirection||(r?[0,0]:Re(i.target)),a=e.state,A=a.width,s=a.height,u=a.targetTransform,l=a.target;if(!o||!l)return!1;r||ht(e,t),Ft(t),n.datas={},n.transform=u,n.prevDist=[1,1],n.direction=o,n.width=A,n.height=s,n.startValue=[1,1],n.fixedDirection=o.map((function(e){return-e})),n.fixedPosition=Dt(e,o);var c=ze(e,t,$($({direction:o,set:function(e){n.startValue=e}},xt(t)),{dragStart:_n.dragStart(e,(new lt).dragStart([0,0],t))}));return!1!==Xe(e,"onScaleStart",c)&&(n.isScale=!0,e.state.snapRenderInfo={request:t.isRequest,direction:o}),!!n.isScale&&c},dragControl:function(e,t){gt(t,"scale");var n=t.datas,r=t.distX,i=t.distY,o=t.parentScale,a=t.parentDistance,A=t.parentKeepRatio,s=t.parentFlag,l=t.isPinch,c=t.dragClient,f=t.parentDist,d=t.isRequest,p=n.prevDist,h=n.direction,g=n.width,v=n.height,B=n.isScale,m=n.startValue;if(!B)return!1;var b=e.props,w=b.throttleScale,E=b.parentMoveable,y=h;h[0]||h[1]||(y=[1,1]);var Q=e.props.keepRatio||A,x=e.state,F=y[0]||!y[1],U=g*m[0],O=v*m[1],H=F?O/U:U/O,T=1,N=1,_=c;if(c||(_=!s&&l?Dt(e,[0,0]):n.fixedPosition),f)T=(g+f[0])/g,N=(v+f[1])/v;else if(o)T=o[0],N=o[1];else if(l)a&&(T=(g+a)/g,N=(v+a*v/g)/v);else{var M=bt({datas:n,distX:r,distY:i}),D=y[0]*M[0],R=y[1]*M[1];if(Q&&g&&v){var P=C([0,0],M),k=C([0,0],y),I=C([0,0],[U,O]),K=Oe([D,R]),L=Math.cos(P-k)*K;y[0]?y[1]?(D=Math.cos(I)*L,R=Math.sin(I)*L):R=Ye(D=L,F,H):D=We(R=L,F,H)}T=(g+D)/g,N=(v+R)/v}T=y[0]||Q?T*m[0]:m[0],N=y[1]||Q?N*m[1]:m[1],0===T&&(T=1e-9*(p[0]>0?1:-1)),0===N&&(N=1e-9*(p[1]>0?1:-1));var z=[T/m[0],N/m[1]],j=[T,N];if(!l&&e.props.groupable){var X=(x.snapRenderInfo||{}).direction;u(X)&&(X[0]||X[1])&&(x.snapRenderInfo={direction:h,request:t.isRequest})}var G=[0,0];if(l||(G=En(e,z,h,n.fixedPosition,d,n)),Q){y[0]&&y[1]&&G[0]&&G[1]&&(Math.abs(G[0])>Math.abs(G[1])?G[1]=0:G[0]=0);var V=!G[0]&&!G[1];if(V&&(F?z[0]=Ie(z[0]*m[0],w)/m[0]:z[1]=Ie(z[1]*m[1],w)/m[1]),y[0]&&!y[1]||G[0]&&!G[1]||V&&F){z[0]+=G[0];var Y=Ye(g*z[0]*m[0],F,H);z[1]=Y/v/m[1]}else if(!y[0]&&y[1]||!G[0]&&G[1]||V&&!F){z[1]+=G[1];var W=We(v*z[1]*m[1],F,H);z[0]=W/g/m[0]}}else z[0]+=G[0],z[1]+=G[1],G[0]||(z[0]=Ie(z[0]*m[0],w)/m[0]),G[1]||(z[1]=Ie(z[1]*m[1],w)/m[1]);0===z[0]&&(z[0]=1e-9*(p[0]>0?1:-1)),0===z[1]&&(z[1]=1e-9*(p[1]>0?1:-1));var J,q,Z=[z[0]/p[0],z[1]/p[1]];q=m,j=[(J=z)[0]*q[0],J[1]*q[1]];var ee=function(e,t,n,r,i){return Ht(e,"scale("+t.join(", ")+")",r,n.map((function(e){return-e})),i)}(e,z,h,_,n),te=Object(S.p)(ee,n.prevInverseDist||[0,0]);if(n.prevDist=z,n.prevInverseDist=ee,T===p[0]&&N===p[1]&&te.every((function(e){return!e}))&&!E)return!1;var ne=vt(n,"scale("+j.join(", ")+")","scale("+z.join(", ")+")"),re=ze(e,t,$({offsetWidth:g,offsetHeight:v,direction:h,scale:j,dist:z,delta:Z,isPinch:!!l},Ot(e,ne,te,l,t)));return Xe(e,"onScale",re),re},dragControlEnd:function(e,t){var n=t.datas,r=t.isDrag;return!!n.isScale&&(n.isScale=!1,Xe(e,"onScaleEnd",je(e,t,{})),r)},dragGroupControlCondition:ot,dragGroupControlStart:function(e,t){var n=t.datas,r=this.dragControlStart(e,t);if(!r)return!1;var i=r.direction,o=n.fixedPosition;n.moveableScale=e.scale;var a=dt(e,this,"dragControlStart",t,(function(t,n){var r=Dt(t,i),a=Object(S.a)(Object(S.h)(-e.rotation/180*Math.PI,3),[r[0]-o[0],r[1]-o[1],1],3),A=a[0],s=a[1];return n.datas.originalX=A,n.datas.originalY=s,n})),A=$($({},r),{targets:e.props.targets,events:a}),s=Xe(e,"onScaleGroupStart",A);return n.isScale=!1!==s,!!n.isScale&&A},dragGroupControl:function(e,t){var n=t.datas;if(n.isScale){var r=this.dragControl(e,t);if(r){var i=n.moveableScale;e.scale=[r.scale[0]*i[0],r.scale[1]*i[1]];var o=e.props.keepRatio,a=r.dist,A=r.scale,s=n.fixedPosition,u=dt(e,this,"dragControl",t,(function(t,n){var r=Object(S.a)(Object(S.h)(e.rotation/180*Math.PI,3),[n.datas.originalX*a[0],n.datas.originalY*a[1],1],3),i=r[0],u=r[1];return $($({},n),{parentDist:null,parentScale:A,parentKeepRatio:o,dragClient:Object(S.s)(s,[i,u])})})),l=$({targets:e.props.targets,events:u},r);return Xe(e,"onScaleGroup",l),l}}},dragGroupControlEnd:function(e,t){var n=t.isDrag;if(t.datas.isScale)return this.dragControlEnd(e,t),dt(e,this,"dragControlEnd",t),Xe(e,"onScaleGroupEnd",je(e,t,{targets:e.props.targets})),n},request:function(){var e={},t=0,n=0;return{isControl:!0,requestStart:function(t){return{datas:e,parentDirection:t.direction||[1,1]}},request:function(r){return t+=r.deltaWidth,n+=r.deltaHeight,{datas:e,parentDist:[t,n]}},requestEnd:function(){return{datas:e,isDrag:!0}}}}};function Vn(e,t){return e.map((function(e,n){return r=e,i=t[n],(r*(a=2)+i*(o=1))/(o+a);var r,i,o,a}))}function Yn(e,t,n){var r=C(e,t),i=C(e,n)-r;return i>=0?i:i+2*Math.PI}var Wn={name:"warpable",ableGroup:"size",props:{warpable:Boolean,renderDirections:Array},events:{onWarpStart:"warpStart",onWarp:"warp",onWarpEnd:"warpEnd"},render:function(e,t){var n=e.props,r=n.resizable,i=n.scalable,o=n.warpable;if(r||i||!o)return[];var a=e.state,A=a.pos1,s=a.pos2,u=a.pos3,l=a.pos4,c=Vn(A,s),f=Vn(s,A),d=Vn(A,u),p=Vn(u,A),h=Vn(u,l),g=Vn(l,u),v=Vn(s,l),B=Vn(l,s);return Z([t.createElement("div",{className:fe("line"),key:"middeLine1",style:Te(c,h)}),t.createElement("div",{className:fe("line"),key:"middeLine2",style:Te(f,g)}),t.createElement("div",{className:fe("line"),key:"middeLine3",style:Te(d,v)}),t.createElement("div",{className:fe("line"),key:"middeLine4",style:Te(p,B)})],zn(e,t))},dragControlCondition:function(e){return!e.isRequest&&x(e.inputEvent.target,fe("direction"))},dragControlStart:function(e,t){var n=t.datas,r=t.inputEvent,i=e.props.target,o=Re(r.target);if(!o||!i)return!1;var a=e.state,A=a.transformOrigin,s=a.is3d,u=a.targetTransform,l=a.targetMatrix,c=a.width,f=a.height,d=a.left,p=a.top;return n.datas={},n.targetTransform=u,n.warpTargetMatrix=s?l:Object(S.c)(l,3,4),n.targetInverseMatrix=Object(S.m)(Object(S.n)(n.warpTargetMatrix,4),3,4),n.direction=o,n.left=d,n.top=p,ht(e,t),Ft(t),n.poses=[[0,0],[c,0],[0,f],[c,f]].map((function(e){return Object(S.p)(e,A)})),n.nextPoses=n.poses.map((function(e){var t=e[0],r=e[1];return Object(S.a)(n.warpTargetMatrix,[t,r,0,1],4)})),n.startValue=Object(S.f)(4),n.prevMatrix=Object(S.f)(4),n.absolutePoses=ke(a),n.posIndexes=wt(o),a.snapRenderInfo={request:t.isRequest,direction:o},!1!==Xe(e,"onWarpStart",ze(e,t,$({set:function(e){n.startValue=e}},xt(t))))&&(n.isWarp=!0),n.isWarp},dragControl:function(e,t){var n=t.datas,r=t.isRequest,i=t.distX,o=t.distY,a=n.targetInverseMatrix,A=n.prevMatrix,s=n.isWarp,u=n.startValue,l=n.poses,c=n.posIndexes,f=n.absolutePoses;if(!s)return!1;if(gt(t,"matrix3d"),un(e,"warpable")){var d=c.map((function(e){return f[e]}));d.length>1&&d.push([(d[0][0]+d[1][0])/2,(d[0][1]+d[1][1])/2]);var p=hn(e,r,d.map((function(e){return[e[0]+i,e[1]+o]}))),h=p.horizontal,g=p.vertical;o-=h.offset,i-=g.offset}var v=bt({datas:n,distX:i,distY:o},!0),B=n.nextPoses.slice();if(c.forEach((function(e){B[e]=Object(S.s)(B[e],v)})),!oe.every((function(e){return function(e,t){var n=Yn(e[0],e[1],e[2]),r=Yn(t[0],t[1],t[2]),i=Math.PI;return!(n>=i&&r<=i||n<=i&&r>=i)}(e.map((function(e){return l[e]})),e.map((function(e){return B[e]})))})))return!1;var m=Object(S.j)(l[0],l[2],l[1],l[3],B[0],B[2],B[1],B[3]);if(!m.length)return!1;var b=Bt(n,Object(S.r)(a,m,4),!0),w=Object(S.r)(Object(S.n)(A,4),b,4);n.prevMatrix=b;var E=Object(S.r)(u,b,4),y=vt(n,"matrix3d("+E.join(", ")+")","matrix3d("+b.join(", ")+")");return St(t,y),Xe(e,"onWarp",ze(e,t,{delta:w,matrix:E,dist:b,multiply:S.r,transform:y})),!0},dragControlEnd:function(e,t){var n=t.datas,r=t.isDrag;return!!n.isWarp&&(n.isWarp=!1,Xe(e,"onWarpEnd",je(e,t,{})),r)}},Jn=fe("area-pieces"),qn=fe("area-piece"),$n=fe("avoid");function Zn(e){var t=e.areaElement,n=e.state,r=n.width,i=n.height;!function(e,t){if(e.classList)e.classList.remove(t);else{var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}}(t,$n),t.style.cssText+="left: 0px; top: 0px; width: "+r+"px; height: "+i+"px"}function er(e){return e.createElement("div",{key:"area_pieces",className:Jn},e.createElement("div",{className:qn}),e.createElement("div",{className:qn}),e.createElement("div",{className:qn}),e.createElement("div",{className:qn}))}var tr={name:"dragArea",props:{dragArea:Boolean,passDragArea:Boolean},events:{onClick:"click",onClickGroup:"clickGroup"},render:function(e,t){var n=e.props,r=n.target,o=n.dragArea,a=n.groupable,A=n.passDragArea,s=e.state,u=s.width,l=s.height,c=s.renderPoses,f=A?fe("area","pass"):fe("area");if(a)return[t.createElement("div",{key:"area",ref:Object(i.d)(e,"areaElement"),className:f}),er(t)];if(!r||!o)return[];var d=Object(S.j)([0,0],[u,0],[0,l],[u,l],c[0],c[1],c[2],c[3]),p=d.length?Ee(d,!0):"none";return[t.createElement("div",{key:"area",ref:Object(i.d)(e,"areaElement"),className:f,style:{top:"0px",left:"0px",width:u+"px",height:l+"px",transformOrigin:"0 0",transform:p}}),er(t)]},dragStart:function(e,t){var n=t.datas,r=t.clientX,i=t.clientY;if(!t.inputEvent)return!1;n.isDragArea=!1;var o,a,A=e.areaElement,s=e.state,u=s.moveableClientRect,l=s.renderPoses,c=s.rootMatrix,f=s.is3d,d=u.left,p=u.top,h=Fe(l),g=h.left,v=h.top,B=h.width,m=h.height,b=et(c,[r-d,i-p],f?4:3),w=b[0],E=b[1],y=[{left:g,top:v,width:B,height:(E-=v)-10},{left:g,top:v,width:(w-=g)-10,height:m},{left:g,top:v+E+10,width:B,height:m-E-10},{left:g+w+10,top:v,width:B-w-10,height:m}],C=[].slice.call(A.nextElementSibling.children);y.forEach((function(e,t){C[t].style.cssText="left: "+e.left+"px;top: "+e.top+"px; width: "+e.width+"px; height: "+e.height+"px;"})),a=$n,(o=A).classList?o.classList.add(a):o.className+=" "+a},drag:function(e,t){var n=t.datas;if(!t.inputEvent)return!1;n.isDragArea||(n.isDragArea=!0,Zn(e))},dragEnd:function(e,t){var n=t.inputEvent,r=t.datas;if(!n)return!1;r.isDragArea||Zn(e)},dragGroupStart:function(e,t){return this.dragStart(e,t)},dragGroup:function(e,t){return this.drag(e,t)},dragGroupEnd:function(e,t){return this.dragEnd(e,t)},unset:function(e){Zn(e)}},nr={name:"origin",props:{origin:Boolean},events:{},render:function(e,t){var n=e.state,r=n.beforeOrigin,i=n.rotation;return[t.createElement("div",{className:fe("control","origin"),style:Ne(i,r),key:"beforeOrigin"})]}};function rr(e){var t=e.scrollContainer;return[t.scrollLeft,t.scrollTop]}var ir={name:"scrollable",canPinch:!0,props:{scrollable:Boolean,scrollContainer:Object,scrollThreshold:Number,getScrollPosition:Function},events:{onScroll:"scroll",onScrollGroup:"scrollGroup"},dragStart:function(e,t){var n=e.props.scrollContainer,r=void 0===n?e.getContainer():n,i=new _.a;t.datas.dragScroll=i;var o=t.isControl?"controlGesto":"targetGesto",a=t.targets;i.on("scroll",(function(n){var r=n.container,i=n.direction,o=ze(e,t,{scrollContainer:r,direction:i}),A=a?"onScrollGroup":"onScroll";a&&(o.targets=a),Xe(e,A,o)})).on("move",(function(n){var r=n.offsetX,i=n.offsetY;e[o].scrollBy(r,i,t.inputEvent,!1)})),i.dragStart(t,{container:r})},checkScroll:function(e,t){var n=t.datas.dragScroll;if(n){var r=e.props,i=r.scrollContainer,o=void 0===i?e.getContainer():i,a=r.scrollThreshold,A=void 0===a?0:a,s=r.getScrollPosition,u=void 0===s?rr:s;return n.drag(t,{container:o,threshold:A,getScrollPosition:function(e){return u({scrollContainer:e.container,direction:e.direction})}}),!0}},drag:function(e,t){return this.checkScroll(e,t)},dragEnd:function(e,t){t.datas.dragScroll.dragEnd(),t.datas.dragScroll=null},dragControlStart:function(e,t){return this.dragStart(e,$($({},t),{isControl:!0}))},dragControl:function(e,t){return this.drag(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupStart:function(e,t){return this.dragStart(e,$($({},t),{targets:e.props.targets}))},dragGroup:function(e,t){return this.drag(e,$($({},t),{targets:e.props.targets}))},dragGroupEnd:function(e,t){return this.dragEnd(e,$($({},t),{targets:e.props.targets}))},dragGroupControlStart:function(e,t){return this.dragStart(e,$($({},t),{targets:e.props.targets,isControl:!0}))},dragGroupContro:function(e,t){return this.drag(e,$($({},t),{targets:e.props.targets}))},dragGroupControEnd:function(e,t){return this.dragEnd(e,$($({},t),{targets:e.props.targets}))}},or={name:"",props:{target:Object,dragTarget:Object,container:Object,rootContainer:Object,zoom:Number,transformOrigin:Array,edge:Boolean,ables:Array,className:String,pinchThreshold:Number,pinchOutside:Boolean,triggerAblesSimultaneously:Boolean,checkInput:Boolean,cspNonce:String,translateZ:Number,props:Object},events:{}},ar={name:"padding",props:{padding:Object},events:{},render:function(e,t){var n=e.props;if(n.dragArea)return[];var r=n.padding||{},i=r.left,o=void 0===i?0:i,a=r.top,A=void 0===a?0:a,s=r.right,u=void 0===s?0:s,l=r.bottom,c=void 0===l?0:l,f=e.state,d=f.renderPoses,p=[f.pos1,f.pos2,f.pos3,f.pos4],h=[];return o>0&&h.push([0,2]),A>0&&h.push([0,1]),u>0&&h.push([1,3]),c>0&&h.push([2,3]),h.map((function(e,n){var r=e[0],i=e[1],o=p[r],a=p[i],A=d[r],s=d[i],u=Object(S.j)([0,0],[100,0],[0,100],[100,100],o,a,A,s);if(u.length)return t.createElement("div",{key:"padding"+n,className:fe("padding"),style:{transform:Ee(u,!0)}})}))}},Ar=["nw","ne","se","sw"];function sr(e,t){var n=e[0]+e[1],r=n>t?t/n:1;return e[0]*=r,e[1]=t-e[1]*r,e}var ur=[1,2,5,6],lr=[0,3,4,7],cr=[1,-1,-1,1],fr=[1,1,-1,-1];function dr(e,t,n,r,i,o,a,A,s){void 0===o&&(o=0),void 0===a&&(a=0),void 0===A&&(A=r),void 0===s&&(s=i);var u=[],l=!1,c=e.map((function(e,c){var f=t[c],d=f.horizontal,p=f.vertical;if(p&&!l&&(l=!0,u.push("/")),l){var h=Math.max(0,1===p?e[1]-a:s-e[1]);return u.push(rt(h,i,n)),h}h=Math.max(0,1===d?e[0]-o:A-e[0]);return u.push(rt(h,r,n)),h}));return{styles:u,raws:c}}function pr(e){for(var t=[0,0],n=[0,0],r=e.length,i=0;i-1?e.slice(0,l):e).length,f=e.slice(0,c),d=e.slice(c+1),p=f[0],h=void 0===p?"0px":p,g=f[1],v=void 0===g?h:g,B=f[2],m=void 0===B?h:B,w=f[3],E=void 0===w?v:w,y=d[0],C=void 0===y?h:y,Q=d[1],x=void 0===Q?C:Q,F=d[2],U=void 0===F?C:F,S=d[3],O=void 0===S?x:S,H=[h,v,m,E].map((function(e){return b(e,t)})),T=[C,x,U,O].map((function(e){return b(e,n)})),N=H.slice(),_=T.slice();a=sr([N[0],N[1]],t),N[0]=a[0],N[1]=a[1],A=sr([N[3],N[2]],t),N[3]=A[0],N[2]=A[1],s=sr([_[0],_[3]],n),_[0]=s[0],_[3]=s[1],u=sr([_[1],_[2]],n),_[1]=u[0],_[2]=u[1];var M=N.slice(0,Math.max(o[0],f.length)),D=_.slice(0,Math.max(o[1],d.length));return Z(M.map((function(e,t){var o=Ar[t];return{horizontal:cr[t],vertical:0,pos:[r+e,i+(-1===fr[t]?n:0)],sub:!0,raw:H[t],direction:o}})),D.map((function(e,n){var o=Ar[n];return{horizontal:0,vertical:fr[n],pos:[r+(-1===cr[n]?t:0),i+e],sub:!0,raw:T[n],direction:o}})))}function gr(e,t,n,r,i){void 0===i&&(i=t.length);var o=pr(e.slice(r)),a=o.horizontalRange,A=o.verticalRange,s=n-r,u=0;if(0===s)u=i;else if(s>0&&s=A[0]))return;u=A[0]+A[1]-s}e.splice(n,u),t.splice(n,u)}function vr(e,t,n,r,i,o,a,A,s,u,l){void 0===u&&(u=0),void 0===l&&(l=0);var c=pr(e.slice(n)),f=c.horizontalRange,d=c.verticalRange;if(r>-1)for(var p=1===cr[r]?o-u:A-o,h=f[1];h<=r;++h){var g=1===fr[h]?l:s,v=0;if(r===h?v=o:0===h?v=u+p:-1===cr[h]&&(v=A-(t[n][0]-u)),e.splice(n+h,0,{horizontal:cr[h],vertical:0,pos:[v,g]}),t.splice(n+h,0,[v,g]),0===h)break}else if(i>-1){var B=1===fr[i]?a-l:s-a;if(0===f[1]&&0===d[1]){var m=[u+B,l];e.push({horizontal:cr[0],vertical:0,pos:m}),t.push(m)}var b=d[0];for(h=d[1];h<=i;++h){v=1===cr[h]?u:A,g=0;if(i===h?g=a:0===h?g=l+B:1===fr[h]?g=t[n+b][1]:-1===fr[h]&&(g=s-(t[n+b][1]-l)),e.push({horizontal:0,vertical:fr[h],pos:[v,g]}),t.push([v,g]),0===h)break}}}function Br(e,t){return void 0===t&&(t=e.map((function(e){return e.raw}))),{horizontals:e.map((function(e,n){return e.horizontal?t[n]:null})).filter((function(e){return null!=e})),verticals:e.map((function(e,n){return e.vertical?t[n]:null})).filter((function(e){return null!=e}))}}var mr=[[0,-1,"n"],[1,0,"e"]],br=[[-1,-1,"nw"],[0,-1,"n"],[1,-1,"ne"],[1,0,"e"],[1,1,"se"],[0,1,"s"],[-1,1,"sw"],[-1,0,"w"]];function wr(e,t,n){var r=e.props.clipRelative,i=e.state,o=i.width,a=i.height,A=t,s=A.type,u=A.poses,l="rect"===s,c="circle"===s;if("polygon"===s)return n.map((function(e){return rt(e[0],o,r)+" "+rt(e[1],a,r)}));if(l||"inset"===s){var f=n[1][1],d=n[3][0],p=n[7][0],h=n[5][1];if(l)return[f,d,h,p].map((function(e){return e+"px"}));var g=[f,o-d,a-h,p].map((function(e,t){return rt(e,t%2?o:a,r)}));if(n.length>8){var v=Object(S.p)(n[4],n[0]),B=v[0],m=v[1];g.push.apply(g,Z(["round"],dr(n.slice(8),u.slice(8),r,B,m,p,f,d,h).styles))}return g}if(c||"ellipse"===s){var b=n[0],w=rt(Math.abs(n[1][1]-b[1]),c?Math.sqrt((o*o+a*a)/2):a,r);return(g=c?[w]:[rt(Math.abs(n[2][0]-b[0]),o,r),w]).push("at",rt(b[0],o,r),rt(b[1],a,r)),g}}function Er(e,t,n,r){var i=[r,(r+t)/2,t],o=[e,(e+n)/2,n];return br.map((function(e){var t=e[0],n=e[1],r=e[2],a=i[t+1],A=o[n+1];return{vertical:Math.abs(n),horizontal:Math.abs(t),direction:r,pos:[a,A]}}))}function yr(e,t,n,r,i){var o,a,A,s,u,l,c,f=i;if(!f){var v=getComputedStyle(e),B=v.clipPath;f="none"!==B?B:v.clip}if(f&&"none"!==f&&"auto"!==f||(f=r)){var m=h(f),w=m.prefix,E=void 0===w?f:w,y=m.value,C=void 0===y?"":y,Q="circle"===E,x=" ";if("polygon"===E)return x=",",{type:E,clipText:f,poses:D=(H=p(C||"0% 0%, 100% 0%, 100% 100%, 0% 100%")).map((function(e){var r=e.split(" "),i=r[0],o=r[1];return{vertical:1,horizontal:1,pos:[b(i,t),b(o,n)]}})),splitter:x};if(Q||"ellipse"===E){var F="",U="",S=0,O=0,H=d(C);if(Q){var T;T=void 0===(o=H[0])?"50%":o,F=void 0===(a=H[2])?"50%":a,U=void 0===(A=H[3])?"50%":A,S=b(T,Math.sqrt((t*t+n*n)/2)),O=S}else{var N,_;N=void 0===(s=H[0])?"50%":s,_=void 0===(u=H[1])?"50%":u,F=void 0===(l=H[3])?"50%":l,U=void 0===(c=H[4])?"50%":c,S=b(N,t),O=b(_,n)}var M=[b(F,t),b(U,n)],D=Z([{vertical:1,horizontal:1,pos:M,direction:"nesw"}],mr.slice(0,Q?1:2).map((function(e){return{vertical:Math.abs(e[1]),horizontal:e[0],direction:e[2],sub:!0,pos:[M[0]+e[0]*S,M[1]+e[1]*O]}})));return{type:E,clipText:f,radiusX:S,radiusY:O,left:M[0]-S,top:M[1]-O,poses:D,splitter:x}}if("inset"===E){var R=(H=d(C||"0 0 0 0")).indexOf("round"),P=(R>-1?H.slice(0,R):H).length,k=H.slice(P+1),I=H.slice(0,P),K=I[0],L=I[1],z=void 0===L?K:L,j=I[2],X=void 0===j?K:j,G=I[3],V=void 0===G?z:G,Y=[K,X].map((function(e){return b(e,n)})),W=Y[0],J=Y[1],q=[V,z].map((function(e){return b(e,t)})),$=q[0],ee=q[1],te=t-ee,ne=n-J,re=hr(k,te-$,ne-W,$,W);return{type:"inset",clipText:f,poses:D=Z(Er(W,te,ne,$),re),top:W,left:$,right:te,bottom:ne,radius:k,splitter:x}}if("rect"===E){x=",";var ie=(H=p(C||"0px, "+t+"px, "+n+"px, 0px")).map((function(e){return g(e).value}));return{type:"rect",clipText:f,poses:D=Er(W=ie[0],ee=ie[1],J=ie[2],$=ie[3]),top:W,right:ee,bottom:J,left:$,values:H,splitter:x}}}}var Cr={name:"clippable",props:{clippable:Boolean,defaultClipPath:String,customClipPath:String,clipRelative:Boolean,clipArea:Boolean,dragWithClip:Boolean,clipTargetBounds:Boolean,clipVerticalGuidelines:Array,clipHorizontalGuidelines:Array,clipSnapThreshold:Boolean},events:{onClipStart:"clipStart",onClip:"clip",onClipEnd:"clipEnd"},css:[".control.clip-control {\n background: #6d6;\n cursor: pointer;\n}\n.control.clip-control.clip-radius {\n background: #d66;\n}\n.line.clip-line {\n background: #6e6;\n cursor: move;\n z-index: 1;\n}\n.clip-area {\n position: absolute;\n top: 0;\n left: 0;\n}\n.clip-ellipse {\n position: absolute;\n cursor: move;\n border: 1px solid #6d6;\n border: var(--zoompx) solid #6d6;\n border-radius: 50%;\n transform-origin: 0px 0px;\n}",":host {\n --bounds-color: #d66;\n}",".guideline {\n pointer-events: none;\n z-index: 2;\n}",".line.guideline.bounds {\n background: #d66;\n background: var(--bounds-color);\n}"],render:function(e,t){var n=e.props,r=n.customClipPath,i=n.defaultClipPath,o=n.clipArea,a=n.zoom,A=e.state,s=A.target,u=A.width,l=A.height,c=A.allMatrix,f=A.is3d,d=A.left,p=A.top,h=A.pos1,g=A.pos2,v=A.pos3,B=A.pos4,m=A.clipPathState,b=A.snapBoundInfos;if(!s)return[];var w=yr(s,u,l,i||"inset",m||r);if(!w)return[];var E=f?4:3,y=w.type,Q=w.poses.map((function(e){var t=Qe(c,e.pos,E);return[t[0]-d,t[1]-p]})),x=[],F=[],U="rect"===y,O="inset"===y,H="polygon"===y;if(U||O||H){var T=O?Q.slice(0,8):Q;F=T.map((function(e,n){var r=0===n?T[T.length-1]:T[n-1],i=C(r,e),o=He(r,e);return t.createElement("div",{key:"clipLine"+n,className:fe("line","clip-line","snap-control"),"data-clip-index":n,style:{width:o+"px",transform:"translate("+r[0]+"px, "+r[1]+"px) rotate("+i+"rad)"}})}))}if(x=Q.map((function(e,n){return t.createElement("div",{key:"clipControl"+n,className:fe("control","clip-control","snap-control"),"data-clip-index":n,style:{transform:"translate("+e[0]+"px, "+e[1]+"px)"}})})),O&&x.push.apply(x,Q.slice(8).map((function(e,n){return t.createElement("div",{key:"clipRadiusControl"+n,className:fe("control","clip-control","clip-radius","snap-control"),"data-clip-index":8+n,style:{transform:"translate("+e[0]+"px, "+e[1]+"px)"}})}))),"circle"===y||"ellipse"===y){var N=w.left,_=w.top,M=w.radiusX,D=w.radiusY,R=Object(S.p)(Qe(c,[N,_],E),Qe(c,[0,0],E)),P=R[0],k=R[1],I="none";if(!o){for(var K=Math.max(10,M/5,D/5),L=[],z=0;z<=K;++z){var j=2*Math.PI/K*z;L.push([M+(M-a)*Math.cos(j),D+(D-a)*Math.sin(j)])}L.push([M,-2]),L.push([-2,-2]),L.push([-2,2*D+2]),L.push([2*M+2,2*D+2]),L.push([2*M+2,-2]),L.push([M,-2]),I="polygon("+L.map((function(e){return e[0]+"px "+e[1]+"px"})).join(", ")+")"}x.push(t.createElement("div",{key:"clipEllipse",className:fe("clip-ellipse","snap-control"),style:{width:2*M+"px",height:2*D+"px",clipPath:I,transform:"translate("+(-d+P)+"px, "+(-p+k)+"px) "+Ee(c)}}))}if(o){var X=Fe(Z([h,g,v,B],Q)),G=X.width,V=X.height,Y=X.left,W=X.top;if(H||U||O){L=O?Q.slice(0,8):Q;x.push(t.createElement("div",{key:"clipArea",className:fe("clip-area","snap-control"),style:{width:G+"px",height:V+"px",transform:"translate("+Y+"px, "+W+"px)",clipPath:"polygon("+L.map((function(e){return e[0]-Y+"px "+(e[1]-W)+"px"})).join(", ")+")"}}))}}return b&&["vertical","horizontal"].forEach((function(e){var n=b[e],r="horizontal"===e;n.isSnap&&F.push.apply(F,n.snap.posInfos.map((function(n,i){var o=n.pos,a=Object(S.p)(Qe(c,r?[0,o]:[o,0],E),[d,p]),A=Object(S.p)(Qe(c,r?[u,o]:[o,l],E),[d,p]);return Ln(t,"",a,A,"clip"+e+"snap"+i,"guideline")}))),n.isBound&&F.push.apply(F,n.bounds.map((function(n,i){var o=n.pos,a=Object(S.p)(Qe(c,r?[0,o]:[o,0],E),[d,p]),A=Object(S.p)(Qe(c,r?[u,o]:[o,l],E),[d,p]);return Ln(t,"",a,A,"clip"+e+"bounds"+i,"guideline","bounds","bold")})))})),Z(x,F)},dragControlCondition:function(e){return e.inputEvent&&(e.inputEvent.target.getAttribute("class")||"").indexOf("clip")>-1},dragStart:function(e,t){var n=e.props.dragWithClip;return!(void 0===n||n)&&this.dragControlStart(e,t)},drag:function(e,t){return this.dragControl(e,t)},dragEnd:function(e,t){return this.dragControlEnd(e,t)},dragControlStart:function(e,t){var n=e.state,r=e.props,i=r.defaultClipPath,o=r.customClipPath,a=n.target,A=n.width,s=n.height,u=t.inputEvent?t.inputEvent.target:null,l=u?u.getAttribute("class"):"",c=t.datas,f=yr(a,A,s,i||"inset",o);if(!f)return!1;var d=f.clipText;return!1===Xe(e,"onClipStart",ze(e,t,{clipType:f.type,clipStyle:d,poses:f.poses.map((function(e){return e.pos}))}))?(c.isClipStart=!1,!1):(c.isControl=l.indexOf("clip-control")>-1,c.isLine=l.indexOf("clip-line")>-1,c.isArea=l.indexOf("clip-area")>-1||l.indexOf("clip-ellipse")>-1,c.index=u?parseInt(u.getAttribute("data-clip-index"),10):-1,c.clipPath=f,c.isClipStart=!0,n.clipPathState=d,ht(e,t),!0)},dragControl:function(e,t){var n=t.datas,r=t.originalDatas;if(!n.isClipStart)return!1;var i=r&&r.draggable||{},o=n,a=o.isControl,A=o.isLine,s=o.isArea,u=o.index,l=o.clipPath;if(!l)return!1;var c=i.isDrag?i.prevDist:bt(t),f=c[0],d=c[1],p=e.props,h=e.state,g=h.width,v=h.height,B=!s&&!a&&!A,m=l.type,w=l.poses,E=l.splitter,y=w.map((function(e){return e.pos}));B&&(f=-f,d=-d);var C=!a||"nesw"===w[u].direction,Q="inset"===m||"rect"===m,x=w.map((function(){return[0,0]}));if(a&&!C){var F=w[u],U=F.horizontal,O=F.vertical,H=[f*Math.abs(U),d*Math.abs(O)];x=function(e,t,n,r){var i=e[t],o=i.direction,a=i.sub,A=e.map((function(){return[0,0]})),s=o?o.split(""):[];if(r&&t<8){var u=s.filter((function(e){return"w"===e||"e"===e}))[0],l=s.filter((function(e){return"n"===e||"s"===e}))[0];A[t]=n,e.forEach((function(e,t){var r=e.direction;r&&(r.indexOf(u)>-1&&(A[t][0]=n[0]),r.indexOf(l)>-1&&(A[t][1]=n[1]))})),u&&(A[1][0]=n[0]/2,A[5][0]=n[0]/2),l&&(A[3][1]=n[1]/2,A[7][1]=n[1]/2)}else o&&!a?s.forEach((function(t){var r="n"===t||"s"===t;e.forEach((function(e,i){var o=e.direction,a=e.horizontal,s=e.vertical;o&&-1!==o.indexOf(t)&&(A[i]=[r||!a?0:n[0],r&&s?n[1]:0])}))})):A[t]=n;return A}(w,u,H,Q)}else C&&(x=y.map((function(){return[f,d]})));var T=y.map((function(e,t){return Object(S.s)(e,x[t])})),N=Z(T);h.snapBoundInfos=null;var _="circle"===l.type,M="ellipse"===l.type;if(_||M){var D=Fe(T),R=Math.abs(D.bottom-D.top),P=Math.abs(M?D.right-D.left:R),k=T[0][1]+R,I=T[0][0]-P,K=T[0][0]+P;_&&(N.push([K,D.bottom]),x.push([1,0])),N.push([D.left,k]),x.push([0,1]),N.push([I,D.bottom]),x.push([1,0])}var L=Pt([],g,v,(p.clipHorizontalGuidelines||[]).map((function(e){return b(""+e,v)})),(p.clipVerticalGuidelines||[]).map((function(e){return b(""+e,g)}))),z=[],j=[];if(_||M)z=[N[4][0],N[2][0]],j=[N[1][1],N[3][1]];else if(Q){var X=[N[0],N[2],N[4],N[6]],G=[x[0],x[2],x[4],x[6]];z=X.filter((function(e,t){return G[t][0]})).map((function(e){return e[0]})),j=X.filter((function(e,t){return G[t][1]})).map((function(e){return e[1]}))}else z=N.filter((function(e,t){return x[t][0]})).map((function(e){return e[0]})),j=N.filter((function(e,t){return x[t][1]})).map((function(e){return e[1]}));for(var V=function(e){var t=gn(L,p.clipTargetBounds&&{left:0,top:0,right:g,bottom:v},z,j,{snapThreshold:5}),n=t.horizontal,r=t.vertical,i=n.offset,o=r.offset;if(!M&&!_||0!==x[0][0]||0!==x[0][1])return N.forEach((function(e,t){var n=x[t];n[0]&&(e[0]-=o),n[1]&&(e[1]-=i)})),"break";var a=Fe(T),A=a.bottom-a.top,s=M?a.right-a.left:A;s-=r.isBound?Math.abs(o):0===r.snapIndex?-o:o,A-=n.isBound?Math.abs(i):0===n.snapIndex?-i:i,_&&(s=A=jt(r,n)>0?A:s);var u=N[0];N[1][1]=u[1]-A,N[2][0]=u[0]+s,N[3][1]=u[1]+A,N[4][0]=u[0]-s},Y=0;Y<2;++Y){if("break"===V())break}var W=wr(e,l,T),J=m+"("+W.join(E)+")";if(h.clipPathState=J,_||M)z=[N[4][0],N[2][0]],j=[N[1][1],N[3][1]];else if(Q){X=[N[0],N[2],N[4],N[6]];z=X.map((function(e){return e[0]})),j=X.map((function(e){return e[1]}))}else z=N.map((function(e){return e[0]})),j=N.map((function(e){return e[1]}));return h.snapBoundInfos=gn(L,p.clipTargetBounds&&{left:0,top:0,right:g,bottom:v},z,j,{snapThreshold:1}),Xe(e,"onClip",ze(e,t,{clipEventType:"changed",clipType:m,poses:T,clipStyle:J,clipStyles:W,distX:f,distY:d})),!0},dragControlEnd:function(e,t){this.unset(e);var n=t.isDrag,r=t.datas,i=t.isDouble,o=r.isLine,a=r.isClipStart,A=r.isControl;return!!a&&(Xe(e,"onClipEnd",je(e,t,{})),i&&(A?function(e,t){var n=t.datas,r=n.clipPath,i=n.index,o=r,a=o.type,A=o.poses,s=o.splitter,u=A.map((function(e){return e.pos})),l=u.length;if("polygon"===a)A.splice(i,1),u.splice(i,1);else{if("inset"!==a)return;if(i<8)return;if(gr(A,u,i,8,l),l===A.length)return}var c=wr(e,r,u);Xe(e,"onClip",ze(e,t,{clipEventType:"removed",clipType:a,poses:u,clipStyles:c,clipStyle:a+"("+c.join(s)+")",distX:0,distY:0}))}(e,t):o&&function(e,t){var n=pt(e,t),r=n[0],i=n[1],o=t.datas,a=o.clipPath,A=o.index,s=a,u=s.type,l=s.poses,c=s.splitter,f=l.map((function(e){return e.pos}));if("polygon"===u)f.splice(A,0,[r,i]);else{if("inset"!==u)return;var d=ur.indexOf(A),p=lr.indexOf(A),h=l.length;if(vr(l,f,8,d,p,r,i,f[4][0],f[4][1],f[0][0],f[0][1]),h===l.length)return}var g=wr(e,a,f);Xe(e,"onClip",ze(e,t,{clipEventType:"added",clipType:u,poses:f,clipStyles:g,clipStyle:u+"("+g.join(c)+")",distX:0,distY:0}))}(e,t)),i||n)},unset:function(e){e.state.clipPathState="",e.state.snapBoundInfos=null}},Qr={name:"originDraggable",props:{originDraggable:Boolean,originRelative:Boolean},events:{onDragOriginStart:"dragOriginStart",onDragOrigin:"dragOrigin",onDragOriginEnd:"dragOriginEnd"},css:[":host[data-able-origindraggable] .control.origin {\n pointer-events: auto;\n}"],dragControlCondition:function(e){return e.isRequest?"originDraggable"===e.requestAble:x(e.inputEvent.target,fe("origin"))},dragControlStart:function(e,t){var n=t.datas;ht(e,t);var r=ze(e,t,{dragStart:_n.dragStart(e,(new lt).dragStart([0,0],t))}),i=Xe(e,"onDragOriginStart",r);return n.startOrigin=e.state.transformOrigin,n.startTargetOrigin=e.state.targetOrigin,n.prevOrigin=[0,0],n.isDragOrigin=!0,!1===i?(n.isDragOrigin=!1,!1):r},dragControl:function(e,t){var n=t.datas,r=t.isPinch,i=t.isRequest;if(!n.isDragOrigin)return!1;var o=bt(t),a=o[0],A=o[1],s=e.state,u=s.width,l=s.height,c=s.offsetMatrix,f=s.targetMatrix,d=s.is3d,p=e.props.originRelative,h=void 0===p||p,g=d?4:3,v=[a,A];if(i){var B=t.distOrigin;(B[0]||B[1])&&(v=B)}var m=Object(S.s)(n.startOrigin,v),b=Object(S.s)(n.startTargetOrigin,v),w=Object(S.p)(v,n.prevOrigin),E=Qt(c,f,m,g),y=e.getRect(),C=Fe(xe(E,u,l,g)),Q=[y.left-C.left,y.top-C.top];n.prevOrigin=v;var x=ze(e,t,{width:u,height:l,origin:m,dist:v,delta:w,transformOrigin:[rt(b[0],u,h),rt(b[1],l,h)].join(" "),drag:_n.drag(e,ut(t,e.state,Q,!!r,!1))});return Xe(e,"onDragOrigin",x),x},dragControlEnd:function(e,t){return!!t.datas.isDragOrigin&&(Xe(e,"onDragOriginEnd",je(e,t,{})),!0)},dragGroupControlCondition:function(e){return this.dragControlCondition(e)},dragGroupControlStart:function(e,t){return!!this.dragControlStart(e,t)},dragGroupControl:function(e,t){var n=this.dragControl(e,t);return!!n&&(e.transformOrigin=n.transformOrigin,!0)},request:function(e){var t={},n=e.getRect(),r=0,i=0,o=n.transformOrigin,a=[0,0];return{isControl:!0,requestStart:function(){return{datas:t}},request:function(e){return"deltaOrigin"in e?(a[0]+=e.deltaOrigin[0],a[1]+=e.deltaOrigin[1]):"origin"in e?(a[0]=e.origin[0]-o[0],a[1]=e.origin[1]-o[1]):("x"in e?r=e.x-n.left:"deltaX"in e&&(r+=e.deltaX),"y"in e?i=e.y-n.top:"deltaY"in e&&(i+=e.deltaY)),{datas:t,distX:r,distY:i,distOrigin:a}},requestEnd:function(){return{datas:t,isDrag:!0}}}}};function xr(e,t,n,r,i){var o;void 0===r&&(r=[0,0]);if(i)o=i;else{var a=window.getComputedStyle(e);o=a&&a.borderRadius||""}return hr(!o||!i&&"0px"===o?[]:d(o),t,n,0,0,r)}function Fr(e,t,n,r,i,o){var a=e.state,A=a.width,s=a.height,u=dr(o,i,e.props.roundRelative,A,s),l=u.raws,c=u.styles,f=Br(i,l),d=f.horizontals,p=f.verticals,h=c.join(" ");a.borderRadiusState=h,Xe(e,"onRound",ze(e,t,{horizontals:d,verticals:p,borderRadius:h,width:A,height:s,delta:r,dist:n}))}var Ur={name:"roundable",props:{roundable:Boolean,roundRelative:Boolean,minRoundControls:Array,maxRoundControls:Array,roundClickable:Boolean},events:{onRoundStart:"roundStart",onRound:"round",onRoundEnd:"roundEnd"},css:[".control.border-radius {\n background: #d66;\n cursor: pointer;\n}",":host[data-able-roundable] .line.direction {\n cursor: pointer;\n}"],render:function(e,t){var n=e.state,r=n.target,i=n.width,o=n.height,a=n.allMatrix,A=n.is3d,s=n.left,u=n.top,l=n.borderRadiusState,c=e.props,f=c.minRoundControls,d=void 0===f?[0,0]:f,p=c.maxRoundControls,h=void 0===p?[4,4]:p;if(!r)return null;var g=A?4:3,v=xr(r,i,o,d,l);if(!v)return null;var B=0,m=0;return v.map((function(e,n){m+=Math.abs(e.horizontal),B+=Math.abs(e.vertical);var r=Object(S.p)(Qe(a,e.pos,g),[s,u]),i=e.vertical?B<=h[1]:m<=h[0];return t.createElement("div",{key:"borderRadiusControl"+n,className:fe("control","border-radius"),"data-radius-index":n,style:{display:i?"block":"none",transform:"translate("+r[0]+"px, "+r[1]+"px)"}})}))},dragControlCondition:function(e){if(!e.inputEvent||e.isRequest)return!1;var t=e.inputEvent.target.getAttribute("class")||"";return t.indexOf("border-radius")>-1||t.indexOf("moveable-line")>-1&&t.indexOf("moveable-direction")>-1},dragControlStart:function(e,t){var n=t.inputEvent,r=t.datas,i=n.target,o=i.getAttribute("class")||"",a=o.indexOf("border-radius")>-1,A=o.indexOf("moveable-line")>-1&&o.indexOf("moveable-direction")>-1,s=a?parseInt(i.getAttribute("data-radius-index"),10):-1,u=A?parseInt(i.getAttribute("data-line-index"),10):-1;if(!a&&!A)return!1;if(!1===Xe(e,"onRoundStart",ze(e,t,{})))return!1;r.lineIndex=u,r.controlIndex=s,r.isControl=a,r.isLine=A,ht(e,t);var l=e.props,c=l.roundRelative,f=l.minRoundControls,d=void 0===f?[0,0]:f,p=e.state,h=p.target,g=p.width,v=p.height;r.isRound=!0,r.prevDist=[0,0];var B=xr(h,g,v,d)||[];return r.controlPoses=B,p.borderRadiusState=dr(B.map((function(e){return e.pos})),B,c,g,v).styles.join(" "),!0},dragControl:function(e,t){var n=t.datas;if(!n.isRound||!n.isControl||!n.controlPoses.length)return!1;var r=n.controlIndex,i=n.controlPoses,o=bt(t),a=o[0],A=o[1],s=[a,A],u=Object(S.p)(s,n.prevDist),l=e.props.maxRoundControls,c=void 0===l?[4,4]:l,f=e.state,d=f.width,p=f.height,h=i[r],g=h.vertical,v=h.horizontal,B=i.map((function(e,t){var n=e.horizontal,r=e.vertical,i=[n*v*s[0],r*g*s[1]];if(n){if(1===c[0])return i;if(c[0]<4&&n!==v)return i}else{if(0===c[1])return i[1]=r*v*s[0]/d*p,i;if(g){if(1===c[1])return i;if(c[1]<4&&r!==g)return i}}return[0,0]}));B[r]=s;var m=i.map((function(e,t){return Object(S.s)(e.pos,B[t])}));return n.prevDist=[a,A],Fr(e,t,s,u,i,m),!0},dragControlEnd:function(e,t){var n=e.state;n.borderRadiusState="";var r=t.datas,i=t.isDouble;if(!r.isRound)return!1;var o=n.width,a=n.height,A=r.isControl,s=r.controlIndex,u=r.isLine,l=r.lineIndex,c=r.controlPoses,f=c.map((function(e){return e.pos})),d=f.length,p=e.props.roundClickable;if(i&&(void 0===p||p)){if(A)gr(c,f,s,0);else if(u){var h=pt(e,t);!function(e,t,n,r,i,o,a){var A=Br(e),s=A.horizontals,u=A.verticals,l=s.length,c=u.length,f=-1,d=-1;0===n?0===l?f=0:1===l&&(f=1):3===n&&(l<=2?f=2:l<=3&&(f=3)),2===n?0===c?d=0:c<4&&(d=3):1===n&&(c<=1?d=1:c<=2&&(d=2)),vr(e,t,0,f,d,r,i,o,a)}(c,f,l,h[0],h[1],o,a)}d!==c.length&&Fr(e,t,[0,0],[0,0],c,f),Xe(e,"onRoundEnd",je(e,t,{}))}return n.borderRadiusState="",!0},unset:function(e){e.state.borderRadiusState=""}},Sr={isPinch:!0,name:"beforeRenderable",props:{},events:{onBeforeRenderStart:"beforeRenderStart",onBeforeRender:"beforeRender",onBeforeRenderEnd:"beforeRenderEnd",onBeforeRenderGroupStart:"beforeRenderGroupStart",onBeforeRenderGroup:"beforeRenderGroup",onBeforeRenderGroupEnd:"beforeRenderGroupEnd"},setTransform:function(e,t){var n=e.state,r=n.is3d,i=n.targetMatrix,o=r?"matrix3d("+i.join(",")+")":"matrix("+Object(S.d)(i,!0)+")";t.datas.startTransforms=[o]},resetTransform:function(e,t){t.datas.nextTransforms=t.datas.startTransforms,t.datas.nextTransformAppendedIndexes=[]},fillDragStartParams:function(e,t){return ze(e,t,{setTransform:function(e){t.datas.startTransforms=u(e)?e:d(e)},isPinch:!!t.isPinch})},fillDragParams:function(e,t){return ze(e,t,{isPinch:!!t.isPinch})},dragStart:function(e,t){this.setTransform(e,t),Xe(e,"onBeforeRenderStart",this.fillDragStartParams(e,t))},drag:function(e,t){this.resetTransform(e,t),Xe(e,"onBeforeRender",ze(e,t,{isPinch:!!t.isPinch}))},dragEnd:function(e,t){Xe(e,"onBeforeRenderEnd",ze(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag}))},dragGroupStart:function(e,t){var n=this;this.dragStart(e,t);var r=ct(e,"beforeRenderable",t),i=e.moveables,o=r.map((function(e,t){var r=i[t];return n.setTransform(r,e),n.fillDragStartParams(r,e)}));Xe(e,"onBeforeRenderGroupStart",ze(e,t,{isPinch:!!t.isPinch,targets:e.props.targets,setTransform:function(){},events:o}))},dragGroup:function(e,t){var n=this;this.drag(e,t);var r=ct(e,"beforeRenderable",t),i=e.moveables,o=r.map((function(e,t){var r=i[t];return n.resetTransform(r,e),n.fillDragParams(r,e)}));Xe(e,"onBeforeRenderGroup",ze(e,t,{isPinch:!!t.isPinch,targets:e.props.targets,events:o}))},dragGroupEnd:function(e,t){this.dragEnd(e,t),Xe(e,"onBeforeRenderGroupEnd",ze(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag,targets:e.props.targets}))},dragControlStart:function(e,t){return this.dragStart(e,t)},dragControl:function(e,t){return this.drag(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupControlStart:function(e,t){return this.dragGroupStart(e,t)},dragGroupControl:function(e,t){return this.dragGroup(e,t)},dragGroupControlEnd:function(e,t){return this.dragGroupEnd(e,t)}},Or={name:"Renderable",props:{},events:{onRenderStart:"renderStart",onRender:"render",onRenderEnd:"renderEnd",onRenderGroupStart:"renderGroupStart",onRenderGroup:"renderGroup",onRenderGroupEnd:"renderGroupEnd"},dragStart:function(e,t){Xe(e,"onRenderStart",ze(e,t,{isPinch:!!t.isPinch}))},drag:function(e,t){Xe(e,"onRender",ze(e,t,{isPinch:!!t.isPinch}))},dragEnd:function(e,t){Xe(e,"onRenderEnd",ze(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag}))},dragGroupStart:function(e,t){Xe(e,"onRenderGroupStart",ze(e,t,{isPinch:!!t.isPinch,targets:e.props.targets}))},dragGroup:function(e,t){Xe(e,"onRenderGroup",ze(e,t,{isPinch:!!t.isPinch,targets:e.props.targets}))},dragGroupEnd:function(e,t){Xe(e,"onRenderGroupEnd",ze(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag,targets:e.props.targets}))},dragControlStart:function(e,t){return this.dragStart(e,t)},dragControl:function(e,t){return this.drag(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupControlStart:function(e,t){return this.dragGroupStart(e,t)},dragGroupControl:function(e,t){return this.dragGroup(e,t)},dragGroupControlEnd:function(e,t){return this.dragGroupEnd(e,t)}};function Hr(e,t,n,r,i,o,a){var A="Start"===i,s=e.state.target,u=o.isRequest;if(!s||A&&r.indexOf("Control")>-1&&!u&&e.areaElement===o.inputEvent.target)return!1;var l=""+n+r+i,c=""+n+r+"Condition",f="End"===i,d=i.indexOf("After")>-1,p=A&&(!e.targetGesto||!e.controlGesto||!e.targetGesto.isFlag()||!e.controlGesto.isFlag());p&&e.updateRect(i,!0,!1),""!==i||d||tt(e.state,o);var h=r.indexOf("Group")>-1,g=Z([Sr],e[t].slice(),[Or]);if(u){var v=o.requestAble;g.some((function(e){return e.name===v}))||g.push.apply(g,e.props.ables.filter((function(e){return e.name===v})))}if(!g.length)return!1;var B=g.filter((function(e){return e[l]})),m=o.datas;p&&B.forEach((function(t){t.unset&&t.unset(e)}));var b,w=o.inputEvent;f&&w&&(b=document.elementFromPoint(o.clientX,o.clientY)||w.target);var E=B.filter((function(t){var n=t.name,r=m[n]||(m[n]={});return A&&(r.isEventStart=!t[c]||t[c](o,e)),!!r.isEventStart&&t[l](e,$($({},o),{datas:r,originalDatas:m,inputTarget:b}))})),y=E.length,C=A&&B.length&&!y;return(f||C)&&(e.state.gesto=null,e.moveables&&e.moveables.forEach((function(e){e.state.gesto=null}))),p&&C&&B.forEach((function(t){t.unset&&t.unset(e)})),!e.isUnmounted&&!C&&((!A&&y&&!a||f)&&(E.some((function(e){return e.updateRect}))&&!h?e.updateRect(i,!1,!1):e.updateRect(i,!0,!1),e.forceUpdate()),A||f||d||!y||a||Hr(e,t,n,r,i+"After",o),!0)}function Tr(e,t,n){var r=e.controlBox.getElement(),i=[];i.push(r),e.props.dragArea||i.push(t);var o=function(t){var n=t.inputEvent.target;return n===e.areaElement||!e.isMoveableElement(n)||x(n,"moveable-area")||x(n,"moveable-padding")};return Nr(e,i,"targetAbles",n,{dragStart:o,pinchStart:o})}function Nr(e,t,n,r,i){void 0===i&&(i={});var o=e.props,a=o.pinchOutside,A=o.pinchThreshold,s={container:window,pinchThreshold:A,pinchOutside:a},u=new V(t,s);return["drag","pinch"].forEach((function(t){["Start","","End"].forEach((function(o){u.on(""+t+o,(function(a){var A=a.eventType;!i[A]||i[A](a)?Hr(e,n,t,r,o,a)||a.stop():a.stop()}))}))})),u}var _r=function(){function e(e,t,n){var r=this;this.target=e,this.moveable=t,this.eventName=n,this.ables=[],this.onEvent=function(e){var t=r.eventName,n=r.moveable;r.ables.forEach((function(r){r[t]({inputEvent:e},n)}))},this.target.addEventListener(this.eventName.toLowerCase(),this.onEvent)}var t=e.prototype;return t.setAbles=function(e){this.ables=e},t.destroy=function(){this.target.removeEventListener(this.eventName.toLowerCase(),this.onEvent),this.target=null,this.moveable=null},e}(),Mr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state=$({container:null,target:null,gesto:null,renderPoses:[[0,0],[0,0],[0,0],[0,0]]},Me(null)),t.enabledAbles=[],t.targetAbles=[],t.controlAbles=[],t.rotation=0,t.scale=[1,1],t.isUnmounted=!1,t.events={mouseEnter:null,mouseLeave:null},t}q(t,e);var n=t.prototype;return n.render=function(){var e=this.props,t=this.state,n=e.edge,r=e.parentPosition,o=e.className,a=e.target,A=e.zoom,s=e.cspNonce,u=e.translateZ,l=e.cssStyled;this.checkUpdate(),this.updateRenderPoses();var c=r||{left:0,top:0},f=c.left,d=c.top,p=t.left,h=t.top,g=t.target,v=t.direction,B=t.renderPoses,m=e.targets,b=(m&&m.length||a)&&g,w=this.isDragging(),E={},y={createElement:M.createElement};return this.getEnabledAbles().forEach((function(e){E["data-able-"+e.name.toLowerCase()]=!0})),Object(M.createElement)(l,$({cspNonce:s,ref:Object(i.d)(this,"controlBox"),className:fe("control-box",-1===v?"reverse":"",w?"dragging":"")+" "+o},E,{style:{position:"absolute",display:b?"block":"none",transform:"translate("+(p-f)+"px, "+(h-d)+"px) translateZ("+u+"px)","--zoom":A,"--zoompx":A+"px"}}),this.renderAbles(),Ln(y,n?"n":"",B[0],B[1],0),Ln(y,n?"e":"",B[1],B[3],1),Ln(y,n?"w":"",B[0],B[2],2),Ln(y,n?"s":"",B[2],B[3],3))},n.componentDidMount=function(){this.controlBox.getElement();var e=this.props,t=e.parentMoveable,n=e.container,r=e.wrapperMoveable;this.updateEvent(e),this.updateNativeEvents(e),n||t||r||this.updateRect("",!1,!0),this.updateCheckInput()},n.componentDidUpdate=function(e){this.updateNativeEvents(e),this.updateEvent(e),this.updateCheckInput()},n.componentWillUnmount=function(){this.isUnmounted=!0,Le(this,"targetGesto"),Le(this,"controlGesto");var e=this.events;for(var t in e){var n=e[t];n&&n.destroy()}},n.getContainer=function(){var e=this.props,t=e.parentMoveable,n=e.wrapperMoveable;return e.container||n&&n.getContainer()||t&&t.getContainer()||this.controlBox.getElement().parentElement},n.isMoveableElement=function(e){return e&&(e.getAttribute("class")||"").indexOf(re)>-1},n.dragStart=function(e){return this.targetGesto&&this.targetGesto.triggerDragStart(e),this},n.hitTest=function(e){var t,n=this.state,r=n.target,i=n.pos1,o=n.pos2,a=n.pos3,A=n.pos4,s=n.targetClientRect;if(!r)return 0;if(e instanceof Element){var u=e.getBoundingClientRect();t={left:u.left,top:u.top,width:u.width,height:u.height}}else t=$({width:0,height:0},e);var l=t.left,c=t.top,f=t.width,d=t.height,p=Object(N.a)([i,o,A,a],s),h=Object(N.e)(p,[[l,c],[l+f,c],[l+f,c+d],[l,c+d]]),g=Object(N.b)(p);return h&&g?Math.min(100,h/g*100):0},n.isInside=function(e,t){var n=this.state,r=n.target,i=n.pos1,o=n.pos2,a=n.pos3,A=n.pos4,s=n.targetClientRect;return!!r&&Object(N.f)([e,t],Object(N.a)([i,o,A,a],s))},n.updateRect=function(e,t,n){void 0===n&&(n=!0);var r=this.props,i=r.parentMoveable,o=this.state,a=o.target||this.props.target,A=this.getContainer(),s=i?i.props.rootContainer:r.rootContainer;this.updateState(Me(this.controlBox&&this.controlBox.getElement(),a,A,A,s||A,t?o:void 0),!i&&n)},n.isTargetChanged=function(e,t){var n=this.props,r=n.dragTarget||n.target,i=e.dragTarget||e.target,o=n.dragArea,a=e.dragArea;return!o&&i!==r||(t||o)&&a!==o},n.updateNativeEvents=function(e){var t=this,n=this.props.dragArea?this.areaElement:this.state.target,r=this.events,i=m(r);if(this.isTargetChanged(e))for(var o in r){var a=r[o];a&&a.destroy(),r[o]=null}if(n){var A=this.enabledAbles;i.forEach((function(e){var i=Ve(A,[e]),o=i.length>0,a=r[e];o?(a||(a=new _r(n,t,e),r[e]=a),a.setAbles(i)):a&&(a.destroy(),r[e]=null)}))}},n.updateEvent=function(e){var t=this.controlBox.getElement(),n=this.targetAbles.length,r=this.controlAbles.length,i=this.props,o=i.dragTarget||i.target,a=this.isTargetChanged(e,!0),A=!n&&this.targetGesto||a;A&&(Le(this,"targetGesto"),this.updateState({gesto:null})),r||Le(this,"controlGesto"),o&&n&&!this.targetGesto&&(this.targetGesto=Tr(this,o,"")),!this.controlGesto&&r&&(this.controlGesto=Nr(this,t,"controlAbles","Control")),A&&this.unsetAbles()},n.isDragging=function(){return!!this.targetGesto&&this.targetGesto.isFlag()||!!this.controlGesto&&this.controlGesto.isFlag()},n.updateTarget=function(e){this.updateRect(e,!0)},n.getRect=function(){var e=this.state,t=ke(this.state),n=t[0],r=t[1],i=t[2],o=t[3],a=Fe(t),A=e.width,s=e.height,u=a.width,l=a.height,c=a.left,f=a.top,d=[e.left,e.top],p=Object(S.s)(d,e.origin);return{width:u,height:l,left:c,top:f,pos1:n,pos2:r,pos3:i,pos4:o,offsetWidth:A,offsetHeight:s,beforeOrigin:Object(S.s)(d,e.beforeOrigin),origin:p,transformOrigin:e.transformOrigin,rotation:this.getRotation()}},n.getManager=function(){return this},n.getRotation=function(){var e=this.state,t=e.pos1,n=e.pos2,r=e.direction,i=C(t,n)/Math.PI*180;return i=(i=r>=0?i:180-i)>=0?i:360+i},n.request=function(e,t,n){void 0===t&&(t={});var r=this.props,i=r.ables,o=r.groupable,a=i.filter((function(t){return t.name===e}))[0];if(this.isDragging()||!a||!a.request)return{request:function(){return this},requestEnd:function(){return this}};var A=this,s=a.request(this),u=n||t.isInstant,l=s.isControl?"controlAbles":"targetAbles",c=(o?"Group":"")+(s.isControl?"Control":""),f={request:function(t){return Hr(A,l,"drag",c,"",$($({},s.request(t)),{requestAble:e,isRequest:!0}),u),this},requestEnd:function(){return Hr(A,l,"drag",c,"End",$($({},s.requestEnd()),{requestAble:e,isRequest:!0}),u),this}};return Hr(A,l,"drag",c,"Start",$($({},s.requestStart(t)),{requestAble:e,isRequest:!0}),u),u?f.request(t).requestEnd():f},n.destroy=function(){this.componentWillUnmount()},n.updateRenderPoses=function(){var e=this.state,t=this.props,n=e.beforeOrigin,r=e.transformOrigin,i=e.allMatrix,o=e.is3d,a=e.pos1,A=e.pos2,s=e.pos3,u=e.pos4,l=e.left,c=e.top,f=t.padding||{},d=f.left,p=void 0===d?0:d,h=f.top,g=void 0===h?0:h,v=f.bottom,B=void 0===v?0:v,m=f.right,b=void 0===m?0:m,w=o?4:3,E=t.groupable?n:Object(S.s)(n,[l,c]);e.renderPoses=[Object(S.s)(a,nt(i,[-p,-g],r,E,w)),Object(S.s)(A,nt(i,[b,-g],r,E,w)),Object(S.s)(s,nt(i,[-p,B],r,E,w)),Object(S.s)(u,nt(i,[b,B],r,E,w))]},n.checkUpdate=function(){var e=this.props,t=e.target,n=e.container,r=e.parentMoveable,i=this.state,o=i.target,a=i.container;(o||t)&&(this.updateAbles(),(!Je(o,t)||!Je(a,n))&&(this.updateState({target:t,container:n}),r||!n&&!this.controlBox||this.updateRect("End",!1,!1)))},n.triggerEvent=function(e,t){var n=this.props[e];return n&&n(t)},n.unsetAbles=function(){var e=this;this.targetAbles.filter((function(t){return!!t.unset&&(t.unset(e),!0)})).length&&this.forceUpdate()},n.updateAbles=function(e,t){void 0===e&&(e=this.props.ables),void 0===t&&(t="");var n=this.props,r=n.triggerAblesSimultaneously,i=e.filter((function(e){return e&&(e.always||n[e.name])})),o="drag"+t+"ControlStart",a=Ve(i,["drag"+t+"Start","pinch"+t+"Start"],r),A=Ve(i,[o],r);this.enabledAbles=i,this.targetAbles=a,this.controlAbles=A},n.updateState=function(e,t){if(t)this.setState(e);else{var n=this.state;for(var r in e)n[r]=e[r]}},n.getEnabledAbles=function(){var e=this.props;return e.ables.filter((function(t){return t&&e[t.name]}))},n.renderAbles=function(){var e=this,t=this.props.triggerAblesSimultaneously,n={createElement:M.createElement};return function(e,t){var n=[],r={};return e.forEach((function(i,o){var a=t(i,o,e),A=r[a];A||(A=[],r[a]=A,n.push(A)),A.push(i)})),n}($e(Ve(this.getEnabledAbles(),["render"],t).map((function(t){return(0,t.render)(e,n)||[]}))).filter((function(e){return e})),(function(e){return e.key})).map((function(e){return e[0]}))},n.updateCheckInput=function(){this.targetGesto&&(this.targetGesto.options.checkInput=this.props.checkInput)},t.defaultProps={target:null,dragTarget:null,container:null,rootContainer:null,origin:!0,edge:!1,parentMoveable:null,wrapperMoveable:null,parentPosition:null,ables:[],pinchThreshold:20,dragArea:!1,passDragArea:!1,transformOrigin:"",className:"",zoom:1,triggerAblesSimultaneously:!1,padding:{},pinchOutside:!0,checkInput:!1,groupable:!1,cspNonce:"",translateZ:50,cssStyled:null,props:{}},t}(M.PureComponent),Dr={name:"groupable",props:{defaultGroupRotate:Number,defaultGroupOrigin:String,groupable:Boolean},events:{},render:function(e,t){var n=e.props.targets||[];e.moveables=[];var r=e.state,o={left:r.left,top:r.top};return n.map((function(n,r){return t.createElement(Mr,{key:"moveable"+r,ref:Object(i.e)(e,"moveables",r),target:n,origin:!1,cssStyled:e.props.cssStyled,parentMoveable:e,parentPosition:o})}))}};function Rr(e){var t=e.originalDatas.draggable;return t||(e.originalDatas.draggable={},t=e.originalDatas.draggable),$($({},e),{datas:t})}var Pr={name:"edgeDraggable",props:{edgeDraggable:Boolean},events:{},dragControlCondition:function(e,t){if(!t.props.edgeDraggable||!e.inputEvent)return!1;var n=e.inputEvent.target;return x(n,fe("direction"))&&x(n,fe("line"))},dragControlStart:function(e,t){return _n.dragStart(e,Rr(t))},dragControl:function(e,t){return _n.drag(e,Rr(t))},dragControlEnd:function(e,t){return _n.dragEnd(e,Rr(t))},dragGroupControlCondition:function(e,t){if(!t.props.edgeDraggable||!e.inputEvent)return!1;var n=e.inputEvent.target;return x(n,fe("direction"))&&x(n,fe("line"))},dragGroupControlStart:function(e,t){return _n.dragGroupStart(e,Rr(t))},dragGroupControl:function(e,t){return _n.dragGroup(e,Rr(t))},dragGroupControlEnd:function(e,t){return _n.dragGroupEnd(e,Rr(t))},unset:function(e){e.state.dragInfo=null}},kr={name:"individualGroupable",props:{individualGroupable:Boolean},events:{}},Ir=[Sr,or,Nn,st,_n,Pr,In,Xn,Gn,Wn,ir,ar,nr,Qr,Cr,Ur,Dr,kr,{name:"clickable",props:{},events:{onClick:"click",onClickGroup:"clickGroup"},always:!0,dragStart:function(){},dragGroupStart:function(e,t){t.datas.inputTarget=t.inputEvent&&t.inputEvent.target},dragEnd:function(e,t){var n=e.state.target,r=t.inputEvent,i=t.inputTarget;if(r&&i&&!t.isDrag&&!e.isMoveableElement(i)){var o=n.contains(i);Xe(e,"onClick",ze(e,t,{isDouble:t.isDouble,inputTarget:i,isTarget:n===i,containsTarget:o}))}},dragGroupEnd:function(e,t){var n=t.inputEvent,r=t.inputTarget;if(n&&r&&!t.isDrag&&!e.isMoveableElement(r)&&t.datas.inputTarget!==r){var i=e.props.targets,o=i.indexOf(r),a=o>-1,A=!1;-1===o&&(A=(o=B(i,(function(e){return e.contains(r)})))>-1),Xe(e,"onClickGroup",ze(e,t,{isDouble:t.isDouble,targets:i,inputTarget:r,targetIndex:o,isTarget:a,containsTarget:A}))}}},tr,Or],Kr=Ir.reduce((function(e,t){return $($({},e),t.events)}),{}),Lr=Ir.reduce((function(e,t){return $($({},e),t.props)}),{}),zr=at(Kr);Object.keys(zr),Object.keys(Lr);function jr(e,t){return Math.max.apply(Math,e.map((function(e){var n=e[0],r=e[1],i=e[2],o=e[3];return Math.max(n[t],r[t],i[t],o[t])})))}function Xr(e,t){return Math.min.apply(Math,e.map((function(e){var n=e[0],r=e[1],i=e[2],o=e[3];return Math.min(n[t],r[t],i[t],o[t])})))}var Gr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.differ=new Y.a,t.moveables=[],t.transformOrigin="50% 50%",t}q(t,e);var n=t.prototype;return n.updateEvent=function(e){var t=this.state,n=this.props;t.target||(t.target=this.areaElement,this.controlBox.getElement().style.display="block",this.targetGesto=Tr(this,t.target,"Group"),this.controlGesto=Nr(this,this.controlBox.getElement(),"controlAbles","GroupControl"));var r=!Je(e.container,n.container);r&&(t.container=n.container);var i=this.differ.update(n.targets),o=i.added,a=i.changed,A=i.removed;(r||o.length||a.length||A.length)&&this.updateRect()},n.checkUpdate=function(){this.updateAbles()},n.updateRect=function(e,t,n){var r;if(void 0===n&&(n=!0),this.controlBox){this.moveables.forEach((function(t){t.updateRect(e,!1,!1)}));var i=this.state,o=this.props,a=i.target||o.target;(!t||""!==e&&o.updateGroup)&&(this.rotation=o.defaultGroupRotate,this.transformOrigin=o.defaultGroupOrigin||"50% 50%",this.scale=[1,1]);var A=this.rotation,s=this.scale,u=function(e,t){if(!e.length)return[0,0,0,0];var n=e.map((function(e){return ke(e.state)})),r=ae,i=ae,o=0,a=0,A=Ie(t,1e-7);if(A%90){var s=t/180*Math.PI,u=Math.tan(s),l=-1/u,c=[Ae,ae],f=[Ae,ae];n.forEach((function(e){e.forEach((function(e){var t=e[1]-u*e[0],n=e[1]-l*e[0];c[0]=Math.max(c[0],t),c[1]=Math.min(c[1],t),f[0]=Math.max(f[0],n),f[1]=Math.min(f[1],n)}))})),c.forEach((function(e){f.forEach((function(t){var n=(t-e)/(u-l),o=u*n+e;r=Math.min(r,n),i=Math.min(i,o)}))}));var d=n.map((function(e){var t=e[0],n=e[1],r=e[2],i=e[3];return[Object(S.t)(t,-s),Object(S.t)(n,-s),Object(S.t)(r,-s),Object(S.t)(i,-s)]}));o=jr(d,0)-Xr(d,0),a=jr(d,1)-Xr(d,1)}else if(r=Xr(n,0),i=Xr(n,1),o=jr(n,0)-r,a=jr(n,1)-i,A%180){var p=o;o=a,a=p}return[r,i,o,a]}(this.moveables,A),l=u[0],c=u[1],f=u[2],d=u[3];a.style.cssText+="left:0px;top:0px; transform-origin: "+this.transformOrigin+"; width:"+f+"px; height:"+d+"px;transform:rotate("+A+"deg) scale("+(s[0]>=0?1:-1)+", "+(s[1]>=0?1:-1)+")",i.width=f,i.height=d;var p=this.getContainer(),h=Me(this.controlBox.getElement(),a,this.controlBox.getElement(),this.getContainer(),this.props.rootContainer||p,i),g=[h.left,h.top];r=ke(h),h.pos1=r[0],h.pos2=r[1],h.pos3=r[2],h.pos4=r[3],h.origin=Object(S.s)(g,h.origin),h.beforeOrigin=Object(S.s)(g,h.beforeOrigin);var v=h.targetClientRect;v.top+=c-h.top-i.top,v.left+=l-h.left-i.left;var B=s[0]*s[1]>0?1:-1;this.updateState($($({},h),{direction:B,beforeDirection:B,left:l-h.left,top:c-h.top}),n)}},n.getRect=function(){return $($({},e.prototype.getRect.call(this)),{children:this.moveables.map((function(e){return e.getRect()}))})},n.triggerEvent=function(t,n,r){if(r||t.indexOf("Group")>-1)return e.prototype.triggerEvent.call(this,t,n)},n.updateAbles=function(){e.prototype.updateAbles.call(this,Z(this.props.ables,[Dr]),"Group")},t.defaultProps=$($({},Mr.defaultProps),{transformOrigin:["50%","50%"],groupable:!0,dragArea:!0,keepRatio:!0,targets:[],defaultGroupRotate:0,defaultGroupOrigin:"50% 50%"}),t}(Mr),Vr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.moveables=[],t}q(t,e);var n=t.prototype;return n.render=function(){var e=this,t=this.props,n=t.cspNonce,r=t.cssStyled,o=t.targets;return Object(M.createElement)(r,{cspNonce:n,ref:Object(i.d)(this,"controlBox"),className:fe("control-box")},o.map((function(t,n){return Object(M.createElement)(Mr,$({key:"moveable"+n,ref:Object(i.e)(e,"moveables",n)},e.props,{target:t,wrapperMoveable:e}))})))},n.componentDidUpdate=function(){},n.updateRect=function(e,t,n){void 0===n&&(n=!0),this.moveables.forEach((function(r){r.updateRect(e,t,n)}))},n.getRect=function(){return $($({},e.prototype.getRect.call(this)),{children:this.moveables.map((function(e){return e.getRect()}))})},n.request=function(){return{request:function(){return this},requestEnd:function(){return this}}},n.dragStart=function(){return this},n.hitTest=function(){return 0},n.isInside=function(){return!1},n.isDragging=function(){return!1},n.updateRenderPoses=function(){},n.updateEvent=function(){},n.checkUpdate=function(){},n.triggerEvent=function(){},n.updateAbles=function(){},t}(Mr),Yr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.refTargets=[],t.selectorMap={},t}q(t,e);var n=t.prototype;return t.makeStyled=function(){var e={};this.getTotalAbles().forEach((function(t){var n=t.css;n&&n.forEach((function(t){e[t]=!0}))}));var t=m(e).join("\n");this.defaultStyled=Object(W.a)("div",Object(i.b)(re,ie+t))},t.getTotalAbles=function(){return Z([or,Dr,kr,tr],this.defaultAbles)},n.render=function(){var e=this.constructor;e.defaultStyled||e.makeStyled();var t=this.props,n=t.ables,r=t.props,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1,u=Z(e.getTotalAbles(),n||[]),c=$($($({},o),r||{}),{ables:u});return s?o.individualGroupable?Object(M.createElement)(Vr,$({key:"individual-group",ref:Object(i.d)(this,"moveable"),cssStyled:e.defaultStyled},c,{target:null,targets:A})):Object(M.createElement)(Gr,$({key:"group",ref:Object(i.d)(this,"moveable"),cssStyled:e.defaultStyled},c,{target:null,targets:A})):Object(M.createElement)(Mr,$({key:"single",ref:Object(i.d)(this,"moveable"),cssStyled:e.defaultStyled},c,{target:A[0]}))},n.componentDidMount=function(){this.updateRefs()},n.componentDidUpdate=function(){this.updateRefs()},n.updateRefs=function(e){var t=At(this.props.target||this.props.targets),n=this.refTargets.some((function(e,n){var r=t[n];return!(!e&&!r)&&e!==r})),r=e?{}:this.selectorMap,i={};this.refTargets.forEach((function(e){l(e)&&(r[e]?i[e]=r[e]:(n=!0,i[e]=[].slice.call(document.querySelectorAll(e))))})),this.selectorMap=i,n&&this.forceUpdate()},n.getManager=function(){return this.moveable},t.defaultAbles=[],t.defaultStyled=null,function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var A=e.length-1;A>=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([Object(i.f)(ce)],t.prototype,"moveable",void 0),t}(M.PureComponent),Wr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return q(t,e),t.defaultAbles=Ir,t}(Yr);t.a=Wr},function(e,t,n){"use strict";n.d(t,"b",(function(){return A}));var r=n(43),i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var o="function"===typeof Map?void 0:function(){var e=0;return function(t){return t.__DIFF_KEY__||(t.__DIFF_KEY__=++e)}}(),a=function(e){function t(t){return void 0===t&&(t=[]),e.call(this,t,o)||this}return function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(r.a);function A(e,t){return Object(r.b)(e,t,o)}t.a=a},function(e,t,n){var r=n(66),i=n(62);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=e.length,r=0;r-1&&r.splice(o,1)}}else this._events[e]=[];else this._events={};return this},t.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})}))},t.emit=function(e,t){var n=this;void 0===t&&(t={});var r=this._events[e];if(!e||!r)return!0;var i=!1;return t.eventType=e,t.stop=function(){i=!0},t.currentTarget=this,function(){for(var e=0,t=0,n=arguments.length;t1&&this.trigger(e+"."+i.join("."),r)},t}(l);t.a=m},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(55);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,A=e[Symbol.iterator]();!(r=(a=A.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==A.return||A.return()}finally{if(i)throw o}}return n}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){var r=n(21).Symbol;e.exports=r},function(e,t,n){var r=n(81),i=n(139),o=n(30);e.exports=function(e){return o(e)?r(e):i(e)}},function(e,t){e.exports=function(e,t){return e===t||e!==e&&t!==t}},function(e,t,n){var r=n(100),i=n(72);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var A=-1,s=t.length;++Ae.length)&&(t=e.length);for(var n=0,r=new Array(t);no-u?(h[1]>p.top||oh[1])&&(B[1]=1),p.left>r-u?(h[0]>p.left||rh[0])&&(B[0]=1),clearTimeout(this.timer),!B[0]&&!B[1])return!1;if(v>0)return this.timer=window.setTimeout((function(){n.drag(e,t)}),v),!1;this.prevTime=g;var m=d({container:A,direction:B});this.trigger("scroll",{container:A,direction:B,inputEvent:e});var b=d({container:A,direction:B}),w=b[0]-m[0],E=b[1]-m[1];return!(!w&&!E)&&(this.trigger("move",{offsetX:B[0]?w:0,offsetY:B[1]?E:0,inputEvent:e}),c&&(this.timer=window.setTimeout((function(){n.drag(e,t)}),c)),!0)},n.dragEnd=function(){clearTimeout(this.timer)},t}(r.a);t.a=A},function(e,t,n){var r=n(79),i=n(83);e.exports=function(e,t){return e&&r(e,i(t))}},function(e,t,n){var r=n(136),i=n(22),o=Object.prototype,a=o.hasOwnProperty,A=o.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!A.call(e,"callee")};e.exports=s},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(78),i=t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,A=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(t){}}();e.exports=A}).call(this,n(59)(e))},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(26),i=n(20);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(82)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(27)(n(21),"Map");e.exports=r},function(e,t,n){var r=n(158),i=n(165),o=n(167),a=n(168),A=n(169);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=-g&&b=h)){var F=0===Q?d?c:l:Q%2===0?10:7,U=d?[x,p?0:c-F]:[p?0:l-F,x],S=U[0],O=U[1],H=d?[S,O+F]:[S+F,O],T=H[0],N=H[1];f.moveTo(S,O),f.lineTo(T,N)}}}f.stroke(),f.restore()},t.defaultProps={type:"horizontal",zoom:1,width:0,height:0,unit:50,direction:"end",style:{width:"100%",height:"100%"},backgroundColor:"#333333",textColor:"#ffffff",lineColor:"#777777"},t}(r.PureComponent),A=n(13),s=("undefined"!==typeof document&&document,['"',"'",'\\"',"\\'"]);function u(e,t,n,r){for(var i=n;i-1&&(a=u(o,t,i+1,r)),-1===a)break;i=a}return-1}function l(e,t){for(var n=new RegExp("(\\s*"+(t||",")+"\\s*|\\(|\\)|\"|'|\\\\\"|\\\\'|\\s+)","g"),r=e.split(n).filter(Boolean),i=r.length,o=[],a=[],A=0;A-1)c=u(l,r,A+1,i);else if(l===t){a.length&&(o.push(a.join("")),a=[]);continue}}-1===c&&(c=i-1),a.push(r.slice(A,c+1).join("")),A=c}return a.length&&o.push(a.join("")),o}function c(e){return l(e,",")}function f(e){var t=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(e);return!t||t.length<4?{}:{prefix:t[1],value:t[2],suffix:t[3]}}function d(e){var t=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(e);if(!t)return{prefix:"",unit:"",value:NaN};var n=t[1],r=t[2];return{prefix:n,unit:t[3],value:parseFloat(r)}}function p(){return Date.now?Date.now():(new Date).getTime()}function h(e,t){e.classList?e.classList.add(t):e.className+=" "+t}function g(e,t){if(e.classList)e.classList.remove(t);else{var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}}function v(e,t,n,r){e.addEventListener(t,n,r)}function B(e,t,n){e.removeEventListener(t,n)}var m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var b=function(){return(b=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0?i:i+2*Math.PI}([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function E(e){return e.touches?function(e){for(var t=Math.min(e.length,2),n=[],r=0;r-1,g=f.isContentEditable;if(h||g){if(s||c===f)return!1;if(c&&g&&c.isContentEditable&&c.contains(f))return!1}else if((A||"touchstart"===e.type)&&c){var m=c.tagName;(c.isContentEditable||U.indexOf(m)>-1)&&c.blur()}if(r.clientStores=[new F(E(e))],r.flag=!0,r.isDrag=!1,r.datas={},a&&(3===e.which||2===e.button))return r.initDrag(),!1;!1===r.emit("dragStart",b({datas:r.datas,inputEvent:e,isTrusted:t},r.getCurrentStore().getPosition()))&&r.initDrag(),r.isDouble=p()-r.prevTime<200,r.flag&&A&&e.preventDefault()}if(!r.flag)return!1;var w=0;if(l&&u&&o&&(w=setTimeout((function(){v(i,"touchstart",r.onDragStart,{passive:!1})}))),!l&&u&&o&&B(i,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(w),l&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=E(e),i=r.moveClients(n,e,!1);(r.pinchFlag||i.deltaX||i.deltaY)&&r.emit("drag",b({},i,{isScroll:!!t,inputEvent:e})),r.pinchFlag&&r.onPinch(e,n),r.getCurrentStore().addClients(n)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,i=t.container;r.isTouch&&n&&B(i,"touchstart",r.onDragStart),r.flag=!1;var o=r.getCurrentStore().getPosition(),a=p(),A=!r.isDrag&&r.isDouble;r.prevTime=r.isDrag||A?0:a,r.emit("dragEnd",b({datas:r.datas,isDouble:A,isDrag:r.isDrag,inputEvent:e},o)),r.pinchFlag&&r.onPinchEnd(e),r.clientStores=[]}},r.onBlur=function(){r.onDragEnd()};var i=[].concat(t);r.options=b({checkInput:!1,container:i.length>1?window:i[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},n);var o=r.options,a=o.container,A=o.events,s=o.checkWindowBlur;if(r.isTouch=A.indexOf("touch")>-1,r.isMouse=A.indexOf("mouse")>-1,r.targets=i,r.isMouse&&(i.forEach((function(e){v(e,"mousedown",r.onDragStart)})),v(a,"mousemove",r.onDrag),v(a,"mouseup",r.onDragEnd),v(a,"contextmenu",r.onDragEnd)),s&&v(window,"blur",r.onBlur),r.isTouch){var u={passive:!1};i.forEach((function(e){v(e,"touchstart",r.onDragStart,u)})),v(a,"touchmove",r.onDrag,u),v(a,"touchend",r.onDragEnd,u),v(a,"touchcancel",r.onDragEnd,u)}return r}!function(e,t){function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(e){var t=e.clientX,i=e.clientY;return{clientX:t+n,clientY:i+r,originalClientX:t,originalClientY:i}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),B(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){B(t,"mousedown",e.onDragStart)})),B(n,"mousemove",this.onDrag),B(n,"mouseup",this.onDragEnd),B(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){B(t,"touchstart",e.onDragStart)})),B(n,"touchstart",this.onDragStart),B(n,"touchmove",this.onDrag),B(n,"touchend",this.onDragEnd),B(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new F(E(e));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",b({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",b({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",b({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition(),{inputEvent:e})),this.isPinch=!1,this.pinchFlag=!1}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](e);return this.isDrag=!0,b({datas:this.datas},r,{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},t}(A.a),O=n(11),H=n(1);function T(e){return function(e){var t=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return e.forEach((function(e){var n=e.matrixFunction,r=e.functionValue;n&&(t=n(t,r))})),t}(function(e){return(n=e,Array.isArray(n)?e:(t=e,l(t,""))).map((function(e){var t=f(e),n=t.prefix,r=t.value,i=null,o=n,a="";if("translate"===n||"translateX"===n||"translate3d"===n){var A=c(r).map((function(e){return parseFloat(e)})),s=A[0],u=A[1],l=void 0===u?0:u,p=A[2],h=void 0===p?0:p;i=H.y,a=[s,l,h]}else if("translateY"===n){l=parseFloat(r);i=H.y,a=[0,l,0]}else if("translateZ"===n){h=parseFloat(r);i=H.y,a=[0,0,h]}else if("scale"===n||"scale3d"===n){var g=c(r).map((function(e){return parseFloat(e)})),v=g[0],B=g[1],m=void 0===B?v:B,b=g[2],w=void 0===b?1:b;i=H.x,a=[v,m,w]}else if("scaleX"===n){v=parseFloat(r);i=H.x,a=[v,1,1]}else if("scaleY"===n){m=parseFloat(r);i=H.x,a=[1,m,1]}else if("scaleZ"===n){w=parseFloat(r);i=H.x,a=[1,1,w]}else if("rotate"===n||"rotateZ"===n||"rotateX"===n||"rotateY"===n){var E=d(r),y=E.unit,C=E.value,Q="rad"===y?C:C*Math.PI/180;"rotate"===n||"rotateZ"===n?(o="rotateZ",i=H.w):"rotateX"===n?i=H.u:"rotateY"===n&&(i=H.v),a=Q}else if("matrix3d"===n)i=H.o,a=c(r).map((function(e){return parseFloat(e)}));else if("matrix"===n){var x=c(r).map((function(e){return parseFloat(e)}));i=H.o,a=[x[0],x[1],0,0,x[2],x[3],0,0,0,0,1,0,x[4],x[5],0,1]}else o="";return{name:n,functionName:o,value:r,matrixFunction:i,functionValue:a}}));var t;var n}(e))}function N(e,t){var n=Object(H.a)(e,[t[0],t[1]||0,t[2]||0,1],4),r=n[3]||1;return[n[0]/r,n[1]/r,n[2]/r]}var _=function(e,t){return(_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var M=function(){return(M=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=t.scrollPos&&A.indexOf(d)<0&&t.setState({guides:A.concat([d])},(function(){l({guides:t.state.guides,distX:i,distY:o}),u(t.state.guides)}));else{var p=n.target.getAttribute("data-index");if(r||d-1)return;A[p]=d}t.setState({guides:A.slice()},(function(){var e=t.state.guides;u(e),l({distX:i,distY:o,guides:e})}))}},t}!function(e,t){function n(){this.constructor=e}_(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.render=function(){var e=this.props,t=e.className,n=e.type,o=e.width,A=e.height,s=e.unit,u=e.zoom,l=e.style,c=e.rulerStyle,f=e.backgroundColor,d=e.lineColor,p=e.textColor,h=e.direction,g=e.textFormat,v=e.displayDragPos,B=e.cspNonce,m=this.getTranslateName();return Object(r.createElement)(z,{ref:Object(i.d)(this,"manager"),cspNonce:B,className:D("manager",n)+" "+t,style:l},Object(r.createElement)("div",{className:D("guide-origin"),ref:Object(i.d)(this,"originElement")}),Object(r.createElement)(a,{ref:Object(i.d)(this,"ruler"),type:n,width:o,height:A,unit:s,zoom:u,backgroundColor:f,lineColor:d,style:c,textColor:p,direction:h,textFormat:g}),Object(r.createElement)("div",{className:P,ref:Object(i.d)(this,"guidesElement"),style:{transform:m+"("+-this.scrollPos*u+"px)"}},v&&Object(r.createElement)("div",{className:K,ref:Object(i.d)(this,"displayElement")}),Object(r.createElement)("div",{className:R,ref:Object(i.d)(this,"adderElement")}),this.renderGuides()))},n.renderGuides=function(){var e=this,t=this.props,n=t.type,o=t.zoom,a=t.showGuides,A=this.getTranslateName(),s=this.state.guides;if(this.guideElements=[],a)return s.map((function(t,a){return Object(r.createElement)("div",{className:D("guide",n),ref:Object(i.e)(e,"guideElements",a),key:a,"data-index":a,"data-pos":t,style:{transform:A+"("+t*o+"px)"}})}))},n.componentDidMount=function(){var e=this;this.gesto=new S(this.manager.getElement(),{container:document.body}).on("dragStart",(function(t){var n,r,i=t.inputEvent.target,o=t.datas,a=e.ruler.canvasElement,A=e.guidesElement,s="horizontal"===e.props.type,u=e.originElement.getBoundingClientRect(),l=function(e,t){void 0===t&&(t=document.body);for(var n=e,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];n;){var i=getComputedStyle(n).transform;if(r=Object(H.o)(T(i),r),n===t)break;n=n.parentElement}return(r=Object(H.n)(r,4))[12]=0,r[13]=0,r[14]=0,r}(e.manager.getElement()),c=N(l,[t.clientX-u.left,t.clientY-u.top]);if(c[0]-=A.offsetLeft,c[1]-=A.offsetTop,c[s?1:0]+=e.scrollPos*e.props.zoom,o.offsetPos=c,o.matrix=l,i===a)o.fromRuler=!0,o.target=e.adderElement;else{if(r=k,!((n=i).classList?n.classList.contains(r):n.className.match(new RegExp("(\\s|^)"+r+"(\\s|$)"))))return t.stop(),!1;o.target=i}e.onDragStart(t)})).on("drag",this.onDrag).on("dragEnd",this.onDragEnd),this.setState({guides:this.props.defaultGuides||[]})},n.componentWillUnmount=function(){this.gesto.unset()},n.componentDidUpdate=function(e){e.defaultGuides!==this.props.defaultGuides&&this.setState({guides:this.props.defaultGuides||[]})},n.loadGuides=function(e){this.setState({guides:e})},n.getGuides=function(){return this.state.guides},n.scrollGuides=function(e){var t=this.props.zoom,n=this.guidesElement;this.scrollPos=e,n.style.transform=this.getTranslateName()+"("+-e*t+"px)";var r=this.state.guides;this.guideElements.forEach((function(t,n){t&&(t.style.display=-e+r[n]<0?"none":"block")}))},n.resize=function(){this.ruler.resize()},n.scroll=function(e){this.ruler.scroll(e)},n.movePos=function(e){var t=e.datas,n=e.distX,r=e.distY,i=this.props,o=i.type,a=i.zoom,A=i.snaps,s=i.snapThreshold,u=i.displayDragPos,l=i.dragPosFormat,c="horizontal"===o,f=N(t.matrix,[n,r]),d=t.offsetPos,p=f[0]+d[0],h=f[1]+d[1],g=Math.round(c?h:p),v=Math.round(g/a),B=A.slice().sort((function(e,t){return Math.abs(v-e)-Math.abs(v-t)}));if(B.length&&Math.abs(B[0]-v)l))return!1;var f=s.get(e),d=s.get(t);if(f&&d)return f==t&&d==e;var p=-1,h=!0,g=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++p=t||n<0||g&&e-p>=l}function w(){var e=i();if(b(e))return E(e);f=setTimeout(w,function(e){var n=t-(e-d);return g?A(n,l-(e-p)):n}(e))}function E(e){return f=void 0,v&&s?B(e):(s=u=void 0,c)}function y(){var e=i(),n=b(e);if(s=arguments,u=this,d=e,n){if(void 0===f)return m(d);if(g)return clearTimeout(f),f=setTimeout(w,t),B(d)}return void 0===f&&(f=setTimeout(w,t)),c}return t=o(t)||0,r(n)&&(h=!!n.leading,l=(g="maxWait"in n)?a(o(n.maxWait)||0,t):l,v="trailing"in n?!!n.trailing:v),y.cancel=function(){void 0!==f&&clearTimeout(f),p=0,s=d=u=f=void 0},y.flush=function(){return void 0===f?c:E(i())},y}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorWrap=void 0;var r=Object.assign||function(e){for(var t=1;t=0?i:i+2*Math.PI}([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function s(e){return e.touches?function(e){for(var t=Math.min(e.length,2),n=[],r=0;r-1,b=v.isContentEditable;if(m||b){if(c||g===v)return!1;if(g&&b&&g.isContentEditable&&g.contains(v))return!1}else if((l||"touchstart"===e.type)&&g){var w=g.tagName;(g.isContentEditable||p.indexOf(w)>-1)&&g.blur()}if(r.clientStores=[new d(s(e))],r.flag=!0,r.isDrag=!1,r.datas={},u&&(3===e.which||2===e.button))return r.initDrag(),!1;!1===r.emit("dragStart",a({datas:r.datas,inputEvent:e,isTrusted:t},r.getCurrentStore().getPosition()))&&r.initDrag(),r.isDouble=Object(i.H)()-r.prevTime<200,r.flag&&l&&e.preventDefault()}if(!r.flag)return!1;var E=0;if(h&&f&&A&&(E=setTimeout((function(){Object(i.p)(o,"touchstart",r.onDragStart,{passive:!1})}))),!h&&f&&A&&Object(i.J)(o,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(E),h&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=s(e),i=r.moveClients(n,e,!1);(r.pinchFlag||i.deltaX||i.deltaY)&&r.emit("drag",a({},i,{isScroll:!!t,inputEvent:e})),r.pinchFlag&&r.onPinch(e,n),r.getCurrentStore().addClients(n)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,o=t.container;r.isTouch&&n&&Object(i.J)(o,"touchstart",r.onDragStart),r.flag=!1;var A=r.getCurrentStore().getPosition(),s=Object(i.H)(),u=!r.isDrag&&r.isDouble;r.prevTime=r.isDrag||u?0:s,r.emit("dragEnd",a({datas:r.datas,isDouble:u,isDrag:r.isDrag,inputEvent:e},A)),r.pinchFlag&&r.onPinchEnd(e),r.clientStores=[]}},r.onBlur=function(){r.onDragEnd()};var o=[].concat(t);r.options=a({checkInput:!1,container:o.length>1?window:o[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},n);var A=r.options,u=A.container,l=A.events,c=A.checkWindowBlur;if(r.isTouch=l.indexOf("touch")>-1,r.isMouse=l.indexOf("mouse")>-1,r.targets=o,r.isMouse&&(o.forEach((function(e){Object(i.p)(e,"mousedown",r.onDragStart)})),Object(i.p)(u,"mousemove",r.onDrag),Object(i.p)(u,"mouseup",r.onDragEnd),Object(i.p)(u,"contextmenu",r.onDragEnd)),c&&Object(i.p)(window,"blur",r.onBlur),r.isTouch){var f={passive:!1};o.forEach((function(e){Object(i.p)(e,"touchstart",r.onDragStart,f)})),Object(i.p)(u,"touchmove",r.onDrag,f),Object(i.p)(u,"touchend",r.onDragEnd,f),Object(i.p)(u,"touchcancel",r.onDragEnd,f)}return r}!function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(e){var t=e.clientX,i=e.clientY;return{clientX:t+n,clientY:i+r,originalClientX:t,originalClientY:i}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),Object(i.J)(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){Object(i.J)(t,"mousedown",e.onDragStart)})),Object(i.J)(n,"mousemove",this.onDrag),Object(i.J)(n,"mouseup",this.onDragEnd),Object(i.J)(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){Object(i.J)(t,"touchstart",e.onDragStart)})),Object(i.J)(n,"touchstart",this.onDragStart),Object(i.J)(n,"touchmove",this.onDrag),Object(i.J)(n,"touchend",this.onDragEnd),Object(i.J)(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new d(s(e));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",a({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",a({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",a({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition(),{inputEvent:e})),this.isPinch=!1,this.pinchFlag=!1}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](e);return this.isDrag=!0,a({datas:this.datas},r,{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},t}(r.a);t.a=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomPicker=t.TwitterPicker=t.SwatchesPicker=t.SliderPicker=t.SketchPicker=t.PhotoshopPicker=t.MaterialPicker=t.HuePicker=t.GithubPicker=t.CompactPicker=t.ChromePicker=t.default=t.CirclePicker=t.BlockPicker=t.AlphaPicker=void 0;var r=n(128);Object.defineProperty(t,"AlphaPicker",{enumerable:!0,get:function(){return B(r).default}});var i=n(258);Object.defineProperty(t,"BlockPicker",{enumerable:!0,get:function(){return B(i).default}});var o=n(260);Object.defineProperty(t,"CirclePicker",{enumerable:!0,get:function(){return B(o).default}});var a=n(262);Object.defineProperty(t,"ChromePicker",{enumerable:!0,get:function(){return B(a).default}});var A=n(268);Object.defineProperty(t,"CompactPicker",{enumerable:!0,get:function(){return B(A).default}});var s=n(271);Object.defineProperty(t,"GithubPicker",{enumerable:!0,get:function(){return B(s).default}});var u=n(273);Object.defineProperty(t,"HuePicker",{enumerable:!0,get:function(){return B(u).default}});var l=n(275);Object.defineProperty(t,"MaterialPicker",{enumerable:!0,get:function(){return B(l).default}});var c=n(276);Object.defineProperty(t,"PhotoshopPicker",{enumerable:!0,get:function(){return B(c).default}});var f=n(282);Object.defineProperty(t,"SketchPicker",{enumerable:!0,get:function(){return B(f).default}});var d=n(285);Object.defineProperty(t,"SliderPicker",{enumerable:!0,get:function(){return B(d).default}});var p=n(289);Object.defineProperty(t,"SwatchesPicker",{enumerable:!0,get:function(){return B(p).default}});var h=n(293);Object.defineProperty(t,"TwitterPicker",{enumerable:!0,get:function(){return B(h).default}});var g=n(110);Object.defineProperty(t,"CustomPicker",{enumerable:!0,get:function(){return B(g).default}});var v=B(a);function B(e){return e&&e.__esModule?e:{default:e}}t.default=v.default},function(e,t,n){e.exports=function(){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};function t(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=55296&&i<=56319&&n>10),a%1024+56320)),(i+1===n||r.length>16384)&&(o+=String.fromCharCode.apply(String,r),r.length=0)}return o},u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l="undefined"===typeof Uint8Array?[]:new Uint8Array(256),c=0;c=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>5])<<2)+(31&e),this.data[t];if(e<=65535)return t=((t=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[t];if(e>11),t=this.index[t],t+=e>>5&63,t=((t=this.index[t])<<2)+(31&e),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),h=10,g=13,v=15,B=17,m=18,b=19,w=20,E=21,y=22,C=24,Q=25,x=26,F=27,U=28,S=30,O=32,H=33,T=34,N=35,_=37,M=38,D=39,R=40,P=42,k=function(e){var t,n,r,i=function(e){var t,n,r,i,o,a=.75*e.length,A=e.length,s=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var u="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint8Array.prototype.slice?new ArrayBuffer(a):new Array(a),c=Array.isArray(u)?u:new Uint8Array(u);for(t=0;t>4,c[s++]=(15&r)<<4|i>>2,c[s++]=(3&i)<<6|63&o;return u}(e),o=Array.isArray(i)?function(e){for(var t=e.length,n=[],r=0;r0;){var a=r[--o];if(Array.isArray(e)?-1!==e.indexOf(a):e===a)for(var A=n;A<=r.length;){var s;if((s=r[++A])===t)return!0;if(s!==h)break}if(a!==h)break}return!1},Y=function(e,t){for(var n=e;n>=0;){var r=t[n];if(r!==h)return r;n--}return 0},W=function(e,t,n,r,i){if(0===n[r])return"\xd7";var o=r-1;if(Array.isArray(i)&&!0===i[o])return"\xd7";var a=o-1,A=o+1,s=t[o],u=a>=0?t[a]:0,l=t[A];if(2===s&&3===l)return"\xd7";if(-1!==K.indexOf(s))return"!";if(-1!==K.indexOf(l))return"\xd7";if(-1!==L.indexOf(l))return"\xd7";if(8===Y(o,t))return"\xf7";if(11===k.get(e[o])&&(l===_||l===O||l===H))return"\xd7";if(7===s||7===l)return"\xd7";if(9===s)return"\xd7";if(-1===[h,g,v].indexOf(s)&&9===l)return"\xd7";if(-1!==[B,m,b,C,U].indexOf(l))return"\xd7";if(Y(o,t)===y)return"\xd7";if(V(23,y,o,t))return"\xd7";if(V([B,m],E,o,t))return"\xd7";if(V(12,12,o,t))return"\xd7";if(s===h)return"\xf7";if(23===s||23===l)return"\xd7";if(16===l||16===s)return"\xf7";if(-1!==[g,v,E].indexOf(l)||14===s)return"\xd7";if(36===u&&-1!==G.indexOf(s))return"\xd7";if(s===U&&36===l)return"\xd7";if(l===w&&-1!==I.concat(w,b,Q,_,O,H).indexOf(s))return"\xd7";if(-1!==I.indexOf(l)&&s===Q||-1!==I.indexOf(s)&&l===Q)return"\xd7";if(s===F&&-1!==[_,O,H].indexOf(l)||-1!==[_,O,H].indexOf(s)&&l===x)return"\xd7";if(-1!==I.indexOf(s)&&-1!==z.indexOf(l)||-1!==z.indexOf(s)&&-1!==I.indexOf(l))return"\xd7";if(-1!==[F,x].indexOf(s)&&(l===Q||-1!==[y,v].indexOf(l)&&t[A+1]===Q)||-1!==[y,v].indexOf(s)&&l===Q||s===Q&&-1!==[Q,U,C].indexOf(l))return"\xd7";if(-1!==[Q,U,C,B,m].indexOf(l))for(var c=o;c>=0;){if((f=t[c])===Q)return"\xd7";if(-1===[U,C].indexOf(f))break;c--}if(-1!==[F,x].indexOf(l))for(c=-1!==[B,m].indexOf(s)?a:o;c>=0;){var f;if((f=t[c])===Q)return"\xd7";if(-1===[U,C].indexOf(f))break;c--}if(M===s&&-1!==[M,D,T,N].indexOf(l)||-1!==[D,T].indexOf(s)&&-1!==[D,R].indexOf(l)||-1!==[R,N].indexOf(s)&&l===R)return"\xd7";if(-1!==X.indexOf(s)&&-1!==[w,x].indexOf(l)||-1!==X.indexOf(l)&&s===F)return"\xd7";if(-1!==I.indexOf(s)&&-1!==I.indexOf(l))return"\xd7";if(s===C&&-1!==I.indexOf(l))return"\xd7";if(-1!==I.concat(Q).indexOf(s)&&l===y||-1!==I.concat(Q).indexOf(l)&&s===m)return"\xd7";if(41===s&&41===l){for(var d=n[o],p=1;d>0&&41===t[--d];)p++;if(p%2!==0)return"\xd7"}return s===O&&l===H?"\xd7":"\xf7"},J=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var n=function(e,t){void 0===t&&(t="strict");var n=[],r=[],i=[];return e.forEach((function(e,o){var a=k.get(e);if(a>50?(i.push(!0),a-=50):i.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return r.push(o),n.push(16);if(4===a||11===a){if(0===o)return r.push(o),n.push(S);var A=n[o-1];return-1===j.indexOf(A)?(r.push(r[o-1]),n.push(A)):(r.push(o),n.push(S))}return r.push(o),31===a?n.push("strict"===t?E:_):a===P||29===a?n.push(S):43===a?e>=131072&&e<=196605||e>=196608&&e<=262141?n.push(_):n.push(S):void n.push(a)})),[r,n,i]}(e,t.lineBreak),r=n[0],i=n[1],o=n[2];return"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(i=i.map((function(e){return-1!==[Q,S,P].indexOf(e)?_:e}))),[r,i,"keep-all"===t.wordBreak?o.map((function(t,n){return t&&e[n]>=19968&&e[n]<=40959})):void 0]},q=function(){function e(e,t,n,r){this.codePoints=e,this.required="!"===t,this.start=n,this.end=r}return e.prototype.slice=function(){return s.apply(void 0,this.codePoints.slice(this.start,this.end))},e}();!function(e){e[e.STRING_TOKEN=0]="STRING_TOKEN",e[e.BAD_STRING_TOKEN=1]="BAD_STRING_TOKEN",e[e.LEFT_PARENTHESIS_TOKEN=2]="LEFT_PARENTHESIS_TOKEN",e[e.RIGHT_PARENTHESIS_TOKEN=3]="RIGHT_PARENTHESIS_TOKEN",e[e.COMMA_TOKEN=4]="COMMA_TOKEN",e[e.HASH_TOKEN=5]="HASH_TOKEN",e[e.DELIM_TOKEN=6]="DELIM_TOKEN",e[e.AT_KEYWORD_TOKEN=7]="AT_KEYWORD_TOKEN",e[e.PREFIX_MATCH_TOKEN=8]="PREFIX_MATCH_TOKEN",e[e.DASH_MATCH_TOKEN=9]="DASH_MATCH_TOKEN",e[e.INCLUDE_MATCH_TOKEN=10]="INCLUDE_MATCH_TOKEN",e[e.LEFT_CURLY_BRACKET_TOKEN=11]="LEFT_CURLY_BRACKET_TOKEN",e[e.RIGHT_CURLY_BRACKET_TOKEN=12]="RIGHT_CURLY_BRACKET_TOKEN",e[e.SUFFIX_MATCH_TOKEN=13]="SUFFIX_MATCH_TOKEN",e[e.SUBSTRING_MATCH_TOKEN=14]="SUBSTRING_MATCH_TOKEN",e[e.DIMENSION_TOKEN=15]="DIMENSION_TOKEN",e[e.PERCENTAGE_TOKEN=16]="PERCENTAGE_TOKEN",e[e.NUMBER_TOKEN=17]="NUMBER_TOKEN",e[e.FUNCTION=18]="FUNCTION",e[e.FUNCTION_TOKEN=19]="FUNCTION_TOKEN",e[e.IDENT_TOKEN=20]="IDENT_TOKEN",e[e.COLUMN_TOKEN=21]="COLUMN_TOKEN",e[e.URL_TOKEN=22]="URL_TOKEN",e[e.BAD_URL_TOKEN=23]="BAD_URL_TOKEN",e[e.CDC_TOKEN=24]="CDC_TOKEN",e[e.CDO_TOKEN=25]="CDO_TOKEN",e[e.COLON_TOKEN=26]="COLON_TOKEN",e[e.SEMICOLON_TOKEN=27]="SEMICOLON_TOKEN",e[e.LEFT_SQUARE_BRACKET_TOKEN=28]="LEFT_SQUARE_BRACKET_TOKEN",e[e.RIGHT_SQUARE_BRACKET_TOKEN=29]="RIGHT_SQUARE_BRACKET_TOKEN",e[e.UNICODE_RANGE_TOKEN=30]="UNICODE_RANGE_TOKEN",e[e.WHITESPACE_TOKEN=31]="WHITESPACE_TOKEN",e[e.EOF_TOKEN=32]="EOF_TOKEN"}(f||(f={}));var $=function(e){return e>=48&&e<=57},Z=function(e){return $(e)||e>=65&&e<=70||e>=97&&e<=102},ee=function(e){return 10===e||9===e||32===e},te=function(e){return function(e){return function(e){return e>=97&&e<=122}(e)||function(e){return e>=65&&e<=90}(e)}(e)||function(e){return e>=128}(e)||95===e},ne=function(e){return te(e)||$(e)||45===e},re=function(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e},ie=function(e,t){return 92===e&&10!==t},oe=function(e,t,n){return 45===e?te(t)||ie(t,n):!!te(e)||!(92!==e||!ie(e,t))},ae=function(e,t,n){return 43===e||45===e?!!$(t)||46===t&&$(n):$(46===e?t:e)},Ae=function(e){var t=0,n=1;43!==e[t]&&45!==e[t]||(45===e[t]&&(n=-1),t++);for(var r=[];$(e[t]);)r.push(e[t++]);var i=r.length?parseInt(s.apply(void 0,r),10):0;46===e[t]&&t++;for(var o=[];$(e[t]);)o.push(e[t++]);var a=o.length,A=a?parseInt(s.apply(void 0,o),10):0;69!==e[t]&&101!==e[t]||t++;var u=1;43!==e[t]&&45!==e[t]||(45===e[t]&&(u=-1),t++);for(var l=[];$(e[t]);)l.push(e[t++]);var c=l.length?parseInt(s.apply(void 0,l),10):0;return n*(i+A*Math.pow(10,-a))*Math.pow(10,u*c)},se={type:f.LEFT_PARENTHESIS_TOKEN},ue={type:f.RIGHT_PARENTHESIS_TOKEN},le={type:f.COMMA_TOKEN},ce={type:f.SUFFIX_MATCH_TOKEN},fe={type:f.PREFIX_MATCH_TOKEN},de={type:f.COLUMN_TOKEN},pe={type:f.DASH_MATCH_TOKEN},he={type:f.INCLUDE_MATCH_TOKEN},ge={type:f.LEFT_CURLY_BRACKET_TOKEN},ve={type:f.RIGHT_CURLY_BRACKET_TOKEN},Be={type:f.SUBSTRING_MATCH_TOKEN},me={type:f.BAD_URL_TOKEN},be={type:f.BAD_STRING_TOKEN},we={type:f.CDO_TOKEN},Ee={type:f.CDC_TOKEN},ye={type:f.COLON_TOKEN},Ce={type:f.SEMICOLON_TOKEN},Qe={type:f.LEFT_SQUARE_BRACKET_TOKEN},xe={type:f.RIGHT_SQUARE_BRACKET_TOKEN},Fe={type:f.WHITESPACE_TOKEN},Ue={type:f.EOF_TOKEN},Se=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(A(e))},e.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==Ue;)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case 34:return this.consumeStringToken(34);case 35:var t=this.peekCodePoint(0),n=this.peekCodePoint(1),r=this.peekCodePoint(2);if(ne(t)||ie(n,r)){var i=oe(t,n,r)?2:1,o=this.consumeName();return{type:f.HASH_TOKEN,value:o,flags:i}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),ce;break;case 39:return this.consumeStringToken(39);case 40:return se;case 41:return ue;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Be;break;case 43:if(ae(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 44:return le;case 45:var a=e,A=this.peekCodePoint(0),u=this.peekCodePoint(1);if(ae(a,A,u))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(oe(a,A,u))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(45===A&&62===u)return this.consumeCodePoint(),this.consumeCodePoint(),Ee;break;case 46:if(ae(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var l=this.consumeCodePoint();if(42===l&&47===(l=this.consumeCodePoint()))return this.consumeToken();if(-1===l)return this.consumeToken()}break;case 58:return ye;case 59:return Ce;case 60:if(33===this.peekCodePoint(0)&&45===this.peekCodePoint(1)&&45===this.peekCodePoint(2))return this.consumeCodePoint(),this.consumeCodePoint(),we;break;case 64:var c=this.peekCodePoint(0),d=this.peekCodePoint(1),p=this.peekCodePoint(2);if(oe(c,d,p))return o=this.consumeName(),{type:f.AT_KEYWORD_TOKEN,value:o};break;case 91:return Qe;case 92:if(ie(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case 93:return xe;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),fe;break;case 123:return ge;case 125:return ve;case 117:case 85:var h=this.peekCodePoint(0),g=this.peekCodePoint(1);return 43!==h||!Z(g)&&63!==g||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),pe;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),de;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),he;break;case-1:return Ue}return ee(e)?(this.consumeWhiteSpace(),Fe):$(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):te(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:f.DELIM_TOKEN,value:s(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return"undefined"===typeof e?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();Z(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var n=!1;63===t&&e.length<6;)e.push(t),t=this.consumeCodePoint(),n=!0;if(n){var r=parseInt(s.apply(void 0,e.map((function(e){return 63===e?48:e}))),16),i=parseInt(s.apply(void 0,e.map((function(e){return 63===e?70:e}))),16);return{type:f.UNICODE_RANGE_TOKEN,start:r,end:i}}var o=parseInt(s.apply(void 0,e),16);if(45===this.peekCodePoint(0)&&Z(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var a=[];Z(t)&&a.length<6;)a.push(t),t=this.consumeCodePoint();return i=parseInt(s.apply(void 0,a),16),{type:f.UNICODE_RANGE_TOKEN,start:o,end:i}}return{type:f.UNICODE_RANGE_TOKEN,start:o,end:o}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:f.FUNCTION_TOKEN,value:e}):{type:f.IDENT_TOKEN,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),-1===this.peekCodePoint(0))return{type:f.URL_TOKEN,value:""};var t=this.peekCodePoint(0);if(39===t||34===t){var n=this.consumeStringToken(this.consumeCodePoint());return n.type===f.STRING_TOKEN&&(this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:f.URL_TOKEN,value:n.value}):(this.consumeBadUrlRemnants(),me)}for(;;){var r=this.consumeCodePoint();if(-1===r||41===r)return{type:f.URL_TOKEN,value:s.apply(void 0,e)};if(ee(r))return this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:f.URL_TOKEN,value:s.apply(void 0,e)}):(this.consumeBadUrlRemnants(),me);if(34===r||39===r||40===r||re(r))return this.consumeBadUrlRemnants(),me;if(92===r){if(!ie(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),me;e.push(this.consumeEscapedCodePoint())}else e.push(r)}},e.prototype.consumeWhiteSpace=function(){for(;ee(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(41===e||-1===e)return;ie(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var t="";e>0;){var n=Math.min(6e4,e);t+=s.apply(void 0,this._value.splice(0,n)),e-=n}return this._value.shift(),t},e.prototype.consumeStringToken=function(e){for(var t="",n=0;;){var r=this._value[n];if(-1===r||void 0===r||r===e)return t+=this.consumeStringSlice(n),{type:f.STRING_TOKEN,value:t};if(10===r)return this._value.splice(0,n),be;if(92===r){var i=this._value[n+1];-1!==i&&void 0!==i&&(10===i?(t+=this.consumeStringSlice(n),n=-1,this._value.shift()):ie(r,i)&&(t+=this.consumeStringSlice(n),t+=s(this.consumeEscapedCodePoint()),n=-1))}n++}},e.prototype.consumeNumber=function(){var e=[],t=4,n=this.peekCodePoint(0);for(43!==n&&45!==n||e.push(this.consumeCodePoint());$(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(46===n&&$(r))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;$(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0),r=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((69===n||101===n)&&((43===r||45===r)&&$(i)||$(r)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;$(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[Ae(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],n=e[1],r=this.peekCodePoint(0),i=this.peekCodePoint(1),o=this.peekCodePoint(2);if(oe(r,i,o)){var a=this.consumeName();return{type:f.DIMENSION_TOKEN,number:t,flags:n,unit:a}}return 37===r?(this.consumeCodePoint(),{type:f.PERCENTAGE_TOKEN,number:t,flags:n}):{type:f.NUMBER_TOKEN,number:t,flags:n}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(Z(e)){for(var t=s(e);Z(this.peekCodePoint(0))&&t.length<6;)t+=s(this.consumeCodePoint());ee(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(t,16);return 0===n||function(e){return e>=55296&&e<=57343}(n)||n>1114111?65533:n}return-1===e?65533:e},e.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(ne(t))e+=s(t);else{if(!ie(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),e;e+=s(this.consumeEscapedCodePoint())}}},e}(),Oe=function(){function e(e){this._tokens=e}return e.create=function(t){var n=new Se;return n.write(t),new e(n.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===f.WHITESPACE_TOKEN;)e=this.consumeToken();if(e.type===f.EOF_TOKEN)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do{e=this.consumeToken()}while(e.type===f.WHITESPACE_TOKEN);if(e.type===f.EOF_TOKEN)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(t.type===f.EOF_TOKEN)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case f.LEFT_CURLY_BRACKET_TOKEN:case f.LEFT_SQUARE_BRACKET_TOKEN:case f.LEFT_PARENTHESIS_TOKEN:return this.consumeSimpleBlock(e.type);case f.FUNCTION_TOKEN:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},n=this.consumeToken();;){if(n.type===f.EOF_TOKEN||ke(n,e))return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue()),n=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:f.FUNCTION};;){var n=this.consumeToken();if(n.type===f.EOF_TOKEN||n.type===f.RIGHT_PARENTHESIS_TOKEN)return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return"undefined"===typeof e?Ue:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),He=function(e){return e.type===f.DIMENSION_TOKEN},Te=function(e){return e.type===f.NUMBER_TOKEN},Ne=function(e){return e.type===f.IDENT_TOKEN},_e=function(e){return e.type===f.STRING_TOKEN},Me=function(e,t){return Ne(e)&&e.value===t},De=function(e){return e.type!==f.WHITESPACE_TOKEN},Re=function(e){return e.type!==f.WHITESPACE_TOKEN&&e.type!==f.COMMA_TOKEN},Pe=function(e){var t=[],n=[];return e.forEach((function(e){if(e.type===f.COMMA_TOKEN){if(0===n.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(n),void(n=[])}e.type!==f.WHITESPACE_TOKEN&&n.push(e)})),n.length&&t.push(n),t},ke=function(e,t){return t===f.LEFT_CURLY_BRACKET_TOKEN&&e.type===f.RIGHT_CURLY_BRACKET_TOKEN||t===f.LEFT_SQUARE_BRACKET_TOKEN&&e.type===f.RIGHT_SQUARE_BRACKET_TOKEN||t===f.LEFT_PARENTHESIS_TOKEN&&e.type===f.RIGHT_PARENTHESIS_TOKEN},Ie=function(e){return e.type===f.NUMBER_TOKEN||e.type===f.DIMENSION_TOKEN},Ke=function(e){return e.type===f.PERCENTAGE_TOKEN||Ie(e)},Le=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},ze={type:f.NUMBER_TOKEN,number:0,flags:4},je={type:f.PERCENTAGE_TOKEN,number:50,flags:4},Xe={type:f.PERCENTAGE_TOKEN,number:100,flags:4},Ge=function(e,t,n){var r=e[0],i=e[1];return[Ve(r,t),Ve("undefined"!==typeof i?i:r,n)]},Ve=function(e,t){if(e.type===f.PERCENTAGE_TOKEN)return e.number/100*t;if(He(e))switch(e.unit){case"rem":case"em":return 16*e.number;case"px":default:return e.number}return e.number},Ye=function(e){if(e.type===f.DIMENSION_TOKEN)switch(e.unit){case"deg":return Math.PI*e.number/180;case"grad":return Math.PI/200*e.number;case"rad":return e.number;case"turn":return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},We=function(e){return e.type===f.DIMENSION_TOKEN&&("deg"===e.unit||"grad"===e.unit||"rad"===e.unit||"turn"===e.unit)},Je=function(e){switch(e.filter(Ne).map((function(e){return e.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ze,ze];case"to top":case"bottom":return qe(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ze,Xe];case"to right":case"left":return qe(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Xe,Xe];case"to bottom":case"top":return qe(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Xe,ze];case"to left":case"right":return qe(270)}return 0},qe=function(e){return Math.PI*e/180},$e=function(e){if(e.type===f.FUNCTION){var t=st[e.name];if("undefined"===typeof t)throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(e.values)}if(e.type===f.HASH_TOKEN){if(3===e.value.length){var n=e.value.substring(0,1),r=e.value.substring(1,2),i=e.value.substring(2,3);return tt(parseInt(n+n,16),parseInt(r+r,16),parseInt(i+i,16),1)}if(4===e.value.length){n=e.value.substring(0,1),r=e.value.substring(1,2),i=e.value.substring(2,3);var o=e.value.substring(3,4);return tt(parseInt(n+n,16),parseInt(r+r,16),parseInt(i+i,16),parseInt(o+o,16)/255)}if(6===e.value.length)return n=e.value.substring(0,2),r=e.value.substring(2,4),i=e.value.substring(4,6),tt(parseInt(n,16),parseInt(r,16),parseInt(i,16),1);if(8===e.value.length)return n=e.value.substring(0,2),r=e.value.substring(2,4),i=e.value.substring(4,6),o=e.value.substring(6,8),tt(parseInt(n,16),parseInt(r,16),parseInt(i,16),parseInt(o,16)/255)}if(e.type===f.IDENT_TOKEN){var a=ut[e.value.toUpperCase()];if("undefined"!==typeof a)return a}return ut.TRANSPARENT},Ze=function(e){return 0===(255&e)},et=function(e){var t=255&e,n=255&e>>8,r=255&e>>16,i=255&e>>24;return t<255?"rgba("+i+","+r+","+n+","+t/255+")":"rgb("+i+","+r+","+n+")"},tt=function(e,t,n,r){return(e<<24|t<<16|n<<8|Math.round(255*r)<<0)>>>0},nt=function(e,t){if(e.type===f.NUMBER_TOKEN)return e.number;if(e.type===f.PERCENTAGE_TOKEN){var n=3===t?1:255;return 3===t?e.number/100*n:Math.round(e.number/100*n)}return 0},rt=function(e){var t=e.filter(Re);if(3===t.length){var n=t.map(nt),r=n[0],i=n[1],o=n[2];return tt(r,i,o,1)}if(4===t.length){var a=t.map(nt),A=(r=a[0],i=a[1],o=a[2],a[3]);return tt(r,i,o,A)}return 0};function it(e,t,n){return n<0&&(n+=1),n>=1&&(n-=1),n<1/6?(t-e)*n*6+e:n<.5?t:n<2/3?6*(t-e)*(2/3-n)+e:e}var ot,at,At=function(e){var t=e.filter(Re),n=t[0],r=t[1],i=t[2],o=t[3],a=(n.type===f.NUMBER_TOKEN?qe(n.number):Ye(n))/(2*Math.PI),A=Ke(r)?r.number/100:0,s=Ke(i)?i.number/100:0,u="undefined"!==typeof o&&Ke(o)?Ve(o,1):1;if(0===A)return tt(255*s,255*s,255*s,1);var l=s<=.5?s*(A+1):s+A-s*A,c=2*s-l,d=it(c,l,a+1/3),p=it(c,l,a),h=it(c,l,a-1/3);return tt(255*d,255*p,255*h,u)},st={hsl:At,hsla:At,rgb:rt,rgba:rt},ut={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199};(function(e){e[e.VALUE=0]="VALUE",e[e.LIST=1]="LIST",e[e.IDENT_VALUE=2]="IDENT_VALUE",e[e.TYPE_VALUE=3]="TYPE_VALUE",e[e.TOKEN_VALUE=4]="TOKEN_VALUE"})(ot||(ot={})),function(e){e[e.BORDER_BOX=0]="BORDER_BOX",e[e.PADDING_BOX=1]="PADDING_BOX",e[e.CONTENT_BOX=2]="CONTENT_BOX"}(at||(at={}));var lt,ct,ft,dt={name:"background-clip",initialValue:"border-box",prefix:!1,type:ot.LIST,parse:function(e){return e.map((function(e){if(Ne(e))switch(e.value){case"padding-box":return at.PADDING_BOX;case"content-box":return at.CONTENT_BOX}return at.BORDER_BOX}))}},pt={name:"background-color",initialValue:"transparent",prefix:!1,type:ot.TYPE_VALUE,format:"color"},ht=function(e){var t=$e(e[0]),n=e[1];return n&&Ke(n)?{color:t,stop:n}:{color:t,stop:null}},gt=function(e,t){var n=e[0],r=e[e.length-1];null===n.stop&&(n.stop=ze),null===r.stop&&(r.stop=Xe);for(var i=[],o=0,a=0;ao?i.push(s):i.push(o),o=s}else i.push(null)}var u=null;for(a=0;ae.optimumDistance)?{optimumCorner:t,optimumDistance:A}:e}),{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},bt=function(e){var t=qe(180),n=[];return Pe(e).forEach((function(e,r){if(0===r){var i=e[0];if(i.type===f.IDENT_TOKEN&&-1!==["top","left","right","bottom"].indexOf(i.value))return void(t=Je(e));if(We(i))return void(t=(Ye(i)+qe(270))%qe(360))}var o=ht(e);n.push(o)})),{angle:t,stops:n,type:lt.LINEAR_GRADIENT}},wt=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},Et=function(e,t,n,r,i){var o="http://www.w3.org/2000/svg",a=document.createElementNS(o,"svg"),A=document.createElementNS(o,"foreignObject");return a.setAttributeNS(null,"width",e.toString()),a.setAttributeNS(null,"height",t.toString()),A.setAttributeNS(null,"width","100%"),A.setAttributeNS(null,"height","100%"),A.setAttributeNS(null,"x",n.toString()),A.setAttributeNS(null,"y",r.toString()),A.setAttributeNS(null,"externalResourcesRequired","true"),a.appendChild(A),A.appendChild(i),a},yt=function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){return t(r)},r.onerror=n,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))}))},Ct={get SUPPORT_RANGE_BOUNDS(){var e=function(e){if(e.createRange){var t=e.createRange();if(t.getBoundingClientRect){var n=e.createElement("boundtest");n.style.height="123px",n.style.display="block",e.body.appendChild(n),t.selectNode(n);var r=t.getBoundingClientRect(),i=Math.round(r.height);if(e.body.removeChild(n),123===i)return!0}}return!1}(document);return Object.defineProperty(Ct,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=function(e){var t=new Image,n=e.createElement("canvas"),r=n.getContext("2d");if(!r)return!1;t.src="data:image/svg+xml,";try{r.drawImage(t,0,0),n.toDataURL()}catch(i){return!1}return!0}(document);return Object.defineProperty(Ct,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"===typeof Array.from&&"function"===typeof window.fetch?function(e){var t=e.createElement("canvas");t.width=100,t.height=100;var n=t.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,100,100);var r=new Image,i=t.toDataURL();r.src=i;var o=Et(100,100,0,0,r);return n.fillStyle="red",n.fillRect(0,0,100,100),yt(o).then((function(t){n.drawImage(t,0,0);var r=n.getImageData(0,0,100,100).data;n.fillStyle="red",n.fillRect(0,0,100,100);var o=e.createElement("div");return o.style.backgroundImage="url("+i+")",o.style.height="100px",wt(r)?yt(Et(100,100,0,0,o)):Promise.reject(!1)})).then((function(e){return n.drawImage(e,0,0),wt(n.getImageData(0,0,100,100).data)})).catch((function(){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(Ct,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e="undefined"!==typeof(new Image).crossOrigin;return Object.defineProperty(Ct,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e="string"===typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Ct,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Ct,"SUPPORT_CORS_XHR",{value:e}),e}},Qt=function(){function e(e){var t=e.id,n=e.enabled;this.id=t,this.enabled=n,this.start=Date.now()}return e.prototype.debug=function(){for(var e=[],t=0;t0&&setTimeout((function(){return t("Timed out ("+a._options.imageTimeout+"ms) loading image")}),a._options.imageTimeout)}))];case 3:return[2,i.sent()]}}))}))},e.prototype.has=function(e){return"undefined"!==typeof this._cache[e]},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,n=this._options.proxy;if(!n)throw new Error("No proxy defined");var r=e.substring(0,256);return new Promise((function(i,o){var a=Ct.SUPPORT_RESPONSE_TYPE?"blob":"text",A=new XMLHttpRequest;if(A.onload=function(){if(200===A.status)if("text"===a)i(A.response);else{var e=new FileReader;e.addEventListener("load",(function(){return i(e.result)}),!1),e.addEventListener("error",(function(e){return o(e)}),!1),e.readAsDataURL(A.response)}else o("Failed to proxy resource "+r+" with status code "+A.status)},A.onerror=o,A.open("GET",n+"?url="+encodeURIComponent(e)+"&responseType="+a),"text"!==a&&A instanceof XMLHttpRequest&&(A.responseType=a),t._options.imageTimeout){var s=t._options.imageTimeout;A.timeout=s,A.ontimeout=function(){return o("Timed out ("+s+"ms) proxying "+r)}}A.send()}))},e}(),Ut=/^data:image\/svg\+xml/i,St=/^data:image\/.*;base64,/i,Ot=/^data:image\/.*/i,Ht=function(e){return Ct.SUPPORT_SVG_DRAWING||!Mt(e)},Tt=function(e){return Ot.test(e)},Nt=function(e){return St.test(e)},_t=function(e){return"blob"===e.substr(0,4)},Mt=function(e){return"svg"===e.substr(-3).toLowerCase()||Ut.test(e)},Dt=function(e){var t=ct.CIRCLE,n=ft.FARTHEST_CORNER,r=[],i=[];return Pe(e).forEach((function(e,o){var a=!0;if(0===o?a=e.reduce((function(e,t){if(Ne(t))switch(t.value){case"center":return i.push(je),!1;case"top":case"left":return i.push(ze),!1;case"right":case"bottom":return i.push(Xe),!1}else if(Ke(t)||Ie(t))return i.push(t),!1;return e}),a):1===o&&(a=e.reduce((function(e,r){if(Ne(r))switch(r.value){case"circle":return t=ct.CIRCLE,!1;case"ellipse":return t=ct.ELLIPSE,!1;case"contain":case"closest-side":return n=ft.CLOSEST_SIDE,!1;case"farthest-side":return n=ft.FARTHEST_SIDE,!1;case"closest-corner":return n=ft.CLOSEST_CORNER,!1;case"cover":case"farthest-corner":return n=ft.FARTHEST_CORNER,!1}else if(Ie(r)||Ke(r))return Array.isArray(n)||(n=[]),n.push(r),!1;return e}),a)),a){var A=ht(e);r.push(A)}})),{size:n,shape:t,stops:r,position:i,type:lt.RADIAL_GRADIENT}};!function(e){e[e.URL=0]="URL",e[e.LINEAR_GRADIENT=1]="LINEAR_GRADIENT",e[e.RADIAL_GRADIENT=2]="RADIAL_GRADIENT"}(lt||(lt={})),function(e){e[e.CIRCLE=0]="CIRCLE",e[e.ELLIPSE=1]="ELLIPSE"}(ct||(ct={})),function(e){e[e.CLOSEST_SIDE=0]="CLOSEST_SIDE",e[e.FARTHEST_SIDE=1]="FARTHEST_SIDE",e[e.CLOSEST_CORNER=2]="CLOSEST_CORNER",e[e.FARTHEST_CORNER=3]="FARTHEST_CORNER"}(ft||(ft={}));var Rt,Pt=function(e){if(e.type===f.URL_TOKEN){var t={url:e.value,type:lt.URL};return xt.getInstance().addImage(e.value),t}if(e.type===f.FUNCTION){var n=kt[e.name];if("undefined"===typeof n)throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return n(e.values)}throw new Error("Unsupported image type")},kt={"linear-gradient":function(e){var t=qe(180),n=[];return Pe(e).forEach((function(e,r){if(0===r){var i=e[0];if(i.type===f.IDENT_TOKEN&&"to"===i.value)return void(t=Je(e));if(We(i))return void(t=Ye(i))}var o=ht(e);n.push(o)})),{angle:t,stops:n,type:lt.LINEAR_GRADIENT}},"-moz-linear-gradient":bt,"-ms-linear-gradient":bt,"-o-linear-gradient":bt,"-webkit-linear-gradient":bt,"radial-gradient":function(e){var t=ct.CIRCLE,n=ft.FARTHEST_CORNER,r=[],i=[];return Pe(e).forEach((function(e,o){var a=!0;if(0===o){var A=!1;a=e.reduce((function(e,r){if(A)if(Ne(r))switch(r.value){case"center":return i.push(je),e;case"top":case"left":return i.push(ze),e;case"right":case"bottom":return i.push(Xe),e}else(Ke(r)||Ie(r))&&i.push(r);else if(Ne(r))switch(r.value){case"circle":return t=ct.CIRCLE,!1;case"ellipse":return t=ct.ELLIPSE,!1;case"at":return A=!0,!1;case"closest-side":return n=ft.CLOSEST_SIDE,!1;case"cover":case"farthest-side":return n=ft.FARTHEST_SIDE,!1;case"contain":case"closest-corner":return n=ft.CLOSEST_CORNER,!1;case"farthest-corner":return n=ft.FARTHEST_CORNER,!1}else if(Ie(r)||Ke(r))return Array.isArray(n)||(n=[]),n.push(r),!1;return e}),a)}if(a){var s=ht(e);r.push(s)}})),{size:n,shape:t,stops:r,position:i,type:lt.RADIAL_GRADIENT}},"-moz-radial-gradient":Dt,"-ms-radial-gradient":Dt,"-o-radial-gradient":Dt,"-webkit-radial-gradient":Dt,"-webkit-gradient":function(e){var t=qe(180),n=[],r=lt.LINEAR_GRADIENT,i=ct.CIRCLE,o=ft.FARTHEST_CORNER;return Pe(e).forEach((function(e,t){var i=e[0];if(0===t){if(Ne(i)&&"linear"===i.value)return void(r=lt.LINEAR_GRADIENT);if(Ne(i)&&"radial"===i.value)return void(r=lt.RADIAL_GRADIENT)}if(i.type===f.FUNCTION)if("from"===i.name){var o=$e(i.values[0]);n.push({stop:ze,color:o})}else if("to"===i.name)o=$e(i.values[0]),n.push({stop:Xe,color:o});else if("color-stop"===i.name){var a=i.values.filter(Re);if(2===a.length){o=$e(a[1]);var A=a[0];Te(A)&&n.push({stop:{type:f.PERCENTAGE_TOKEN,number:100*A.number,flags:A.flags},color:o})}}})),r===lt.LINEAR_GRADIENT?{angle:(t+qe(180))%qe(360),stops:n,type:r}:{size:o,shape:i,stops:n,position:[],type:r}}},It={name:"background-image",initialValue:"none",type:ot.LIST,prefix:!1,parse:function(e){if(0===e.length)return[];var t=e[0];return t.type===f.IDENT_TOKEN&&"none"===t.value?[]:e.filter((function(e){return Re(e)&&function(e){return e.type!==f.FUNCTION||kt[e.name]}(e)})).map(Pt)}},Kt={name:"background-origin",initialValue:"border-box",prefix:!1,type:ot.LIST,parse:function(e){return e.map((function(e){if(Ne(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Lt={name:"background-position",initialValue:"0% 0%",type:ot.LIST,prefix:!1,parse:function(e){return Pe(e).map((function(e){return e.filter(Ke)})).map(Le)}};!function(e){e[e.REPEAT=0]="REPEAT",e[e.NO_REPEAT=1]="NO_REPEAT",e[e.REPEAT_X=2]="REPEAT_X",e[e.REPEAT_Y=3]="REPEAT_Y"}(Rt||(Rt={}));var zt,jt={name:"background-repeat",initialValue:"repeat",prefix:!1,type:ot.LIST,parse:function(e){return Pe(e).map((function(e){return e.filter(Ne).map((function(e){return e.value})).join(" ")})).map(Xt)}},Xt=function(e){switch(e){case"no-repeat":return Rt.NO_REPEAT;case"repeat-x":case"repeat no-repeat":return Rt.REPEAT_X;case"repeat-y":case"no-repeat repeat":return Rt.REPEAT_Y;case"repeat":default:return Rt.REPEAT}};!function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"}(zt||(zt={}));var Gt,Vt={name:"background-size",initialValue:"0",prefix:!1,type:ot.LIST,parse:function(e){return Pe(e).map((function(e){return e.filter(Yt)}))}},Yt=function(e){return Ne(e)||Ke(e)},Wt=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:ot.TYPE_VALUE,format:"color"}},Jt=Wt("top"),qt=Wt("right"),$t=Wt("bottom"),Zt=Wt("left"),en=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:ot.LIST,parse:function(e){return Le(e.filter(Ke))}}},tn=en("top-left"),nn=en("top-right"),rn=en("bottom-right"),on=en("bottom-left");!function(e){e[e.NONE=0]="NONE",e[e.SOLID=1]="SOLID"}(Gt||(Gt={}));var an,An=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"none":return Gt.NONE}return Gt.SOLID}}},sn=An("top"),un=An("right"),ln=An("bottom"),cn=An("left"),fn=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:ot.VALUE,prefix:!1,parse:function(e){return He(e)?e.number:0}}},dn=fn("top"),pn=fn("right"),hn=fn("bottom"),gn=fn("left"),vn={name:"color",initialValue:"transparent",prefix:!1,type:ot.TYPE_VALUE,format:"color"},Bn={name:"display",initialValue:"inline-block",prefix:!1,type:ot.LIST,parse:function(e){return e.filter(Ne).reduce((function(e,t){return e|mn(t.value)}),0)}},mn=function(e){switch(e){case"block":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0};!function(e){e[e.NONE=0]="NONE",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.INLINE_START=3]="INLINE_START",e[e.INLINE_END=4]="INLINE_END"}(an||(an={}));var bn,wn={name:"float",initialValue:"none",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"left":return an.LEFT;case"right":return an.RIGHT;case"inline-start":return an.INLINE_START;case"inline-end":return an.INLINE_END}return an.NONE}},En={name:"letter-spacing",initialValue:"0",prefix:!1,type:ot.VALUE,parse:function(e){return e.type===f.IDENT_TOKEN&&"normal"===e.value?0:e.type===f.NUMBER_TOKEN||e.type===f.DIMENSION_TOKEN?e.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(bn||(bn={}));var yn,Cn={name:"line-break",initialValue:"normal",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"strict":return bn.STRICT;case"normal":default:return bn.NORMAL}}},Qn={name:"line-height",initialValue:"normal",prefix:!1,type:ot.TOKEN_VALUE},xn={name:"list-style-image",initialValue:"none",type:ot.VALUE,prefix:!1,parse:function(e){return e.type===f.IDENT_TOKEN&&"none"===e.value?null:Pt(e)}};!function(e){e[e.INSIDE=0]="INSIDE",e[e.OUTSIDE=1]="OUTSIDE"}(yn||(yn={}));var Fn,Un={name:"list-style-position",initialValue:"outside",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"inside":return yn.INSIDE;case"outside":default:return yn.OUTSIDE}}};!function(e){e[e.NONE=-1]="NONE",e[e.DISC=0]="DISC",e[e.CIRCLE=1]="CIRCLE",e[e.SQUARE=2]="SQUARE",e[e.DECIMAL=3]="DECIMAL",e[e.CJK_DECIMAL=4]="CJK_DECIMAL",e[e.DECIMAL_LEADING_ZERO=5]="DECIMAL_LEADING_ZERO",e[e.LOWER_ROMAN=6]="LOWER_ROMAN",e[e.UPPER_ROMAN=7]="UPPER_ROMAN",e[e.LOWER_GREEK=8]="LOWER_GREEK",e[e.LOWER_ALPHA=9]="LOWER_ALPHA",e[e.UPPER_ALPHA=10]="UPPER_ALPHA",e[e.ARABIC_INDIC=11]="ARABIC_INDIC",e[e.ARMENIAN=12]="ARMENIAN",e[e.BENGALI=13]="BENGALI",e[e.CAMBODIAN=14]="CAMBODIAN",e[e.CJK_EARTHLY_BRANCH=15]="CJK_EARTHLY_BRANCH",e[e.CJK_HEAVENLY_STEM=16]="CJK_HEAVENLY_STEM",e[e.CJK_IDEOGRAPHIC=17]="CJK_IDEOGRAPHIC",e[e.DEVANAGARI=18]="DEVANAGARI",e[e.ETHIOPIC_NUMERIC=19]="ETHIOPIC_NUMERIC",e[e.GEORGIAN=20]="GEORGIAN",e[e.GUJARATI=21]="GUJARATI",e[e.GURMUKHI=22]="GURMUKHI",e[e.HEBREW=22]="HEBREW",e[e.HIRAGANA=23]="HIRAGANA",e[e.HIRAGANA_IROHA=24]="HIRAGANA_IROHA",e[e.JAPANESE_FORMAL=25]="JAPANESE_FORMAL",e[e.JAPANESE_INFORMAL=26]="JAPANESE_INFORMAL",e[e.KANNADA=27]="KANNADA",e[e.KATAKANA=28]="KATAKANA",e[e.KATAKANA_IROHA=29]="KATAKANA_IROHA",e[e.KHMER=30]="KHMER",e[e.KOREAN_HANGUL_FORMAL=31]="KOREAN_HANGUL_FORMAL",e[e.KOREAN_HANJA_FORMAL=32]="KOREAN_HANJA_FORMAL",e[e.KOREAN_HANJA_INFORMAL=33]="KOREAN_HANJA_INFORMAL",e[e.LAO=34]="LAO",e[e.LOWER_ARMENIAN=35]="LOWER_ARMENIAN",e[e.MALAYALAM=36]="MALAYALAM",e[e.MONGOLIAN=37]="MONGOLIAN",e[e.MYANMAR=38]="MYANMAR",e[e.ORIYA=39]="ORIYA",e[e.PERSIAN=40]="PERSIAN",e[e.SIMP_CHINESE_FORMAL=41]="SIMP_CHINESE_FORMAL",e[e.SIMP_CHINESE_INFORMAL=42]="SIMP_CHINESE_INFORMAL",e[e.TAMIL=43]="TAMIL",e[e.TELUGU=44]="TELUGU",e[e.THAI=45]="THAI",e[e.TIBETAN=46]="TIBETAN",e[e.TRAD_CHINESE_FORMAL=47]="TRAD_CHINESE_FORMAL",e[e.TRAD_CHINESE_INFORMAL=48]="TRAD_CHINESE_INFORMAL",e[e.UPPER_ARMENIAN=49]="UPPER_ARMENIAN",e[e.DISCLOSURE_OPEN=50]="DISCLOSURE_OPEN",e[e.DISCLOSURE_CLOSED=51]="DISCLOSURE_CLOSED"}(Fn||(Fn={}));var Sn,On={name:"list-style-type",initialValue:"none",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"disc":return Fn.DISC;case"circle":return Fn.CIRCLE;case"square":return Fn.SQUARE;case"decimal":return Fn.DECIMAL;case"cjk-decimal":return Fn.CJK_DECIMAL;case"decimal-leading-zero":return Fn.DECIMAL_LEADING_ZERO;case"lower-roman":return Fn.LOWER_ROMAN;case"upper-roman":return Fn.UPPER_ROMAN;case"lower-greek":return Fn.LOWER_GREEK;case"lower-alpha":return Fn.LOWER_ALPHA;case"upper-alpha":return Fn.UPPER_ALPHA;case"arabic-indic":return Fn.ARABIC_INDIC;case"armenian":return Fn.ARMENIAN;case"bengali":return Fn.BENGALI;case"cambodian":return Fn.CAMBODIAN;case"cjk-earthly-branch":return Fn.CJK_EARTHLY_BRANCH;case"cjk-heavenly-stem":return Fn.CJK_HEAVENLY_STEM;case"cjk-ideographic":return Fn.CJK_IDEOGRAPHIC;case"devanagari":return Fn.DEVANAGARI;case"ethiopic-numeric":return Fn.ETHIOPIC_NUMERIC;case"georgian":return Fn.GEORGIAN;case"gujarati":return Fn.GUJARATI;case"gurmukhi":return Fn.GURMUKHI;case"hebrew":return Fn.HEBREW;case"hiragana":return Fn.HIRAGANA;case"hiragana-iroha":return Fn.HIRAGANA_IROHA;case"japanese-formal":return Fn.JAPANESE_FORMAL;case"japanese-informal":return Fn.JAPANESE_INFORMAL;case"kannada":return Fn.KANNADA;case"katakana":return Fn.KATAKANA;case"katakana-iroha":return Fn.KATAKANA_IROHA;case"khmer":return Fn.KHMER;case"korean-hangul-formal":return Fn.KOREAN_HANGUL_FORMAL;case"korean-hanja-formal":return Fn.KOREAN_HANJA_FORMAL;case"korean-hanja-informal":return Fn.KOREAN_HANJA_INFORMAL;case"lao":return Fn.LAO;case"lower-armenian":return Fn.LOWER_ARMENIAN;case"malayalam":return Fn.MALAYALAM;case"mongolian":return Fn.MONGOLIAN;case"myanmar":return Fn.MYANMAR;case"oriya":return Fn.ORIYA;case"persian":return Fn.PERSIAN;case"simp-chinese-formal":return Fn.SIMP_CHINESE_FORMAL;case"simp-chinese-informal":return Fn.SIMP_CHINESE_INFORMAL;case"tamil":return Fn.TAMIL;case"telugu":return Fn.TELUGU;case"thai":return Fn.THAI;case"tibetan":return Fn.TIBETAN;case"trad-chinese-formal":return Fn.TRAD_CHINESE_FORMAL;case"trad-chinese-informal":return Fn.TRAD_CHINESE_INFORMAL;case"upper-armenian":return Fn.UPPER_ARMENIAN;case"disclosure-open":return Fn.DISCLOSURE_OPEN;case"disclosure-closed":return Fn.DISCLOSURE_CLOSED;case"none":default:return Fn.NONE}}},Hn=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:ot.TOKEN_VALUE}},Tn=Hn("top"),Nn=Hn("right"),_n=Hn("bottom"),Mn=Hn("left");!function(e){e[e.VISIBLE=0]="VISIBLE",e[e.HIDDEN=1]="HIDDEN",e[e.SCROLL=2]="SCROLL",e[e.AUTO=3]="AUTO"}(Sn||(Sn={}));var Dn,Rn={name:"overflow",initialValue:"visible",prefix:!1,type:ot.LIST,parse:function(e){return e.filter(Ne).map((function(e){switch(e.value){case"hidden":return Sn.HIDDEN;case"scroll":return Sn.SCROLL;case"auto":return Sn.AUTO;case"visible":default:return Sn.VISIBLE}}))}};!function(e){e.NORMAL="normal",e.BREAK_WORD="break-word"}(Dn||(Dn={}));var Pn,kn={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"break-word":return Dn.BREAK_WORD;case"normal":default:return Dn.NORMAL}}},In=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:ot.TYPE_VALUE,format:"length-percentage"}},Kn=In("top"),Ln=In("right"),zn=In("bottom"),jn=In("left");!function(e){e[e.LEFT=0]="LEFT",e[e.CENTER=1]="CENTER",e[e.RIGHT=2]="RIGHT"}(Pn||(Pn={}));var Xn,Gn={name:"text-align",initialValue:"left",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"right":return Pn.RIGHT;case"center":case"justify":return Pn.CENTER;case"left":default:return Pn.LEFT}}};!function(e){e[e.STATIC=0]="STATIC",e[e.RELATIVE=1]="RELATIVE",e[e.ABSOLUTE=2]="ABSOLUTE",e[e.FIXED=3]="FIXED",e[e.STICKY=4]="STICKY"}(Xn||(Xn={}));var Vn,Yn={name:"position",initialValue:"static",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"relative":return Xn.RELATIVE;case"absolute":return Xn.ABSOLUTE;case"fixed":return Xn.FIXED;case"sticky":return Xn.STICKY}return Xn.STATIC}},Wn={name:"text-shadow",initialValue:"none",type:ot.LIST,prefix:!1,parse:function(e){return 1===e.length&&Me(e[0],"none")?[]:Pe(e).map((function(e){for(var t={color:ut.TRANSPARENT,offsetX:ze,offsetY:ze,blur:ze},n=0,r=0;r1?1:0],this.overflowWrap=Fr(kn,e.overflowWrap),this.paddingTop=Fr(Kn,e.paddingTop),this.paddingRight=Fr(Ln,e.paddingRight),this.paddingBottom=Fr(zn,e.paddingBottom),this.paddingLeft=Fr(jn,e.paddingLeft),this.position=Fr(Yn,e.position),this.textAlign=Fr(Gn,e.textAlign),this.textDecorationColor=Fr(ur,e.textDecorationColor||e.color),this.textDecorationLine=Fr(lr,e.textDecorationLine),this.textShadow=Fr(Wn,e.textShadow),this.textTransform=Fr(qn,e.textTransform),this.transform=Fr($n,e.transform),this.transformOrigin=Fr(nr,e.transformOrigin),this.visibility=Fr(ir,e.visibility),this.wordBreak=Fr(ar,e.wordBreak),this.zIndex=Fr(Ar,e.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===Jn.VISIBLE},e.prototype.isTransparent=function(){return Ze(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return this.position!==Xn.STATIC},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return this.float!==an.NONE},e.prototype.isInlineLevel=function(){return vr(this.display,4)||vr(this.display,33554432)||vr(this.display,268435456)||vr(this.display,536870912)||vr(this.display,67108864)||vr(this.display,134217728)},e}(),Qr=function(e){this.content=Fr(Br,e.content),this.quotes=Fr(wr,e.quotes)},xr=function(e){this.counterIncrement=Fr(mr,e.counterIncrement),this.counterReset=Fr(br,e.counterReset)},Fr=function(e,t){var n=new Se,r=null!==t&&"undefined"!==typeof t?t.toString():e.initialValue;n.write(r);var i=new Oe(n.read());switch(e.type){case ot.IDENT_VALUE:var o=i.parseComponentValue();return e.parse(Ne(o)?o.value:e.initialValue);case ot.VALUE:return e.parse(i.parseComponentValue());case ot.LIST:return e.parse(i.parseComponentValues());case ot.TOKEN_VALUE:return i.parseComponentValue();case ot.TYPE_VALUE:switch(e.format){case"angle":return Ye(i.parseComponentValue());case"color":return $e(i.parseComponentValue());case"image":return Pt(i.parseComponentValue());case"length":var a=i.parseComponentValue();return Ie(a)?a:ze;case"length-percentage":var A=i.parseComponentValue();return Ke(A)?A:ze}}throw new Error("Attempting to parse unsupported css format type "+e.format)},Ur=function(e){this.styles=new Cr(window.getComputedStyle(e,null)),this.textNodes=[],this.elements=[],null!==this.styles.transform&&ii(e)&&(e.style.transform="none"),this.bounds=a(e),this.flags=0},Sr=function(e,t){this.text=e,this.bounds=t},Or=function(e){var t=e.ownerDocument;if(t){var n=t.createElement("html2canvaswrapper");n.appendChild(e.cloneNode(!0));var r=e.parentNode;if(r){r.replaceChild(n,e);var i=a(n);return n.firstChild&&r.replaceChild(n.firstChild,n),i}}return new o(0,0,0,0)},Hr=function(e,t,n){var r=e.ownerDocument;if(!r)throw new Error("Node has no owner document");var i=r.createRange();return i.setStart(e,t),i.setEnd(e,t+n),o.fromClientRect(i.getBoundingClientRect())},Tr=function(e,t){return 0!==t.letterSpacing?A(e).map((function(e){return s(e)})):Nr(e,t)},Nr=function(e,t){for(var n,r=function(e,t){var n=A(e),r=J(n,t),i=r[0],o=r[1],a=r[2],s=n.length,u=0,l=0;return{next:function(){if(l>=s)return{done:!0,value:null};for(var e="\xd7";l0)if(Ct.SUPPORT_RANGE_BOUNDS)i.push(new Sr(e,Hr(n,o,e.length)));else{var r=n.splitText(e.length);i.push(new Sr(e,Or(n))),n=r}else Ct.SUPPORT_RANGE_BOUNDS||(n=n.splitText(e.length));o+=e.length})),i}(this.text,t,e)},Mr=function(e,t){switch(t){case Vn.LOWERCASE:return e.toLowerCase();case Vn.CAPITALIZE:return e.replace(Dr,Rr);case Vn.UPPERCASE:return e.toUpperCase();default:return e}},Dr=/(^|\s|:|-|\(|\))([a-z])/g,Rr=function(e,t,n){return e.length>0?t+n.toUpperCase():e},Pr=function(e){function n(t){var n=e.call(this,t)||this;return n.src=t.currentSrc||t.src,n.intrinsicWidth=t.naturalWidth,n.intrinsicHeight=t.naturalHeight,xt.getInstance().addImage(n.src),n}return t(n,e),n}(Ur),kr=function(e){function n(t){var n=e.call(this,t)||this;return n.canvas=t,n.intrinsicWidth=t.width,n.intrinsicHeight=t.height,n}return t(n,e),n}(Ur),Ir=function(e){function n(t){var n=e.call(this,t)||this,r=new XMLSerializer;return n.svg="data:image/svg+xml,"+encodeURIComponent(r.serializeToString(t)),n.intrinsicWidth=t.width.baseVal.value,n.intrinsicHeight=t.height.baseVal.value,xt.getInstance().addImage(n.svg),n}return t(n,e),n}(Ur),Kr=function(e){function n(t){var n=e.call(this,t)||this;return n.value=t.value,n}return t(n,e),n}(Ur),Lr=function(e){function n(t){var n=e.call(this,t)||this;return n.start=t.start,n.reversed="boolean"===typeof t.reversed&&!0===t.reversed,n}return t(n,e),n}(Ur),zr=[{type:f.DIMENSION_TOKEN,flags:0,unit:"px",number:3}],jr=[{type:f.PERCENTAGE_TOKEN,flags:0,number:50}],Xr="password",Gr=function(e){function n(t){var n,r=e.call(this,t)||this;switch(r.type=t.type.toLowerCase(),r.checked=t.checked,r.value=function(e){var t=e.type===Xr?new Array(e.value.length+1).join("\u2022"):e.value;return 0===t.length?e.placeholder||"":t}(t),"checkbox"!==r.type&&"radio"!==r.type||(r.styles.backgroundColor=3739148031,r.styles.borderTopColor=r.styles.borderRightColor=r.styles.borderBottomColor=r.styles.borderLeftColor=2779096575,r.styles.borderTopWidth=r.styles.borderRightWidth=r.styles.borderBottomWidth=r.styles.borderLeftWidth=1,r.styles.borderTopStyle=r.styles.borderRightStyle=r.styles.borderBottomStyle=r.styles.borderLeftStyle=Gt.SOLID,r.styles.backgroundClip=[at.BORDER_BOX],r.styles.backgroundOrigin=[0],r.bounds=(n=r.bounds).width>n.height?new o(n.left+(n.width-n.height)/2,n.top,n.height,n.height):n.width0)n.textNodes.push(new _r(i,n.styles));else if(ri(i)){var a=$r(i);a.styles.isVisible()&&(ei(i,a,r)?a.flags|=4:ti(a.styles)&&(a.flags|=2),-1!==qr.indexOf(i.tagName)&&(a.flags|=8),n.elements.push(a),gi(i)||ui(i)||vi(i)||e(i,a,r))}}(e,t,t),t},ei=function(e,t,n){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||li(e)&&n.styles.isTransparent()},ti=function(e){return e.isPositioned()||e.isFloating()},ni=function(e){return e.nodeType===Node.TEXT_NODE},ri=function(e){return e.nodeType===Node.ELEMENT_NODE},ii=function(e){return ri(e)&&"undefined"!==typeof e.style&&!oi(e)},oi=function(e){return"object"===typeof e.className},ai=function(e){return"LI"===e.tagName},Ai=function(e){return"OL"===e.tagName},si=function(e){return"INPUT"===e.tagName},ui=function(e){return"svg"===e.tagName},li=function(e){return"BODY"===e.tagName},ci=function(e){return"CANVAS"===e.tagName},fi=function(e){return"IMG"===e.tagName},di=function(e){return"IFRAME"===e.tagName},pi=function(e){return"STYLE"===e.tagName},hi=function(e){return"SCRIPT"===e.tagName},gi=function(e){return"TEXTAREA"===e.tagName},vi=function(e){return"SELECT"===e.tagName},Bi=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},e.prototype.pop=function(e){var t=this;e.forEach((function(e){return t.counters[e].pop()}))},e.prototype.parse=function(e){var t=this,n=e.counterIncrement,r=e.counterReset,i=!0;null!==n&&n.forEach((function(e){var n=t.counters[e.counter];n&&0!==e.increment&&(i=!1,n[Math.max(0,n.length-1)]+=e.increment)}));var o=[];return i&&r.forEach((function(e){var n=t.counters[e.counter];o.push(e.counter),n||(n=t.counters[e.counter]=[]),n.push(e.reset)})),o},e}(),mi={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},bi={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u0554","\u0553","\u0552","\u0551","\u0550","\u054f","\u054e","\u054d","\u054c","\u054b","\u054a","\u0549","\u0548","\u0547","\u0546","\u0545","\u0544","\u0543","\u0542","\u0541","\u0540","\u053f","\u053e","\u053d","\u053c","\u053b","\u053a","\u0539","\u0538","\u0537","\u0536","\u0535","\u0534","\u0533","\u0532","\u0531"]},wi={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["\u05d9\u05f3","\u05d8\u05f3","\u05d7\u05f3","\u05d6\u05f3","\u05d5\u05f3","\u05d4\u05f3","\u05d3\u05f3","\u05d2\u05f3","\u05d1\u05f3","\u05d0\u05f3","\u05ea","\u05e9","\u05e8","\u05e7","\u05e6","\u05e4","\u05e2","\u05e1","\u05e0","\u05de","\u05dc","\u05db","\u05d9\u05d8","\u05d9\u05d7","\u05d9\u05d6","\u05d8\u05d6","\u05d8\u05d5","\u05d9","\u05d8","\u05d7","\u05d6","\u05d5","\u05d4","\u05d3","\u05d2","\u05d1","\u05d0"]},Ei={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u10f5","\u10f0","\u10ef","\u10f4","\u10ee","\u10ed","\u10ec","\u10eb","\u10ea","\u10e9","\u10e8","\u10e7","\u10e6","\u10e5","\u10e4","\u10f3","\u10e2","\u10e1","\u10e0","\u10df","\u10de","\u10dd","\u10f2","\u10dc","\u10db","\u10da","\u10d9","\u10d8","\u10d7","\u10f1","\u10d6","\u10d5","\u10d4","\u10d3","\u10d2","\u10d1","\u10d0"]},yi=function(e,t,n,r,i,o){return en?Ui(e,i,o.length>0):r.integers.reduce((function(t,n,i){for(;e>=n;)e-=n,t+=r.values[i];return t}),"")+o},Ci=function(e,t,n,r){var i="";do{n||e--,i=r(e)+i,e/=t}while(e*t>=t);return i},Qi=function(e,t,n,r,i){var o=n-t+1;return(e<0?"-":"")+(Ci(Math.abs(e),o,r,(function(e){return s(Math.floor(e%o)+t)}))+i)},xi=function(e,t,n){void 0===n&&(n=". ");var r=t.length;return Ci(Math.abs(e),r,!1,(function(e){return t[Math.floor(e%r)]}))+n},Fi=function(e,t,n,r,i,o){if(e<-9999||e>9999)return Ui(e,Fn.CJK_DECIMAL,i.length>0);var a=Math.abs(e),A=i;if(0===a)return t[0]+A;for(var s=0;a>0&&s<=4;s++){var u=a%10;0===u&&vr(o,1)&&""!==A?A=t[u]+A:u>1||1===u&&0===s||1===u&&1===s&&vr(o,2)||1===u&&1===s&&vr(o,4)&&e>100||1===u&&s>1&&vr(o,8)?A=t[u]+(s>0?n[s-1]:"")+A:1===u&&s>0&&(A=n[s-1]+A),a=Math.floor(a/10)}return(e<0?r:"")+A},Ui=function(e,t,n){var r=n?". ":"",i=n?"\u3001":"",o=n?", ":"",a=n?" ":"";switch(t){case Fn.DISC:return"\u2022"+a;case Fn.CIRCLE:return"\u25e6"+a;case Fn.SQUARE:return"\u25fe"+a;case Fn.DECIMAL_LEADING_ZERO:var A=Qi(e,48,57,!0,r);return A.length<4?"0"+A:A;case Fn.CJK_DECIMAL:return xi(e,"\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d",i);case Fn.LOWER_ROMAN:return yi(e,1,3999,mi,Fn.DECIMAL,r).toLowerCase();case Fn.UPPER_ROMAN:return yi(e,1,3999,mi,Fn.DECIMAL,r);case Fn.LOWER_GREEK:return Qi(e,945,969,!1,r);case Fn.LOWER_ALPHA:return Qi(e,97,122,!1,r);case Fn.UPPER_ALPHA:return Qi(e,65,90,!1,r);case Fn.ARABIC_INDIC:return Qi(e,1632,1641,!0,r);case Fn.ARMENIAN:case Fn.UPPER_ARMENIAN:return yi(e,1,9999,bi,Fn.DECIMAL,r);case Fn.LOWER_ARMENIAN:return yi(e,1,9999,bi,Fn.DECIMAL,r).toLowerCase();case Fn.BENGALI:return Qi(e,2534,2543,!0,r);case Fn.CAMBODIAN:case Fn.KHMER:return Qi(e,6112,6121,!0,r);case Fn.CJK_EARTHLY_BRANCH:return xi(e,"\u5b50\u4e11\u5bc5\u536f\u8fb0\u5df3\u5348\u672a\u7533\u9149\u620c\u4ea5",i);case Fn.CJK_HEAVENLY_STEM:return xi(e,"\u7532\u4e59\u4e19\u4e01\u620a\u5df1\u5e9a\u8f9b\u58ec\u7678",i);case Fn.CJK_IDEOGRAPHIC:case Fn.TRAD_CHINESE_INFORMAL:return Fi(e,"\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u842c","\u8ca0",i,14);case Fn.TRAD_CHINESE_FORMAL:return Fi(e,"\u96f6\u58f9\u8cb3\u53c3\u8086\u4f0d\u9678\u67d2\u634c\u7396","\u62fe\u4f70\u4edf\u842c","\u8ca0",i,15);case Fn.SIMP_CHINESE_INFORMAL:return Fi(e,"\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u842c","\u8d1f",i,14);case Fn.SIMP_CHINESE_FORMAL:return Fi(e,"\u96f6\u58f9\u8d30\u53c1\u8086\u4f0d\u9646\u67d2\u634c\u7396","\u62fe\u4f70\u4edf\u842c","\u8d1f",i,15);case Fn.JAPANESE_INFORMAL:return Fi(e,"\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u4e07","\u30de\u30a4\u30ca\u30b9",i,0);case Fn.JAPANESE_FORMAL:return Fi(e,"\u96f6\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d","\u62fe\u767e\u5343\u4e07","\u30de\u30a4\u30ca\u30b9",i,7);case Fn.KOREAN_HANGUL_FORMAL:return Fi(e,"\uc601\uc77c\uc774\uc0bc\uc0ac\uc624\uc721\uce60\ud314\uad6c","\uc2ed\ubc31\ucc9c\ub9cc","\ub9c8\uc774\ub108\uc2a4",o,7);case Fn.KOREAN_HANJA_INFORMAL:return Fi(e,"\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u842c","\ub9c8\uc774\ub108\uc2a4",o,0);case Fn.KOREAN_HANJA_FORMAL:return Fi(e,"\u96f6\u58f9\u8cb3\u53c3\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u62fe\u767e\u5343","\ub9c8\uc774\ub108\uc2a4",o,7);case Fn.DEVANAGARI:return Qi(e,2406,2415,!0,r);case Fn.GEORGIAN:return yi(e,1,19999,Ei,Fn.DECIMAL,r);case Fn.GUJARATI:return Qi(e,2790,2799,!0,r);case Fn.GURMUKHI:return Qi(e,2662,2671,!0,r);case Fn.HEBREW:return yi(e,1,10999,wi,Fn.DECIMAL,r);case Fn.HIRAGANA:return xi(e,"\u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051\u3053\u3055\u3057\u3059\u305b\u305d\u305f\u3061\u3064\u3066\u3068\u306a\u306b\u306c\u306d\u306e\u306f\u3072\u3075\u3078\u307b\u307e\u307f\u3080\u3081\u3082\u3084\u3086\u3088\u3089\u308a\u308b\u308c\u308d\u308f\u3090\u3091\u3092\u3093");case Fn.HIRAGANA_IROHA:return xi(e,"\u3044\u308d\u306f\u306b\u307b\u3078\u3068\u3061\u308a\u306c\u308b\u3092\u308f\u304b\u3088\u305f\u308c\u305d\u3064\u306d\u306a\u3089\u3080\u3046\u3090\u306e\u304a\u304f\u3084\u307e\u3051\u3075\u3053\u3048\u3066\u3042\u3055\u304d\u3086\u3081\u307f\u3057\u3091\u3072\u3082\u305b\u3059");case Fn.KANNADA:return Qi(e,3302,3311,!0,r);case Fn.KATAKANA:return xi(e,"\u30a2\u30a4\u30a6\u30a8\u30aa\u30ab\u30ad\u30af\u30b1\u30b3\u30b5\u30b7\u30b9\u30bb\u30bd\u30bf\u30c1\u30c4\u30c6\u30c8\u30ca\u30cb\u30cc\u30cd\u30ce\u30cf\u30d2\u30d5\u30d8\u30db\u30de\u30df\u30e0\u30e1\u30e2\u30e4\u30e6\u30e8\u30e9\u30ea\u30eb\u30ec\u30ed\u30ef\u30f0\u30f1\u30f2\u30f3",i);case Fn.KATAKANA_IROHA:return xi(e,"\u30a4\u30ed\u30cf\u30cb\u30db\u30d8\u30c8\u30c1\u30ea\u30cc\u30eb\u30f2\u30ef\u30ab\u30e8\u30bf\u30ec\u30bd\u30c4\u30cd\u30ca\u30e9\u30e0\u30a6\u30f0\u30ce\u30aa\u30af\u30e4\u30de\u30b1\u30d5\u30b3\u30a8\u30c6\u30a2\u30b5\u30ad\u30e6\u30e1\u30df\u30b7\u30f1\u30d2\u30e2\u30bb\u30b9",i);case Fn.LAO:return Qi(e,3792,3801,!0,r);case Fn.MONGOLIAN:return Qi(e,6160,6169,!0,r);case Fn.MYANMAR:return Qi(e,4160,4169,!0,r);case Fn.ORIYA:return Qi(e,2918,2927,!0,r);case Fn.PERSIAN:return Qi(e,1776,1785,!0,r);case Fn.TAMIL:return Qi(e,3046,3055,!0,r);case Fn.TELUGU:return Qi(e,3174,3183,!0,r);case Fn.THAI:return Qi(e,3664,3673,!0,r);case Fn.TIBETAN:return Qi(e,3872,3881,!0,r);case Fn.DECIMAL:default:return Qi(e,48,57,!0,r)}},Si=function(){function e(e,t){if(this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new Bi,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement)}return e.prototype.toIFrame=function(e,t){var n=this,o=Hi(e,t);if(!o.contentWindow)return Promise.reject("Unable to find iframe window");var a=e.defaultView.pageXOffset,A=e.defaultView.pageYOffset,s=o.contentWindow,u=s.document,l=Ti(o).then((function(){return r(n,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return this.scrolledElements.forEach(Di),s&&(s.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===t.top&&s.scrollX===t.left||(u.documentElement.style.top=-t.top+"px",u.documentElement.style.left=-t.left+"px",u.documentElement.style.position="absolute")),e=this.options.onclone,"undefined"===typeof this.clonedReferenceElement?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:u.fonts&&u.fonts.ready?[4,u.fonts.ready]:[3,2];case 1:n.sent(),n.label=2;case 2:return"function"===typeof e?[2,Promise.resolve().then((function(){return e(u)})).then((function(){return o}))]:[2,o]}}))}))}));return u.open(),u.write(_i(document.doctype)+""),Mi(this.referenceElement.ownerDocument,a,A),u.replaceChild(u.adoptNode(this.documentElement),u.documentElement),u.close(),l},e.prototype.createElementClone=function(e){if(ci(e))return this.createCanvasClone(e);if(pi(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return fi(t)&&"lazy"===t.loading&&(t.loading="eager"),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var n=[].slice.call(t.cssRules,0).reduce((function(e,t){return t&&"string"===typeof t.cssText?e+t.cssText:e}),""),r=e.cloneNode(!1);return r.textContent=n,r}}catch(i){if(Qt.getInstance(this.options.id).error("Unable to access cssRules property",i),"SecurityError"!==i.name)throw i}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){if(this.options.inlineImages&&e.ownerDocument){var t=e.ownerDocument.createElement("img");try{return t.src=e.toDataURL(),t}catch(o){Qt.getInstance(this.options.id).info("Unable to clone canvas contents, canvas is tainted")}}var n=e.cloneNode(!1);try{n.width=e.width,n.height=e.height;var r=e.getContext("2d"),i=n.getContext("2d");return i&&(r?i.putImageData(r.getImageData(0,0,e.width,e.height),0,0):i.drawImage(e,0,0)),n}catch(o){}return n},e.prototype.cloneNode=function(e){if(ni(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var t=e.ownerDocument.defaultView;if(t&&ri(e)&&(ii(e)||oi(e))){var n=this.createElementClone(e),r=t.getComputedStyle(e),i=t.getComputedStyle(e,":before"),o=t.getComputedStyle(e,":after");this.referenceElement===e&&ii(n)&&(this.clonedReferenceElement=n),li(n)&&ki(n);for(var a=this.counters.parse(new xr(r)),A=this.resolvePseudoContent(e,n,i,hr.BEFORE),s=e.firstChild;s;s=s.nextSibling)ri(s)&&(hi(s)||s.hasAttribute("data-html2canvas-ignore")||"function"===typeof this.options.ignoreElements&&this.options.ignoreElements(s))||this.options.copyStyles&&ri(s)&&pi(s)||n.appendChild(this.cloneNode(s));A&&n.insertBefore(A,n.firstChild);var u=this.resolvePseudoContent(e,n,o,hr.AFTER);return u&&n.appendChild(u),this.counters.pop(a),r&&(this.options.copyStyles||oi(e))&&!di(e)&&Ni(r,n),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([n,e.scrollLeft,e.scrollTop]),(gi(e)||vi(e))&&(gi(n)||vi(n))&&(n.value=e.value),n}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,n,r){var i=this;if(n){var o=n.content,a=t.ownerDocument;if(a&&o&&"none"!==o&&"-moz-alt-content"!==o&&"none"!==n.display){this.counters.parse(new xr(n));var A=new Qr(n),s=a.createElement("html2canvaspseudoelement");Ni(n,s),A.content.forEach((function(t){if(t.type===f.STRING_TOKEN)s.appendChild(a.createTextNode(t.value));else if(t.type===f.URL_TOKEN){var n=a.createElement("img");n.src=t.value,n.style.opacity="1",s.appendChild(n)}else if(t.type===f.FUNCTION){if("attr"===t.name){var r=t.values.filter(Ne);r.length&&s.appendChild(a.createTextNode(e.getAttribute(r[0].value)||""))}else if("counter"===t.name){var o=t.values.filter(Re),u=o[0],l=o[1];if(u&&Ne(u)){var c=i.counters.getCounterValue(u.value),d=l&&Ne(l)?On.parse(l.value):Fn.DECIMAL;s.appendChild(a.createTextNode(Ui(c,d,!1)))}}else if("counters"===t.name){var p=t.values.filter(Re),h=(u=p[0],p[1]);if(l=p[2],u&&Ne(u)){var g=i.counters.getCounterValues(u.value),v=l&&Ne(l)?On.parse(l.value):Fn.DECIMAL,B=h&&h.type===f.STRING_TOKEN?h.value:"",m=g.map((function(e){return Ui(e,v,!1)})).join(B);s.appendChild(a.createTextNode(m))}}}else if(t.type===f.IDENT_TOKEN)switch(t.value){case"open-quote":s.appendChild(a.createTextNode(Er(A.quotes,i.quoteDepth++,!0)));break;case"close-quote":s.appendChild(a.createTextNode(Er(A.quotes,--i.quoteDepth,!1)));break;default:s.appendChild(a.createTextNode(t.value))}})),s.className=Ri+" "+Pi;var u=r===hr.BEFORE?" "+Ri:" "+Pi;return oi(t)?t.className.baseValue+=u:t.className+=u,s}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();!function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"}(hr||(hr={}));var Oi,Hi=function(e,t){var n=e.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=t.width.toString(),n.height=t.height.toString(),n.scrolling="no",n.setAttribute("data-html2canvas-ignore","true"),e.body.appendChild(n),n},Ti=function(e){return new Promise((function(t,n){var r=e.contentWindow;if(!r)return n("No window assigned for iframe");var i=r.document;r.onload=e.onload=i.onreadystatechange=function(){r.onload=e.onload=i.onreadystatechange=null;var n=setInterval((function(){i.body.childNodes.length>0&&"complete"===i.readyState&&(clearInterval(n),t(e))}),50)}}))},Ni=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e.item(n);"content"!==r&&t.style.setProperty(r,e.getPropertyValue(r))}return t},_i=function(e){var t="";return e&&(t+=""),t},Mi=function(e,t,n){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||n!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,n)},Di=function(e){var t=e[0],n=e[1],r=e[2];t.scrollLeft=n,t.scrollTop=r},Ri="___html2canvas___pseudoelement_before",Pi="___html2canvas___pseudoelement_after",ki=function(e){Ii(e,"."+Ri+':before{\n content: "" !important;\n display: none !important;\n}\n .'+Pi+':after{\n content: "" !important;\n display: none !important;\n}')},Ii=function(e,t){var n=e.ownerDocument;if(n){var r=n.createElement("style");r.textContent=t,e.appendChild(r)}};!function(e){e[e.VECTOR=0]="VECTOR",e[e.BEZIER_CURVE=1]="BEZIER_CURVE"}(Oi||(Oi={}));var Ki,Li=function(e,t){return e.length===t.length&&e.some((function(e,n){return e===t[n]}))},zi=function(){function e(e,t){this.type=Oi.VECTOR,this.x=e,this.y=t}return e.prototype.add=function(t,n){return new e(this.x+t,this.y+n)},e}(),ji=function(e,t,n){return new zi(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},Xi=function(){function e(e,t,n,r){this.type=Oi.BEZIER_CURVE,this.start=e,this.startControl=t,this.endControl=n,this.end=r}return e.prototype.subdivide=function(t,n){var r=ji(this.start,this.startControl,t),i=ji(this.startControl,this.endControl,t),o=ji(this.endControl,this.end,t),a=ji(r,i,t),A=ji(i,o,t),s=ji(a,A,t);return n?new e(this.start,r,a,s):new e(s,A,o,this.end)},e.prototype.add=function(t,n){return new e(this.start.add(t,n),this.startControl.add(t,n),this.endControl.add(t,n),this.end.add(t,n))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Gi=function(e){return e.type===Oi.BEZIER_CURVE},Vi=function(e){var t=e.styles,n=e.bounds,r=Ge(t.borderTopLeftRadius,n.width,n.height),i=r[0],o=r[1],a=Ge(t.borderTopRightRadius,n.width,n.height),A=a[0],s=a[1],u=Ge(t.borderBottomRightRadius,n.width,n.height),l=u[0],c=u[1],f=Ge(t.borderBottomLeftRadius,n.width,n.height),d=f[0],p=f[1],h=[];h.push((i+A)/n.width),h.push((d+l)/n.width),h.push((o+p)/n.height),h.push((s+c)/n.height);var g=Math.max.apply(Math,h);g>1&&(i/=g,o/=g,A/=g,s/=g,l/=g,c/=g,d/=g,p/=g);var v=n.width-A,B=n.height-c,m=n.width-l,b=n.height-p,w=t.borderTopWidth,E=t.borderRightWidth,y=t.borderBottomWidth,C=t.borderLeftWidth,Q=Ve(t.paddingTop,e.bounds.width),x=Ve(t.paddingRight,e.bounds.width),F=Ve(t.paddingBottom,e.bounds.width),U=Ve(t.paddingLeft,e.bounds.width);this.topLeftBorderBox=i>0||o>0?Yi(n.left,n.top,i,o,Ki.TOP_LEFT):new zi(n.left,n.top),this.topRightBorderBox=A>0||s>0?Yi(n.left+v,n.top,A,s,Ki.TOP_RIGHT):new zi(n.left+n.width,n.top),this.bottomRightBorderBox=l>0||c>0?Yi(n.left+m,n.top+B,l,c,Ki.BOTTOM_RIGHT):new zi(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=d>0||p>0?Yi(n.left,n.top+b,d,p,Ki.BOTTOM_LEFT):new zi(n.left,n.top+n.height),this.topLeftPaddingBox=i>0||o>0?Yi(n.left+C,n.top+w,Math.max(0,i-C),Math.max(0,o-w),Ki.TOP_LEFT):new zi(n.left+C,n.top+w),this.topRightPaddingBox=A>0||s>0?Yi(n.left+Math.min(v,n.width+C),n.top+w,v>n.width+C?0:A-C,s-w,Ki.TOP_RIGHT):new zi(n.left+n.width-E,n.top+w),this.bottomRightPaddingBox=l>0||c>0?Yi(n.left+Math.min(m,n.width-C),n.top+Math.min(B,n.height+w),Math.max(0,l-E),c-y,Ki.BOTTOM_RIGHT):new zi(n.left+n.width-E,n.top+n.height-y),this.bottomLeftPaddingBox=d>0||p>0?Yi(n.left+C,n.top+b,Math.max(0,d-C),p-y,Ki.BOTTOM_LEFT):new zi(n.left+C,n.top+n.height-y),this.topLeftContentBox=i>0||o>0?Yi(n.left+C+U,n.top+w+Q,Math.max(0,i-(C+U)),Math.max(0,o-(w+Q)),Ki.TOP_LEFT):new zi(n.left+C+U,n.top+w+Q),this.topRightContentBox=A>0||s>0?Yi(n.left+Math.min(v,n.width+C+U),n.top+w+Q,v>n.width+C+U?0:A-C+U,s-(w+Q),Ki.TOP_RIGHT):new zi(n.left+n.width-(E+x),n.top+w+Q),this.bottomRightContentBox=l>0||c>0?Yi(n.left+Math.min(m,n.width-(C+U)),n.top+Math.min(B,n.height+w+Q),Math.max(0,l-(E+x)),c-(y+F),Ki.BOTTOM_RIGHT):new zi(n.left+n.width-(E+x),n.top+n.height-(y+F)),this.bottomLeftContentBox=d>0||p>0?Yi(n.left+C+U,n.top+b,Math.max(0,d-(C+U)),p-(y+F),Ki.BOTTOM_LEFT):new zi(n.left+C+U,n.top+n.height-(y+F))};!function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(Ki||(Ki={}));var Yi=function(e,t,n,r,i){var o=(Math.sqrt(2)-1)/3*4,a=n*o,A=r*o,s=e+n,u=t+r;switch(i){case Ki.TOP_LEFT:return new Xi(new zi(e,u),new zi(e,u-A),new zi(s-a,t),new zi(s,t));case Ki.TOP_RIGHT:return new Xi(new zi(e,t),new zi(e+a,t),new zi(s,u-A),new zi(s,u));case Ki.BOTTOM_RIGHT:return new Xi(new zi(s,t),new zi(s,t+A),new zi(e+a,u),new zi(e,u));case Ki.BOTTOM_LEFT:default:return new Xi(new zi(s,u),new zi(s-a,u),new zi(e,t+A),new zi(e,t))}},Wi=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Ji=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},qi=function(e,t,n){this.type=0,this.offsetX=e,this.offsetY=t,this.matrix=n,this.target=6},$i=function(e,t){this.type=1,this.target=t,this.path=e},Zi=function(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},eo=function(){function e(e,t){if(this.container=e,this.effects=t.slice(0),this.curves=new Vi(e),null!==e.styles.transform){var n=e.bounds.left+e.styles.transformOrigin[0].number,r=e.bounds.top+e.styles.transformOrigin[1].number,i=e.styles.transform;this.effects.push(new qi(n,r,i))}if(e.styles.overflowX!==Sn.VISIBLE){var o=Wi(this.curves),a=Ji(this.curves);Li(o,a)?this.effects.push(new $i(o,6)):(this.effects.push(new $i(o,2)),this.effects.push(new $i(a,4)))}}return e.prototype.getParentEffects=function(){var e=this.effects.slice(0);if(this.container.styles.overflowX!==Sn.VISIBLE){var t=Wi(this.curves),n=Ji(this.curves);Li(t,n)||e.push(new $i(n,6))}return e},e}(),to=function(e,t){for(var n=e instanceof Lr?e.start:1,r=e instanceof Lr&&e.reversed,i=0;ie.element.container.styles.zIndex.order?(d=t,!1):d>0})),l.negativeZIndex.splice(d,0,c)}else if(f>0){var p=0;l.positiveZIndex.some((function(e,t){return f>=e.element.container.styles.zIndex.order?(p=t+1,!1):p>0})),l.positiveZIndex.splice(p,0,c)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else o.styles.isFloating()?l.nonPositionedFloats.push(c):l.nonPositionedInlineLevel.push(c);e(s,c,a?c:r,u)}else o.styles.isInlineLevel()?n.inlineLevel.push(s):n.nonInlineLevel.push(s),e(s,n,r,u);vr(o.flags,8)&&to(o,u)}))}(t,n,n,r),to(t.container,r),n},ro=function(e,t,n,r){var i=[];return Gi(e)?i.push(e.subdivide(.5,!1)):i.push(e),Gi(n)?i.push(n.subdivide(.5,!0)):i.push(n),Gi(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),Gi(t)?i.push(t.subdivide(.5,!1).reverse()):i.push(t),i},io=function(e){var t=e.bounds,n=e.styles;return t.add(n.borderLeftWidth,n.borderTopWidth,-(n.borderRightWidth+n.borderLeftWidth),-(n.borderTopWidth+n.borderBottomWidth))},oo=function(e){var t=e.styles,n=e.bounds,r=Ve(t.paddingLeft,n.width),i=Ve(t.paddingRight,n.width),o=Ve(t.paddingTop,n.width),a=Ve(t.paddingBottom,n.width);return n.add(r+t.borderLeftWidth,o+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+r+i),-(t.borderTopWidth+t.borderBottomWidth+o+a))},ao=function(e,t,n){var r=function(e,t){return 0===e?t.bounds:2===e?oo(t):io(t)}(lo(e.styles.backgroundOrigin,t),e),i=function(e,t){return e===at.BORDER_BOX?t.bounds:e===at.CONTENT_BOX?oo(t):io(t)}(lo(e.styles.backgroundClip,t),e),o=uo(lo(e.styles.backgroundSize,t),n,r),a=o[0],A=o[1],s=Ge(lo(e.styles.backgroundPosition,t),r.width-a,r.height-A);return[co(lo(e.styles.backgroundRepeat,t),s,o,r,i),Math.round(r.left+s[0]),Math.round(r.top+s[1]),a,A]},Ao=function(e){return Ne(e)&&e.value===zt.AUTO},so=function(e){return"number"===typeof e},uo=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=e[0],A=e[1];if(Ke(a)&&A&&Ke(A))return[Ve(a,n.width),Ve(A,n.height)];var s=so(o);if(Ne(a)&&(a.value===zt.CONTAIN||a.value===zt.COVER))return so(o)?n.width/n.height0&&e.intrinsicHeight>0){var r=oo(e),i=Ji(t);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return r(this,void 0,void 0,(function(){var n,r,a,A,s,u,l,c,d,p,h,g,v,B;return i(this,(function(i){switch(i.label){case 0:this.applyEffects(t.effects,4),n=t.container,r=t.curves,a=n.styles,A=0,s=n.textNodes,i.label=1;case 1:return A0&&C>0&&(B=r.ctx.createPattern(h,"repeat"),r.renderRepeat(b,B,x,F))):function(e){return e.type===lt.RADIAL_GRADIENT}(n)&&(m=ao(e,t,[null,null,null]),b=m[0],w=m[1],E=m[2],y=m[3],C=m[4],Q=0===n.position.length?[je]:n.position,x=Ve(Q[0],y),F=Ve(Q[Q.length-1],C),U=function(e,t,n,r,i){var o=0,a=0;switch(e.size){case ft.CLOSEST_SIDE:e.shape===ct.CIRCLE?o=a=Math.min(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):e.shape===ct.ELLIPSE&&(o=Math.min(Math.abs(t),Math.abs(t-r)),a=Math.min(Math.abs(n),Math.abs(n-i)));break;case ft.CLOSEST_CORNER:if(e.shape===ct.CIRCLE)o=a=Math.min(Bt(t,n),Bt(t,n-i),Bt(t-r,n),Bt(t-r,n-i));else if(e.shape===ct.ELLIPSE){var A=Math.min(Math.abs(n),Math.abs(n-i))/Math.min(Math.abs(t),Math.abs(t-r)),s=mt(r,i,t,n,!0),u=s[0],l=s[1];a=A*(o=Bt(u-t,(l-n)/A))}break;case ft.FARTHEST_SIDE:e.shape===ct.CIRCLE?o=a=Math.max(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):e.shape===ct.ELLIPSE&&(o=Math.max(Math.abs(t),Math.abs(t-r)),a=Math.max(Math.abs(n),Math.abs(n-i)));break;case ft.FARTHEST_CORNER:if(e.shape===ct.CIRCLE)o=a=Math.max(Bt(t,n),Bt(t,n-i),Bt(t-r,n),Bt(t-r,n-i));else if(e.shape===ct.ELLIPSE){A=Math.max(Math.abs(n),Math.abs(n-i))/Math.max(Math.abs(t),Math.abs(t-r));var c=mt(r,i,t,n,!1);u=c[0],l=c[1],a=A*(o=Bt(u-t,(l-n)/A))}}return Array.isArray(e.size)&&(o=Ve(e.size[0],r),a=2===e.size.length?Ve(e.size[1],i):o),[o,a]}(n,x,F,y,C),S=U[0],O=U[1],S>0&&S>0&&(H=r.ctx.createRadialGradient(w+x,E+F,0,w+x,E+F,S),gt(n.stops,2*S).forEach((function(e){return H.addColorStop(e.stop,et(e.color))})),r.path(b),r.ctx.fillStyle=H,S!==O?(T=e.bounds.left+.5*e.bounds.width,N=e.bounds.top+.5*e.bounds.height,M=1/(_=O/S),r.ctx.save(),r.ctx.translate(T,N),r.ctx.transform(1,0,0,_,0,0),r.ctx.translate(-T,-N),r.ctx.fillRect(w,M*(E-N)+N,y,C*M),r.ctx.restore()):r.ctx.fill())),i.label=6;case 6:return t--,[2]}}))},r=this,o=0,a=e.styles.backgroundImage.slice(0).reverse(),s.label=1;case 1:return o-1&&(s=A(a,t,i+1,r)),-1===s)break;i=s}return-1}function s(e,t){for(var n=new RegExp("(\\s*"+(t||",")+"\\s*|\\(|\\)|\"|'|\\\\\"|\\\\'|\\s+)","g"),r=e.split(n).filter(Boolean),i=r.length,a=[],s=[],u=0;u-1)c=A(l,r,u+1,i);else if(l===t){s.length&&(a.push(s.join("")),s=[]);continue}}-1===c&&(c=i-1),s.push(r.slice(u,c+1).join("")),u=c}return s.length&&a.push(s.join("")),a}function u(e){return s(e,",")}function l(){return Date.now?Date.now():(new Date).getTime()}function c(e,t,n){return Math.max(t,Math.min(e,n))}function f(e,t,n){return[[t[0],t[0]*e[1]/e[0]],[t[1]*e[0]/e[1],t[1]]].filter((function(e){return e.every((function(e,r){return n?e<=t[r]:e>=t[r]}))}))[0]||e}function d(e,t,n,r){e.addEventListener(t,n,r)}function p(e,t,n){e.removeEventListener(t,n)}var h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var g=function(){return(g=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0?i:i+2*Math.PI}([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function B(e){return e.touches?function(e){for(var t=Math.min(e.length,2),n=[],r=0;r-1,b=h.isContentEditable;if(m||b){if(s||f===h)return!1;if(f&&b&&f.isContentEditable&&f.contains(h))return!1}else if((A||"touchstart"===e.type)&&f){var w=f.tagName;(f.isContentEditable||C.indexOf(w)>-1)&&f.blur()}if(r.clientStores=[new y(B(e))],r.flag=!0,r.isDrag=!1,r.datas={},a&&(3===e.which||2===e.button))return r.initDrag(),!1;!1===r.emit("dragStart",g({datas:r.datas,inputEvent:e,isTrusted:t},r.getCurrentStore().getPosition()))&&r.initDrag(),r.isDouble=l()-r.prevTime<200,r.flag&&A&&e.preventDefault()}if(!r.flag)return!1;var E=0;if(c&&u&&o&&(E=setTimeout((function(){d(i,"touchstart",r.onDragStart,{passive:!1})}))),!c&&u&&o&&p(i,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(E),c&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=B(e),i=r.moveClients(n,e,!1);(r.pinchFlag||i.deltaX||i.deltaY)&&r.emit("drag",g({},i,{isScroll:!!t,inputEvent:e})),r.pinchFlag&&r.onPinch(e,n),r.getCurrentStore().addClients(n)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,i=t.container;r.isTouch&&n&&p(i,"touchstart",r.onDragStart),r.flag=!1;var o=r.getCurrentStore().getPosition(),a=l(),A=!r.isDrag&&r.isDouble;r.prevTime=r.isDrag||A?0:a,r.emit("dragEnd",g({datas:r.datas,isDouble:A,isDrag:r.isDrag,inputEvent:e},o)),r.pinchFlag&&r.onPinchEnd(e),r.clientStores=[]}},r.onBlur=function(){r.onDragEnd()};var i=[].concat(t);r.options=g({checkInput:!1,container:i.length>1?window:i[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},n);var o=r.options,a=o.container,A=o.events,s=o.checkWindowBlur;if(r.isTouch=A.indexOf("touch")>-1,r.isMouse=A.indexOf("mouse")>-1,r.targets=i,r.isMouse&&(i.forEach((function(e){d(e,"mousedown",r.onDragStart)})),d(a,"mousemove",r.onDrag),d(a,"mouseup",r.onDragEnd),d(a,"contextmenu",r.onDragEnd)),s&&d(window,"blur",r.onBlur),r.isTouch){var u={passive:!1};i.forEach((function(e){d(e,"touchstart",r.onDragStart,u)})),d(a,"touchmove",r.onDrag,u),d(a,"touchend",r.onDragEnd,u),d(a,"touchcancel",r.onDragEnd,u)}return r}!function(e,t){function n(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(e){var t=e.clientX,i=e.clientY;return{clientX:t+n,clientY:i+r,originalClientX:t,originalClientY:i}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),p(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){p(t,"mousedown",e.onDragStart)})),p(n,"mousemove",this.onDrag),p(n,"mouseup",this.onDragEnd),p(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){p(t,"touchstart",e.onDragStart)})),p(n,"touchstart",this.onDragStart),p(n,"touchmove",this.onDrag),p(n,"touchend",this.onDragEnd),p(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new y(B(e));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",g({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",g({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",g({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition(),{inputEvent:e})),this.isPinch=!1,this.pinchFlag=!1}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](e);return this.isDrag=!0,g({datas:this.datas},r,{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},t}(i.a),x=n(8),F=n(29),U=n(56),S=function(e,t){return(S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function O(e){return e&&"object"===typeof e}function H(e){return Array.isArray(e)}function T(e){return"string"===typeof e}function N(e,t,n,r){e.addEventListener(t,n,r)}function _(e,t,n){e.removeEventListener(t,n)}var M=function(){return(M=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1&&r.splice(i,1)}}else this._events[e]=[];else this._events={};return this},t.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})}))},t.emit=function(e,t){var n=this;void 0===t&&(t={});var r=this._events[e];if(!e||!r)return!0;var i=!1;return t.eventType=e,t.stop=function(){i=!0},t.currentTarget=this,function(){for(var e=0,t=0,n=arguments.length;t1&&this.trigger(e+"."+i.join("."),r)},t}(D),G=n(19);var V=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0};function Y(e,t,n,r){var i=document.createElement("style");return i.setAttribute("type","text/css"),i.setAttribute("data-styled-id",e),n.nonce&&i.setAttribute("nonce",n.nonce),i.innerHTML=function(e,t,n){return n.original?t:t.replace(/([^};{\s}][^};{]*|^\s*){/gm,(function(t,n){var r=n.trim();return(r?u(r):[""]).map((function(t){var n=t.trim();return 0===n.indexOf("@")?n:n.indexOf(":global")>-1?n.replace(/\:global/g,""):n.indexOf(":host")>-1?""+n.replace(/\:host/g,"."+e):n?"."+e+" "+n:"."+e})).join(", ")+" {"}))}(e,t,n),(r||document.head||document.body).appendChild(i),i}var W=function(e,t){return(W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function J(e,t){function n(){this.constructor=e}W(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var q=function(){return(q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0){var d=Math.sqrt((o*o+A*A)/(1+t*t));o=(o>=0?1:-1)*(t*d),A=(A>=0?1:-1)*d}var p=Math.abs(o),h=Math.abs(A);r=function(e,t,n,r){if(!r)return e.map((function(e,r){return c(e,t[r],n[r])}));var i=e[0],o=e[1],a=f(e,t,!1),A=a[0],s=a[1],u=f(e,n,!0),l=u[0],d=u[1];return il||o>d)&&(i=l,o=d),[i,o]}([p,h],[0,0],[o<0?u-n.left:n.right-u,A<0?l-n.top:n.bottom-l],!!t),o=(o>=0?1:-1)*(p=r[0]),A=(A>=0?1:-1)*(h=r[1]);var g=u+Math.min(0,o),v=l+Math.min(0,A);return{left:g,top:v,right:g+p,bottom:v+h,width:p,height:h}}function ne(e){var t=e.getBoundingClientRect(),n=t.left,r=t.top,i=t.width,o=t.height;return{pos1:[n,r],pos2:[n+i,r],pos3:[n,r+o],pos4:[n+i,r+o]}}function re(e,t){var n=Object(F.b)(e,t),r=n.list,i=n.prevList,o=n.added,a=n.removed;return o.map((function(e){return r[e]})).concat(a.map((function(e){return i[e]})))}var ie=function(e){var t,n="rCS"+V(e).toString(36),r=0;return{className:n,inject:function(i,o){void 0===o&&(o={});var a,A=function(e){if(e&&e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t}}(i),s=0===r;return(A||s)&&(a=Y(n,e,o,A)),s&&(t=a),A||++r,{destroy:function(){A?(i.removeChild(a),a=null):(r>0&&--r,0===r&&t&&(t.parentNode.removeChild(t),t=null))}}}}}("\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"),oe="selecto-selection "+ie.className,ae=["boundContainer","selectableTargets","selectByClick","selectFromInside","continueSelect","toggleContinueSelect","keyContainer","hitRate","scrollOptions","checkInput","preventDefault","ratio","getElementRect"],Ae=function(){for(var e=0,t=0,n=arguments.length;t-1);)g=g.parentElement;h=g?[g]:[]}var v=h.length>0,B=!u&&v;if(B&&!l)return e.stop(),!1;var m=a.type;if(!(!("mousedown"===m||"touchstart"===m)||n.trigger("dragStart",q({},e))))return e.stop(),!1;if(s?(h=re(n.selectedTargets,h),r.startPassedTargets=n.selectedTargets):r.startPassedTargets=[],n.select(n.selectedTargets,h,p,a,!0),r.startX=i,r.startY=o,r.selectFlag=!1,r.boundsArea=n.target.style.cssText+="left:0px;top:0px;transform: translate("+i+"px, "+o+"px)",B&&l)return a.preventDefault(),!1;r.selectFlag=!0,"touchstart"===m&&a.preventDefault();var b=n.options.scrollOptions;return b&&b.container&&n.dragScroll.dragStart(e,b),!0},n.onDrag=function(e){if(e.datas.selectFlag){var t=n.options.scrollOptions;if(t&&t.container&&n.dragScroll.drag(e,t))return}n.check(e)},n.onDragEnd=function(e){var t=e.datas,r=e.inputEvent,i=te(e,n.options.ratio),o=t.selectFlag;r&&n.trigger("dragEnd",q(q({isDouble:!1,isDrag:!1,isSelect:o},e),{rect:i})),o&&(t.selectFlag=!1,n.dragScroll.dragEnd(),n.target.style.cssText+="display: none;"),n.selectEnd(t.startSelectedTargets,t.startPassedTargets,i,e)},n.onKeyDown=function(e){n.sameCombiKey(e)&&(n.continueSelect=!0,n.trigger("keydown",{}))},n.onKeyUp=function(e){n.sameCombiKey(e,!0)&&(n.continueSelect=!1,n.trigger("keyup",{}))},n.onBlur=function(){n.toggleContinueSelect&&n.continueSelect&&(n.continueSelect=!1,n.trigger("keyup",{}))},n.onDocumentSelectStart=function(e){if(n.gesto.isFlag()){var t=n.dragContainer;t===window&&(t=document.documentElement);var r=t instanceof Element?[t]:[].slice.call(t),i=e.target;r.some((function(t){if(t===i||t.contains(i))return e.preventDefault(),!0}))}},n.target=t.target,n.container=t.container||document.body,n.options=q({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,getElementRect:ne,cspNonce:"",ratio:0},t),n.initElement(),n.initDragScroll(),n.setKeyController(),n}J(t,e);var n=t.prototype;return n.setSelectedTargets=function(e){return this.selectedTargets=e,this},n.getSelectedTargets=function(){return this.selectedTargets},n.setKeyContainer=function(e){var t=this,n=this.options;ee(n.keyContainer,e,(function(){n.keyContainer=e,t.setKeyController()}))},n.setToggleContinueSelect=function(e){var t=this,n=this.options;ee(n.toggleContinueSelect,e,(function(){n.toggleContinueSelect=e,t.setKeyEvent()}))},n.setPreventDefault=function(e){this.gesto.options.preventDefault=e},n.setCheckInput=function(e){this.gesto.options.checkInput=e},n.triggerDragStart=function(e){return this.gesto.triggerDragStart(e),this},n.destroy=function(){this.off(),this.keycon&&this.keycon.destroy(),this.gesto.unset(),this.injectResult.destroy(),p(document,"selectstart",this.onDocumentSelectStart),this.keycon=null,this.gesto=null,this.injectResult=null,this.target=null,this.container=null,this.options=null},n.getElementPoints=function(e){var t=this.getElementRect,n=t(e),r=[n.pos1,n.pos2,n.pos4,n.pos3];if(t!==ne){var i=e.getBoundingClientRect();return Object(G.a)(r,i)}return r},n.findSelectableTargets=function(e){var t=this;void 0===e&&(e=this.gesto.getEventDatas());var n=this.getSelectableTargets(),r=n.map((function(e){return t.getElementPoints(e)}));e.selectableTargets=n,e.selectablePoints=r},n.clickTarget=function(e,t){var n=function(e){if("touches"in e){var t=e.touches[0]||e.changedTouches[0];return{clientX:t.clientX,clientY:t.clientY}}return{clientX:e.clientX,clientY:e.clientY}}(e),r={datas:{flag:!1},clientX:n.clientX,clientY:n.clientY,inputEvent:e,stop:function(){return!1}};return this.onDragStart(r,t)&&(r.datas.flag=!1,this.onDragEnd(r)),this},n.setKeyController=function(){var e=this.options,t=e.keyContainer,n=e.toggleContinueSelect;this.keycon&&(this.keycon.destroy(),this.keycon=null),n&&(this.keycon=new X(t||window),this.keycon.keydown(this.onKeyDown).keyup(this.onKeyUp).on("blur",this.onBlur))},n.setKeyEvent=function(){this.options.toggleContinueSelect&&!this.keycon&&this.setKeyController()},n.initElement=function(){this.target=Z(function(e,t){for(var n=[],r=2;r=Math.min(100,a)}))},n.initDragScroll=function(){var e=this;this.dragScroll.on("scroll",(function(t){var n=t.container,r=t.direction;e.trigger("scroll",{container:n,direction:r})})).on("move",(function(t){var n=t.offsetX,r=t.offsetY,i=t.inputEvent,o=i.datas;o.startX-=n,o.startY-=r,o.selectablePoints.forEach((function(e){e.forEach((function(e){e[0]-=n,e[1]-=r}))})),e.gesto.scrollBy(n,r,i.inputEvent,!1),i.distX+=n,i.distY+=r,e.check(i)}))},n.getSelectableTargets=function(){var e=[];return this.options.selectableTargets.forEach((function(t){a(t)?e.push(t):[].slice.call(document.querySelectorAll(t)).forEach((function(t){e.push(t)}))})),e},n.select=function(e,t,n,r,i){var o=Object(F.b)(e,t),a=o.added,A=o.removed,s=o.prevList,u=o.list;this.selectedTargets=t,i&&this.trigger("selectStart",{selected:t,added:a.map((function(e){return u[e]})),removed:A.map((function(e){return s[e]})),rect:n,inputEvent:r}),(a.length||A.length)&&this.trigger("select",{selected:t,added:a.map((function(e){return u[e]})),removed:A.map((function(e){return s[e]})),rect:n,inputEvent:r})},n.selectEnd=function(e,t,n,r){var i=r.inputEvent,o=r.isDouble,a=Object(F.b)(e,this.selectedTargets),A=a.added,s=a.removed,u=a.prevList,l=a.list,c=Object(F.b)(t,this.selectedTargets),f=c.added,d=c.removed,p=c.prevList,h=c.list,g=i&&i.type,v="mousedown"===g||"touchstart"===g;this.trigger("selectEnd",{selected:this.selectedTargets,added:A.map((function(e){return l[e]})),removed:s.map((function(e){return u[e]})),afterAdded:f.map((function(e){return h[e]})),afterRemoved:d.map((function(e){return p[e]})),isDragStart:v,isDouble:!!o,rect:n,inputEvent:i})},n.check=function(e,t){void 0===t&&(t=te(e,this.options.ratio));var n=e.datas,r=e.inputEvent,i=t.top,o=t.left,a=t.width,A=t.height,s=n.selectFlag,u=[],l=[];if(s){this.target.style.cssText+="display: block;left:0px;top:0px;transform: translate("+o+"px, "+i+"px);width:"+a+"px;height:"+A+"px;";var c=this.hitTest(t,n.startX,n.startY,n.selectableTargets,n.selectablePoints);u=this.selectedTargets,l=re(n.startPassedTargets,c),this.selectedTargets=l}this.trigger("drag",q(q({},e),{isSelect:s,rect:t})),s&&this.select(u,l,t,r)},n.sameCombiKey=function(e,t){var n,r=[].concat(this.options.toggleContinueSelect),i=z(e.inputEvent,e.key),o=(n=r[0],Array.isArray(n)?r:[r]);if(t){var a=e.key;return o.some((function(e){return e.some((function(e){return e===a}))}))}return o.some((function(e){return e.every((function(e){return i.indexOf(e)>-1}))}))},t=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var A=e.length-1;A>=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}([Object(x.a)(ae,(function(e,t){var n={enumerable:!0,configurable:!0,get:function(){return this.options[t]}},r=("set "+t).replace(/[\s-_]([a-z])/g,(function(e,t){return t.toUpperCase()}));e[r]?n.set=function(e){this[r](e)}:n.set=function(e){this.options[t]=e},Object.defineProperty(e,t,n)}))],t)}(i.a)),ce=n(2),fe=function(e,t){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var de=function(){return(de=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([Object(x.f)(ue)],t.prototype,"selecto",void 0),t}(r.PureComponent);t.a=he},function(e,t,n){"use strict";var r=n(0),i=n(13),o=("undefined"!==typeof document&&document,['"',"'",'\\"',"\\'"]),a={cm:function(e){return 96*e/2.54},mm:function(e){return 96*e/254},in:function(e){return 96*e},pt:function(e){return 96*e/72},pc:function(e){return 96*e/6},"%":function(e,t){return e*t/100},vw:function(e,t){return void 0===t&&(t=window.innerWidth),e/100*t},vh:function(e,t){return void 0===t&&(t=window.innerHeight),e/100*t},vmax:function(e,t){return void 0===t&&(t=Math.max(window.innerWidth,window.innerHeight)),e/100*t},vmin:function(e,t){return void 0===t&&(t=Math.min(window.innerWidth,window.innerHeight)),e/100*t}};function A(e,t,n,r){for(var i=n;i-1&&(s=A(a,t,i+1,r)),-1===s)break;i=s}return-1}function s(e,t){for(var n=new RegExp("(\\s*"+(t||",")+"\\s*|\\(|\\)|\"|'|\\\\\"|\\\\'|\\s+)","g"),r=e.split(n).filter(Boolean),i=r.length,a=[],s=[],u=0;u-1)c=A(l,r,u+1,i);else if(l===t){s.length&&(a.push(s.join("")),s=[]);continue}}-1===c&&(c=i-1),s.push(r.slice(u,c+1).join("")),u=c}return s.length&&a.push(s.join("")),a}function u(e){return s(e,",")}function l(){return Date.now?Date.now():(new Date).getTime()}function c(e,t){var n=function(e){var t=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(e);if(!t)return{prefix:"",unit:"",value:NaN};var n=t[1],r=t[2];return{prefix:n,unit:t[3],value:parseFloat(r)}}(e),r=n.value,i=n.unit;if(function(e){return e&&"object"===typeof e}(t)){var o=t[i];if(o){if(function(e){return"function"===typeof e}(o))return o(r);if(a[i])return a[i](r,o)}}else if("%"===i)return r*t/100;return a[i]?a[i](r):r}function f(e,t){e.classList?e.classList.add(t):e.className+=" "+t}function d(e,t,n,r){e.addEventListener(t,n,r)}function p(e,t,n){e.removeEventListener(t,n)}var h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var g=function(){return(g=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0?i:i+2*Math.PI}([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function B(e){return e.touches?function(e){for(var t=Math.min(e.length,2),n=[],r=0;r-1,b=h.isContentEditable;if(m||b){if(s||f===h)return!1;if(f&&b&&f.isContentEditable&&f.contains(h))return!1}else if((A||"touchstart"===e.type)&&f){var w=f.tagName;(f.isContentEditable||C.indexOf(w)>-1)&&f.blur()}if(r.clientStores=[new y(B(e))],r.flag=!0,r.isDrag=!1,r.datas={},a&&(3===e.which||2===e.button))return r.initDrag(),!1;!1===r.emit("dragStart",g({datas:r.datas,inputEvent:e,isTrusted:t},r.getCurrentStore().getPosition()))&&r.initDrag(),r.isDouble=l()-r.prevTime<200,r.flag&&A&&e.preventDefault()}if(!r.flag)return!1;var E=0;if(c&&u&&o&&(E=setTimeout((function(){d(i,"touchstart",r.onDragStart,{passive:!1})}))),!c&&u&&o&&p(i,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(E),c&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=B(e),i=r.moveClients(n,e,!1);(r.pinchFlag||i.deltaX||i.deltaY)&&r.emit("drag",g({},i,{isScroll:!!t,inputEvent:e})),r.pinchFlag&&r.onPinch(e,n),r.getCurrentStore().addClients(n)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,i=t.container;r.isTouch&&n&&p(i,"touchstart",r.onDragStart),r.flag=!1;var o=r.getCurrentStore().getPosition(),a=l(),A=!r.isDrag&&r.isDouble;r.prevTime=r.isDrag||A?0:a,r.emit("dragEnd",g({datas:r.datas,isDouble:A,isDrag:r.isDrag,inputEvent:e},o)),r.pinchFlag&&r.onPinchEnd(e),r.clientStores=[]}},r.onBlur=function(){r.onDragEnd()};var i=[].concat(t);r.options=g({checkInput:!1,container:i.length>1?window:i[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},n);var o=r.options,a=o.container,A=o.events,s=o.checkWindowBlur;if(r.isTouch=A.indexOf("touch")>-1,r.isMouse=A.indexOf("mouse")>-1,r.targets=i,r.isMouse&&(i.forEach((function(e){d(e,"mousedown",r.onDragStart)})),d(a,"mousemove",r.onDrag),d(a,"mouseup",r.onDragEnd),d(a,"contextmenu",r.onDragEnd)),s&&d(window,"blur",r.onBlur),r.isTouch){var u={passive:!1};i.forEach((function(e){d(e,"touchstart",r.onDragStart,u)})),d(a,"touchmove",r.onDrag,u),d(a,"touchend",r.onDragEnd,u),d(a,"touchcancel",r.onDragEnd,u)}return r}!function(e,t){function n(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(e){var t=e.clientX,i=e.clientY;return{clientX:t+n,clientY:i+r,originalClientX:t,originalClientY:i}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),p(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){p(t,"mousedown",e.onDragStart)})),p(n,"mousemove",this.onDrag),p(n,"mouseup",this.onDragEnd),p(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){p(t,"touchstart",e.onDragStart)})),p(n,"touchstart",this.onDragStart),p(n,"touchmove",this.onDrag),p(n,"touchend",this.onDragEnd),p(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new y(B(e));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",g({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",g({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",g({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition(),{inputEvent:e})),this.isPinch=!1,this.pinchFlag=!1}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](e);return this.isDrag=!0,g({datas:this.datas},r,{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},t}(i.a),x=n(8);var F=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0};function U(e,t,n,r){var i=document.createElement("style");return i.setAttribute("type","text/css"),i.setAttribute("data-styled-id",e),n.nonce&&i.setAttribute("nonce",n.nonce),i.innerHTML=function(e,t,n){return n.original?t:t.replace(/([^};{\s}][^};{]*|^\s*){/gm,(function(t,n){var r=n.trim();return(r?u(r):[""]).map((function(t){var n=t.trim();return 0===n.indexOf("@")?n:n.indexOf(":global")>-1?n.replace(/\:global/g,""):n.indexOf(":host")>-1?""+n.replace(/\:host/g,"."+e):n?"."+e+" "+n:"."+e})).join(", ")+" {"}))}(e,t,n),(r||document.head||document.body).appendChild(i),i}var S=function(e){var t,n="rCS"+F(e).toString(36),r=0;return{className:n,inject:function(i,o){void 0===o&&(o={});var a,A=function(e){if(e&&e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t}}(i),s=0===r;return(A||s)&&(a=U(n,e,o,A)),s&&(t=a),A||++r,{destroy:function(){A?(i.removeChild(a),a=null):(r>0&&--r,0===r&&t&&(t.parentNode.removeChild(t),t=null))}}}}},O=n(32),H=function(e,t){return(H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function T(e,t){function n(){this.constructor=e}H(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var N=function(){return(N=Object.assign||function(e){for(var t,n=1,r=arguments.length;nn?"block":"none",o=this.isHorizontal?["X","width"]:["Y","height"],a=o[0],A=o[1];this.barElement.style.cssText="display: "+i+";",this.thumbElement.style.cssText+=A+": "+n*n/r+"px;transform: translate"+a+"("+t/r*n+"px)"},n.destroy=function(){p(this.barElement,"wheel",this.onWheel),this.gesto.off(),this.off()},t}(i.a),V=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return T(t,e),t}(function(e){function t(t,n,r){void 0===r&&(r={});var i=e.call(this)||this;return i.containerElement=t,i.viewportElement=n,i.offsetX=0,i.offsetY=0,i.containerWidth=0,i.containerHeight=0,i.viewportWidth=0,i.viewportHeight=0,i.scrollLeft=0,i.scrollTop=0,i.timer=0,i.dragFlag=!1,i.tempScale=1,i.isLoop=!1,i.resize=function(){var e=i.containerElement,t=e.offsetWidth,n=e.offsetHeight,r=i.viewportElement,o=r.offsetWidth,a=r.offsetHeight;i.containerWidth=t,i.containerHeight=n,i.viewportWidth=o,i.viewportHeight=a},i.onScroll=function(){var e=i.wrapperElement,t=e.scrollLeft,n=e.scrollTop,r=i.zoom,o=void 0===r?R.zoom:r,a=t-i.scrollLeft,A=n-i.scrollTop,s=i.getScrollLeft(),u=i.getScrollTop();i.isLoop&&(i.isLoop=!1),i.scrollLeft=t,i.scrollTop=n,i.scrollTo(s+a/o,u+A/o)},i.onWheel=function(e){console.log("wheel",e);var t=i.options;if(e.ctrlKey){var n=-e.deltaY,r=Math.max(1+n*(t.wheelScale||.01),1e-6);i.trigger("pinch",{distance:n,scale:r,rotation:0,zoom:i.zoom*r,inputEvent:e})}else{if(!_&&!t.useForceWheel)return;var o=i.zoom,a=e.deltaX,A=e.deltaY;e.shiftKey&&!a&&(a=A,A=0),i.scrollBy(a/o,A/o)}e.preventDefault()},i.onGestureStart=function(e){i.tempScale=i.zoom,e.preventDefault()},i.onGestureChange=function(e){if(console.log(e),e.preventDefault(),!i.gesto.isFlag()&&i.tempScale){var t=e.scale;i.trigger("pinch",{distance:0,scale:t,rotation:e.rotation,zoom:i.tempScale*t,inputEvent:e})}else i.tempScale=0},i.options=N(N({},R),r),i.init(),i}T(t,e);var n=t.prototype;return n.getContainer=function(){return this.containerElement},n.getViewport=function(){return this.viewportElement},n.getWrapper=function(){return this.wrapperElement},n.destroy=function(){this.off(),this.gesto.unset(),this.verticalScrollbar.destroy(),this.horizontalScrollbar.destroy(),this.injectResult.destroy();var e=this.containerElement;p(window,"resize",this.resize),p(this.wrapperElement,"scroll",this.onScroll),p(e,"wheel",this.onWheel),p(e,"tgesturestart",this.onGestureStart),p(e,"gesturechange",this.onGestureChange),this.gesto=null,this.injectResult=null,this.containerElement=null,this.viewportElement=null,this.options=null},n.getScrollTop=function(e){return this.scrollTop/this.zoom+this.offsetY+(e?j(this.getRangeY()[0]):0)},n.getScrollLeft=function(e){return this.scrollLeft/this.zoom+this.offsetX+(e?j(this.getRangeX()[0]):0)},n.getScrollWidth=function(e){var t=this.getRangeX(e);return this.containerWidth+j(t[0])+j(t[1])},n.getScrollHeight=function(e){var t=this.getRangeY(e);return this.containerHeight+j(t[0])+j(t[1])},n.scrollCenter=function(){this.resize();var e=this.zoom,t=-(this.containerWidth/e-this.viewportWidth)/2,n=-(this.containerHeight/e-this.viewportHeight)/2;return this.scrollTo(t,n)},n.scrollBy=function(e,t){return this.scrollTo(this.getScrollLeft()+e,this.getScrollTop()+t)},n.scrollTo=function(e,t){var n=this,r=this,i=r.zoom,o=void 0===i?R.zoom:i,a=r.margin,A=void 0===a?R.margin:a,s=r.threshold,u=void 0===s?R.threshold:s,l=r.scrollLeft,c=r.scrollTop,f=this.getRangeX(!0,!0),d=f[0],p=f[1],h=this.getRangeY(!0,!0),g=h[0],v=h[1],B=l,m=c,b=this.getScrollAreaWidth(),w=this.getScrollAreaHeight(),E=e*o,y=t*o;if(E-u<=d){var C=Math.max(0,E-d);B=C,e=(d+C)/o}else if(E+u>=p){var Q=Math.max(0,p-E);B=b-Q,e=(p-Q)/o}else Bb-u&&(B-=A);if(y-u<=g){C=Math.max(0,y-g);m=C,t=(g+C)/o}else if(y+u>=v){Q=Math.max(0,v-y);m=w-Q,t=(v-Q)/o}else mw-u&&(m-=A);B=Math.round(B),m=Math.round(m),this.scrollLeft=B,this.scrollTop=m,this.offsetX=e-B/o,this.offsetY=t-m/o,this.render();var x=this.getScrollLeft(),F=this.getScrollTop();return this.trigger("scroll",{scrollLeft:x,scrollTop:F}),l===B&&c===m||(this.isLoop=!0,this.move(B,m),requestAnimationFrame((function(){if(n.isLoop){n.isLoop=!1;var e=n.wrapperElement,t=e.scrollLeft,r=e.scrollTop;n.scrollLeft=t,n.scrollTop=r,B===t&&m===r||(console.log("??"),n.scrollTo(x,F))}})),!1)},n.setZoom=function(e){var t=this,n=t.containerWidth,r=t.containerHeight,i=t.zoomOffsetX,o=void 0===i?R.zoomOffsetX:i,a=t.zoomOffsetY,A=void 0===a?R.zoomOffsetY:a,s=t.zoom,u=this.getScrollLeft(),l=this.getScrollTop();this.options.zoom=e;var f=this.getScrollLeft(),d=this.getScrollTop(),p=c(""+o,n),h=c(""+A,r),g=u+p/s,v=l+h/s,B=f+p/e,m=d+h/e;this.scrollBy(g-B,v-m),this.render()},n.getRangeX=function(e,t){var n=this.rangeX,r=void 0===n?R.rangeX:n,i=this.margin,o=void 0===i?R.margin:i,a=this.zoom,A=void 0===a?R.zoom:a,s=this.threshold,u=X(this.getScrollLeft(),o,r,s,t);return e?[u[0]*A,Math.max(this.viewportWidth*A-this.containerWidth,u[1]*A)]:u},n.getRangeY=function(e,t){var n=this.rangeY,r=void 0===n?R.rangeY:n,i=this.margin,o=void 0===i?R.margin:i,a=this.zoom,A=void 0===a?R.zoom:a,s=this.threshold,u=X(this.getScrollTop(),o,r,s,t);return e?[u[0]*A,Math.max(this.viewportHeight*A-this.containerHeight,u[1]*A)]:u},n.init=function(){var e=this,t=this.containerElement,n=this.options;f(t,P);var r=n.wrapperElement||t.querySelector(".infinite-viewer-wrapper"),i=n.scrollAreaElement||t.querySelector(".infinite-viewer-scroll-area"),o=n.horizontalScrollElement||t.querySelector(".infinite-viewer-horizontal-scroll-bar"),a=n.verticalScrollElement||t.querySelector(".infinite-viewer-vertical-scroll-bar");r||(f(r=document.createElement("div"),"infinite-viewer-wrapper"),r.insertBefore(this.viewportElement,null),t.insertBefore(r,null)),this.wrapperElement=r,i||(f(i=document.createElement("div"),"infinite-viewer-scroll-area"),r.insertBefore(i,r.firstChild)),this.scrollAreaElement=i,this.horizontalScrollbar=new G("horizontal",o),this.verticalScrollbar=new G("vertical",a),this.horizontalScrollbar.on("scroll",(function(t){e.scrollBy(t.delta/e.zoom,0)})),this.verticalScrollbar.on("scroll",(function(t){e.scrollBy(0,t.delta/e.zoom)})),this.horizontalScrollbar.isAppend&&t.insertBefore(this.horizontalScrollbar.barElement,null),this.verticalScrollbar.isAppend&&t.insertBefore(this.verticalScrollbar.barElement,null),f(t,P),this.injectResult=D.inject(t,{nonce:this.options.cspNonce}),this.gesto=new Q(t,{container:document.body,events:["touch"]}).on("dragStart",(function(t){var n=t.inputEvent,r=t.datas,i=t.stop;e.pauseAnimation(),e.dragFlag=!1,!1!==e.trigger("dragStart",{inputEvent:n})?(n.preventDefault(),r.startEvent=n):i()})).on("drag",(function(t){if(!e.options.usePinch||t.isPinch){e.trigger("drag",{inputEvent:t.inputEvent}),function(e){var t=e.deltaX,n=e.deltaY,r=e.datas,i=Date.now(),o=r.speed;if(!o)return r.speed=[0,0],void(r.time=i);var a=i-r.time;r.speed=[o[0]/2+t/a,o[1]/2+n/a]}(t);var r=e.zoom;e.scrollBy(-t.deltaX/r,-t.deltaY/r)}else!e.dragFlag&&t.movement>n.pinchThreshold&&(e.dragFlag=!0,e.trigger("abortPinch",{inputEvent:t.datas.startEvent||t.inputEvent}))})).on("dragEnd",(function(t){e.trigger("dragEnd",{isDrag:t.isDrag,isDouble:t.isDouble,inputEvent:t.inputEvent}),e.startAnimation(t.datas.speed)})).on("pinchStart",(function(t){var n=t.inputEvent,r=t.datas,i=t.stop;n.preventDefault(),e.pauseAnimation(),r.startZoom=e.zoom,!1===e.trigger("pinchStart",{inputEvent:n})&&i()})).on("pinch",(function(t){console.log(t),e.trigger("pinch",{rotation:t.rotation,distance:t.distance,scale:t.scale,zoom:t.datas.startZoom*t.scale,inputEvent:t.inputEvent})})),d(r,"scroll",this.onScroll),d(window,"resize",this.resize),d(t,"wheel",this.onWheel,{passive:!1}),d(t,"gesturestart",this.onGestureStart,{passive:!1}),d(t,"gesturechange",this.onGestureChange,{passive:!1}),this.resize(),this.render(),this.scrollTo(0,0)},n.render=function(){var e=this.offsetX,t=this.offsetY,n=this.zoom,r=void 0===n?R.zoom:n,i=-e*r,o=-t*r;this.scrollAreaElement.style.cssText="width:calc(100% + "+this.getScrollAreaWidth()+"px);height:calc(100% + "+this.getScrollAreaHeight()+"px);",this.viewportElement.style.cssText+="transform-origin: 0 0;transform:translate("+i+"px, "+o+"px) scale("+r+");",this.renderScroll()},n.renderScroll=function(){var e=this.containerWidth,t=this.containerHeight,n=this.zoom,r=this.getScrollLeft(!0)*n,i=this.getScrollTop(!0)*n,o=this.getScrollWidth(!0),a=this.getScrollHeight(!0);this.horizontalScrollbar.render(this.displayHorizontalScroll,r,e,o),this.verticalScrollbar.render(this.displayVerticalScroll,i,t,a)},n.move=function(e,t){var n=this.wrapperElement;n.scrollLeft=e,n.scrollTop=t},n.startAnimation=function(e){var t=this;if(e&&(e[0]||e[1])){var n=-6e-4,r=function(e){return 1-Math.pow(1-e,3)},i=z(e,n),o=function(e,t){var n=z(e,t);return[e[0]/2*n,e[1]/2*n]}(e,n),a=Date.now(),A=a;this.timer=requestAnimationFrame((function e(){var n=Date.now(),s=n-a;i=i||(t.timer=requestAnimationFrame(e))}))}},n.pauseAnimation=function(){cancelAnimationFrame(this.timer)},n.getScrollAreaWidth=function(){var e=this.getRangeX(!0),t=e[0],n=e[1];return t||n?2*this.margin:0},n.getScrollAreaHeight=function(){var e=this.getRangeY(!0),t=e[0],n=e[1];return t||n?2*this.margin:0},t=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var A=e.length-1;A>=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}([Object(x.a)(k,(function(e,t){var n={enumerable:!0,configurable:!0,get:function(){return this.options[t]}},r=("set "+t).replace(/[\s-_]([a-z])/g,(function(e,t){return t.toUpperCase()}));e[r]?n.set=function(e){this[r](e)}:n.set=function(e){this.options[t]=e},Object.defineProperty(e,t,n)}))],t)}(i.a)),Y=n(2),W=function(e,t){return(W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var J=function(){return(J=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([Object(x.f)(L)],t.prototype,"infiniteViewer",void 0),t}(r.PureComponent);t.a=$},function(e,t,n){"use strict";var r=n(2),i=n(13),o=function(){function e(e){this.separator=e,this.orderMap={}}var t=e.prototype;return t.getFullName=function(e){return e.join(this.separator)},t.get=function(e){return this.orderMap[this.getFullName(e)]},t.gets=function(e,t){void 0===t&&(t=!0);var n=[],r=this;return function e(t,i){var o=r.get(t);if(o)return o.forEach((function(r){var o=i.concat([r]),a=e(t.concat([r]),o);a&&a.length||n.push(i.concat([r]))})),o}(e,t?e:[]),n},t.set=function(e,t){var n=this;return e.forEach((function(t,r){n.addName(e.slice(0,r),t)})),this.orderMap[this.getFullName(e)]=t,t},t.add=function(e){var t=e.length;return t?this.addName(e.slice(0,-1),e[t-1]):[]},t.addName=function(e,t){var n=this.get(e)||this.set(e,[]);return-1===n.indexOf(t)&&n.push(t),n},t.findIndex=function(e,t){var n=this.orderMap[this.getFullName(e)];return n?n.indexOf(t):-1},t.remove=function(e){var t=this.getFullName(e),n=this.orderMap;for(var r in n)0===r.indexOf(t)&&delete n[r];var i=e.length;if(i){var o=e.slice(0,-1),a=e[i-1];this.splice(o,this.findIndex(o,a),1)}return this},t.filter=function(t,n,r){void 0===r&&(r=!0);var i=this.gets(t,r).filter(n),o=new e(this.separator),a=r?[]:t;return i.forEach((function(e){o.add(a.concat(e))})),o},t.splice=function(e,t,n){for(var r=[],i=3;i.001;){if(i=u(e,t,r)-n,Math.abs(i)<.001)return r;r-=i/2}return r}(e,n,Object(r.r)(o,0,1));return u(t,i,a)};return o.easingName="cubic-bezier("+e+","+t+","+n+","+i+")",o}function c(e,t){var n=function(n){var r=1/e;return n>=1?1:("start"===t?r:0)+Math.floor(n/r)*r};return n.easingName="steps("+e+", "+t+")",n}var f,d=c(1,"start"),p=c(1,"end"),h=l(0,0,1,1),g=l(.25,.1,.25,1),v=l(.42,0,1,1),B=l(0,0,.58,1),m=l(.42,0,.58,1),b="animation-timing-function",w={transform:{},filter:{},attribute:{},html:!0},E={easing:[b]},y=((f={})[b]=!0,f.contents=!0,f.html=!0,f),C="delay",Q={linear:h,ease:g,"ease-in":v,"ease-out":B,"ease-in-out":m,"step-start":d,"step-end":p},x=["duration","fillMode","direction","iterationCount",C,"easing","playSpeed"],F=function(){function e(e,t){this.prefix="",this.suffix="",this.model="",this.type="",this.separator=",",t&&this.setOptions(t),this.value=Object(r.F)(e)?e.split(this.separator):e}var t=e.prototype;return t.setOptions=function(e){for(var t in e)this[t]=e[t];return this},t.size=function(){return this.value.length},t.get=function(e){return this.value[e]},t.set=function(e,t){return this.value[e]=t,this},t.clone=function(){var t=this,n=t.separator,r=t.prefix,i=t.suffix,o=t.model,a=t.type;return new e(this.value.map((function(t){return t instanceof e?t.clone():t})),{separator:n,prefix:r,suffix:i,model:o,type:a})},t.toValue=function(){return this.prefix+this.join()+this.suffix},t.join=function(){return this.value.map((function(t){return t instanceof e?t.toValue():t})).join(this.separator)},t.forEach=function(e){return this.value.forEach(e),this},e}();function U(e){for(var t=Object(r.P)(e,";"),n={},i=t.length,o=i,a=0;a1?O(n.map((function(e){return H(e)})),","):(n=Object(r.O)(e)).length>1?O(n.map((function(e){return H(e)}))," "):(n=/^(['"])([^'"]*)(['"])$/g.exec(e))&&n[1]===n[3]?new F([H(n[2])],{prefix:n[1],suffix:n[1]}):-1!==e.indexOf("(")?function(e){var t=Object(r.M)(e),n=t.prefix,i=t.value,o=t.suffix;if("undefined"===typeof i)return e;if(r.d.indexOf(n)>-1)return S(Object(r.R)(e));var a=H(i,n),A=[i],s=",",u=n+"(",l=")"+o;return a instanceof F&&(s=a.separator,A=a.value,u+=a.prefix,l=a.suffix+l),new F(A,{separator:s,model:n,prefix:u,suffix:l})}(e):"#"===e.charAt(0)&&"url"!==t?function(e){var t=Object(r.R)(e);return t?S(t):e}(e):e}function T(e,t){void 0===t&&(t={});var n=e.model;if(n){e.setOptions({model:"",suffix:"",prefix:""});var r=e.size()>1?e:e.get(0);t[n]=r}else e.forEach((function(e){T(e,t)}));return t}function N(e){return e instanceof F}function _(e){var t=typeof e;if(t===r.j){if(Object(r.B)(e))return r.c;if(N(e))return r.k}else if(t===r.m||t===r.i)return"value";return t}function M(e){return Object(r.E)(e)&&e.constructor===Object}function D(e,t){var n=[];if(M(e))for(var r in e)t.push(r),n=n.concat(D(e[r],t)),t.pop();else n.push(t.slice());return n}function R(e){return Math.round(1e6*e)/1e6}function P(e,t,n){void 0===n&&(n=e.length);for(var i=t,o=0;o=1?"alternate-reverse":"alternate"):n===(e%2>=1?"alternate":"alternate-reverse"))}var j=["id","iterationCount",C,"fillMode","direction","playSpeed","duration","playSpeed","iterationTime","playState"],X=s(j,["easing","easingName"]);i.a;function G(e,t){if(void 0===t&&(t=[]),!e)return"";var n=[],i=Object(r.z)(e);return Object(r.L)(i,t),i.forEach((function(t){n.push(t.replace(/\d$/g,"")+"("+e[t]+")")})),n.join(" ")}function V(e,t){return void 0===t&&(t=!1),Y({},e,t)}function Y(e,t,n){for(var i in void 0===n&&(n=!1),t){var o=t[i],a=_(o);a===r.k?e[i]=n?o.toValue():o.clone():a===r.f?e[i]=n?J([i],o):o:a===r.c?e[i]=o.slice():a===r.j?Object(r.E)(e[i])&&!N(e[i])?Y(e[i],o,n):e[i]=V(o,n):e[i]=t[i]}return e}function W(e){return e[0]in E?E[e[0]]:e}function J(e,t){var n=_(t);if(n===r.k)return t.toValue();if(n===r.f){if(e[0]!==b)return J(e,t())}else if(n===r.j)return V(t,!0);return t}var q=function(){function e(e){void 0===e&&(e={}),this.properties={},this.orderMap=new o("_///_"),this.properties={},this.set(e)}var t=e.prototype;return t.get=function(){for(var e=[],t=0;tO.length&&O.push(e)}function N(e,t,n){return null==e?0:function e(t,n,r,i){var A=typeof t;"undefined"!==A&&"boolean"!==A||(t=null);var s=!1;if(null===t)s=!0;else switch(A){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case o:case a:s=!0}}if(s)return r(i,t,""===n?"."+_(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var u=0;u