From 5bad64a497584d92ceda915f39919f30566ef7f4 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 18 Dec 2019 23:07:42 +0100 Subject: [PATCH] :arrow_up: Update vendor deps and add randomcolor dep. --- frontend/vendor/datefns/datefns.bundle.min.js | 2 +- frontend/vendor/deps.cljs | 4 + frontend/vendor/package-lock.json | 1530 ++++++++++------- frontend/vendor/package.json | 26 +- frontend/vendor/randomcolor/externs.js | 1 + .../vendor/randomcolor/randomcolor.bundle.js | 531 ++++++ .../randomcolor/randomcolor.bundle.min.js | 1 + frontend/vendor/randomcolor/randomcolor.js | 11 + .../react-color/react-color.bundle.min.js | 2 +- frontend/vendor/react-dnd/react-dnd.bundle.js | 178 +- .../vendor/react-dnd/react-dnd.bundle.min.js | 2 +- frontend/vendor/rollup.config.js | 8 + 12 files changed, 1630 insertions(+), 666 deletions(-) create mode 100644 frontend/vendor/randomcolor/externs.js create mode 100644 frontend/vendor/randomcolor/randomcolor.bundle.js create mode 100644 frontend/vendor/randomcolor/randomcolor.bundle.min.js create mode 100644 frontend/vendor/randomcolor/randomcolor.js diff --git a/frontend/vendor/datefns/datefns.bundle.min.js b/frontend/vendor/datefns/datefns.bundle.min.js index b8a73aedd..57528cd85 100644 --- a/frontend/vendor/datefns/datefns.bundle.min.js +++ b/frontend/vendor/datefns/datefns.bundle.min.js @@ -1 +1 @@ -!function(){"use strict";var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t=function(e){var t=new Date(e.getTime()),n=t.getTimezoneOffset();return t.setSeconds(0,0),6e4*n+t.getTime()%6e4};var n=function(e){return e instanceof Date},r=36e5,a=6e4,o=2,u=/[T ]/,i=/:/,s=/^(\d{2})$/,f=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],c=/^(\d{4})/,l=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],d=/^-(\d{2})$/,g=/^-?(\d{3})$/,h=/^-?(\d{2})-?(\d{2})$/,v=/^-?W(\d{2})$/,m=/^-?W(\d{2})-?(\d{1})$/,D=/^(\d{2}([.,]\d*)?)$/,M=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,T=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,p=/([Z+-].*)$/,y=/^(Z)$/,S=/^([+-])(\d{2})$/,x=/^([+-])(\d{2}):?(\d{2})$/;function Y(e,t,n){t=t||0,n=n||0;var r=new Date(0);r.setUTCFullYear(e,0,4);var a=7*t+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+a),r}var w=function(e,w){if(n(e))return new Date(e.getTime());if("string"!=typeof e)return new Date(e);var b=(w||{}).additionalDigits;b=null==b?o:Number(b);var F=function(e){var t,n={},r=e.split(u);if(i.test(r[0])?(n.date=null,t=r[0]):(n.date=r[0],t=r[1]),t){var a=p.exec(t);a?(n.time=t.replace(a[1],""),n.timezone=a[1]):n.time=t}return n}(e),H=function(e,t){var n,r=f[t],a=l[t];if(n=c.exec(e)||a.exec(e)){var o=n[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(n=s.exec(e)||r.exec(e)){var u=n[1];return{year:100*parseInt(u,10),restDateString:e.slice(u.length)}}return{year:null}}(F.date,b),I=H.year,X=function(e,t){if(null===t)return null;var n,r,a,o;if(0===e.length)return(r=new Date(0)).setUTCFullYear(t),r;if(n=d.exec(e))return r=new Date(0),a=parseInt(n[1],10)-1,r.setUTCFullYear(t,a),r;if(n=g.exec(e)){r=new Date(0);var u=parseInt(n[1],10);return r.setUTCFullYear(t,0,u),r}if(n=h.exec(e)){r=new Date(0),a=parseInt(n[1],10)-1;var i=parseInt(n[2],10);return r.setUTCFullYear(t,a,i),r}if(n=v.exec(e))return o=parseInt(n[1],10)-1,Y(t,o);if(n=m.exec(e)){o=parseInt(n[1],10)-1;var s=parseInt(n[2],10)-1;return Y(t,o,s)}return null}(H.restDateString,I);if(X){var W,$=X.getTime(),z=0;if(F.time&&(z=function(e){var t,n,o;if(t=D.exec(e))return(n=parseFloat(t[1].replace(",",".")))%24*r;if(t=M.exec(e))return n=parseInt(t[1],10),o=parseFloat(t[2].replace(",",".")),n%24*r+o*a;if(t=T.exec(e)){n=parseInt(t[1],10),o=parseInt(t[2],10);var u=parseFloat(t[3].replace(",","."));return n%24*r+o*a+1e3*u}return null}(F.time)),F.timezone)A=F.timezone,W=((C=y.exec(A))?0:(C=S.exec(A))?(U=60*parseInt(C[2],10),"+"===C[1]?-U:U):(C=x.exec(A))?(U=60*parseInt(C[2],10)+parseInt(C[3],10),"+"===C[1]?-U:U):0)*a;else{var G=$+z,O=new Date(G);W=t(O);var E=new Date(G);E.setDate(O.getDate()+1);var Z=t(E)-t(O);Z>0&&(W+=Z)}return new Date($+z+W)}var A,C,U;return new Date(e)};var b=function(e){var t=w(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n};var F=function(e){var t=w(e);return t.setHours(0,0,0,0),t},H=6e4,I=864e5;var X=function(e,t){var n=F(e),r=F(t),a=n.getTime()-n.getTimezoneOffset()*H,o=r.getTime()-r.getTimezoneOffset()*H;return Math.round((a-o)/I)};var W=function(e){var t=w(e);return X(t,b(t))+1};var $=function(e,t){var n=t&&Number(t.weekStartsOn)||0,r=w(e),a=r.getDay(),o=(a=a.getTime()?n+1:t.getTime()>=u.getTime()?n:n-1};var O=function(e){var t=G(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),z(n)},E=6048e5;var Z=function(e){var t=w(e),n=z(t).getTime()-O(t).getTime();return Math.round(n/E)+1};var A=function(e){if(n(e))return!isNaN(e);throw new TypeError(toString.call(e)+" is not an instance of Date")};var C=["M","MM","Q","D","DD","DDD","DDDD","d","E","W","WW","YY","YYYY","GG","GGGG","H","HH","h","hh","m","mm","s","ss","S","SS","SSS","Z","ZZ","X","x"];var U=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);var r=C.concat(t).sort().reverse();return new RegExp("(\\[[^\\[]*\\])|(\\\\)?("+r.join("|")+"|.)","g")};var N=function(){var e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],t=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Su","Mo","Tu","We","Th","Fr","Sa"],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],a=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["AM","PM"],u=["am","pm"],i=["a.m.","p.m."],s={MMM:function(t){return e[t.getMonth()]},MMMM:function(e){return t[e.getMonth()]},dd:function(e){return n[e.getDay()]},ddd:function(e){return r[e.getDay()]},dddd:function(e){return a[e.getDay()]},A:function(e){return e.getHours()/12>=1?o[1]:o[0]},a:function(e){return e.getHours()/12>=1?u[1]:u[0]},aa:function(e){return e.getHours()/12>=1?i[1]:i[0]}};return["M","D","DDD","d","Q","W"].forEach(function(e){s[e+"o"]=function(t,n){return function(e){var t=e%100;if(t>20||t<10)switch(t%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"}(n[e](t))}}),{formatters:s,formattingTokensRegExp:U(s)}},k={distanceInWords:function(){var e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};return{localize:function(t,n,r){var a;return r=r||{},a="string"==typeof e[t]?e[t]:1===n?e[t].one:e[t].other.replace("{{count}}",n),r.addSuffix?r.comparison>0?"in "+a:a+" ago":a}}}(),format:N()};var J={M:function(e){return e.getMonth()+1},MM:function(e){return Q(e.getMonth()+1,2)},Q:function(e){return Math.ceil((e.getMonth()+1)/3)},D:function(e){return e.getDate()},DD:function(e){return Q(e.getDate(),2)},DDD:function(e){return W(e)},DDDD:function(e){return Q(W(e),3)},d:function(e){return e.getDay()},E:function(e){return e.getDay()||7},W:function(e){return Z(e)},WW:function(e){return Q(Z(e),2)},YY:function(e){return Q(e.getFullYear(),4).substr(2)},YYYY:function(e){return Q(e.getFullYear(),4)},GG:function(e){return String(G(e)).substr(2)},GGGG:function(e){return G(e)},H:function(e){return e.getHours()},HH:function(e){return Q(e.getHours(),2)},h:function(e){var t=e.getHours();return 0===t?12:t>12?t%12:t},hh:function(e){return Q(J.h(e),2)},m:function(e){return e.getMinutes()},mm:function(e){return Q(e.getMinutes(),2)},s:function(e){return e.getSeconds()},ss:function(e){return Q(e.getSeconds(),2)},S:function(e){return Math.floor(e.getMilliseconds()/100)},SS:function(e){return Q(Math.floor(e.getMilliseconds()/10),2)},SSS:function(e){return Q(e.getMilliseconds(),3)},Z:function(e){return R(e.getTimezoneOffset(),":")},ZZ:function(e){return R(e.getTimezoneOffset())},X:function(e){return Math.floor(e.getTime()/1e3)},x:function(e){return e.getTime()}};function R(e,t){t=t||"";var n=e>0?"-":"+",r=Math.abs(e),a=r%60;return n+Q(Math.floor(r/60),2)+t+Q(a,2)}function Q(e,t){for(var n=Math.abs(e).toString();n.lengthr?-1:n0?Math.floor(n):Math.ceil(n)};var K=function(e,t){var n=w(e),r=w(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())};var L=function(e,t){var n=w(e).getTime(),r=w(t).getTime();return nr?1:0};var V=function(e,t){var n=w(e),r=w(t),a=L(n,r),o=Math.abs(K(n,r));return n.setMonth(n.getMonth()-a*o),a*(o-(L(n,r)===-a))},_=1440,ee=2520,te=43200,ne=86400;var re=function(e,t,n){var r=n||{},a=j(e,t),o=r.locale,u=k.distanceInWords.localize;o&&o.distanceInWords&&o.distanceInWords.localize&&(u=o.distanceInWords.localize);var i,s,f={addSuffix:Boolean(r.addSuffix),comparison:a};a>0?(i=w(e),s=w(t)):(i=w(t),s=w(e));var c,l=q(s,i),d=s.getTimezoneOffset()-i.getTimezoneOffset(),g=Math.round(l/60)-d;if(g<2)return r.includeSeconds?l<5?u("lessThanXSeconds",5,f):l<10?u("lessThanXSeconds",10,f):l<20?u("lessThanXSeconds",20,f):l<40?u("halfAMinute",null,f):u(l<60?"lessThanXMinutes":"xMinutes",1,f):0===g?u("lessThanXMinutes",1,f):u("xMinutes",g,f);if(g<45)return u("xMinutes",g,f);if(g<90)return u("aboutXHours",1,f);if(g<_)return u("aboutXHours",Math.round(g/60),f);if(g0&&(W+=Z)}return new Date($+z+W)}return new Date(e)};var b=function(e){var t=w(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n};var F=function(e){var t=w(e);return t.setHours(0,0,0,0),t},H=6e4,I=864e5;var X=function(e,t){var n=F(e),r=F(t),a=n.getTime()-n.getTimezoneOffset()*H,o=r.getTime()-r.getTimezoneOffset()*H;return Math.round((a-o)/I)};var W=function(e){var t=w(e);return X(t,b(t))+1};var $=function(e,t){var n=t&&Number(t.weekStartsOn)||0,r=w(e),a=r.getDay(),o=(a=a.getTime()?n+1:t.getTime()>=u.getTime()?n:n-1};var O=function(e){var t=G(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),z(n)},E=6048e5;var Z=function(e){var t=w(e),n=z(t).getTime()-O(t).getTime();return Math.round(n/E)+1};var A=function(e){if(n(e))return!isNaN(e);throw new TypeError(toString.call(e)+" is not an instance of Date")};var C=["M","MM","Q","D","DD","DDD","DDDD","d","E","W","WW","YY","YYYY","GG","GGGG","H","HH","h","hh","m","mm","s","ss","S","SS","SSS","Z","ZZ","X","x"];var U=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);var r=C.concat(t).sort().reverse();return new RegExp("(\\[[^\\[]*\\])|(\\\\)?("+r.join("|")+"|.)","g")};var N=function(){var e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],t=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Su","Mo","Tu","We","Th","Fr","Sa"],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],a=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["AM","PM"],u=["am","pm"],i=["a.m.","p.m."],s={MMM:function(t){return e[t.getMonth()]},MMMM:function(e){return t[e.getMonth()]},dd:function(e){return n[e.getDay()]},ddd:function(e){return r[e.getDay()]},dddd:function(e){return a[e.getDay()]},A:function(e){return e.getHours()/12>=1?o[1]:o[0]},a:function(e){return e.getHours()/12>=1?u[1]:u[0]},aa:function(e){return e.getHours()/12>=1?i[1]:i[0]}};return["M","D","DDD","d","Q","W"].forEach((function(e){s[e+"o"]=function(t,n){return function(e){var t=e%100;if(t>20||t<10)switch(t%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"}(n[e](t))}})),{formatters:s,formattingTokensRegExp:U(s)}},k={distanceInWords:function(){var e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};return{localize:function(t,n,r){var a;return r=r||{},a="string"==typeof e[t]?e[t]:1===n?e[t].one:e[t].other.replace("{{count}}",n),r.addSuffix?r.comparison>0?"in "+a:a+" ago":a}}}(),format:N()};var J={M:function(e){return e.getMonth()+1},MM:function(e){return P(e.getMonth()+1,2)},Q:function(e){return Math.ceil((e.getMonth()+1)/3)},D:function(e){return e.getDate()},DD:function(e){return P(e.getDate(),2)},DDD:function(e){return W(e)},DDDD:function(e){return P(W(e),3)},d:function(e){return e.getDay()},E:function(e){return e.getDay()||7},W:function(e){return Z(e)},WW:function(e){return P(Z(e),2)},YY:function(e){return P(e.getFullYear(),4).substr(2)},YYYY:function(e){return P(e.getFullYear(),4)},GG:function(e){return String(G(e)).substr(2)},GGGG:function(e){return G(e)},H:function(e){return e.getHours()},HH:function(e){return P(e.getHours(),2)},h:function(e){var t=e.getHours();return 0===t?12:t>12?t%12:t},hh:function(e){return P(J.h(e),2)},m:function(e){return e.getMinutes()},mm:function(e){return P(e.getMinutes(),2)},s:function(e){return e.getSeconds()},ss:function(e){return P(e.getSeconds(),2)},S:function(e){return Math.floor(e.getMilliseconds()/100)},SS:function(e){return P(Math.floor(e.getMilliseconds()/10),2)},SSS:function(e){return P(e.getMilliseconds(),3)},Z:function(e){return Q(e.getTimezoneOffset(),":")},ZZ:function(e){return Q(e.getTimezoneOffset())},X:function(e){return Math.floor(e.getTime()/1e3)},x:function(e){return e.getTime()}};function R(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|]$/g,""):e.replace(/\\/g,"")}function Q(e,t){t=t||"";var n=e>0?"-":"+",r=Math.abs(e),a=r%60;return n+P(Math.floor(r/60),2)+t+P(a,2)}function P(e,t){for(var n=Math.abs(e).toString();n.lengthr?-1:n0?Math.floor(n):Math.ceil(n)};var L=function(e,t){var n=w(e),r=w(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())};var V=function(e,t){var n=w(e).getTime(),r=w(t).getTime();return nr?1:0};var _=function(e,t){var n=w(e),r=w(t),a=V(n,r),o=Math.abs(L(n,r));return n.setMonth(n.getMonth()-a*o),a*(o-(V(n,r)===-a))},ee=1440,te=2520,ne=43200,re=86400;var ae=function(e,t,n){var r=n||{},a=B(e,t),o=r.locale,u=k.distanceInWords.localize;o&&o.distanceInWords&&o.distanceInWords.localize&&(u=o.distanceInWords.localize);var i,s,f={addSuffix:Boolean(r.addSuffix),comparison:a};a>0?(i=w(e),s=w(t)):(i=w(t),s=w(e));var c,l=K(s,i),d=s.getTimezoneOffset()-i.getTimezoneOffset(),g=Math.round(l/60)-d;if(g<2)return r.includeSeconds?l<5?u("lessThanXSeconds",5,f):l<10?u("lessThanXSeconds",10,f):l<20?u("lessThanXSeconds",20,f):l<40?u("halfAMinute",null,f):u(l<60?"lessThanXMinutes":"xMinutes",1,f):0===g?u("lessThanXMinutes",1,f):u("xMinutes",g,f);if(g<45)return u("xMinutes",g,f);if(g<90)return u("aboutXHours",1,f);if(g colors.length) { + + // Since we're generating multiple colors, + // incremement the seed. Otherwise we'd just + // generate the same color each time... + if (seed && options.seed) options.seed += 1; + + colors.push(randomColor(options)); + } + + options.count = totalColors; + + return colors; + } + + // First we pick a hue (H) + H = pickHue(options); + + // Then use H to determine saturation (S) + S = pickSaturation(H, options); + + // Then use S and H to determine brightness (B). + B = pickBrightness(H, S, options); + + // Then we return the HSB color in the desired format + return setFormat([H,S,B], options); + }; + + function pickHue(options) { + if (colorRanges.length > 0) { + var hueRange = getRealHueRange(options.hue); + + var hue = randomWithin(hueRange); + + //Each of colorRanges.length ranges has a length equal approximatelly one step + var step = (hueRange[1] - hueRange[0]) / colorRanges.length; + + var j = parseInt((hue - hueRange[0]) / step); + + //Check if the range j is taken + if (colorRanges[j] === true) { + j = (j + 2) % colorRanges.length; + } + else { + colorRanges[j] = true; + } + + var min = (hueRange[0] + j * step) % 359, + max = (hueRange[0] + (j + 1) * step) % 359; + + hueRange = [min, max]; + + hue = randomWithin(hueRange); + + if (hue < 0) {hue = 360 + hue;} + return hue + } + else { + var hueRange = getHueRange(options.hue); + + hue = randomWithin(hueRange); + // Instead of storing red as two seperate ranges, + // we group them, using negative numbers + if (hue < 0) { + hue = 360 + hue; + } + + return hue; + } + } + + function pickSaturation (hue, options) { + + if (options.hue === 'monochrome') { + return 0; + } + + if (options.luminosity === 'random') { + return randomWithin([0,100]); + } + + var saturationRange = getSaturationRange(hue); + + var sMin = saturationRange[0], + sMax = saturationRange[1]; + + switch (options.luminosity) { + + case 'bright': + sMin = 55; + break; + + case 'dark': + sMin = sMax - 10; + break; + + case 'light': + sMax = 55; + break; + } + + return randomWithin([sMin, sMax]); + + } + + function pickBrightness (H, S, options) { + + var bMin = getMinimumBrightness(H, S), + bMax = 100; + + switch (options.luminosity) { + + case 'dark': + bMax = bMin + 20; + break; + + case 'light': + bMin = (bMax + bMin)/2; + break; + + case 'random': + bMin = 0; + bMax = 100; + break; + } + + return randomWithin([bMin, bMax]); + } + + function setFormat (hsv, options) { + + switch (options.format) { + + case 'hsvArray': + return hsv; + + case 'hslArray': + return HSVtoHSL(hsv); + + case 'hsl': + var hsl = HSVtoHSL(hsv); + return 'hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)'; + + case 'hsla': + var hslColor = HSVtoHSL(hsv); + var alpha = options.alpha || Math.random(); + return 'hsla('+hslColor[0]+', '+hslColor[1]+'%, '+hslColor[2]+'%, ' + alpha + ')'; + + case 'rgbArray': + return HSVtoRGB(hsv); + + case 'rgb': + var rgb = HSVtoRGB(hsv); + return 'rgb(' + rgb.join(', ') + ')'; + + case 'rgba': + var rgbColor = HSVtoRGB(hsv); + var alpha = options.alpha || Math.random(); + return 'rgba(' + rgbColor.join(', ') + ', ' + alpha + ')'; + + default: + return HSVtoHex(hsv); + } + + } + + function getMinimumBrightness(H, S) { + + var lowerBounds = getColorInfo(H).lowerBounds; + + for (var i = 0; i < lowerBounds.length - 1; i++) { + + var s1 = lowerBounds[i][0], + v1 = lowerBounds[i][1]; + + var s2 = lowerBounds[i+1][0], + v2 = lowerBounds[i+1][1]; + + if (S >= s1 && S <= s2) { + + var m = (v2 - v1)/(s2 - s1), + b = v1 - m*s1; + + return m*S + b; + } + + } + + return 0; + } + + function getHueRange (colorInput) { + + if (typeof parseInt(colorInput) === 'number') { + + var number = parseInt(colorInput); + + if (number < 360 && number > 0) { + return [number, number]; + } + + } + + if (typeof colorInput === 'string') { + + if (colorDictionary[colorInput]) { + var color = colorDictionary[colorInput]; + if (color.hueRange) {return color.hueRange;} + } else if (colorInput.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)) { + var hue = HexToHSB(colorInput)[0]; + return [ hue, hue ]; + } + } + + return [0,360]; + + } + + function getSaturationRange (hue) { + return getColorInfo(hue).saturationRange; + } + + function getColorInfo (hue) { + + // Maps red colors to make picking hue easier + if (hue >= 334 && hue <= 360) { + hue-= 360; + } + + for (var colorName in colorDictionary) { + var color = colorDictionary[colorName]; + if (color.hueRange && + hue >= color.hueRange[0] && + hue <= color.hueRange[1]) { + return colorDictionary[colorName]; + } + } return 'Color not found'; + } + + function randomWithin (range) { + if (seed === null) { + //generate random evenly destinct number from : https://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/ + var golden_ratio = 0.618033988749895; + var r=Math.random(); + r += golden_ratio; + r %= 1; + return Math.floor(range[0] + r*(range[1] + 1 - range[0])); + } else { + //Seeded random algorithm from http://indiegamr.com/generate-repeatable-random-numbers-in-js/ + var max = range[1] || 1; + var min = range[0] || 0; + seed = (seed * 9301 + 49297) % 233280; + var rnd = seed / 233280.0; + return Math.floor(min + rnd * (max - min)); +} + } + + function HSVtoHex (hsv){ + + var rgb = HSVtoRGB(hsv); + + function componentToHex(c) { + var hex = c.toString(16); + return hex.length == 1 ? '0' + hex : hex; + } + + var hex = '#' + componentToHex(rgb[0]) + componentToHex(rgb[1]) + componentToHex(rgb[2]); + + return hex; + + } + + function defineColor (name, hueRange, lowerBounds) { + + var sMin = lowerBounds[0][0], + sMax = lowerBounds[lowerBounds.length - 1][0], + + bMin = lowerBounds[lowerBounds.length - 1][1], + bMax = lowerBounds[0][1]; + + colorDictionary[name] = { + hueRange: hueRange, + lowerBounds: lowerBounds, + saturationRange: [sMin, sMax], + brightnessRange: [bMin, bMax] + }; + + } + + function loadColorBounds () { + + defineColor( + 'monochrome', + null, + [[0,0],[100,0]] + ); + + defineColor( + 'red', + [-26,18], + [[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]] + ); + + defineColor( + 'orange', + [19,46], + [[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]] + ); + + defineColor( + 'yellow', + [47,62], + [[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]] + ); + + defineColor( + 'green', + [63,178], + [[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]] + ); + + defineColor( + 'blue', + [179, 257], + [[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]] + ); + + defineColor( + 'purple', + [258, 282], + [[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]] + ); + + defineColor( + 'pink', + [283, 334], + [[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]] + ); + + } + + function HSVtoRGB (hsv) { + + // this doesn't work for the values of 0 and 360 + // here's the hacky fix + var h = hsv[0]; + if (h === 0) {h = 1;} + if (h === 360) {h = 359;} + + // Rebase the h,s,v values + h = h/360; + var s = hsv[1]/100, + v = hsv[2]/100; + + var h_i = Math.floor(h*6), + f = h * 6 - h_i, + p = v * (1 - s), + q = v * (1 - f*s), + t = v * (1 - (1 - f)*s), + r = 256, + g = 256, + b = 256; + + switch(h_i) { + case 0: r = v; g = t; b = p; break; + case 1: r = q; g = v; b = p; break; + case 2: r = p; g = v; b = t; break; + case 3: r = p; g = q; b = v; break; + case 4: r = t; g = p; b = v; break; + case 5: r = v; g = p; b = q; break; + } + + var result = [Math.floor(r*255), Math.floor(g*255), Math.floor(b*255)]; + return result; + } + + function HexToHSB (hex) { + hex = hex.replace(/^#/, ''); + hex = hex.length === 3 ? hex.replace(/(.)/g, '$1$1') : hex; + + var red = parseInt(hex.substr(0, 2), 16) / 255, + green = parseInt(hex.substr(2, 2), 16) / 255, + blue = parseInt(hex.substr(4, 2), 16) / 255; + + var cMax = Math.max(red, green, blue), + delta = cMax - Math.min(red, green, blue), + saturation = cMax ? (delta / cMax) : 0; + + switch (cMax) { + case red: return [ 60 * (((green - blue) / delta) % 6) || 0, saturation, cMax ]; + case green: return [ 60 * (((blue - red) / delta) + 2) || 0, saturation, cMax ]; + case blue: return [ 60 * (((red - green) / delta) + 4) || 0, saturation, cMax ]; + } + } + + function HSVtoHSL (hsv) { + var h = hsv[0], + s = hsv[1]/100, + v = hsv[2]/100, + k = (2-s)*v; + + return [ + h, + Math.round(s*v / (k<1 ? k : 2-k) * 10000) / 100, + k/2 * 100 + ]; + } + + function stringToInteger (string) { + var total = 0; + for (var i = 0; i !== string.length; i++) { + if (total >= Number.MAX_SAFE_INTEGER) break; + total += string.charCodeAt(i); + } + return total + } + + // get The range of given hue when options.count!=0 + function getRealHueRange(colorHue) + { if (!isNaN(colorHue)) { + var number = parseInt(colorHue); + + if (number < 360 && number > 0) { + return getColorInfo(colorHue).hueRange + } + } + else if (typeof colorHue === 'string') { + + if (colorDictionary[colorHue]) { + var color = colorDictionary[colorHue]; + + if (color.hueRange) { + return color.hueRange + } + } else if (colorHue.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)) { + var hue = HexToHSB(colorHue)[0]; + return getColorInfo(hue).hueRange + } + } + + return [0,360] +} + return randomColor; +})); +}); +var randomColor_1 = randomColor.randomColor;if (typeof self !== "undefined") { + init(self); +} else if (typeof global$1 !== "undefined") { + init(global$1); +} else if (typeof window !== "undefined") { + init(window); +} else { + throw new Error("unsupported execution environment"); +} + +function init(g) { + g.randomcolor = randomColor; +}}()); \ No newline at end of file diff --git a/frontend/vendor/randomcolor/randomcolor.bundle.min.js b/frontend/vendor/randomcolor/randomcolor.bundle.min.js new file mode 100644 index 000000000..d7fe207e7 --- /dev/null +++ b/frontend/vendor/randomcolor/randomcolor.bundle.min.js @@ -0,0 +1 @@ +!function(){"use strict";var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var r=function(e,r){return e(r={exports:{}},r.exports),r.exports}((function(e,r){!function(n,t){var a=function(){var e=null,r={};u("monochrome",null,[[0,0],[100,0]]),u("red",[-26,18],[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]),u("orange",[19,46],[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]),u("yellow",[47,62],[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]),u("green",[63,178],[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]),u("blue",[179,257],[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]),u("purple",[258,282],[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]),u("pink",[283,334],[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]);var n=[],t=function(u){if(void 0!==(u=u||{}).seed&&null!==u.seed&&u.seed===parseInt(u.seed,10))e=u.seed;else if("string"==typeof u.seed)e=function(e){for(var r=0,n=0;n!==e.length&&!(r>=Number.MAX_SAFE_INTEGER);n++)r+=e.charCodeAt(n);return r}(u.seed);else{if(void 0!==u.seed&&null!==u.seed)throw new TypeError("The seed value must be an integer or string");e=null}var l,c;if(null!==u.count&&void 0!==u.count){for(var h=u.count,d=[],g=0;gd.length;)e&&u.seed&&(u.seed+=1),d.push(t(u));return u.count=h,d}return function(e,r){switch(r.format){case"hsvArray":return e;case"hslArray":return f(e);case"hsl":var n=f(e);return"hsl("+n[0]+", "+n[1]+"%, "+n[2]+"%)";case"hsla":var t=f(e),a=r.alpha||Math.random();return"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+a+")";case"rgbArray":return i(e);case"rgb":return"rgb("+i(e).join(", ")+")";case"rgba":var o=i(e);a=r.alpha||Math.random();return"rgba("+o.join(", ")+", "+a+")";default:return function(e){var r=i(e);function n(e){var r=e.toString(16);return 1==r.length?"0"+r:r}return"#"+n(r[0])+n(r[1])+n(r[2])}(e)}}([l=function(e){if(n.length>0){var t=o(c=function(e){if(isNaN(e)){if("string"==typeof e)if(r[e]){var n=r[e];if(n.hueRange)return n.hueRange}else if(e.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){return a(s(e)[0]).hueRange}}else{var t=parseInt(e);if(t<360&&t>0)return a(e).hueRange}return[0,360]}(e.hue)),u=(c[1]-c[0])/n.length,i=parseInt((t-c[0])/u);!0===n[i]?i=(i+2)%n.length:n[i]=!0;var f=(c[0]+i*u)%359,l=(c[0]+(i+1)*u)%359;return(t=o(c=[f,l]))<0&&(t=360+t),t}var c=function(e){if("number"==typeof parseInt(e)){var n=parseInt(e);if(n<360&&n>0)return[n,n]}if("string"==typeof e)if(r[e]){var t=r[e];if(t.hueRange)return t.hueRange}else if(e.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){var a=s(e)[0];return[a,a]}return[0,360]}(e.hue);return(t=o(c))<0&&(t=360+t),t}(u),c=function(e,r){if("monochrome"===r.hue)return 0;if("random"===r.luminosity)return o([0,100]);var n=function(e){return a(e).saturationRange}(e),t=n[0],u=n[1];switch(r.luminosity){case"bright":t=55;break;case"dark":t=u-10;break;case"light":u=55}return o([t,u])}(l,u),function(e,r,n){var t=function(e,r){for(var n=a(e).lowerBounds,t=0;t=o&&r<=i){var f=(s-u)/(i-o);return f*r+(u-f*o)}}return 0}(e,r),u=100;switch(n.luminosity){case"dark":u=t+20;break;case"light":t=(u+t)/2;break;case"random":t=0,u=100}return o([t,u])}(l,c,u)],u)};function a(e){for(var n in e>=334&&e<=360&&(e-=360),r){var t=r[n];if(t.hueRange&&e>=t.hueRange[0]&&e<=t.hueRange[1])return r[n]}return"Color not found"}function o(r){if(null===e){var n=Math.random();return n+=.618033988749895,n%=1,Math.floor(r[0]+n*(r[1]+1-r[0]))}var t=r[1]||1,a=r[0]||0,o=(e=(9301*e+49297)%233280)/233280;return Math.floor(a+o*(t-a))}function u(e,n,t){var a=t[0][0],o=t[t.length-1][0],u=t[t.length-1][1],i=t[0][1];r[e]={hueRange:n,lowerBounds:t,saturationRange:[a,o],brightnessRange:[u,i]}}function i(e){var r=e[0];0===r&&(r=1),360===r&&(r=359),r/=360;var n=e[1]/100,t=e[2]/100,a=Math.floor(6*r),o=6*r-a,u=t*(1-n),i=t*(1-o*n),s=t*(1-(1-o)*n),f=256,l=256,c=256;switch(a){case 0:f=t,l=s,c=u;break;case 1:f=i,l=t,c=u;break;case 2:f=u,l=t,c=s;break;case 3:f=u,l=i,c=t;break;case 4:f=s,l=u,c=t;break;case 5:f=t,l=u,c=i}return[Math.floor(255*f),Math.floor(255*l),Math.floor(255*c)]}function s(e){e=3===(e=e.replace(/^#/,"")).length?e.replace(/(.)/g,"$1$1"):e;var r=parseInt(e.substr(0,2),16)/255,n=parseInt(e.substr(2,2),16)/255,t=parseInt(e.substr(4,2),16)/255,a=Math.max(r,n,t),o=a-Math.min(r,n,t),u=a?o/a:0;switch(a){case r:return[(n-t)/o%6*60||0,u,a];case n:return[60*((t-r)/o+2)||0,u,a];case t:return[60*((r-n)/o+4)||0,u,a]}}function f(e){var r=e[0],n=e[1]/100,t=e[2]/100,a=(2-n)*t;return[r,Math.round(n*t/(a<1?a:2-a)*1e4)/100,a/2*100]}return t}();e&&e.exports&&(r=e.exports=a),r.randomColor=a}()}));r.randomColor;if("undefined"!=typeof self)n(self);else if(void 0!==e)n(e);else{if("undefined"==typeof window)throw new Error("unsupported execution environment");n(window)}function n(e){e.randomcolor=r}}(); \ No newline at end of file diff --git a/frontend/vendor/randomcolor/randomcolor.js b/frontend/vendor/randomcolor/randomcolor.js new file mode 100644 index 000000000..da9234c8d --- /dev/null +++ b/frontend/vendor/randomcolor/randomcolor.js @@ -0,0 +1,11 @@ +import randomcolor from "randomcolor"; + +if (typeof self !== "undefined") { init(self); } +else if (typeof global !== "undefined") { init(global); } +else if (typeof window !== "undefined") { init(window); } +else { throw new Error("unsupported execution environment"); } + +function init(g) { + g.randomcolor = randomcolor; +} + diff --git a/frontend/vendor/react-color/react-color.bundle.min.js b/frontend/vendor/react-color/react-color.bundle.min.js index db903b9e8..041fe7949 100644 --- a/frontend/vendor/react-color/react-color.bundle.min.js +++ b/frontend/vendor/react-color/react-color.bundle.min.js @@ -1 +1 @@ -!function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function o(e,t){return e(t={exports:{}},t.exports),t.exports}var a="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";function i(){}function u(){}u.resetWarningCache=i;var l=o(function(e){e.exports=function(){function e(e,t,r,n,o,i){if(i!==a){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:u,resetWarningCache:i};return r.PropTypes=r,r}()}),s="object"==typeof r&&r&&r.Object===Object&&r,c="object"==typeof self&&self&&self.Object===Object&&self,f=s||c||Function("return this")(),p=f.Symbol,d=Object.prototype,h=d.hasOwnProperty,v=d.toString,b=p?p.toStringTag:void 0;var g=function(e){var t=h.call(e,b),r=e[b];try{e[b]=void 0;var n=!0}catch(e){}var o=v.call(e);return n&&(t?e[b]=r:delete e[b]),o},y=Object.prototype.toString;var _=function(e){return y.call(e)},m="[object Null]",w="[object Undefined]",x=p?p.toStringTag:void 0;var j=function(e){return null==e?void 0===e?w:m:x&&x in Object(e)?g(e):_(e)},O=Array.isArray;var S=function(e){return null!=e&&"object"==typeof e},C="[object String]";var k=function(e){return"string"==typeof e||!O(e)&&S(e)&&j(e)==C};var E=function(e){return function(t,r,n){for(var o=-1,a=Object(t),i=n(t),u=i.length;u--;){var l=i[e?u:++o];if(!1===r(a[l],l,a))break}return t}}();var A=function(e,t){for(var r=-1,n=Array(e);++r-1&&e%1==0&&e-1&&e%1==0&&e<=W},N={};N["[object Float32Array]"]=N["[object Float64Array]"]=N["[object Int8Array]"]=N["[object Int16Array]"]=N["[object Int32Array]"]=N["[object Uint8Array]"]=N["[object Uint8ClampedArray]"]=N["[object Uint16Array]"]=N["[object Uint32Array]"]=!0,N["[object Arguments]"]=N["[object Array]"]=N["[object ArrayBuffer]"]=N["[object Boolean]"]=N["[object DataView]"]=N["[object Date]"]=N["[object Error]"]=N["[object Function]"]=N["[object Map]"]=N["[object Number]"]=N["[object Object]"]=N["[object RegExp]"]=N["[object Set]"]=N["[object String]"]=N["[object WeakMap]"]=!1;var V=function(e){return S(e)&&I(e.length)&&!!N[j(e)]};var $=function(e){return function(t){return e(t)}},X=o(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&s.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}),q=X&&X.isTypedArray,Y=q?$(q):V,K=Object.prototype.hasOwnProperty;var G=function(e,t){var r=O(e),n=!r&&H(e),o=!r&&!n&&z(e),a=!r&&!n&&!o&&Y(e),i=r||n||o||a,u=i?A(e.length,String):[],l=u.length;for(var s in e)!t&&!K.call(e,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||B(s,l))||u.push(s);return u},J=Object.prototype;var Q=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||J)};var Z=function(e,t){return function(r){return e(t(r))}},ee=Z(Object.keys,Object),te=Object.prototype.hasOwnProperty;var re=function(e){if(!Q(e))return ee(e);var t=[];for(var r in Object(e))te.call(e,r)&&"constructor"!=r&&t.push(r);return t};var ne=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},oe="[object AsyncFunction]",ae="[object Function]",ie="[object GeneratorFunction]",ue="[object Proxy]";var le=function(e){if(!ne(e))return!1;var t=j(e);return t==ae||t==ie||t==oe||t==ue};var se=function(e){return null!=e&&I(e.length)&&!le(e)};var ce=function(e){return se(e)?G(e):re(e)};var fe=function(e,t){return e&&E(e,t,ce)};var pe=function(e){return e};var de=function(e){return"function"==typeof e?e:pe};var he=function(e,t){return e&&fe(e,de(t))},ve=Z(Object.getPrototypeOf,Object),be="[object Object]",ge=Function.prototype,ye=Object.prototype,_e=ge.toString,me=ye.hasOwnProperty,we=_e.call(Object);var xe=function(e){if(!S(e)||j(e)!=be)return!1;var t=ve(e);if(null===t)return!0;var r=me.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&_e.call(r)==we};var je=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r-1};var Pe=function(e,t){var r=this.__data__,n=Ce(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Re(e){var t=-1,r=null==e?0:e.length;for(this.clear();++tu))return!1;var s=a.get(e);if(s&&a.get(t))return s==t;var c=-1,f=!0,p=r&Tt?new At:void 0;for(a.set(e,t),a.set(t,e);++c0&&void 0!==arguments[0]?arguments[0]:[],i=[];return(0,a.default)(t,function(t){Array.isArray(t)?e(t).map(function(e){return i.push(e)}):(0,o.default)(t)?(0,n.default)(t,function(e,t){!0===e&&i.push(t),i.push(t+"-"+e)}):(0,r.default)(t)&&i.push(t)}),i};t.default=u});n(yn);yn.flattenNames;var _n=function(e,t){for(var r=-1,n=null==e?0:e.length;++r1&&void 0!==arguments[1]?arguments[1]:[],a=e.default&&(0,n.default)(e.default)||{};return t.map(function(t){var n=e[t];return n&&(0,r.default)(n,function(e,t){a[t]||(a[t]={}),a[t]=o({},a[t],n[t])}),t}),a};t.default=i});n(zo);zo.mergeClasses;var Do=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.autoprefix=void 0;var r,n=(r=he)&&r.__esModule?r:{default:r},o=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"span";return function(r){function n(){var r,l,s;i(this,n);for(var c=arguments.length,f=Array(c),p=0;p1&&void 0!==arguments[1]?arguments[1]:"span";return function(r){function n(){var r,l,s;i(this,n);for(var c=arguments.length,f=Array(c),p=0;p1&&void 0!==arguments[1])||arguments[1];r[e]=t};return 0===e&&n("first-child"),e===t-1&&n("last-child"),(0===e||e%2==0)&&n("even"),1===Math.abs(e%2)&&n("odd"),n("nth-child",e),r}});n(Wo);var Io=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ReactCSS=t.loop=t.handleActive=t.handleHover=t.hover=void 0;var r=l(yn),n=l(zo),o=l(Do),a=l(Uo),i=l(Bo),u=l(Wo);function l(e){return e&&e.__esModule?e:{default:e}}t.hover=a.default,t.handleHover=a.default,t.handleActive=i.default,t.loop=u.default;var s=t.ReactCSS=function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),i=1;i0){if(++t>=ea)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Zo);var oa=function(e,t){return na(Jo(e,t,pe),e+"")};var aa=function(e,t,r){if(!ne(r))return!1;var n=typeof t;return!!("number"==n?se(r)&&B(t,r.length):"string"==n&&t in r)&&Se(r[t],e)};var ia=function(e){return oa(function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,i&&aa(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),t=Object(t);++ni?1:Math.round(100*c/i)/100,t.a!==f)return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}else{var p=void 0;if(n!==(p=s<0?0:s>a?1:Math.round(100*s/a)/100))return{h:t.h,s:t.s,l:t.l,a:p,source:"rgb"}}return null}});n(ua);ua.calculateChange;var la=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r={},n=t.render=function(e,t,r,n){if("undefined"==typeof document&&!n)return null;var o=n?new n:document.createElement("canvas");o.width=2*r,o.height=2*r;var a=o.getContext("2d");return a?(a.fillStyle=e,a.fillRect(0,0,o.width,o.height),a.fillStyle=t,a.fillRect(0,0,r,r),a.translate(r,r),a.fillRect(0,0,r,r),o.toDataURL()):null};t.get=function(e,t,o,a){var i=e+"-"+t+"-"+o+(a?"-server":"");if(r[i])return r[i];var u=n(e,t,o,a);return r[i]=u,u}});n(la);la.render,la.get;var sa=o(function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Checkboard=void 0;var n=i(e),o=i(Io),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(la);function i(e){return e&&e.__esModule?e:{default:e}}var u=r.Checkboard=function(e){var t=e.white,r=e.grey,i=e.size,u=e.renderers,l=e.borderRadius,s=e.boxShadow,c=(0,o.default)({default:{grid:{borderRadius:l,boxShadow:s,absolute:"0px 0px 0px 0px",background:"url("+a.get(t,r,i,u.canvas)+") center left"}}});return n.default.createElement("div",{style:c.grid})};u.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}},r.default=u});n(sa);sa.Checkboard;var ca=o(function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Alpha=void 0;var n=Object.assign||function(e){for(var t=1;t-1},c=function(e){return Number(String(e).replace(/%/g,""))},f=r.EditableInput=function(t){function r(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t.handleBlur=function(){t.state.blurValue&&t.setState({value:t.state.blurValue,blurValue:null})},t.handleChange=function(e){t.setUpdatedValue(e.target.value,e)},t.handleKeyDown=function(e){var r=c(e.target.value);if(!isNaN(r)&&s(e.keyCode)){var n=t.getArrowOffset(),o=e.keyCode===u?r+n:r-n;t.setUpdatedValue(o,e)}},t.handleDrag=function(e){if(t.props.dragLabel){var r=Math.round(t.props.value+e.movementX);r>=0&&r<=t.props.dragMax&&t.props.onChange&&t.props.onChange(t.getValueObjectWithLabel(r),e)}},t.handleMouseDown=function(e){t.props.dragLabel&&(e.preventDefault(),t.handleDrag(e),window.addEventListener("mousemove",t.handleDrag),window.addEventListener("mouseup",t.handleMouseUp))},t.handleMouseUp=function(){t.unbindEventListeners()},t.unbindEventListeners=function(){window.removeEventListener("mousemove",t.handleDrag),window.removeEventListener("mouseup",t.handleMouseUp)},t.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,e.PureComponent||e.Component),n(r,[{key:"componentWillReceiveProps",value:function(e){var t=this.input;e.value!==this.state.value&&(t===document.activeElement?this.setState({blurValue:String(e.value).toUpperCase()}):this.setState({value:String(e.value).toUpperCase(),blurValue:!this.state.blurValue&&String(e.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(e){return function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},this.props.label,e)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||1}},{key:"setUpdatedValue",value:function(e,t){var r=null!==this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(r,t);var n,o=function(e){return String(e).indexOf("%")>-1}(t.target.value);this.setState({value:o?(n=e,n+"%"):e})}},{key:"render",value:function(){var e=this,t=(0,a.default)({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return o.default.createElement("div",{style:t.wrap},o.default.createElement("input",{style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?o.default.createElement("span",{style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),r}();r.default=f});n(fa);fa.EditableInput;var pa=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.calculateChange=function(e,t,r,n){var o=n.clientWidth,a=n.clientHeight,i="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,u="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,l=i-(n.getBoundingClientRect().left+window.pageXOffset),s=u-(n.getBoundingClientRect().top+window.pageYOffset);if("vertical"===t){var c=void 0;if(s<0)c=359;else if(s>a)c=0;else{c=360*(-100*s/a+100)/100}if(r.h!==c)return{h:c,s:r.s,l:r.l,a:r.a,source:"rgb"}}else{var f=void 0;if(l<0)f=0;else if(l>o)f=359;else{f=360*(100*l/o)/100}if(r.h!==f)return{h:f,s:r.s,l:r.l,a:r.a,source:"rgb"}}return null}});n(pa);pa.calculateChange;var da=o(function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Hue=void 0;var n=function(){function e(e,t){for(var r=0;r=t||r<0||f&&e-s>=a}function v(){var e=va();if(h(e))return b(e);u=setTimeout(v,function(e){var r=t-(e-l);return f?Sa(r,a-(e-s)):r}(e))}function b(e){return u=void 0,p&&n?d(e):(n=o=void 0,i)}function g(){var e=va(),r=h(e);if(n=arguments,o=this,l=e,r){if(void 0===u)return function(e){return s=e,u=setTimeout(v,t),c?d(e):i}(l);if(f)return clearTimeout(u),u=setTimeout(v,t),d(l)}return void 0===u&&(u=setTimeout(v,t)),i}return t=xa(t)||0,ne(r)&&(c=!!r.leading,a=(f="maxWait"in r)?Oa(xa(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),g.cancel=function(){void 0!==u&&clearTimeout(u),s=0,n=l=o=u=void 0},g.flush=function(){return void 0===u?i:b(va())},g},ka="Expected a function";var Ea=function(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new TypeError(ka);return ne(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),Ca(e,t,{leading:n,maxWait:t,trailing:o})},Aa=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.calculateChange=function(e,t,r){var n=r.getBoundingClientRect(),o=n.width,a=n.height,i="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,u="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,l=i-(r.getBoundingClientRect().left+window.pageXOffset),s=u-(r.getBoundingClientRect().top+window.pageYOffset);l<0?l=0:l>o?l=o:s<0?s=0:s>a&&(s=a);var c=100*l/o,f=-100*s/a+100;return{h:t.h,s:c,v:f,a:t.a,source:"rgb"}}});n(Aa);Aa.calculateChange;var Ma=o(function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Saturation=void 0;var n=function(){function e(e,t){for(var r=0;r1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=M(e,360),t=M(t,100),r=M(r,100),0===t)n=o=a=r;else{var u=r<.5?r*(1+t):r+t-r*t,l=2*r-u;n=i(l,u,e+1/3),o=i(l,u,e),a=i(l,u,e-1/3)}return{r:255*n,g:255*o,b:255*a}}(e.h,l,c),f=!0,p="hsl"),e.hasOwnProperty("a")&&(a=e.a));var d,h,v;return a=A(a),{ok:f,format:e.format||p,r:i(255,u(o.r,0)),g:i(255,u(o.g,0)),b:i(255,u(o.b,0)),a:a}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=a(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=c.ok,this._tc_id=o++}function c(e,t,r){e=M(e,255),t=M(t,255),r=M(r,255);var n,o,a=u(e,t,r),l=i(e,t,r),s=(a+l)/2;if(a==l)n=o=0;else{var c=a-l;switch(o=s>.5?c/(2-a-l):c/(a+l),a){case e:n=(t-r)/c+(t>1)+720)%360;--t;)n.h=(n.h+o)%360,a.push(s(n));return a}function C(e,t){t=t||6;for(var r=s(e).toHsv(),n=r.h,o=r.s,a=r.v,i=[],u=1/t;t--;)i.push(s({h:n,s:o,v:a})),a=(a+u)%1;return i}s.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,r,n,o=this.toRgb();return e=o.r/255,r=o.g/255,n=o.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=A(e),this._roundA=a(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=a(360*e.h),r=a(100*e.s),n=a(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=c(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=c(this._r,this._g,this._b),t=a(360*e.h),r=a(100*e.s),n=a(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return p(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,o){var i=[T(a(e).toString(16)),T(a(t).toString(16)),T(a(r).toString(16)),T(H(n))];if(o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*M(this._r,255))+"%",g:a(100*M(this._g,255))+"%",b:a(100*M(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*M(this._r,255))+"%, "+a(100*M(this._g,255))+"%, "+a(100*M(this._b,255))+"%)":"rgba("+a(100*M(this._r,255))+"%, "+a(100*M(this._g,255))+"%, "+a(100*M(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[p(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+d(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var o=s(e);r="#"+d(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return s(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(b,arguments)},spin:function(){return this._applyModification(m,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(w,arguments)},monochromatic:function(){return this._applyCombination(C,arguments)},splitcomplement:function(){return this._applyCombination(O,arguments)},triad:function(){return this._applyCombination(x,arguments)},tetrad:function(){return this._applyCombination(j,arguments)}},s.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:F(e[n]));e=r}return s(e,t)},s.equals=function(e,t){return!(!e||!t)&&s(e).toRgbString()==s(t).toRgbString()},s.random=function(){return s.fromRatio({r:l(),g:l(),b:l()})},s.mix=function(e,t,r){r=0===r?0:r||50;var n=s(e).toRgb(),o=s(t).toRgb(),a=r/100;return s({r:(o.r-n.r)*a+n.r,g:(o.g-n.g)*a+n.g,b:(o.b-n.b)*a+n.b,a:(o.a-n.a)*a+n.a})},s.readability=function(e,r){var n=s(e),o=s(r);return(t.max(n.getLuminance(),o.getLuminance())+.05)/(t.min(n.getLuminance(),o.getLuminance())+.05)},s.isReadable=function(e,t,r){var n,o,a=s.readability(e,t);switch(o=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":o=a>=4.5;break;case"AAlarge":o=a>=3;break;case"AAAsmall":o=a>=7}return o},s.mostReadable=function(e,t,r){var n,o,a,i,u=null,l=0;o=(r=r||{}).includeFallbackColors,a=r.level,i=r.size;for(var c=0;cl&&(l=n,u=s(t[c]));return s.isReadable(e,u,{level:a,size:i})||!o?u:(r.includeFallbackColors=!1,s.mostReadable(e,["#fff","#000"],r))};var k=s.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},E=s.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(k);function A(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function M(e,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=i(r,u(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(e){return i(1,u(0,e))}function R(e){return parseInt(e,16)}function T(e){return 1==e.length?"0"+e:""+e}function F(e){return e<=1&&(e=100*e+"%"),e}function H(e){return t.round(255*parseFloat(e)).toString(16)}function L(e){return R(e)/255}var z,D,U,B=(D="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",U="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+D),rgba:new RegExp("rgba"+U),hsl:new RegExp("hsl"+D),hsla:new RegExp("hsla"+U),hsv:new RegExp("hsv"+D),hsva:new RegExp("hsva"+U),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function W(e){return!!B.CSS_UNIT.exec(e)}e.exports?e.exports=s:window.tinycolor=s}(Math)}),Ta=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.red=t.getContrastingColor=t.isValidHex=t.toState=t.simpleCheckForValidColor=void 0;var r=o(Pa),n=o(Ra);function o(e){return e&&e.__esModule?e:{default:e}}t.simpleCheckForValidColor=function(e){var t=0,n=0;return(0,r.default)(["r","g","b","a","h","s","l","v"],function(r){if(e[r]&&(t+=1,isNaN(e[r])||(n+=1),"s"===r||"l"===r)){/^\d+%$/.test(e[r])&&(n+=1)}}),t===n&&e};var a=t.toState=function(e,t){var r=e.hex?(0,n.default)(e.hex):(0,n.default)(e),o=r.toHsl(),a=r.toHsv(),i=r.toRgb(),u=r.toHex();return 0===o.s&&(o.h=t||0,a.h=t||0),{hsl:o,hex:"000000"===u&&0===i.a?"transparent":"#"+u,rgb:i,hsv:a,oldHue:e.h||t||o.h,source:e.source}};t.isValidHex=function(e){var t="#"===String(e).charAt(0)?1:0;return e.length!==4+t&&e.length<7+t&&(0,n.default)(e).isValid()},t.getContrastingColor=function(e){if(!e)return"#fff";var t=a(e);return"transparent"===t.hex?"rgba(0,0,0,0.4)":(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3>=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});n(Ta);Ta.red,Ta.getContrastingColor,Ta.isValidHex,Ta.toState,Ta.simpleCheckForValidColor;var Fa=o(function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ColorWrap=void 0;var n=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"span";return function(r){function n(){var e,t,r;u(this,n);for(var o=arguments.length,a=Array(o),i=0;i100&&(e.a=100),e.a/=100,t({h:i.h,s:i.s,l:i.l,a:e.a,source:"rgb"},n))};return n.default.createElement("div",{style:s.fields,className:"flexbox-fix"},n.default.createElement("div",{style:s.double},n.default.createElement(za.EditableInput,{style:{input:s.input,label:s.label},label:"hex",value:u.replace("#",""),onChange:c})),n.default.createElement("div",{style:s.single},n.default.createElement(za.EditableInput,{style:{input:s.input,label:s.label},label:"r",value:r.r,onChange:c,dragLabel:"true",dragMax:"255"})),n.default.createElement("div",{style:s.single},n.default.createElement(za.EditableInput,{style:{input:s.input,label:s.label},label:"g",value:r.g,onChange:c,dragLabel:"true",dragMax:"255"})),n.default.createElement("div",{style:s.single},n.default.createElement(za.EditableInput,{style:{input:s.input,label:s.label},label:"b",value:r.b,onChange:c,dragLabel:"true",dragMax:"255"})),n.default.createElement("div",{style:s.alpha},n.default.createElement(za.EditableInput,{style:{input:s.input,label:s.label},label:"a",value:Math.round(100*r.a),onChange:c,dragLabel:"true",dragMax:"100"})))};r.default=u});n(Da);Da.SketchFields;var Ua=o(function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.SketchPresetColors=void 0;var n=Object.assign||function(e){for(var t=1;t-1&&e%1==0&&e-1&&e%1==0&&e<=W},N={};N["[object Float32Array]"]=N["[object Float64Array]"]=N["[object Int8Array]"]=N["[object Int16Array]"]=N["[object Int32Array]"]=N["[object Uint8Array]"]=N["[object Uint8ClampedArray]"]=N["[object Uint16Array]"]=N["[object Uint32Array]"]=!0,N["[object Arguments]"]=N["[object Array]"]=N["[object ArrayBuffer]"]=N["[object Boolean]"]=N["[object DataView]"]=N["[object Date]"]=N["[object Error]"]=N["[object Function]"]=N["[object Map]"]=N["[object Number]"]=N["[object Object]"]=N["[object RegExp]"]=N["[object Set]"]=N["[object String]"]=N["[object WeakMap]"]=!1;var V=function(e){return S(e)&&I(e.length)&&!!N[j(e)]};var $=function(e){return function(t){return e(t)}},X=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&s.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a})),q=X&&X.isTypedArray,Y=q?$(q):V,K=Object.prototype.hasOwnProperty;var G=function(e,t){var r=O(e),n=!r&&H(e),o=!r&&!n&&z(e),a=!r&&!n&&!o&&Y(e),i=r||n||o||a,u=i?A(e.length,String):[],l=u.length;for(var s in e)!t&&!K.call(e,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||B(s,l))||u.push(s);return u},J=Object.prototype;var Q=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||J)};var Z=function(e,t){return function(r){return e(t(r))}},ee=Z(Object.keys,Object),te=Object.prototype.hasOwnProperty;var re=function(e){if(!Q(e))return ee(e);var t=[];for(var r in Object(e))te.call(e,r)&&"constructor"!=r&&t.push(r);return t};var ne=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},oe="[object AsyncFunction]",ae="[object Function]",ie="[object GeneratorFunction]",ue="[object Proxy]";var le=function(e){if(!ne(e))return!1;var t=j(e);return t==ae||t==ie||t==oe||t==ue};var se=function(e){return null!=e&&I(e.length)&&!le(e)};var ce=function(e){return se(e)?G(e):re(e)};var fe=function(e,t){return e&&E(e,t,ce)};var pe=function(e){return e};var de=function(e){return"function"==typeof e?e:pe};var he=function(e,t){return e&&fe(e,de(t))},ve=Z(Object.getPrototypeOf,Object),be="[object Object]",ge=Function.prototype,ye=Object.prototype,_e=ge.toString,me=ye.hasOwnProperty,we=_e.call(Object);var xe=function(e){if(!S(e)||j(e)!=be)return!1;var t=ve(e);if(null===t)return!0;var r=me.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&_e.call(r)==we};var je=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r-1};var Pe=function(e,t){var r=this.__data__,n=Ce(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Re(e){var t=-1,r=null==e?0:e.length;for(this.clear();++tu))return!1;var s=a.get(e);if(s&&a.get(t))return s==t;var c=-1,f=!0,p=r&Tt?new At:void 0;for(a.set(e,t),a.set(t,e);++c0&&void 0!==arguments[0]?arguments[0]:[],i=[];return(0,a.default)(t,(function(t){Array.isArray(t)?e(t).map((function(e){return i.push(e)})):(0,o.default)(t)?(0,n.default)(t,(function(e,t){!0===e&&i.push(t),i.push(t+"-"+e)})):(0,r.default)(t)&&i.push(t)})),i};t.default=u}));n(yn);yn.flattenNames;var _n=function(e,t){for(var r=-1,n=null==e?0:e.length;++r1&&void 0!==arguments[1]?arguments[1]:[],a=e.default&&(0,n.default)(e.default)||{};return t.map((function(t){var n=e[t];return n&&(0,r.default)(n,(function(e,t){a[t]||(a[t]={}),a[t]=o({},a[t],n[t])})),t})),a};t.default=i}));n(zo);zo.mergeClasses;var Do=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.autoprefix=void 0;var r,n=(r=he)&&r.__esModule?r:{default:r},o=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"span";return function(r){function n(){var r,l,s;i(this,n);for(var c=arguments.length,f=Array(c),p=0;p1&&void 0!==arguments[1]?arguments[1]:"span";return function(r){function n(){var r,l,s;i(this,n);for(var c=arguments.length,f=Array(c),p=0;p1&&void 0!==arguments[1])||arguments[1];r[e]=t};return 0===e&&n("first-child"),e===t-1&&n("last-child"),(0===e||e%2==0)&&n("even"),1===Math.abs(e%2)&&n("odd"),n("nth-child",e),r}}));n(Wo);var Io=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ReactCSS=t.loop=t.handleActive=t.handleHover=t.hover=void 0;var r=l(yn),n=l(zo),o=l(Do),a=l(Uo),i=l(Bo),u=l(Wo);function l(e){return e&&e.__esModule?e:{default:e}}t.hover=a.default,t.handleHover=a.default,t.handleActive=i.default,t.loop=u.default;var s=t.ReactCSS=function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),i=1;i0){if(++t>=ea)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Zo);var oa=function(e,t){return na(Jo(e,t,pe),e+"")};var aa=function(e,t,r){if(!ne(r))return!1;var n=typeof t;return!!("number"==n?se(r)&&B(t,r.length):"string"==n&&t in r)&&Se(r[t],e)};var ia=function(e){return oa((function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,i&&aa(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),t=Object(t);++ni?1:Math.round(100*c/i)/100,t.a!==f)return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}else{var p=void 0;if(n!==(p=s<0?0:s>a?1:Math.round(100*s/a)/100))return{h:t.h,s:t.s,l:t.l,a:p,source:"rgb"}}return null}}));n(ua);ua.calculateChange;var la=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r={},n=t.render=function(e,t,r,n){if("undefined"==typeof document&&!n)return null;var o=n?new n:document.createElement("canvas");o.width=2*r,o.height=2*r;var a=o.getContext("2d");return a?(a.fillStyle=e,a.fillRect(0,0,o.width,o.height),a.fillStyle=t,a.fillRect(0,0,r,r),a.translate(r,r),a.fillRect(0,0,r,r),o.toDataURL()):null};t.get=function(e,t,o,a){var i=e+"-"+t+"-"+o+(a?"-server":"");if(r[i])return r[i];var u=n(e,t,o,a);return r[i]=u,u}}));n(la);la.render,la.get;var sa=o((function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Checkboard=void 0;var n=i(e),o=i(Io),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(la);function i(e){return e&&e.__esModule?e:{default:e}}var u=r.Checkboard=function(e){var t=e.white,r=e.grey,i=e.size,u=e.renderers,l=e.borderRadius,s=e.boxShadow,c=(0,o.default)({default:{grid:{borderRadius:l,boxShadow:s,absolute:"0px 0px 0px 0px",background:"url("+a.get(t,r,i,u.canvas)+") center left"}}});return n.default.createElement("div",{style:c.grid})};u.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}},r.default=u}));n(sa);sa.Checkboard;var ca=o((function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Alpha=void 0;var n=Object.assign||function(e){for(var t=1;t-1},c=function(e){return Number(String(e).replace(/%/g,""))},f=r.EditableInput=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.handleBlur=function(){r.state.blurValue&&r.setState({value:r.state.blurValue,blurValue:null})},r.handleChange=function(e){r.setUpdatedValue(e.target.value,e)},r.handleKeyDown=function(e){var t=c(e.target.value);if(!isNaN(t)&&s(e.keyCode)){var n=r.getArrowOffset(),o=e.keyCode===u?t+n:t-n;r.setUpdatedValue(o,e)}},r.handleDrag=function(e){if(r.props.dragLabel){var t=Math.round(r.props.value+e.movementX);t>=0&&t<=r.props.dragMax&&r.props.onChange&&r.props.onChange(r.getValueObjectWithLabel(t),e)}},r.handleMouseDown=function(e){r.props.dragLabel&&(e.preventDefault(),r.handleDrag(e),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"componentWillReceiveProps",value:function(e){var t=this.input;e.value!==this.state.value&&(t===document.activeElement?this.setState({blurValue:String(e.value).toUpperCase()}):this.setState({value:String(e.value).toUpperCase(),blurValue:!this.state.blurValue&&String(e.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(e){return function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},this.props.label,e)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||1}},{key:"setUpdatedValue",value:function(e,t){var r=null!==this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(r,t);var n,o=function(e){return String(e).indexOf("%")>-1}(t.target.value);this.setState({value:o?(n=e,n+"%"):e})}},{key:"render",value:function(){var e=this,t=(0,a.default)({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return o.default.createElement("div",{style:t.wrap},o.default.createElement("input",{style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?o.default.createElement("span",{style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(e.PureComponent||e.Component);r.default=f}));n(fa);fa.EditableInput;var pa=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.calculateChange=function(e,t,r,n){var o=n.clientWidth,a=n.clientHeight,i="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,u="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,l=i-(n.getBoundingClientRect().left+window.pageXOffset),s=u-(n.getBoundingClientRect().top+window.pageYOffset);if("vertical"===t){var c=void 0;if(s<0)c=359;else if(s>a)c=0;else{c=360*(-100*s/a+100)/100}if(r.h!==c)return{h:c,s:r.s,l:r.l,a:r.a,source:"rgb"}}else{var f=void 0;if(l<0)f=0;else if(l>o)f=359;else{f=360*(100*l/o)/100}if(r.h!==f)return{h:f,s:r.s,l:r.l,a:r.a,source:"rgb"}}return null}}));n(pa);pa.calculateChange;var da=o((function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Hue=void 0;var n=function(){function e(e,t){for(var r=0;r=t||r<0||f&&e-s>=a}function v(){var e=va();if(h(e))return b(e);u=setTimeout(v,function(e){var r=t-(e-l);return f?Sa(r,a-(e-s)):r}(e))}function b(e){return u=void 0,p&&n?d(e):(n=o=void 0,i)}function g(){var e=va(),r=h(e);if(n=arguments,o=this,l=e,r){if(void 0===u)return function(e){return s=e,u=setTimeout(v,t),c?d(e):i}(l);if(f)return clearTimeout(u),u=setTimeout(v,t),d(l)}return void 0===u&&(u=setTimeout(v,t)),i}return t=xa(t)||0,ne(r)&&(c=!!r.leading,a=(f="maxWait"in r)?Oa(xa(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),g.cancel=function(){void 0!==u&&clearTimeout(u),s=0,n=l=o=u=void 0},g.flush=function(){return void 0===u?i:b(va())},g},ka="Expected a function";var Ea=function(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new TypeError(ka);return ne(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),Ca(e,t,{leading:n,maxWait:t,trailing:o})},Aa=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.calculateChange=function(e,t,r){var n=r.getBoundingClientRect(),o=n.width,a=n.height,i="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,u="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,l=i-(r.getBoundingClientRect().left+window.pageXOffset),s=u-(r.getBoundingClientRect().top+window.pageYOffset);l<0?l=0:l>o?l=o:s<0?s=0:s>a&&(s=a);var c=100*l/o,f=-100*s/a+100;return{h:t.h,s:c,v:f,a:t.a,source:"rgb"}}}));n(Aa);Aa.calculateChange;var Ma=o((function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Saturation=void 0;var n=function(){function e(e,t){for(var r=0;r1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=M(e,360),t=M(t,100),r=M(r,100),0===t)n=o=a=r;else{var u=r<.5?r*(1+t):r+t-r*t,l=2*r-u;n=i(l,u,e+1/3),o=i(l,u,e),a=i(l,u,e-1/3)}return{r:255*n,g:255*o,b:255*a}}(e.h,l,c),f=!0,p="hsl"),e.hasOwnProperty("a")&&(a=e.a));var d,h,v;return a=A(a),{ok:f,format:e.format||p,r:i(255,u(o.r,0)),g:i(255,u(o.g,0)),b:i(255,u(o.b,0)),a:a}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=a(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=c.ok,this._tc_id=o++}function c(e,t,r){e=M(e,255),t=M(t,255),r=M(r,255);var n,o,a=u(e,t,r),l=i(e,t,r),s=(a+l)/2;if(a==l)n=o=0;else{var c=a-l;switch(o=s>.5?c/(2-a-l):c/(a+l),a){case e:n=(t-r)/c+(t>1)+720)%360;--t;)n.h=(n.h+o)%360,a.push(s(n));return a}function C(e,t){t=t||6;for(var r=s(e).toHsv(),n=r.h,o=r.s,a=r.v,i=[],u=1/t;t--;)i.push(s({h:n,s:o,v:a})),a=(a+u)%1;return i}s.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,r,n,o=this.toRgb();return e=o.r/255,r=o.g/255,n=o.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=A(e),this._roundA=a(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=a(360*e.h),r=a(100*e.s),n=a(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=c(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=c(this._r,this._g,this._b),t=a(360*e.h),r=a(100*e.s),n=a(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return p(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,o){var i=[T(a(e).toString(16)),T(a(t).toString(16)),T(a(r).toString(16)),T(H(n))];if(o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*M(this._r,255))+"%",g:a(100*M(this._g,255))+"%",b:a(100*M(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*M(this._r,255))+"%, "+a(100*M(this._g,255))+"%, "+a(100*M(this._b,255))+"%)":"rgba("+a(100*M(this._r,255))+"%, "+a(100*M(this._g,255))+"%, "+a(100*M(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[p(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+d(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var o=s(e);r="#"+d(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return s(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(b,arguments)},spin:function(){return this._applyModification(m,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(w,arguments)},monochromatic:function(){return this._applyCombination(C,arguments)},splitcomplement:function(){return this._applyCombination(O,arguments)},triad:function(){return this._applyCombination(x,arguments)},tetrad:function(){return this._applyCombination(j,arguments)}},s.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:F(e[n]));e=r}return s(e,t)},s.equals=function(e,t){return!(!e||!t)&&s(e).toRgbString()==s(t).toRgbString()},s.random=function(){return s.fromRatio({r:l(),g:l(),b:l()})},s.mix=function(e,t,r){r=0===r?0:r||50;var n=s(e).toRgb(),o=s(t).toRgb(),a=r/100;return s({r:(o.r-n.r)*a+n.r,g:(o.g-n.g)*a+n.g,b:(o.b-n.b)*a+n.b,a:(o.a-n.a)*a+n.a})},s.readability=function(e,r){var n=s(e),o=s(r);return(t.max(n.getLuminance(),o.getLuminance())+.05)/(t.min(n.getLuminance(),o.getLuminance())+.05)},s.isReadable=function(e,t,r){var n,o,a=s.readability(e,t);switch(o=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":o=a>=4.5;break;case"AAlarge":o=a>=3;break;case"AAAsmall":o=a>=7}return o},s.mostReadable=function(e,t,r){var n,o,a,i,u=null,l=0;o=(r=r||{}).includeFallbackColors,a=r.level,i=r.size;for(var c=0;cl&&(l=n,u=s(t[c]));return s.isReadable(e,u,{level:a,size:i})||!o?u:(r.includeFallbackColors=!1,s.mostReadable(e,["#fff","#000"],r))};var k=s.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},E=s.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(k);function A(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function M(e,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=i(r,u(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(e){return i(1,u(0,e))}function R(e){return parseInt(e,16)}function T(e){return 1==e.length?"0"+e:""+e}function F(e){return e<=1&&(e=100*e+"%"),e}function H(e){return t.round(255*parseFloat(e)).toString(16)}function L(e){return R(e)/255}var z,D,U,B=(D="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",U="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+D),rgba:new RegExp("rgba"+U),hsl:new RegExp("hsl"+D),hsla:new RegExp("hsla"+U),hsv:new RegExp("hsv"+D),hsva:new RegExp("hsva"+U),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function W(e){return!!B.CSS_UNIT.exec(e)}e.exports?e.exports=s:window.tinycolor=s}(Math)})),Ta=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.red=t.getContrastingColor=t.isValidHex=t.toState=t.simpleCheckForValidColor=void 0;var r=o(Pa),n=o(Ra);function o(e){return e&&e.__esModule?e:{default:e}}t.simpleCheckForValidColor=function(e){var t=0,n=0;return(0,r.default)(["r","g","b","a","h","s","l","v"],(function(r){if(e[r]&&(t+=1,isNaN(e[r])||(n+=1),"s"===r||"l"===r)){/^\d+%$/.test(e[r])&&(n+=1)}})),t===n&&e};var a=t.toState=function(e,t){var r=e.hex?(0,n.default)(e.hex):(0,n.default)(e),o=r.toHsl(),a=r.toHsv(),i=r.toRgb(),u=r.toHex();return 0===o.s&&(o.h=t||0,a.h=t||0),{hsl:o,hex:"000000"===u&&0===i.a?"transparent":"#"+u,rgb:i,hsv:a,oldHue:e.h||t||o.h,source:e.source}};t.isValidHex=function(e){var t="#"===String(e).charAt(0)?1:0;return e.length!==4+t&&e.length<7+t&&(0,n.default)(e).isValid()},t.getContrastingColor=function(e){if(!e)return"#fff";var t=a(e);return"transparent"===t.hex?"rgba(0,0,0,0.4)":(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3>=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}));n(Ta);Ta.red,Ta.getContrastingColor,Ta.isValidHex,Ta.toState,Ta.simpleCheckForValidColor;var Fa=o((function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ColorWrap=void 0;var n=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"span";return function(r){function n(){var e,t,r;u(this,n);for(var o=arguments.length,a=Array(o),i=0;i100&&(e.a=100),e.a/=100,t({h:i.h,s:i.s,l:i.l,a:e.a,source:"rgb"},n))};return n.default.createElement("div",{style:s.fields,className:"flexbox-fix"},n.default.createElement("div",{style:s.double},n.default.createElement(za.EditableInput,{style:{input:s.input,label:s.label},label:"hex",value:u.replace("#",""),onChange:c})),n.default.createElement("div",{style:s.single},n.default.createElement(za.EditableInput,{style:{input:s.input,label:s.label},label:"r",value:r.r,onChange:c,dragLabel:"true",dragMax:"255"})),n.default.createElement("div",{style:s.single},n.default.createElement(za.EditableInput,{style:{input:s.input,label:s.label},label:"g",value:r.g,onChange:c,dragLabel:"true",dragMax:"255"})),n.default.createElement("div",{style:s.single},n.default.createElement(za.EditableInput,{style:{input:s.input,label:s.label},label:"b",value:r.b,onChange:c,dragLabel:"true",dragMax:"255"})),n.default.createElement("div",{style:s.alpha},n.default.createElement(za.EditableInput,{style:{input:s.input,label:s.label},label:"a",value:Math.round(100*r.a),onChange:c,dragLabel:"true",dragMax:"100"})))};r.default=u}));n(Da);Da.SketchFields;var Ua=o((function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.SketchPresetColors=void 0;var n=Object.assign||function(e){for(var t=1;t 0 && arguments[0] !== undefined ? arguments[0] : 0; return state + 1; -}function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; } +}function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } -function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(source, true).forEach(function (key) { _defineProperty$3(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } +function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(Object(source), true).forEach(function (key) { _defineProperty$3(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function reduce() { @@ -1705,7 +1705,7 @@ function _slicedToArray$2(arr, i) { return _arrayWithHoles$2(arr) || _iterableTo function _nonIterableRest$2() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } -function _iterableToArrayLimit$2(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } +function _iterableToArrayLimit$2(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles$2(arr) { if (Array.isArray(arr)) return arr; } @@ -1751,7 +1751,7 @@ function mapContainsValue(map, searchValue) { return true; } - isDone = done; + isDone = !!done; } while (!isDone); return false; @@ -1959,6 +1959,7 @@ function () { }, { key: "getActions", value: function getActions() { + /* eslint-disable-next-line @typescript-eslint/no-this-alias */ var manager = this; var dispatch = this.store.dispatch; @@ -2465,7 +2466,7 @@ function () { function _nonIterableRest$3() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } -function _iterableToArrayLimit$3(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } +function _iterableToArrayLimit$3(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles$3(arr) { if (Array.isArray(arr)) return arr; } @@ -2535,7 +2536,7 @@ function useDragHandler(spec, monitor, connector) { function _nonIterableRest$4() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } -function _iterableToArrayLimit$4(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } +function _iterableToArrayLimit$4(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles$4(arr) { if (Array.isArray(arr)) return arr; } /** @@ -2813,7 +2814,7 @@ function () { function _nonIterableRest$5() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } -function _iterableToArrayLimit$5(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } +function _iterableToArrayLimit$5(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles$5(arr) { if (Array.isArray(arr)) return arr; } function useDropTargetMonitor() { @@ -2864,7 +2865,7 @@ function useDropHandler(spec, monitor, connector) { function _nonIterableRest$6() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } -function _iterableToArrayLimit$6(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } +function _iterableToArrayLimit$6(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles$6(arr) { if (Array.isArray(arr)) return arr; } /** @@ -2896,9 +2897,18 @@ function useDrop(spec) { connector.reconnect(); }, [spec.options]); return [result, connectDropTarget]; -}function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } +}function _slicedToArray$7(arr, i) { return _arrayWithHoles$7(arr) || _iterableToArrayLimit$7(arr, i) || _nonIterableRest$7(); } + +function _nonIterableRest$7() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit$7(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles$7(arr) { if (Array.isArray(arr)) return arr; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } +var refCount$1 = 0; /** * A React component that provides the React-DnD context */ @@ -2907,13 +2917,53 @@ var DndProvider = React.memo(function (_ref) { var children = _ref.children, props = _objectWithoutProperties(_ref, ["children"]); - var context = 'manager' in props ? { - dragDropManager: props.manager - } : createSingletonDndContext(props.backend, props.context, props.options, props.debugMode); + var _getDndContextValue = getDndContextValue(props), + _getDndContextValue2 = _slicedToArray$7(_getDndContextValue, 2), + manager = _getDndContextValue2[0], + isGlobalInstance = _getDndContextValue2[1]; // memoized from props + + /** + * If the global context was used to store the DND context + * then where theres no more references to it we should + * clean it up to avoid memory leaks + */ + + + React.useEffect(function () { + if (isGlobalInstance) { + refCount$1++; + } + + return function () { + if (isGlobalInstance) { + refCount$1--; + + if (refCount$1 === 0) { + var context = getGlobalContext(); + context[instanceSymbol] = null; + } + } + }; + }, []); return React.createElement(DndContext.Provider, { - value: context + value: manager }, children); }); +DndProvider.displayName = 'DndProvider'; + +function getDndContextValue(props) { + if ('manager' in props) { + var _manager = { + dragDropManager: props.manager + }; + return [_manager, false]; + } + + var manager = createSingletonDndContext(props.backend, props.context, props.options, props.debugMode); + var isGlobalInstance = !props.context; + return [manager, isGlobalInstance]; +} + var instanceSymbol = Symbol.for('__REACT_DND_CONTEXT_INSTANCE__'); function createSingletonDndContext(backend) { @@ -2931,26 +2981,7 @@ function createSingletonDndContext(backend) { function getGlobalContext() { return typeof global$1 !== 'undefined' ? global$1 : window; -}/* - * A utility for rendering a drag preview image - */ - -var DragPreviewImage = React.memo(function (_ref) { - var connect = _ref.connect, - src = _ref.src; - - if (typeof Image !== 'undefined') { - var img = new Image(); - img.src = src; - - img.onload = function () { - return connect(img); - }; - } - - return null; -}); -DragPreviewImage.displayName = 'DragPreviewImage';// cheap lodash replacements +}// cheap lodash replacements function memoize(fn) { var result = null; @@ -3253,7 +3284,7 @@ function getDragPreviewOffset(sourceNode, dragPreview, clientOffset, anchorPoint }; }var FILE = '__NATIVE_FILE__'; var URL = '__NATIVE_URL__'; -var TEXT = '__NATIVE_TEXT__';var NativeTypes = /*#__PURE__*/Object.freeze({FILE: FILE,URL: URL,TEXT: TEXT});function getDataFromDataTransfer(dataTransfer, typesToTry, defaultValue) { +var TEXT = '__NATIVE_TEXT__';var NativeTypes=/*#__PURE__*/Object.freeze({__proto__:null,FILE: FILE,URL: URL,TEXT: TEXT});function getDataFromDataTransfer(dataTransfer, typesToTry, defaultValue) { var result = typesToTry.reduce(function (resultSoFar, typeToTry) { return resultSoFar || dataTransfer.getData(typeToTry); }, ''); @@ -3295,41 +3326,46 @@ var NativeDragSource = /*#__PURE__*/ function () { function NativeDragSource(config) { - var _this = this; - _classCallCheck$9(this, NativeDragSource); this.config = config; this.item = {}; - Object.keys(this.config.exposeProperties).forEach(function (property) { - Object.defineProperty(_this.item, property, { - configurable: true, - enumerable: true, - get: function get() { - // eslint-disable-next-line no-console - console.warn("Browser doesn't allow reading \"".concat(property, "\" until the drop event.")); - return null; - } - }); - }); + this.initializeExposedProperties(); } _createClass$9(NativeDragSource, [{ - key: "mutateItemByReadingDataTransfer", - value: function mutateItemByReadingDataTransfer(dataTransfer) { + key: "initializeExposedProperties", + value: function initializeExposedProperties() { + var _this = this; + + Object.keys(this.config.exposeProperties).forEach(function (property) { + Object.defineProperty(_this.item, property, { + configurable: true, + enumerable: true, + get: function get() { + // eslint-disable-next-line no-console + console.warn("Browser doesn't allow reading \"".concat(property, "\" until the drop event.")); + return null; + } + }); + }); + } + }, { + key: "loadDataTransfer", + value: function loadDataTransfer(dataTransfer) { var _this2 = this; - var newProperties = {}; - if (dataTransfer) { + var newProperties = {}; Object.keys(this.config.exposeProperties).forEach(function (property) { newProperties[property] = { - value: _this2.config.exposeProperties[property](dataTransfer, _this2.config.matchesTypes) + value: _this2.config.exposeProperties[property](dataTransfer, _this2.config.matchesTypes), + configurable: true, + enumerable: true }; }); + Object.defineProperties(this.item, newProperties); } - - Object.defineProperties(this.item, newProperties); } }, { key: "canDrag", @@ -3353,8 +3389,10 @@ function () { }]); return NativeDragSource; -}();function createNativeDragSource(type) { - return new NativeDragSource(nativeTypesConfig[type]); +}();function createNativeDragSource(type, dataTransfer) { + var result = new NativeDragSource(nativeTypesConfig[type]); + result.loadDataTransfer(dataTransfer); + return result; } function matchNativeItemType(dataTransfer) { if (!dataTransfer) { @@ -3406,9 +3444,9 @@ function () { }]); return OptionsReader; -}();function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; } +}();function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } -function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$4(source, true).forEach(function (key) { _defineProperty$5(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$4(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } +function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$4(Object(source), true).forEach(function (key) { _defineProperty$5(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty$5(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } @@ -3608,7 +3646,7 @@ function () { if (nativeType) { // A native item (such as file or URL) dragged from outside the document - _this.beginDragNativeItem(nativeType); + _this.beginDragNativeItem(nativeType, dataTransfer); } }; @@ -3718,7 +3756,7 @@ function () { e.preventDefault(); if (_this.isDraggingNativeItem()) { - _this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer); + _this.currentNativeSource.loadDataTransfer(e.dataTransfer); } _this.enterLeaveCounter.reset(); @@ -3945,9 +3983,9 @@ function () { } }, { key: "beginDragNativeItem", - value: function beginDragNativeItem(type) { + value: function beginDragNativeItem(type, dataTransfer) { this.clearCurrentDragSourceNode(); - this.currentNativeSource = createNativeDragSource(type); + this.currentNativeSource = createNativeDragSource(type, dataTransfer); this.currentNativeHandle = this.registry.addSource(type, this.currentNativeSource); this.actions.beginDrag([this.currentNativeHandle]); } diff --git a/frontend/vendor/react-dnd/react-dnd.bundle.min.js b/frontend/vendor/react-dnd/react-dnd.bundle.min.js index 7a4faa605..8ffc75ea1 100644 --- a/frontend/vendor/react-dnd/react-dnd.bundle.min.js +++ b/frontend/vendor/react-dnd/react-dnd.bundle.min.js @@ -1 +1 @@ -!function(e){"use strict";var t,r="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},n=function(e,t,r,n,i,o,a,u){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,i,o,a,u],l=0;(c=new Error(t.replace(/%s/g,function(){return s[l++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}},i="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,o=function(e,t,r,n){var i=r?r.call(n,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var u=Object.prototype.hasOwnProperty.bind(t),c=0;c0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},n=r.publishSource,i=void 0===n||n,o=r.clientOffset,a=r.getSourceClientOffset,u=e.getMonitor(),c=e.getRegistry();e.dispatch(m(o)),T(t,u,c);var s=k(t,u);if(null!==s){var l=null;o&&(I(a),l=a(s)),e.dispatch(m(o,l));var f=c.getSource(s),d=f.beginDrag(u,s);E(d),c.pinSource(s);var g=c.getSourceType(s);return{type:h,payload:{itemType:g,item:d,sourceId:s,clientOffset:o||null,sourceClientOffset:l||null,isSourcePublic:!!i}}}e.dispatch(D)}}function T(e,t,r){n(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(e){n(r.getSource(e),"Expected sourceIds to be registered.")})}function I(e){n("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}function E(e){n(O(e),"Item must be an object.")}function k(e,t){for(var r=null,n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function C(e){return function(){if(e.getMonitor().isDragging())return{type:p}}}function P(e,t){return null===t?null===e:Array.isArray(e)?e.some(function(e){return e===t}):e===t}function N(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.clientOffset;R(t);var i=t.slice(0),o=e.getMonitor(),a=e.getRegistry();x(i,o,a);var u=o.getItemType();return j(i,a,u),M(i,o,a),{type:v,payload:{targetIds:i,clientOffset:n||null}}}}function R(e){n(Array.isArray(e),"Expected targetIds to be an array.")}function x(e,t,r){n(t.isDragging(),"Cannot call hover while not dragging."),n(!t.didDrop(),"Cannot call hover after drop.");for(var i=0;i=0;n--){var i=e[n];P(t.getTargetType(i),r)||e.splice(n,1)}}function M(e,t,r){e.forEach(function(e){r.getTarget(e).hover(t,e)})}function A(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(e)),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r}function L(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},r=e.getMonitor(),n=e.getRegistry();U(r);var i=B(r);i.forEach(function(i,o){var a=F(i,o,n,r),u={type:y,payload:{dropResult:L({},t,{},a)}};e.dispatch(u)})}}function U(e){n(e.isDragging(),"Cannot call drop while not dragging."),n(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function F(e,t,r,i){var o=r.getTarget(e),a=o?o.drop(i,e):void 0;return function(e){n(void 0===e||O(e),"Drop result must either be an object or undefined.")}(a),void 0===a&&(a=0===t?{}:i.getDropResult()),a}function B(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Y(e){return function(){var t=e.getMonitor(),r=e.getRegistry();!function(e){n(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var i=t.getSourceId();return r.getSource(i,!0).endDrag(t,i),r.unpinSource(),{type:b}}}var G=function(e,t){return e===t};function X(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(e)),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r}function W(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var K={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function V(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K,n=arguments.length>1?arguments[1]:void 0,i=n.payload;switch(n.type){case g:case h:return{initialSourceClientOffset:i.sourceClientOffset,initialClientOffset:i.clientOffset,clientOffset:i.clientOffset};case v:return e=r.clientOffset,t=i.clientOffset,!e&&!t||e&&t&&e.x===t.x&&e.y===t.y?r:function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:te,n=arguments.length>1?arguments[1]:void 0,i=n.payload;switch(n.type){case h:return $({},r,{itemType:i.itemType,item:i.item,sourceId:i.sourceId,isSourcePublic:i.isSourcePublic,dropResult:null,didDrop:!1});case p:return $({},r,{isSourcePublic:!0});case v:return $({},r,{targetIds:i.targetIds});case Q:return-1===r.targetIds.indexOf(i.targetId)?r:$({},r,{targetIds:(e=r.targetIds,t=i.targetId,e.filter(function(e){return e!==t}))});case y:return $({},r,{dropResult:i.dropResult,didDrop:!0,targetIds:[]});case b:return $({},r,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return r}}function ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case q:case z:return e+1;case J:case Q:return e-1;default:return e}}var ie=[],oe=[];function ae(e,t){return e!==ie&&(e===oe||void 0===t||(r=e,t.filter(function(e){return r.indexOf(e)>-1})).length>0);var r}function ue(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case v:break;case q:case z:case Q:case J:return ie;case h:case p:case b:case y:default:return oe}var t=e.payload,r=t.targetIds,n=void 0===r?[]:r,i=t.prevTargetIds,o=void 0===i?[]:i,a=function(e,t){var r=new Map,n=function(e){return r.set(e,r.has(e)?r.get(e)+1:1)};e.forEach(n),t.forEach(n);var i=[];return r.forEach(function(e,t){1===e&&i.push(t)}),i}(n,o);if(!(a.length>0||!function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:G;if(e.length!==t.length)return!1;for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0)+1}function se(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(e)),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r}function le(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:ue(n.dirtyHandlerIds,{type:i.type,payload:le({},i.payload,{prevTargetIds:(e=n,t="dragOperation.targetIds",r=[],t.split(".").reduce(function(e,t){return e&&e[t]?e[t]:r||null},e))})}),dragOffset:V(n.dragOffset,i),refCount:ne(n.refCount,i),dragOperation:re(n.dragOperation,i),stateId:ce(n.stateId)}}function ge(e,t){return{x:e.x-t.x,y:e.y-t.y}}function he(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{handlerIds:void 0},i=r.handlerIds;n("function"==typeof e,"listener must be a function."),n(void 0===i||Array.isArray(i),"handlerIds, when specified, must be an array of strings.");var o=this.store.getState().stateId,a=function(){var r=t.store.getState(),n=r.stateId;try{n===o||n===o+1&&!ae(r.dirtyHandlerIds,i)||e()}finally{o=n}};return this.store.subscribe(a)}},{key:"subscribeToOffsetChange",value:function(e){var t=this;n("function"==typeof e,"listener must be a function.");var r=this.store.getState().dragOffset;return this.store.subscribe(function(){var n=t.store.getState().dragOffset;n!==r&&(r=n,e())})}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return n(t,"Expected to find a valid source."),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return n(t,"Expected to find a valid target."),!(!this.isDragging()||this.didDrop())&&(P(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e))}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return n(t,"Expected to find a valid source."),!(!this.isDragging()||!this.isSourcePublic())&&(this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e))}},{key:"isOverTarget",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1};if(!e)return!1;var r=t.shallow;if(!this.isDragging())return!1;var n=this.registry.getTargetType(e),i=this.getItemType();if(i&&!P(n,i))return!1;var o=this.getTargetIds();if(!o.length)return!1;var a=o.indexOf(e);return r?a===o.length-1:a>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return e=this.store.getState().dragOffset,n=e.clientOffset,i=e.initialClientOffset,o=e.initialSourceClientOffset,n&&i&&o?ge((r=o,{x:(t=n).x+r.x,y:t.y+r.y}),i):null;var e,t,r,n,i,o}},{key:"getDifferenceFromInitialOffset",value:function(){return e=this.store.getState().dragOffset,t=e.clientOffset,r=e.initialClientOffset,t&&r?ge(t,r):null;var e,t,r}}])&&he(t.prototype,r),i&&he(t,i),e}(),ve="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ye=be;function be(e){we.length||me(),we[we.length]=e}var me,we=[],Oe=0,De=1024;function Se(){for(;OeDe){for(var t=0,r=we.length-Oe;t1&&void 0!==arguments[1]&&arguments[1];n(this.isSourceId(e),"Expected a valid source ID.");var r=t&&e===this.pinnedSourceId,i=r?this.pinnedSource:this.dragSources.get(e);return i}},{key:"getTarget",value:function(e){return n(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return n(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return n(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return Ye(e)===t.SOURCE}},{key:"isTargetId",value:function(e){return Ye(e)===t.TARGET}},{key:"removeSource",value:function(e){var t=this;n(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:J,payload:{sourceId:e}}}(e)),je(function(){t.dragSources.delete(e),t.types.delete(e)})}},{key:"removeTarget",value:function(e){n(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:Q,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);n(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){n(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,r,n){var i=Be(e);return this.types.set(i,r),e===t.SOURCE?this.dragSources.set(i,n):e===t.TARGET&&this.dropTargets.set(i,n),i}}])&&Ue(r.prototype,i),o&&Ue(r,o),e}();function We(e,t){for(var r=0;r0&&void 0!==arguments[0]&&arguments[0];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isSetUp=!1,this.handleRefCountChange=function(){var e=t.store.getState().refCount>0;t.backend&&(e&&!t.isSetUp?(t.backend.setup(),t.isSetUp=!0):!e&&t.isSetUp&&(t.backend.teardown(),t.isSetUp=!1))};var n=function(e){var t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return d(de,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(r);this.store=n,this.monitor=new pe(n,new Xe(n)),n.subscribe(this.handleRefCountChange)}var t,r,n;return t=e,(r=[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch;var r=function(e){return{beginDrag:S(e),publishDragSource:C(e),hover:N(e),drop:H(e),endDrag:Y(e)}}(this);return Object.keys(r).reduce(function(n,i){var o,a=r[i];return n[i]=(o=a,function(){for(var r=arguments.length,n=new Array(r),i=0;i or
. Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),i?e.cloneElement(t,{ref:function(e){et(i,e),et(r,e)}}):e.cloneElement(t,{ref:r})}function rt(e){if("string"!=typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a
, or turn it into a ")+"drag source or a drop target itself.")}}function nt(t){var r={};return Object.keys(t).forEach(function(n){var i=t[n];if(n.endsWith("Ref"))r[n]=t[n];else{var o=function(t){return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e.isValidElement(r)){var i=r;return t(i,n),i}var o=r;rt(o);var a=n?function(e){return t(e,n)}:t;return tt(o,a)}}(i);r[n]=function(){return o}}}),r}function it(e){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ot(e){return null!==e&&"object"===it(e)&&e.hasOwnProperty("current")}function at(e,t){for(var r=0;r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var Ot=e.memo(function(t){var n=t.children,i=wt(t,["children"]),o="manager"in i?{dragDropManager:i.manager}:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0!==r?r:window,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=t;o[Dt]||(o[Dt]=function(e,t,r,n){return{dragDropManager:Ve(e,t,r,n)}}(e,t,n,i));return o[Dt]}(i.backend,i.context,i.options,i.debugMode);return e.createElement(qe.Provider,{value:o},n)}),Dt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");function St(e){var t=null;return function(){return null==t&&(t=e()),t}}function Tt(e,t){for(var r=0;r0}},{key:"leave",value:function(e){var t,r,n=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),r=e,t.filter(function(e){return e!==r})),n>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}])&&Tt(t.prototype,r),n&&Tt(t,n),e}(),Et=St(function(){return/firefox/i.test(navigator.userAgent)}),kt=St(function(){return Boolean(window.safari)});function Ct(e,t){for(var r=0;re))return r[u];s=u-1}}var f=e-t[a=Math.max(0,s)],d=f*f;return r[a]+n[a]*f+i[a]*d+o[a]*f*d}}])&&Ct(t.prototype,r),n&&Ct(t,n),e}(),Nt=1;function Rt(e){var t=e.nodeType===Nt?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top;return{x:r.left,y:n}}function xt(e){return{x:e.clientX,y:e.clientY}}function jt(e,t,r,n,i){var o,a=function(e){return"IMG"===e.nodeName&&(Et()||!document.documentElement.contains(e))}(t),u=Rt(a?e:t),c={x:r.x-u.x,y:r.y-u.y},s=e.offsetWidth,l=e.offsetHeight,f=n.anchorX,d=n.anchorY,g=function(e,t,r,n){var i=e?t.width:r,o=e?t.height:n;return kt()&&e&&(o/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:o}}(a,t,s,l),h=g.dragPreviewWidth,p=g.dragPreviewHeight,v=i.offsetX,y=i.offsetY,b=0===y||y;return{x:0===v||v?v:new Pt([0,.5,1],[c.x,c.x/s*h,c.x+h-s]).interpolate(f),y:b?y:(o=new Pt([0,.5,1],[c.y,c.y/l*p,c.y+p-l]).interpolate(d),kt()&&a&&(o+=(window.devicePixelRatio-1)*p),o)}}var Mt,At="__NATIVE_FILE__",Lt="__NATIVE_URL__",_t="__NATIVE_TEXT__",Ht=Object.freeze({FILE:At,URL:Lt,TEXT:_t});function Ut(e,t,r){var n=t.reduce(function(t,r){return t||e.getData(r)},"");return null!=n?n:r}function Ft(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Bt=(Ft(Mt={},At,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items}},matchesTypes:["Files"]}),Ft(Mt,Lt,{exposeProperties:{urls:function(e,t){return Ut(e,t,"").split("\n")}},matchesTypes:["Url","text/uri-list"]}),Ft(Mt,_t,{exposeProperties:{text:function(e,t){return Ut(e,t,"")}},matchesTypes:["Text","text/plain"]}),Mt);function Yt(e,t){for(var r=0;r-1})})[0]||null}function Wt(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},n=r.publishSource,i=void 0===n||n,o=r.clientOffset,a=r.getSourceClientOffset,u=e.getMonitor(),c=e.getRegistry();e.dispatch(m(o)),T(t,u,c);var s=k(t,u);if(null!==s){var l=null;o&&(I(a),l=a(s)),e.dispatch(m(o,l));var f=c.getSource(s),d=f.beginDrag(u,s);E(d),c.pinSource(s);var g=c.getSourceType(s);return{type:h,payload:{itemType:g,item:d,sourceId:s,clientOffset:o||null,sourceClientOffset:l||null,isSourcePublic:!!i}}}e.dispatch(D)}}function T(e,t,r){n(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach((function(e){n(r.getSource(e),"Expected sourceIds to be registered.")}))}function I(e){n("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}function E(e){n(w(e),"Item must be an object.")}function k(e,t){for(var r=null,n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function C(e){return function(){if(e.getMonitor().isDragging())return{type:p}}}function P(e,t){return null===t?null===e:Array.isArray(e)?e.some((function(e){return e===t})):e===t}function j(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.clientOffset;N(t);var i=t.slice(0),o=e.getMonitor(),a=e.getRegistry();x(i,o,a);var u=o.getItemType();return R(i,a,u),M(i,o,a),{type:v,payload:{targetIds:i,clientOffset:n||null}}}}function N(e){n(Array.isArray(e),"Expected targetIds to be an array.")}function x(e,t,r){n(t.isDragging(),"Cannot call hover while not dragging."),n(!t.didDrop(),"Cannot call hover after drop.");for(var i=0;i=0;n--){var i=e[n];P(t.getTargetType(i),r)||e.splice(n,1)}}function M(e,t,r){e.forEach((function(e){r.getTarget(e).hover(t,e)}))}function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},r=e.getMonitor(),n=e.getRegistry();U(r);var i=B(r);i.forEach((function(i,o){var a=F(i,o,n,r),u={type:y,payload:{dropResult:_({},t,{},a)}};e.dispatch(u)}))}}function U(e){n(e.isDragging(),"Cannot call drop while not dragging."),n(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function F(e,t,r,i){var o=r.getTarget(e),a=o?o.drop(i,e):void 0;return function(e){n(void 0===e||w(e),"Drop result must either be an object or undefined.")}(a),void 0===a&&(a=0===t?{}:i.getDropResult()),a}function B(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Y(e){return function(){var t=e.getMonitor(),r=e.getRegistry();!function(e){n(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var i=t.getSourceId();return r.getSource(i,!0).endDrag(t,i),r.unpinSource(),{type:b}}}var G=function(e,t){return e===t};function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function W(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var K={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function V(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K,n=arguments.length>1?arguments[1]:void 0,i=n.payload;switch(n.type){case g:case h:return{initialSourceClientOffset:i.sourceClientOffset,initialClientOffset:i.clientOffset,clientOffset:i.clientOffset};case v:return e=r.clientOffset,t=i.clientOffset,!e&&!t||e&&t&&e.x===t.x&&e.y===t.y?r:function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:te,n=arguments.length>1?arguments[1]:void 0,i=n.payload;switch(n.type){case h:return $({},r,{itemType:i.itemType,item:i.item,sourceId:i.sourceId,isSourcePublic:i.isSourcePublic,dropResult:null,didDrop:!1});case p:return $({},r,{isSourcePublic:!0});case v:return $({},r,{targetIds:i.targetIds});case Q:return-1===r.targetIds.indexOf(i.targetId)?r:$({},r,{targetIds:(e=r.targetIds,t=i.targetId,e.filter((function(e){return e!==t})))});case y:return $({},r,{dropResult:i.dropResult,didDrop:!0,targetIds:[]});case b:return $({},r,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return r}}function ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case q:case z:return e+1;case J:case Q:return e-1;default:return e}}var ie=[],oe=[];function ae(e,t){return e!==ie&&(e===oe||void 0===t||(r=e,t.filter((function(e){return r.indexOf(e)>-1}))).length>0);var r}function ue(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case v:break;case q:case z:case Q:case J:return ie;case h:case p:case b:case y:default:return oe}var t=e.payload,r=t.targetIds,n=void 0===r?[]:r,i=t.prevTargetIds,o=void 0===i?[]:i,a=function(e,t){var r=new Map,n=function(e){return r.set(e,r.has(e)?r.get(e)+1:1)};e.forEach(n),t.forEach(n);var i=[];return r.forEach((function(e,t){1===e&&i.push(t)})),i}(n,o);if(!(a.length>0||!function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:G;if(e.length!==t.length)return!1;for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0)+1}function se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function le(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:ue(n.dirtyHandlerIds,{type:i.type,payload:le({},i.payload,{prevTargetIds:(e=n,t="dragOperation.targetIds",r=[],t.split(".").reduce((function(e,t){return e&&e[t]?e[t]:r||null}),e))})}),dragOffset:V(n.dragOffset,i),refCount:ne(n.refCount,i),dragOperation:re(n.dragOperation,i),stateId:ce(n.stateId)}}function ge(e,t){return{x:e.x-t.x,y:e.y-t.y}}function he(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{handlerIds:void 0},i=r.handlerIds;n("function"==typeof e,"listener must be a function."),n(void 0===i||Array.isArray(i),"handlerIds, when specified, must be an array of strings.");var o=this.store.getState().stateId,a=function(){var r=t.store.getState(),n=r.stateId;try{n===o||n===o+1&&!ae(r.dirtyHandlerIds,i)||e()}finally{o=n}};return this.store.subscribe(a)}},{key:"subscribeToOffsetChange",value:function(e){var t=this;n("function"==typeof e,"listener must be a function.");var r=this.store.getState().dragOffset;return this.store.subscribe((function(){var n=t.store.getState().dragOffset;n!==r&&(r=n,e())}))}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return n(t,"Expected to find a valid source."),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return n(t,"Expected to find a valid target."),!(!this.isDragging()||this.didDrop())&&P(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return n(t,"Expected to find a valid source."),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}},{key:"isOverTarget",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1};if(!e)return!1;var r=t.shallow;if(!this.isDragging())return!1;var n=this.registry.getTargetType(e),i=this.getItemType();if(i&&!P(n,i))return!1;var o=this.getTargetIds();if(!o.length)return!1;var a=o.indexOf(e);return r?a===o.length-1:a>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return e=this.store.getState().dragOffset,n=e.clientOffset,i=e.initialClientOffset,o=e.initialSourceClientOffset,n&&i&&o?ge((r=o,{x:(t=n).x+r.x,y:t.y+r.y}),i):null;var e,t,r,n,i,o}},{key:"getDifferenceFromInitialOffset",value:function(){return e=this.store.getState().dragOffset,t=e.clientOffset,r=e.initialClientOffset,t&&r?ge(t,r):null;var e,t,r}}])&&he(t.prototype,r),i&&he(t,i),e}(),ve="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ye=be;function be(e){Oe.length||me(),Oe[Oe.length]=e}var me,Oe=[],we=0,De=1024;function Se(){for(;weDe){for(var t=0,r=Oe.length-we;t1&&void 0!==arguments[1]&&arguments[1];n(this.isSourceId(e),"Expected a valid source ID.");var r=t&&e===this.pinnedSourceId,i=r?this.pinnedSource:this.dragSources.get(e);return i}},{key:"getTarget",value:function(e){return n(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return n(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return n(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return Ye(e)===t.SOURCE}},{key:"isTargetId",value:function(e){return Ye(e)===t.TARGET}},{key:"removeSource",value:function(e){var t=this;n(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:J,payload:{sourceId:e}}}(e)),Re((function(){t.dragSources.delete(e),t.types.delete(e)}))}},{key:"removeTarget",value:function(e){n(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:Q,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);n(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){n(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,r,n){var i=Be(e);return this.types.set(i,r),e===t.SOURCE?this.dragSources.set(i,n):e===t.TARGET&&this.dropTargets.set(i,n),i}}])&&Ue(r.prototype,i),o&&Ue(r,o),e}();function We(e,t){for(var r=0;r0&&void 0!==arguments[0]&&arguments[0];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isSetUp=!1,this.handleRefCountChange=function(){var e=t.store.getState().refCount>0;t.backend&&(e&&!t.isSetUp?(t.backend.setup(),t.isSetUp=!0):!e&&t.isSetUp&&(t.backend.teardown(),t.isSetUp=!1))};var n=function(e){var t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return d(de,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(r);this.store=n,this.monitor=new pe(n,new Xe(n)),n.subscribe(this.handleRefCountChange)}var t,r,n;return t=e,(r=[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch,r=function(e){return{beginDrag:S(e),publishDragSource:C(e),hover:j(e),drop:H(e),endDrag:Y(e)}}(this);return Object.keys(r).reduce((function(n,i){var o,a=r[i];return n[i]=(o=a,function(){for(var r=arguments.length,n=new Array(r),i=0;i or
. Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),i?e.cloneElement(t,{ref:function(e){et(i,e),et(r,e)}}):e.cloneElement(t,{ref:r})}function rt(e){if("string"!=typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a
, or turn it into a ")+"drag source or a drop target itself.")}}function nt(t){var r={};return Object.keys(t).forEach((function(n){var i=t[n];if(n.endsWith("Ref"))r[n]=t[n];else{var o=function(t){return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e.isValidElement(r)){var i=r;return t(i,n),i}var o=r;rt(o);var a=n?function(e){return t(e,n)}:t;return tt(o,a)}}(i);r[n]=function(){return o}}})),r}function it(e){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ot(e){return null!==e&&"object"===it(e)&&e.hasOwnProperty("current")}function at(e,t){for(var r=0;r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var Dt=0,St=e.memo((function(t){var r=t.children,n=Ot(function(e){if("manager"in e){return[{dragDropManager:e.manager},!1]}var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:It(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=t;i[Tt]||(i[Tt]=function(e,t,r,n){return{dragDropManager:Ve(e,t,r,n)}}(e,t,r,n));return i[Tt]}(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}(wt(t,["children"])),2),i=n[0],o=n[1];return e.useEffect((function(){return o&&Dt++,function(){o&&(0===--Dt&&(It()[Tt]=null))}}),[]),e.createElement(qe.Provider,{value:i},r)}));St.displayName="DndProvider";var Tt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");function It(){return void 0!==r?r:window}function Et(e){var t=null;return function(){return null==t&&(t=e()),t}}function kt(e,t){for(var r=0;r0}},{key:"leave",value:function(e){var t,r,n=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),r=e,t.filter((function(e){return e!==r}))),n>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}])&&kt(t.prototype,r),n&&kt(t,n),e}(),Pt=Et((function(){return/firefox/i.test(navigator.userAgent)})),jt=Et((function(){return Boolean(window.safari)}));function Nt(e,t){for(var r=0;re))return r[u];s=u-1}}var f=e-t[a=Math.max(0,s)],d=f*f;return r[a]+n[a]*f+i[a]*d+o[a]*f*d}}])&&Nt(t.prototype,r),n&&Nt(t,n),e}(),Rt=1;function Mt(e){var t=e.nodeType===Rt?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top;return{x:r.left,y:n}}function At(e){return{x:e.clientX,y:e.clientY}}function _t(e,t,r,n,i){var o,a=function(e){return"IMG"===e.nodeName&&(Pt()||!document.documentElement.contains(e))}(t),u=Mt(a?e:t),c={x:r.x-u.x,y:r.y-u.y},s=e.offsetWidth,l=e.offsetHeight,f=n.anchorX,d=n.anchorY,g=function(e,t,r,n){var i=e?t.width:r,o=e?t.height:n;return jt()&&e&&(o/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:o}}(a,t,s,l),h=g.dragPreviewWidth,p=g.dragPreviewHeight,v=i.offsetX,y=i.offsetY,b=0===y||y;return{x:0===v||v?v:new xt([0,.5,1],[c.x,c.x/s*h,c.x+h-s]).interpolate(f),y:b?y:(o=new xt([0,.5,1],[c.y,c.y/l*p,c.y+p-l]).interpolate(d),jt()&&a&&(o+=(window.devicePixelRatio-1)*p),o)}}var Lt,Ht="__NATIVE_FILE__",Ut="__NATIVE_URL__",Ft="__NATIVE_TEXT__",Bt=Object.freeze({__proto__:null,FILE:Ht,URL:Ut,TEXT:Ft});function Yt(e,t,r){var n=t.reduce((function(t,r){return t||e.getData(r)}),"");return null!=n?n:r}function Gt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Xt=(Gt(Lt={},Ht,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items}},matchesTypes:["Files"]}),Gt(Lt,Ut,{exposeProperties:{urls:function(e,t){return Yt(e,t,"").split("\n")}},matchesTypes:["Url","text/uri-list"]}),Gt(Lt,Ft,{exposeProperties:{text:function(e,t){return Yt(e,t,"")}},matchesTypes:["Text","text/plain"]}),Lt);function Wt(e,t){for(var r=0;r-1}))}))[0]||null}function qt(e,t){for(var r=0;r