function isChromeExtension(){return window.chrome&&window.chrome.extension}function resetColors(){[].slice.call(document.querySelectorAll(".paint-area")).forEach(function(a){a.style[classie.has(a,"paint-area--text")?"color":"background-color"]=""})}!function(a){"use strict";function b(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}function c(a,b){var c=d(a,b)?f:e;c(a,b)}var d,e,f;"classList"in document.documentElement?(d=function(a,b){return a.classList.contains(b)},e=function(a,b){a.classList.add(b)},f=function(a,b){a.classList.remove(b)}):(d=function(a,c){return b(c).test(a.className)},e=function(a,b){d(a,b)||(a.className=a.className+" "+b)},f=function(a,c){a.className=a.className.replace(b(c)," ")});var g={hasClass:d,addClass:e,removeClass:f,toggleClass:c,has:d,add:e,remove:f,toggle:c};"function"==typeof define&&define.amd?define(g):"object"==typeof exports?module.exports=g:a.classie=g}(window),!function(a){"use strict";function b(){}function c(a){if(!a||"object"!=typeof a)return!1;var b=w(a)||na;return/object|function/.test(typeof b.Element)?a instanceof b.Element:1===a.nodeType&&"string"==typeof a.nodeName}function d(a){return!(!a||!a.Window)&&a instanceof a.Window}function e(a){return!!a&&a instanceof pa}function f(a){return g(a)&&void 0!==typeof a.length&&h(a.splice)}function g(a){return!!a&&"object"==typeof a}function h(a){return"function"==typeof a}function i(a){return"number"==typeof a}function j(a){return"boolean"==typeof a}function k(a){return"string"==typeof a}function l(a){return k(a)?(oa.querySelector(a),!0):!1}function m(a,b){for(var c in b)a[c]=b[c];return a}function n(a,b){a.page=a.page||{},a.page.x=b.page.x,a.page.y=b.page.y,a.client=a.client||{},a.client.x=b.client.x,a.client.y=b.client.y,a.timeStamp=b.timeStamp}function o(a,b,c){b||(b=c.pointerIds.length>1?z(c.pointers):c.pointers[0]),r(b,wa,c),a.page.x=wa.x,a.page.y=wa.y,s(b,wa,c),a.client.x=wa.x,a.client.y=wa.y,a.timeStamp=(new Date).getTime()}function p(a,b,c){a.page.x=c.page.x-b.page.x,a.page.y=c.page.y-b.page.y,a.client.x=c.client.x-b.client.x,a.client.y=c.client.y-b.client.y,a.timeStamp=(new Date).getTime()-b.timeStamp;var d=Math.max(a.timeStamp/1e3,.001);a.page.speed=va(a.page.x,a.page.y)/d,a.page.vx=a.page.x/d,a.page.vy=a.page.y/d,a.client.speed=va(a.client.x,a.page.y)/d,a.client.vx=a.client.x/d,a.client.vy=a.client.y/d}function q(a,b,c){return c=c||{},a=a||"page",c.x=b[a+"X"],c.y=b[a+"Y"],c}function r(a,b,c){return b=b||{},a instanceof W?/inertiastart/.test(a.type)?(c=c||a.interaction,m(b,c.inertiaStatus.upCoords.page),b.x+=c.inertiaStatus.sx,b.y+=c.inertiaStatus.sy):(b.x=a.pageX,b.y=a.pageY):Pa?(q("screen",a,b),b.x+=na.scrollX,b.y+=na.scrollY):q("page",a,b),b}function s(a,b,c){return b=b||{},a instanceof W?/inertiastart/.test(a.type)?(m(b,c.inertiaStatus.upCoords.client),b.x+=c.inertiaStatus.sx,b.y+=c.inertiaStatus.sy):(b.x=a.clientX,b.y=a.clientY):q(Pa?"screen":"client",a,b),b}function t(a){return a=a||na,{x:a.scrollX||a.document.documentElement.scrollLeft,y:a.scrollY||a.document.documentElement.scrollTop}}function u(a){return i(a.pointerId)?a.pointerId:a.identifier}function v(a){return a instanceof sa?a.correspondingUseElement:a}function w(a){if(d(a))return a;var b=a.ownerDocument||a;return b.defaultView||b.parentWindow||na}function x(a){var b=Qa?{x:0,y:0}:t(w(a)),c=a instanceof qa?a.getBoundingClientRect():a.getClientRects()[0];return c&&{left:c.left+b.x,right:c.right+b.x,top:c.top+b.y,bottom:c.bottom+b.y,width:c.width||c.right-c.left,height:c.heigh||c.bottom-c.top}}function y(a){var b=[];return f(a)?(b[0]=a[0],b[1]=a[1]):"touchend"===a.type?1===a.touches.length?(b[0]=a.touches[0],b[1]=a.changedTouches[0]):0===a.touches.length&&(b[0]=a.changedTouches[0],b[1]=a.changedTouches[1]):(b[0]=a.touches[0],b[1]=a.touches[1]),b}function z(a){var b=y(a);return{pageX:(b[0].pageX+b[1].pageX)/2,pageY:(b[0].pageY+b[1].pageY)/2,clientX:(b[0].clientX+b[1].clientX)/2,clientY:(b[0].clientY+b[1].clientY)/2}}function A(a){if(a.length||a.touches&&a.touches.length>1){var b=y(a),c=Math.min(b[0].pageX,b[1].pageX),d=Math.min(b[0].pageY,b[1].pageY),e=Math.max(b[0].pageX,b[1].pageX),f=Math.max(b[0].pageY,b[1].pageY);return{x:c,y:d,left:c,top:d,width:e-c,height:f-d}}}function B(a,b){b=b||Ca.deltaSource;var c=b+"X",d=b+"Y",e=y(a),f=e[0][c]-e[1][c],g=e[0][d]-e[1][d];return va(f,g)}function C(a,b,c){c=c||Ca.deltaSource;var d=c+"X",e=c+"Y",f=y(a),g=f[0][d]-f[1][d],h=f[0][e]-f[1][e],j=180*Math.atan(h/g)/Math.PI;if(i(b)){var k=j-b,l=k%360;l>315?j-=360+j/360|0:l>135?j-=180+j/360|0:-315>l?j+=360+j/360|0:-135>l&&(j+=180+j/360|0)}return j}function D(a,b){var d=a?a.options.origin:Ca.origin;return"parent"===d?d=J(b):"self"===d?d=a.getRect(b):l(d)&&(d=I(b,d)||{x:0,y:0}),h(d)&&(d=d(a&&b)),c(d)&&(d=x(d)),d.x="x"in d?d.x:d.left,d.y="y"in d?d.y:d.top,d}function E(a,b,c,d){var e=1-a;return e*e*b+2*e*a*c+a*a*d}function F(a,b,c,d,e,f,g){return{x:E(g,a,c,e),y:E(g,b,d,f)}}function G(a,b,c,d){return a/=d,-c*a*(a-2)+b}function H(a,b){for(;b;){if(b===a)return!0;b=b.parentNode}return!1}function I(a,b){for(var d=J(a);c(d);){if(ja(d,b))return d;d=J(d)}return null}function J(a){var b=a.parentNode;if(e(b)){for(;(b=b.host)&&e(b););return b}return b}function K(a,b){return a._context===b.ownerDocument||H(a._context,b)}function L(a,b,d){var e=a.options.ignoreFrom;return e&&c(d)?k(e)?ka(d,e,b):c(e)?H(e,d):!1:!1}function M(a,b,d){var e=a.options.allowFrom;return e?c(d)?k(e)?ka(d,e,b):c(e)?H(e,d):!1:!1:!0}function N(a,b){if(!b)return!1;var c=b.options.drag.axis;return"xy"===a||"xy"===c||c===a}function O(a,b){var c=a.options;return/^resize/.test(b)&&(b="resize"),c[b].snap&&c[b].snap.enabled}function P(a,b){var c=a.options;return/^resize/.test(b)&&(b="resize"),c[b].restrict&&c[b].restrict.enabled}function Q(a,b){var c=a.options;return/^resize/.test(b)&&(b="resize"),c[b].autoScroll&&c[b].autoScroll.enabled}function R(a,b,c){for(var d=a.options,e=d[c.name].max,f=d[c.name].maxPerElement,g=0,h=0,i=0,j=0,k=za.length;k>j;j++){var l=za[j],m=l.prepared.name,n=l.interacting();if(n){if(g++,g>=Ja)return!1;if(l.target===a){if(h+=m===c.name|0,h>=e)return!1;if(l.element===b&&(i++,m!==c.name||i>=f))return!1}}}return Ja>0}function S(a){var b,c,d,e,f,g=a[0],h=g?0:-1,i=[],j=[];for(e=1;e<a.length;e++)if(b=a[e],b&&b!==g)if(g){if(b.parentNode!==b.ownerDocument)if(g.parentNode!==b.ownerDocument){if(!i.length)for(c=g;c.parentNode&&c.parentNode!==c.ownerDocument;)i.unshift(c),c=c.parentNode;if(g instanceof ta&&b instanceof qa&&!(b instanceof ra)){if(b===g.parentNode)continue;c=b.ownerSVGElement}else c=b;for(j=[];c.parentNode!==c.ownerDocument;)j.unshift(c),c=c.parentNode;for(f=0;j[f]&&j[f]===i[f];)f++;var k=[j[f-1],j[f],i[f]];for(d=k[0].lastChild;d;){if(d===k[1]){g=b,h=e,i=[];break}if(d===k[2])break;d=d.previousSibling}}else g=b,h=e}else g=b,h=e;return h}function T(){if(this.target=null,this.element=null,this.dropTarget=null,this.dropElement=null,this.prevDropTarget=null,this.prevDropElement=null,this.prepared={name:null,axis:null,edges:null},this.matches=[],this.matchElements=[],this.inertiaStatus={active:!1,smoothEnd:!1,startEvent:null,upCoords:{},xe:0,ye:0,sx:0,sy:0,t0:0,vx0:0,vys:0,duration:0,resumeDx:0,resumeDy:0,lambda_v0:0,one_ve_v0:0,i:null},h(Function.prototype.bind))this.boundInertiaFrame=this.inertiaFrame.bind(this),this.boundSmoothEndFrame=this.smoothEndFrame.bind(this);else{var a=this;this.boundInertiaFrame=function(){return a.inertiaFrame()},this.boundSmoothEndFrame=function(){return a.smoothEndFrame()}}this.activeDrops={dropzones:[],elements:[],rects:[]},this.pointers=[],this.pointerIds=[],this.downTargets=[],this.downTimes=[],this.holdTimers=[],this.prevCoords={page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},this.curCoords={page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},this.startCoords={page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},this.pointerDelta={page:{x:0,y:0,vx:0,vy:0,speed:0},client:{x:0,y:0,vx:0,vy:0,speed:0},timeStamp:0},this.downEvent=null,this.downPointer={},this._eventTarget=null,this._curEventTarget=null,this.prevEvent=null,this.tapTime=0,this.prevTap=null,this.startOffset={left:0,right:0,top:0,bottom:0},this.restrictOffset={left:0,right:0,top:0,bottom:0},this.snapOffsets=[],this.gesture={start:{x:0,y:0},startDistance:0,prevDistance:0,distance:0,scale:1,startAngle:0,prevAngle:0},this.snapStatus={x:0,y:0,dx:0,dy:0,realX:0,realY:0,snappedX:0,snappedY:0,targets:[],locked:!1,changed:!1},this.restrictStatus={dx:0,dy:0,restrictedX:0,restrictedY:0,snap:null,restricted:!1,changed:!1},this.restrictStatus.snap=this.snapStatus,this.pointerIsDown=!1,this.pointerWasMoved=!1,this.gesturing=!1,this.dragging=!1,this.resizing=!1,this.resizeAxes="xy",this.mouse=!1,za.push(this)}function U(a,b,c){var d,e=0,f=za.length,g=/mouse/i.test(a.pointerType||b)||4===a.pointerType,h=u(a);if(/down|start/i.test(b))for(e=0;f>e;e++){d=za[e];var i=c;if(d.inertiaStatus.active&&d.target.options[d.prepared.name].inertia.allowResume&&d.mouse===g)for(;i;){if(i===d.element)return d.pointers[0]&&d.removePointer(d.pointers[0]),d.addPointer(a),d;i=J(i)}}if(g||!Ea&&!Fa){for(e=0;f>e;e++)if(za[e].mouse&&!za[e].inertiaStatus.active)return za[e];for(e=0;f>e;e++)if(za[e].mouse&&(!/down/.test(b)||!za[e].inertiaStatus.active))return d;return d=new T,d.mouse=!0,d}for(e=0;f>e;e++)if(ia(za[e].pointerIds,h))return za[e];if(/up|end|out/i.test(b))return null;for(e=0;f>e;e++)if(d=za[e],!(d.prepared.name&&!d.target.options.gesture.enabled||d.interacting()||!g&&d.mouse))return d.addPointer(a),d;return new T}function V(a){return function(b){var c,d,e=v(b.path?b.path[0]:b.target),f=v(b.currentTarget);if(Ea&&/touch/.test(b.type))for(Ia=(new Date).getTime(),d=0;d<b.changedTouches.length;d++){var g=b.changedTouches[d];c=U(g,b.type,e),c&&(c._updateEventTargets(e,f),c[a](g,b,e,f))}else{if(!Fa&&/mouse/.test(b.type)){for(d=0;d<za.length;d++)if(!za[d].mouse&&za[d].pointerIsDown)return;if((new Date).getTime()-Ia<500)return}if(c=U(b,b.type,e),!c)return;c._updateEventTargets(e,f),c[a](b,b,e,f)}}}function W(a,b,c,d,e,f){var g,h,i=a.target,j=a.snapStatus,k=a.restrictStatus,l=a.pointers,n=(i&&i.options||Ca).deltaSource,o=n+"X",p=n+"Y",q=i?i.options:Ca,r=D(i,e),s="start"===d,t="end"===d,u=s?a.startCoords:a.curCoords;e=e||a.element,h=m({},u.page),g=m({},u.client),h.x-=r.x,h.y-=r.y,g.x-=r.x,g.y-=r.y;var v=q[c].snap&&q[c].snap.relativePoints;!O(i,c)||s&&v&&v.length||(this.snap={range:j.range,locked:j.locked,x:j.snappedX,y:j.snappedY,realX:j.realX,realY:j.realY,dx:j.dx,dy:j.dy},j.locked&&(h.x+=j.dx,h.y+=j.dy,g.x+=j.dx,g.y+=j.dy)),!P(i,c)||s&&q[c].restrict.elementRect||!k.restricted||(h.x+=k.dx,h.y+=k.dy,g.x+=k.dx,g.y+=k.dy,this.restrict={dx:k.dx,dy:k.dy}),this.pageX=h.x,this.pageY=h.y,this.clientX=g.x,this.clientY=g.y,this.x0=a.startCoords.page.x,this.y0=a.startCoords.page.y,this.clientX0=a.startCoords.client.x,this.clientY0=a.startCoords.client.y,this.ctrlKey=b.ctrlKey,this.altKey=b.altKey,this.shiftKey=b.shiftKey,this.metaKey=b.metaKey,this.button=b.button,this.target=e,this.t0=a.downTimes[0],this.type=c+(d||""),this.interaction=a,this.interactable=i;var w=a.inertiaStatus;if(w.active&&(this.detail="inertia"),f&&(this.relatedTarget=f),t?"client"===n?(this.dx=g.x-a.startCoords.client.x,this.dy=g.y-a.startCoords.client.y):(this.dx=h.x-a.startCoords.page.x,this.dy=h.y-a.startCoords.page.y):s?(this.dx=0,this.dy=0):"inertiastart"===d?(this.dx=a.prevEvent.dx,this.dy=a.prevEvent.dy):"client"===n?(this.dx=g.x-a.prevEvent.clientX,this.dy=g.y-a.prevEvent.clientY):(this.dx=h.x-a.prevEvent.pageX,this.dy=h.y-a.prevEvent.pageY),a.prevEvent&&"inertia"===a.prevEvent.detail&&!w.active&&q[c].inertia&&q[c].inertia.zeroResumeDelta&&(w.resumeDx+=this.dx,w.resumeDy+=this.dy,this.dx=this.dy=0),"resize"===c&&a.resizeAxes?q.resize.square?("y"===a.resizeAxes?this.dx=this.dy:this.dy=this.dx,this.axes="xy"):(this.axes=a.resizeAxes,"x"===a.resizeAxes?this.dy=0:"y"===a.resizeAxes&&(this.dx=0)):"gesture"===c&&(this.touches=[l[0],l[1]],s?(this.distance=B(l,n),this.box=A(l),this.scale=1,this.ds=0,this.angle=C(l,void 0,n),this.da=0):t||b instanceof W?(this.distance=a.prevEvent.distance,this.box=a.prevEvent.box,this.scale=a.prevEvent.scale,this.ds=this.scale-1,this.angle=a.prevEvent.angle,this.da=this.angle-a.gesture.startAngle):(this.distance=B(l,n),this.box=A(l),this.scale=this.distance/a.gesture.startDistance,this.angle=C(l,a.gesture.prevAngle,n),this.ds=this.scale-a.gesture.prevScale,this.da=this.angle-a.gesture.prevAngle)),s)this.timeStamp=a.downTimes[0],this.dt=0,this.duration=0,this.speed=0,this.velocityX=0,this.velocityY=0;else if("inertiastart"===d)this.timeStamp=a.prevEvent.timeStamp,this.dt=a.prevEvent.dt,this.duration=a.prevEvent.duration,this.speed=a.prevEvent.speed,this.velocityX=a.prevEvent.velocityX,this.velocityY=a.prevEvent.velocityY;else if(this.timeStamp=(new Date).getTime(),this.dt=this.timeStamp-a.prevEvent.timeStamp,this.duration=this.timeStamp-a.downTimes[0],b instanceof W){var x=this[o]-a.prevEvent[o],y=this[p]-a.prevEvent[p],z=this.dt/1e3;this.speed=va(x,y)/z,this.velocityX=x/z,this.velocityY=y/z}else this.speed=a.pointerDelta[n].speed,this.velocityX=a.pointerDelta[n].vx,this.velocityY=a.pointerDelta[n].vy;if((t||"inertiastart"===d)&&a.prevEvent.speed>600&&this.timeStamp-a.prevEvent.timeStamp<150){var E=180*Math.atan2(a.prevEvent.velocityY,a.prevEvent.velocityX)/Math.PI,F=22.5;0>E&&(E+=360);var G=E>=135-F&&225+F>E,H=E>=225-F&&315+F>E,I=!G&&(E>=315-F||45+F>E),J=!H&&E>=45-F&&135+F>E;this.swipe={up:H,down:J,left:G,right:I,angle:E,speed:a.prevEvent.speed,velocity:{x:a.prevEvent.velocityX,y:a.prevEvent.velocityY}}}}function X(){this.originalEvent.preventDefault()}function Y(a){var b="";if("drag"===a.name&&(b=Ka.drag),"resize"===a.name)if(a.axis)b=Ka[a.name+a.axis];else if(a.edges){for(var c="resize",d=["top","bottom","left","right"],e=0;4>e;e++)a.edges[d[e]]&&(c+=d[e]);b=Ka[c]}return b}function Z(a,b,d,e,f,g){if(!b)return!1;if(b===!0){var h=i(g.width)?g.width:g.right-g.left,j=i(g.height)?g.height:g.bottom-g.top;if(0>h&&("left"===a?a="right":"right"===a&&(a="left")),0>j&&("top"===a?a="bottom":"bottom"===a&&(a="top")),"left"===a)return d.x<(h>=0?g.left:g.right)+Ga;if("top"===a)return d.y<(j>=0?g.top:g.bottom)+Ga;if("right"===a)return d.x>(h>=0?g.right:g.left)-Ga;if("bottom"===a)return d.y>(j>=0?g.bottom:g.top)-Ga}return c(e)?c(b)?b===e:ka(e,b,f):!1}function $(a,b,c){var d,e=this.getRect(c),f=!1,h=null,i=null,j=m({},b.curCoords.page),k=this.options;if(!e)return null;if(La.resize&&k.resize.enabled){var l=k.resize;if(d={left:!1,right:!1,top:!1,bottom:!1},g(l.edges)){for(var n in d)d[n]=Z(n,l.edges[n],j,b._eventTarget,c,e);d.left=d.left&&!d.right,d.top=d.top&&!d.bottom,f=d.left||d.right||d.top||d.bottom}else{var o="y"!==k.resize.axis&&j.x>e.right-Ga,p="x"!==k.resize.axis&&j.y>e.bottom-Ga;f=o||p,i=(o?"x":"")+(p?"y":"")}}return h=f?"resize":La.drag&&k.drag.enabled?"drag":null,La.gesture&&b.pointerIds.length>=2&&!b.dragging&&!b.resizing&&(h="gesture"),h?{name:h,axis:i,edges:d}:null}function _(a,b){if(!g(a))return null;var c=a.name,d=b.options;return("resize"===c&&d.resize.enabled||"drag"===c&&d.drag.enabled||"gesture"===c&&d.gesture.enabled)&&La[c]?(("resize"===c||"resizeyx"===c)&&(c="resizexy"),a):null}function aa(a,b){var d={},e=Ba[a.type],f=v(a.path?a.path[0]:a.target),g=f;b=b?!0:!1;for(var h in a)d[h]=a[h];for(d.originalEvent=a,d.preventDefault=X;c(g);){for(var i=0;i<e.selectors.length;i++){var j=e.selectors[i],k=e.contexts[i];if(ja(g,j)&&H(k,f)&&H(k,g)){var l=e.listeners[i];d.currentTarget=g;for(var m=0;m<l.length;m++)l[m][1]===b&&l[m][0](d)}}g=J(g)}}function ba(a){return aa.call(this,a,!0)}function ca(a,b){return ya.get(a,b)||new da(a,b)}function da(a,b){this._element=a,this._iEvents=this._iEvents||{};var d;if(l(a)){this.selector=a;var e=b&&b.context;d=e?w(e):na,e&&(d.Node?e instanceof d.Node:c(e)||e===d.document)&&(this._context=e)}else d=w(a),c(a,d)&&(ua?(Ua.add(this._element,la.down,Va.pointerDown),Ua.add(this._element,la.move,Va.pointerHover)):(Ua.add(this._element,"mousedown",Va.pointerDown),Ua.add(this._element,"mousemove",Va.pointerHover),Ua.add(this._element,"touchstart",Va.pointerDown),Ua.add(this._element,"touchmove",Va.pointerHover)));this._doc=d.document,ia(xa,this._doc)||ga(this._doc),ya.push(this),this.set(b)}function ea(a,b){var c=!1;return function(){return c||(na.console.warn(b),c=!0),a.apply(this,arguments)}}function fa(a){for(var b=0;b<za.length;b++)za[b].pointerEnd(a,a)}function ga(a){if(!ia(xa,a)){var b=a.defaultView||a.parentWindow;for(var c in Ba)Ua.add(a,c,aa),Ua.add(a,c,ba,!0);ua?(la=ua===b.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"},Ua.add(a,la.down,Va.selectorDown),Ua.add(a,la.move,Va.pointerMove),Ua.add(a,la.over,Va.pointerOver),Ua.add(a,la.out,Va.pointerOut),Ua.add(a,la.up,Va.pointerUp),Ua.add(a,la.cancel,Va.pointerCancel),Ua.add(a,la.move,Da.edgeMove)):(Ua.add(a,"mousedown",Va.selectorDown),Ua.add(a,"mousemove",Va.pointerMove),Ua.add(a,"mouseup",Va.pointerUp),Ua.add(a,"mouseover",Va.pointerOver),Ua.add(a,"mouseout",Va.pointerOut),Ua.add(a,"touchstart",Va.selectorDown),Ua.add(a,"touchmove",Va.pointerMove),Ua.add(a,"touchend",Va.pointerUp),Ua.add(a,"touchcancel",Va.pointerCancel),Ua.add(a,"mousemove",Da.edgeMove),Ua.add(a,"touchmove",Da.edgeMove)),Ua.add(b,"blur",fa);try{if(b.frameElement){var d=b.frameElement.ownerDocument,e=d.defaultView;Ua.add(d,"mouseup",Va.pointerEnd),Ua.add(d,"touchend",Va.pointerEnd),Ua.add(d,"touchcancel",Va.pointerEnd),Ua.add(d,"pointerup",Va.pointerEnd),Ua.add(d,"MSPointerUp",Va.pointerEnd),Ua.add(e,"blur",fa)}}catch(f){ca.windowParentError=f}Ua.useAttachEvent&&(Ua.add(a,"selectstart",function(a){var b=za[0];b.currentAction()&&b.checkAndPreventDefault(a)}),Ua.add(a,"dblclick",V("ie8Dblclick"))),xa.push(a)}}function ha(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1}function ia(a,b){return-1!==ha(a,b)}function ja(b,c,d){return ma?ma(b,c,d):(na!==a&&(c=c.replace(/\/deep\//g," ")),b[Ra](c))}function ka(a,b,d){for(;c(a);){if(ja(a,b))return!0;if(a=J(a),a===d)return ja(a,b)}return!1}var la,ma,na=function(){var b=a.document.createTextNode("");return b.ownerDocument!==a.document&&"function"==typeof a.wrap&&a.wrap(b)===b?a.wrap(a):a}(),oa=na.document,pa=na.DocumentFragment||b,qa=na.SVGElement||b,ra=na.SVGSVGElement||b,sa=na.SVGElementInstance||b,ta=na.HTMLElement||na.Element,ua=na.PointerEvent||na.MSPointerEvent,va=Math.hypot||function(a,b){return Math.sqrt(a*a+b*b)},wa={},xa=[],ya=[],za=[],Aa=!1,Ba={},Ca={base:{accept:null,actionChecker:null,styleCursor:!0,preventDefault:"auto",origin:{x:0,y:0},deltaSource:"page",allowFrom:null,ignoreFrom:null,_context:oa,dropChecker:null},drag:{enabled:!1,manualStart:!0,max:1/0,maxPerElement:1,snap:null,restrict:null,inertia:null,autoScroll:null,axis:"xy"},drop:{enabled:!1,accept:null,overlap:"pointer"},resize:{enabled:!1,manualStart:!1,max:1/0,maxPerElement:1,snap:null,restrict:null,inertia:null,autoScroll:null,square:!1,axis:"xy",edges:null,invert:"none"},gesture:{manualStart:!1,enabled:!1,max:1/0,maxPerElement:1,restrict:null},perAction:{manualStart:!1,max:1/0,maxPerElement:1,snap:{enabled:!1,endOnly:!1,range:1/0,targets:null,offsets:null,relativePoints:null},restrict:{enabled:!1,endOnly:!1},autoScroll:{enabled:!1,container:null,margin:60,speed:300},inertia:{enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,zeroResumeDelta:!0,smoothEndDuration:300}},_holdDuration:600},Da={interaction:null,i:null,x:0,y:0,scroll:function(){var a=Da.interaction.target.options[Da.interaction.prepared.name].autoScroll,b=a.container||w(Da.interaction.element),c=(new Date).getTime(),e=(c-Da.prevTime)/1e3,f=a.speed*e;f>=1&&(d(b)?b.scrollBy(Da.x*f,Da.y*f):b&&(b.scrollLeft+=Da.x*f,b.scrollTop+=Da.y*f),Da.prevTime=c),Da.isScrolling&&(Ta(Da.i),Da.i=Sa(Da.scroll))},edgeMove:function(a){for(var b,c,e=!1,f=0;f<za.length;f++)if(b=za[f],b.interacting()&&Q(b.target,b.prepared.name)){c=b.target,e=!0;break}if(e){var g,h,i,j,k=c.options[b.prepared.name].autoScroll,l=k.container||w(b.element);if(d(l))j=a.clientX<Da.margin,g=a.clientY<Da.margin,h=a.clientX>l.innerWidth-Da.margin,i=a.clientY>l.innerHeight-Da.margin;else{var m=x(l);j=a.clientX<m.left+Da.margin,g=a.clientY<m.top+Da.margin,h=a.clientX>m.right-Da.margin,i=a.clientY>m.bottom-Da.margin}Da.x=h?1:j?-1:0,Da.y=i?1:g?-1:0,Da.isScrolling||(Da.margin=k.margin,Da.speed=k.speed,Da.start(b))}},isScrolling:!1,prevTime:0,start:function(a){Da.isScrolling=!0,Ta(Da.i),Da.interaction=a,Da.prevTime=(new Date).getTime(),Da.i=Sa(Da.scroll)},stop:function(){Da.isScrolling=!1,Ta(Da.i)}},Ea="ontouchstart"in na||na.DocumentTouch&&oa instanceof na.DocumentTouch,Fa=!!ua,Ga=Ea||Fa?20:10,Ha=1,Ia=0,Ja=1/0,Ka=oa.all&&!na.atob?{drag:"move",resizex:"e-resize",resizey:"s-resize",resizexy:"se-resize",resizetop:"n-resize",resizeleft:"w-resize",resizebottom:"s-resize",resizeright:"e-resize",resizetopleft:"se-resize",resizebottomright:"se-resize",resizetopright:"ne-resize",resizebottomleft:"ne-resize",gesture:""}:{drag:"move",resizex:"ew-resize",resizey:"ns-resize",resizexy:"nwse-resize",resizetop:"ns-resize",resizeleft:"ew-resize",resizebottom:"ns-resize",resizeright:"ew-resize",resizetopleft:"nwse-resize",resizebottomright:"nwse-resize",resizetopright:"nesw-resize",resizebottomleft:"nesw-resize",gesture:""},La={drag:!0,resize:!0,gesture:!0},Ma="onmousewheel"in oa?"mousewheel":"wheel",Na=["dragstart","dragmove","draginertiastart","dragend","dragenter","dragleave","dropactivate","dropdeactivate","dropmove","drop","resizestart","resizemove","resizeinertiastart","resizeend","gesturestart","gesturemove","gestureinertiastart","gestureend","down","move","up","cancel","tap","doubletap","hold"],Oa={},Pa="Opera"==navigator.appName&&Ea&&navigator.userAgent.match("Presto"),Qa=/iP(hone|od|ad)/.test(navigator.platform)&&/OS [1-7][^\d]/.test(navigator.appVersion),Ra="matches"in Element.prototype?"matches":"webkitMatchesSelector"in Element.prototype?"webkitMatchesSelector":"mozMatchesSelector"in Element.prototype?"mozMatchesSelector":"oMatchesSelector"in Element.prototype?"oMatchesSelector":"msMatchesSelector",Sa=a.requestAnimationFrame,Ta=a.cancelAnimationFrame,Ua=function(){function a(a,b,h,m){var n=ha(j,a),o=k[n];if(o||(o={events:{},typeCount:0},n=j.push(a)-1,k.push(o),l.push(f?{supplied:[],wrapped:[],useCount:[]}:null)),o.events[b]||(o.events[b]=[],o.typeCount++),!ia(o.events[b],h)){var p;if(f){var q=l[n],r=ha(q.supplied,h),s=q.wrapped[r]||function(b){b.immediatePropagationStopped||(b.target=b.srcElement,b.currentTarget=a,b.preventDefault=b.preventDefault||c,b.stopPropagation=b.stopPropagation||d,b.stopImmediatePropagation=b.stopImmediatePropagation||e,/mouse|click/.test(b.type)&&(b.pageX=b.clientX+w(a).document.documentElement.scrollLeft,b.pageY=b.clientY+w(a).document.documentElement.scrollTop),h(b))};p=a[g](i+b,s,Boolean(m)),-1===r?(q.supplied.push(h),q.wrapped.push(s),q.useCount.push(1)):q.useCount[r]++}else p=a[g](b,h,m||!1);return o.events[b].push(h),p}}function b(a,c,d,e){var g,m,n,o=ha(j,a),p=k[o],q=d;if(p&&p.events)if(f&&(m=l[o],n=ha(m.supplied,d),q=m.wrapped[n]),"all"!==c){if(p.events[c]){var r=p.events[c].length;if("all"===d)for(g=0;r>g;g++)b(a,c,p.events[c][g],Boolean(e));else for(g=0;r>g;g++)if(p.events[c][g]===d){a[h](i+c,q,e||!1),p.events[c].splice(g,1),f&&m&&(m.useCount[n]--,0===m.useCount[n]&&(m.supplied.splice(n,1),m.wrapped.splice(n,1),m.useCount.splice(n,1)));break}p.events[c]&&0===p.events[c].length&&(p.events[c]=null,p.typeCount--)}p.typeCount||(k.splice(o),j.splice(o),l.splice(o))}else for(c in p.events)p.events.hasOwnProperty(c)&&b(a,c,"all")}function c(){this.returnValue=!1}function d(){this.cancelBubble=!0}function e(){this.cancelBubble=!0,this.immediatePropagationStopped=!0}var f="attachEvent"in na&&!("addEventListener"in na),g=f?"attachEvent":"addEventListener",h=f?"detachEvent":"removeEventListener",i=f?"on":"",j=[],k=[],l=[];return{add:a,remove:b,useAttachEvent:f,_elements:j,_targets:k,_attachedListeners:l}}();T.prototype={getPageXY:function(a,b){return r(a,b,this)},getClientXY:function(a,b){return s(a,b,this)},setEventXY:function(a,b){return o(a,b,this)},pointerOver:function(a,b,c){function d(a,b){a&&K(a,c)&&!L(a,c,c)&&M(a,c,c)&&ja(c,b)&&(e.push(a),f.push(c))}if(!this.prepared.name&&this.mouse){var e=[],f=[],g=this.element;this.addPointer(a),!this.target||!L(this.target,this.element,c)&&M(this.target,this.element,c)||(this.target=null,this.element=null,this.matches=[],this.matchElements=[]);var h=ya.get(c),i=h&&!L(h,c,c)&&M(h,c,c)&&_(h.getAction(a,this,c),h);i&&!R(h,c,i)&&(i=null),i?(this.target=h,this.element=c,this.matches=[],this.matchElements=[]):(ya.forEachSelector(d),this.validateSelector(a,e,f)?(this.matches=e,this.matchElements=f,this.pointerHover(a,b,this.matches,this.matchElements),Ua.add(c,ua?la.move:"mousemove",Va.pointerHover)):this.target&&(H(g,c)?(this.pointerHover(a,b,this.matches,this.matchElements),Ua.add(this.element,ua?la.move:"mousemove",Va.pointerHover)):(this.target=null,this.element=null,this.matches=[],this.matchElements=[])))}},pointerHover:function(a,b,c,d,e,f){var g=this.target;if(!this.prepared.name&&this.mouse){var h;this.setEventXY(this.curCoords,a),e?h=this.validateSelector(a,e,f):g&&(h=_(g.getAction(this.pointers[0],this,this.element),this.target)),g&&g.options.styleCursor&&(g._doc.documentElement.style.cursor=h?Y(h):"")}else this.prepared.name&&this.checkAndPreventDefault(b,g,this.element)},pointerOut:function(a,b,c){this.prepared.name||(ya.get(c)||Ua.remove(c,ua?la.move:"mousemove",Va.pointerHover),this.target&&this.target.options.styleCursor&&!this.interacting()&&(this.target._doc.documentElement.style.cursor=""))},selectorDown:function(a,b,d,e){function f(a,b,c){var e=ma?c.querySelectorAll(b):void 0;K(a,j)&&!L(a,j,d)&&M(a,j,d)&&ja(j,b,e)&&(h.matches.push(a),h.matchElements.push(j))}var g,h=this,i=Ua.useAttachEvent?m({},b):b,j=d,k=this.addPointer(a);if(this.holdTimers[k]=setTimeout(function(){h.pointerHold(Ua.useAttachEvent?i:a,i,d,e)},Ca._holdDuration),this.pointerIsDown=!0,this.inertiaStatus.active&&this.target.selector)for(;c(j);){if(j===this.element&&_(this.target.getAction(a,this,this.element),this.target).name===this.prepared.name)return Ta(this.inertiaStatus.i),this.inertiaStatus.active=!1,void this.collectEventTargets(a,b,d,"down");j=J(j)}if(this.interacting())return void this.collectEventTargets(a,b,d,"down");for(this.setEventXY(this.curCoords,a);c(j)&&!g;)this.matches=[],this.matchElements=[],ya.forEachSelector(f),g=this.validateSelector(a,this.matches,this.matchElements),j=J(j);return g?(this.prepared.name=g.name,this.prepared.axis=g.axis,this.prepared.edges=g.edges,this.collectEventTargets(a,b,d,"down"),this.pointerDown(a,b,d,e,g)):(this.downTimes[k]=(new Date).getTime(),this.downTargets[k]=d,this.downEvent=b,m(this.downPointer,a),n(this.prevCoords,this.curCoords),this.pointerWasMoved=!1,void this.collectEventTargets(a,b,d,"down"))},pointerDown:function(a,b,c,d,e){if(!e&&!this.inertiaStatus.active&&this.pointerWasMoved&&this.prepared.name)return void this.checkAndPreventDefault(b,this.target,this.element);this.pointerIsDown=!0;var f,g=this.addPointer(a);if(this.pointerIds.length<2&&!this.target||!this.prepared.name){var h=ya.get(d);h&&!L(h,d,c)&&M(h,d,c)&&(f=_(e||h.getAction(a,this,d),h,c))&&R(h,d,f)&&(this.target=h,this.element=d)}var i=this.target,j=i&&i.options;if(i&&!this.interacting()){if(f=f||_(e||i.getAction(a,this,d),i,this.element),this.setEventXY(this.startCoords),!f)return;j.styleCursor&&(i._doc.documentElement.style.cursor=Y(f)),this.resizeAxes="resize"===f.name?f.axis:null,"gesture"===f&&this.pointerIds.length<2&&(f=null),this.prepared.name=f.name,this.prepared.axis=f.axis,this.prepared.edges=f.edges,this.snapStatus.snappedX=this.snapStatus.snappedY=this.restrictStatus.restrictedX=this.restrictStatus.restrictedY=NaN,this.downTimes[g]=(new Date).getTime(),this.downTargets[g]=c,this.downEvent=b,m(this.downPointer,a),this.setEventXY(this.prevCoords),this.pointerWasMoved=!1,this.checkAndPreventDefault(b,i,this.element)}else this.inertiaStatus.active&&d===this.element&&_(i.getAction(a,this,this.element),i).name===this.prepared.name&&(Ta(this.inertiaStatus.i),this.inertiaStatus.active=!1,this.checkAndPreventDefault(b,i,this.element))},setModifications:function(a,b){var c=this.target,d=!0,e=O(c,this.prepared.name)&&(!c.options[this.prepared.name].snap.endOnly||b),f=P(c,this.prepared.name)&&(!c.options[this.prepared.name].restrict.endOnly||b);return e?this.setSnapping(a):this.snapStatus.locked=!1,f?this.setRestriction(a):this.restrictStatus.restricted=!1,e&&this.snapStatus.locked&&!this.snapStatus.changed?d=f&&this.restrictStatus.restricted&&this.restrictStatus.changed:f&&this.restrictStatus.restricted&&!this.restrictStatus.changed&&(d=!1),d},setStartOffsets:function(a,b,c){var d,e,f=b.getRect(c),g=D(b,c),h=b.options[this.prepared.name].snap,i=b.options[this.prepared.name].restrict;f?(this.startOffset.left=this.startCoords.page.x-f.left,this.startOffset.top=this.startCoords.page.y-f.top,this.startOffset.right=f.right-this.startCoords.page.x,this.startOffset.bottom=f.bottom-this.startCoords.page.y,d="width"in f?f.width:f.right-f.left,e="height"in f?f.height:f.bottom-f.top):this.startOffset.left=this.startOffset.top=this.startOffset.right=this.startOffset.bottom=0,this.snapOffsets.splice(0);var j=h&&"startCoords"===h.offset?{x:this.startCoords.page.x-g.x,y:this.startCoords.page.y-g.y}:h&&h.offset||{x:0,y:0};if(f&&h&&h.relativePoints&&h.relativePoints.length)for(var k=0;k<h.relativePoints.length;k++)this.snapOffsets.push({x:this.startOffset.left-d*h.relativePoints[k].x+j.x,y:this.startOffset.top-e*h.relativePoints[k].y+j.y});else this.snapOffsets.push(j);f&&i.elementRect?(this.restrictOffset.left=this.startOffset.left-d*i.elementRect.left,this.restrictOffset.top=this.startOffset.top-e*i.elementRect.top,this.restrictOffset.right=this.startOffset.right-d*(1-i.elementRect.right),this.restrictOffset.bottom=this.startOffset.bottom-e*(1-i.elementRect.bottom)):this.restrictOffset.left=this.restrictOffset.top=this.restrictOffset.right=this.restrictOffset.bottom=0},start:function(a,b,c){this.interacting()||!this.pointerIsDown||this.pointerIds.length<("gesture"===a.name?2:1)||(-1===ha(za,this)&&za.push(this),this.prepared.name=a.name,this.prepared.axis=a.axis,this.prepared.edges=a.edges,this.target=b,this.element=c,this.setStartOffsets(a.name,b,c),this.setModifications(this.startCoords.page),this.prevEvent=this[this.prepared.name+"Start"](this.downEvent))},pointerMove:function(a,b,d,e,f){this.recordPointer(a),this.setEventXY(this.curCoords,a instanceof W?this.inertiaStatus.startEvent:void 0);var g,h,i=this.curCoords.page.x===this.prevCoords.page.x&&this.curCoords.page.y===this.prevCoords.page.y&&this.curCoords.client.x===this.prevCoords.client.x&&this.curCoords.client.y===this.prevCoords.client.y,j=this.mouse?0:ha(this.pointerIds,u(a));if(this.pointerIsDown&&!this.pointerWasMoved&&(g=this.curCoords.client.x-this.startCoords.client.x,h=this.curCoords.client.y-this.startCoords.client.y,this.pointerWasMoved=va(g,h)>Ha),i||this.pointerIsDown&&!this.pointerWasMoved||(this.pointerIsDown&&clearTimeout(this.holdTimers[j]),this.collectEventTargets(a,b,d,"move")),this.pointerIsDown){if(i&&this.pointerWasMoved&&!f)return void this.checkAndPreventDefault(b,this.target,this.element);if(p(this.pointerDelta,this.prevCoords,this.curCoords),this.prepared.name){if(this.pointerWasMoved&&(!this.inertiaStatus.active||a instanceof W&&/inertiastart/.test(a.type))){if(!this.interacting()&&(p(this.pointerDelta,this.prevCoords,this.curCoords),"drag"===this.prepared.name)){var k=Math.abs(g),l=Math.abs(h),m=this.target.options.drag.axis,o=k>l?"x":l>k?"y":"xy";if("xy"!==o&&"xy"!==m&&m!==o){this.prepared.name=null;for(var q=d;c(q);){var r=ya.get(q);if(r&&r!==this.target&&!r.options.drag.manualStart&&"drag"===r.getAction(this.downPointer,this,q).name&&N(o,r)){this.prepared.name="drag",this.target=r,this.element=q;break}q=J(q)}if(!this.prepared.name){
var s=function(a,b,c){var e=ma?c.querySelectorAll(b):void 0;return a!==this.target&&K(a,d)&&!a.options.drag.manualStart&&!L(a,q,d)&&M(a,q,d)&&ja(q,b,e)&&"drag"===a.getAction(this.downPointer,this,q).name&&N(o,a)&&R(a,q,"drag")?a:void 0};for(q=d;c(q);){var t=ya.forEachSelector(s);if(t){this.prepared.name="drag",this.target=t,this.element=q;break}q=J(q)}}}}var v=!!this.prepared.name&&!this.interacting();if(v&&(this.target.options[this.prepared.name].manualStart||!R(this.target,this.element,this.prepared)))return void this.stop();if(this.prepared.name&&this.target){v&&this.start(this.prepared,this.target,this.element);var w=this.setModifications(this.curCoords.page,f);(w||v)&&(this.prevEvent=this[this.prepared.name+"Move"](b)),this.checkAndPreventDefault(b,this.target,this.element)}}n(this.prevCoords,this.curCoords),(this.dragging||this.resizing)&&Da.edgeMove(b)}}},dragStart:function(a){var b=new W(this,a,"drag","start",this.element);this.dragging=!0,this.target.fire(b),this.activeDrops.dropzones=[],this.activeDrops.elements=[],this.activeDrops.rects=[],this.dynamicDrop||this.setActiveDrops(this.element);var c=this.getDropEvents(a,b);return c.activate&&this.fireActiveDrops(c.activate),b},dragMove:function(a){var b=this.target,c=new W(this,a,"drag","move",this.element),d=this.element,e=this.getDrop(c,d);this.dropTarget=e.dropzone,this.dropElement=e.element;var f=this.getDropEvents(a,c);return b.fire(c),f.leave&&this.prevDropTarget.fire(f.leave),f.enter&&this.dropTarget.fire(f.enter),f.move&&this.dropTarget.fire(f.move),this.prevDropTarget=this.dropTarget,this.prevDropElement=this.dropElement,c},resizeStart:function(a){var b=new W(this,a,"resize","start",this.element);if(this.prepared.edges){var c=this.target.getRect(this.element);if(this.target.options.resize.square){var d=m({},this.prepared.edges);d.top=d.top||d.left&&!d.bottom,d.left=d.left||d.top&&!d.right,d.bottom=d.bottom||d.right&&!d.top,d.right=d.right||d.bottom&&!d.left,this.prepared._squareEdges=d}else this.prepared._squareEdges=null;this.resizeRects={start:c,current:m({},c),restricted:m({},c),previous:m({},c),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},b.rect=this.resizeRects.restricted,b.deltaRect=this.resizeRects.delta}return this.target.fire(b),this.resizing=!0,b},resizeMove:function(a){var b=new W(this,a,"resize","move",this.element),c=this.prepared.edges,d=this.target.options.resize.invert,e="reposition"===d||"negate"===d;if(c){var f=b.dx,g=b.dy,h=this.resizeRects.start,i=this.resizeRects.current,j=this.resizeRects.restricted,k=this.resizeRects.delta,l=m(this.resizeRects.previous,j);if(this.target.options.resize.square){var n=c;c=this.prepared._squareEdges,n.left&&n.bottom||n.right&&n.top?g=-f:n.left||n.right?g=f:(n.top||n.bottom)&&(f=g)}if(c.top&&(i.top+=g),c.bottom&&(i.bottom+=g),c.left&&(i.left+=f),c.right&&(i.right+=f),e){if(m(j,i),"reposition"===d){var o;j.top>j.bottom&&(o=j.top,j.top=j.bottom,j.bottom=o),j.left>j.right&&(o=j.left,j.left=j.right,j.right=o)}}else j.top=Math.min(i.top,h.bottom),j.bottom=Math.max(i.bottom,h.top),j.left=Math.min(i.left,h.right),j.right=Math.max(i.right,h.left);j.width=j.right-j.left,j.height=j.bottom-j.top;for(var p in j)k[p]=j[p]-l[p];b.edges=this.prepared.edges,b.rect=j,b.deltaRect=k}return this.target.fire(b),b},gestureStart:function(a){var b=new W(this,a,"gesture","start",this.element);return b.ds=0,this.gesture.startDistance=this.gesture.prevDistance=b.distance,this.gesture.startAngle=this.gesture.prevAngle=b.angle,this.gesture.scale=1,this.gesturing=!0,this.target.fire(b),b},gestureMove:function(a){if(!this.pointerIds.length)return this.prevEvent;var b;return b=new W(this,a,"gesture","move",this.element),b.ds=b.scale-this.gesture.scale,this.target.fire(b),this.gesture.prevAngle=b.angle,this.gesture.prevDistance=b.distance,1/0===b.scale||null===b.scale||void 0===b.scale||isNaN(b.scale)||(this.gesture.scale=b.scale),b},pointerHold:function(a,b,c){this.collectEventTargets(a,b,c,"hold")},pointerUp:function(a,b,c,d){var e=this.mouse?0:ha(this.pointerIds,u(a));clearTimeout(this.holdTimers[e]),this.collectEventTargets(a,b,c,"up"),this.collectEventTargets(a,b,c,"tap"),this.pointerEnd(a,b,c,d),this.removePointer(a)},pointerCancel:function(a,b,c,d){var e=this.mouse?0:ha(this.pointerIds,u(a));clearTimeout(this.holdTimers[e]),this.collectEventTargets(a,b,c,"cancel"),this.pointerEnd(a,b,c,d),this.removePointer(a)},ie8Dblclick:function(a,b,c){this.prevTap&&b.clientX===this.prevTap.clientX&&b.clientY===this.prevTap.clientY&&c===this.prevTap.target&&(this.downTargets[0]=c,this.downTimes[0]=(new Date).getTime(),this.collectEventTargets(a,b,c,"tap"))},pointerEnd:function(a,b,c,d){var e,f=this.target,g=f&&f.options,h=g&&this.prepared.name&&g[this.prepared.name].inertia,i=this.inertiaStatus;if(this.interacting()){if(i.active)return;var j,k,l=(new Date).getTime(),o=!1,p=!1,q=!1,r=O(f,this.prepared.name)&&g[this.prepared.name].snap.endOnly,s=P(f,this.prepared.name)&&g[this.prepared.name].restrict.endOnly,t=0,u=0;if(j=this.dragging?"x"===g.drag.axis?Math.abs(this.pointerDelta.client.vx):"y"===g.drag.axis?Math.abs(this.pointerDelta.client.vy):this.pointerDelta.client.speed:this.pointerDelta.client.speed,o=h&&h.enabled&&"gesture"!==this.prepared.name&&b!==i.startEvent,p=o&&l-this.curCoords.timeStamp<50&&j>h.minSpeed&&j>h.endSpeed,o&&!p&&(r||s)){var v={};v.snap=v.restrict=v,r&&(this.setSnapping(this.curCoords.page,v),v.locked&&(t+=v.dx,u+=v.dy)),s&&(this.setRestriction(this.curCoords.page,v),v.restricted&&(t+=v.dx,u+=v.dy)),(t||u)&&(q=!0)}if(p||q){if(n(i.upCoords,this.curCoords),this.pointers[0]=i.startEvent=k=new W(this,b,this.prepared.name,"inertiastart",this.element),i.t0=l,f.fire(i.startEvent),p){i.vx0=this.pointerDelta.client.vx,i.vy0=this.pointerDelta.client.vy,i.v0=j,this.calcInertia(i);var w,x=m({},this.curCoords.page),y=D(f,this.element);if(x.x=x.x+i.xe-y.x,x.y=x.y+i.ye-y.y,w={useStatusXY:!0,x:x.x,y:x.y,dx:0,dy:0,snap:null},w.snap=w,t=u=0,r){var z=this.setSnapping(this.curCoords.page,w);z.locked&&(t+=z.dx,u+=z.dy)}if(s){var A=this.setRestriction(this.curCoords.page,w);A.restricted&&(t+=A.dx,u+=A.dy)}i.modifiedXe+=t,i.modifiedYe+=u,i.i=Sa(this.boundInertiaFrame)}else i.smoothEnd=!0,i.xe=t,i.ye=u,i.sx=i.sy=0,i.i=Sa(this.boundSmoothEndFrame);return void(i.active=!0)}(r||s)&&this.pointerMove(a,b,c,d,!0)}if(this.dragging){e=new W(this,b,"drag","end",this.element);var B=this.element,C=this.getDrop(e,B);this.dropTarget=C.dropzone,this.dropElement=C.element;var E=this.getDropEvents(b,e);E.leave&&this.prevDropTarget.fire(E.leave),E.enter&&this.dropTarget.fire(E.enter),E.drop&&this.dropTarget.fire(E.drop),E.deactivate&&this.fireActiveDrops(E.deactivate),f.fire(e)}else this.resizing?(e=new W(this,b,"resize","end",this.element),f.fire(e)):this.gesturing&&(e=new W(this,b,"gesture","end",this.element),f.fire(e));this.stop(b)},collectDrops:function(a){var b,d=[],e=[];for(a=a||this.element,b=0;b<ya.length;b++)if(ya[b].options.drop.enabled){var f=ya[b],g=f.options.drop.accept;if(!(c(g)&&g!==a||k(g)&&!ja(a,g)))for(var h=f.selector?f._context.querySelectorAll(f.selector):[f._element],i=0,j=h.length;j>i;i++){var l=h[i];l!==a&&(d.push(f),e.push(l))}}return{dropzones:d,elements:e}},fireActiveDrops:function(a){var b,c,d,e;for(b=0;b<this.activeDrops.dropzones.length;b++)c=this.activeDrops.dropzones[b],d=this.activeDrops.elements[b],d!==e&&(a.target=d,c.fire(a)),e=d},setActiveDrops:function(a){var b=this.collectDrops(a,!0);this.activeDrops.dropzones=b.dropzones,this.activeDrops.elements=b.elements,this.activeDrops.rects=[];for(var c=0;c<this.activeDrops.dropzones.length;c++)this.activeDrops.rects[c]=this.activeDrops.dropzones[c].getRect(this.activeDrops.elements[c])},getDrop:function(a,b){var c=[];Aa&&this.setActiveDrops(b);for(var d=0;d<this.activeDrops.dropzones.length;d++){var e=this.activeDrops.dropzones[d],f=this.activeDrops.elements[d],g=this.activeDrops.rects[d];c.push(e.dropCheck(this.pointers[0],this.target,b,f,g)?f:null)}var h=S(c),i=this.activeDrops.dropzones[h]||null,j=this.activeDrops.elements[h]||null;return{dropzone:i,element:j}},getDropEvents:function(a,b){var c={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return this.dropElement!==this.prevDropElement&&(this.prevDropTarget&&(c.leave={target:this.prevDropElement,dropzone:this.prevDropTarget,relatedTarget:b.target,draggable:b.interactable,dragEvent:b,interaction:this,timeStamp:b.timeStamp,type:"dragleave"},b.dragLeave=this.prevDropElement,b.prevDropzone=this.prevDropTarget),this.dropTarget&&(c.enter={target:this.dropElement,dropzone:this.dropTarget,relatedTarget:b.target,draggable:b.interactable,dragEvent:b,interaction:this,timeStamp:b.timeStamp,type:"dragenter"},b.dragEnter=this.dropElement,b.dropzone=this.dropTarget)),"dragend"===b.type&&this.dropTarget&&(c.drop={target:this.dropElement,dropzone:this.dropTarget,relatedTarget:b.target,draggable:b.interactable,dragEvent:b,interaction:this,timeStamp:b.timeStamp,type:"drop"}),"dragstart"===b.type&&(c.activate={target:null,dropzone:null,relatedTarget:b.target,draggable:b.interactable,dragEvent:b,interaction:this,timeStamp:b.timeStamp,type:"dropactivate"}),"dragend"===b.type&&(c.deactivate={target:null,dropzone:null,relatedTarget:b.target,draggable:b.interactable,dragEvent:b,interaction:this,timeStamp:b.timeStamp,type:"dropdeactivate"}),"dragmove"===b.type&&this.dropTarget&&(c.move={target:this.dropElement,dropzone:this.dropTarget,relatedTarget:b.target,draggable:b.interactable,dragEvent:b,interaction:this,dragmove:b,timeStamp:b.timeStamp,type:"dropmove"},b.dropzone=this.dropTarget),c},currentAction:function(){return this.dragging&&"drag"||this.resizing&&"resize"||this.gesturing&&"gesture"||null},interacting:function(){return this.dragging||this.resizing||this.gesturing},clearTargets:function(){this.target&&!this.target.selector&&(this.target=this.element=null),this.dropTarget=this.dropElement=this.prevDropTarget=this.prevDropElement=null},stop:function(a){if(this.interacting()){Da.stop(),this.matches=[],this.matchElements=[];var b=this.target;b.options.styleCursor&&(b._doc.documentElement.style.cursor=""),a&&h(a.preventDefault)&&this.checkAndPreventDefault(a,b,this.element),this.dragging&&(this.activeDrops.dropzones=this.activeDrops.elements=this.activeDrops.rects=null),this.clearTargets()}this.pointerIsDown=this.snapStatus.locked=this.dragging=this.resizing=this.gesturing=!1,this.prepared.name=this.prevEvent=null,this.inertiaStatus.resumeDx=this.inertiaStatus.resumeDy=0;for(var c=0;c<this.pointers.length;c++)-1===ha(this.pointerIds,u(this.pointers[c]))&&this.pointers.splice(c,1);za.length>1&&za.splice(ha(za,this),1)},inertiaFrame:function(){var a=this.inertiaStatus,b=this.target.options[this.prepared.name].inertia,c=b.resistance,d=(new Date).getTime()/1e3-a.t0;if(d<a.te){var e=1-(Math.exp(-c*d)-a.lambda_v0)/a.one_ve_v0;if(a.modifiedXe===a.xe&&a.modifiedYe===a.ye)a.sx=a.xe*e,a.sy=a.ye*e;else{var f=F(0,0,a.xe,a.ye,a.modifiedXe,a.modifiedYe,e);a.sx=f.x,a.sy=f.y}this.pointerMove(a.startEvent,a.startEvent),a.i=Sa(this.boundInertiaFrame)}else a.sx=a.modifiedXe,a.sy=a.modifiedYe,this.pointerMove(a.startEvent,a.startEvent),a.active=!1,this.pointerEnd(a.startEvent,a.startEvent)},smoothEndFrame:function(){var a=this.inertiaStatus,b=(new Date).getTime()-a.t0,c=this.target.options[this.prepared.name].inertia.smoothEndDuration;c>b?(a.sx=G(b,0,a.xe,c),a.sy=G(b,0,a.ye,c),this.pointerMove(a.startEvent,a.startEvent),a.i=Sa(this.boundSmoothEndFrame)):(a.sx=a.xe,a.sy=a.ye,this.pointerMove(a.startEvent,a.startEvent),a.active=!1,a.smoothEnd=!1,this.pointerEnd(a.startEvent,a.startEvent))},addPointer:function(a){var b=u(a),c=this.mouse?0:ha(this.pointerIds,b);return-1===c&&(c=this.pointerIds.length),this.pointerIds[c]=b,this.pointers[c]=a,c},removePointer:function(a){var b=u(a),c=this.mouse?0:ha(this.pointerIds,b);-1!==c&&(this.interacting()||this.pointers.splice(c,1),this.pointerIds.splice(c,1),this.downTargets.splice(c,1),this.downTimes.splice(c,1),this.holdTimers.splice(c,1))},recordPointer:function(a){if(!this.inertiaStatus.active){var b=this.mouse?0:ha(this.pointerIds,u(a));-1!==b&&(this.pointers[b]=a)}},collectEventTargets:function(a,b,d,e){function f(a,b,f){var g=ma?f.querySelectorAll(b):void 0;a._iEvents[e]&&c(j)&&K(a,j)&&!L(a,j,d)&&M(a,j,d)&&ja(j,b,g)&&(h.push(a),i.push(j))}var g=this.mouse?0:ha(this.pointerIds,u(a));if("tap"!==e||!this.pointerWasMoved&&this.downTargets[g]&&this.downTargets[g]===d){for(var h=[],i=[],j=d;j;)ca.isSet(j)&&ca(j)._iEvents[e]&&(h.push(ca(j)),i.push(j)),ya.forEachSelector(f),j=J(j);(h.length||"tap"===e)&&this.firePointers(a,b,d,h,i,e)}},firePointers:function(a,b,c,d,e,f){var g,h,i,j=this.mouse?0:ha(u(a)),l={};for("doubletap"===f?l=a:(m(l,b),b!==a&&m(l,a),l.preventDefault=X,l.stopPropagation=W.prototype.stopPropagation,l.stopImmediatePropagation=W.prototype.stopImmediatePropagation,l.interaction=this,l.timeStamp=(new Date).getTime(),l.originalEvent=b,l.type=f,l.pointerId=u(a),l.pointerType=this.mouse?"mouse":Fa?k(a.pointerType)?a.pointerType:[,,"touch","pen","mouse"][a.pointerType]:"touch"),"tap"===f&&(l.dt=l.timeStamp-this.downTimes[j],h=l.timeStamp-this.tapTime,i=!!(this.prevTap&&"doubletap"!==this.prevTap.type&&this.prevTap.target===l.target&&500>h),l["double"]=i,this.tapTime=l.timeStamp),g=0;g<d.length&&(l.currentTarget=e[g],l.interactable=d[g],d[g].fire(l),!(l.immediatePropagationStopped||l.propagationStopped&&e[g+1]!==l.currentTarget));g++);if(i){var n={};m(n,l),n.dt=h,n.type="doubletap",this.collectEventTargets(n,b,c,"doubletap"),this.prevTap=n}else"tap"===f&&(this.prevTap=l)},validateSelector:function(a,b,c){for(var d=0,e=b.length;e>d;d++){var f=b[d],g=c[d],h=_(f.getAction(a,this,g),f);if(h&&R(f,g,h))return this.target=f,this.element=g,h}},setSnapping:function(a,b){var c,d,e,f=this.target.options[this.prepared.name].snap,g=[];if(b=b||this.snapStatus,b.useStatusXY)d={x:b.x,y:b.y};else{var j=D(this.target,this.element);d=m({},a),d.x-=j.x,d.y-=j.y}b.realX=d.x,b.realY=d.y,d.x=d.x-this.inertiaStatus.resumeDx,d.y=d.y-this.inertiaStatus.resumeDy;for(var k=f.targets?f.targets.length:0,l=0;l<this.snapOffsets.length;l++){var n={x:d.x-this.snapOffsets[l].x,y:d.y-this.snapOffsets[l].y};for(e=0;k>e;e++)c=h(f.targets[e])?f.targets[e](n.x,n.y,this):f.targets[e],c&&g.push({x:i(c.x)?c.x+this.snapOffsets[l].x:n.x,y:i(c.y)?c.y+this.snapOffsets[l].y:n.y,range:i(c.range)?c.range:f.range})}var o={target:null,inRange:!1,distance:0,range:0,dx:0,dy:0};for(e=0,k=g.length;k>e;e++){c=g[e];var p=c.range,q=c.x-d.x,r=c.y-d.y,s=va(q,r),t=p>=s;1/0===p&&o.inRange&&1/0!==o.range&&(t=!1),(!o.target||(t?o.inRange&&1/0!==p?s/p<o.distance/o.range:1/0===p&&1/0!==o.range||s<o.distance:!o.inRange&&s<o.distance))&&(1/0===p&&(t=!0),o.target=c,o.distance=s,o.range=p,o.inRange=t,o.dx=q,o.dy=r,b.range=p)}var u;return o.target?(u=b.snappedX!==o.target.x||b.snappedY!==o.target.y,b.snappedX=o.target.x,b.snappedY=o.target.y):(u=!0,b.snappedX=NaN,b.snappedY=NaN),b.dx=o.dx,b.dy=o.dy,b.changed=u||o.inRange&&!b.locked,b.locked=o.inRange,b},setRestriction:function(a,b){var d,e=this.target,f=e&&e.options[this.prepared.name].restrict,g=f&&f.restriction;if(!g)return b;b=b||this.restrictStatus,d=d=b.useStatusXY?{x:b.x,y:b.y}:m({},a),b.snap&&b.snap.locked&&(d.x+=b.snap.dx||0,d.y+=b.snap.dy||0),d.x-=this.inertiaStatus.resumeDx,d.y-=this.inertiaStatus.resumeDy,b.dx=0,b.dy=0,b.restricted=!1;var i,j,l;return k(g)&&(g="parent"===g?J(this.element):"self"===g?e.getRect(this.element):I(this.element,g),!g)?b:(h(g)&&(g=g(d.x,d.y,this.element)),c(g)&&(g=x(g)),i=g,g?"x"in g&&"y"in g?(j=Math.max(Math.min(i.x+i.width-this.restrictOffset.right,d.x),i.x+this.restrictOffset.left),l=Math.max(Math.min(i.y+i.height-this.restrictOffset.bottom,d.y),i.y+this.restrictOffset.top)):(j=Math.max(Math.min(i.right-this.restrictOffset.right,d.x),i.left+this.restrictOffset.left),l=Math.max(Math.min(i.bottom-this.restrictOffset.bottom,d.y),i.top+this.restrictOffset.top)):(j=d.x,l=d.y),b.dx=j-d.x,b.dy=l-d.y,b.changed=b.restrictedX!==j||b.restrictedY!==l,b.restricted=!(!b.dx&&!b.dy),b.restrictedX=j,b.restrictedY=l,b)},checkAndPreventDefault:function(a,b,c){if(b=b||this.target){var d=b.options,e=d.preventDefault;if("auto"===e&&c&&!/^input$|^textarea$/i.test(c.nodeName)){if(/down|start/i.test(a.type)&&"drag"===this.prepared.name&&"xy"!==d.drag.axis)return;if(d[this.prepared.name]&&d[this.prepared.name].manualStart&&!this.interacting())return;return void a.preventDefault()}return"always"===e?void a.preventDefault():void 0}},calcInertia:function(a){var b=this.target.options[this.prepared.name].inertia,c=b.resistance,d=-Math.log(b.endSpeed/a.v0)/c;a.x0=this.prevEvent.pageX,a.y0=this.prevEvent.pageY,a.t0=a.startEvent.timeStamp/1e3,a.sx=a.sy=0,a.modifiedXe=a.xe=(a.vx0-d)/c,a.modifiedYe=a.ye=(a.vy0-d)/c,a.te=d,a.lambda_v0=c/a.v0,a.one_ve_v0=1-b.endSpeed/a.v0},_updateEventTargets:function(a,b){this._eventTarget=a,this._curEventTarget=b}},W.prototype={preventDefault:b,stopImmediatePropagation:function(){this.immediatePropagationStopped=this.propagationStopped=!0},stopPropagation:function(){this.propagationStopped=!0}};for(var Va={},Wa=["dragStart","dragMove","resizeStart","resizeMove","gestureStart","gestureMove","pointerOver","pointerOut","pointerHover","selectorDown","pointerDown","pointerMove","pointerUp","pointerCancel","pointerEnd","addPointer","removePointer","recordPointer"],Xa=0,Ya=Wa.length;Ya>Xa;Xa++){var Za=Wa[Xa];Va[Za]=V(Za)}ya.indexOfElement=function(a,b){b=b||oa;for(var c=0;c<this.length;c++){var d=this[c];if(d.selector===a&&d._context===b||!d.selector&&d._element===a)return c}return-1},ya.get=function(a,b){return this[this.indexOfElement(a,b&&b.context)]},ya.forEachSelector=function(a){for(var b=0;b<this.length;b++){var c=this[b];if(c.selector){var d=a(c,c.selector,c._context,b,this);if(void 0!==d)return d}}},da.prototype={setOnEvents:function(a,b){return"drop"===a?(h(b.ondrop)&&(this.ondrop=b.ondrop),h(b.ondropactivate)&&(this.ondropactivate=b.ondropactivate),h(b.ondropdeactivate)&&(this.ondropdeactivate=b.ondropdeactivate),h(b.ondragenter)&&(this.ondragenter=b.ondragenter),h(b.ondragleave)&&(this.ondragleave=b.ondragleave),h(b.ondropmove)&&(this.ondropmove=b.ondropmove)):(a="on"+a,h(b.onstart)&&(this[a+"start"]=b.onstart),h(b.onmove)&&(this[a+"move"]=b.onmove),h(b.onend)&&(this[a+"end"]=b.onend),h(b.oninertiastart)&&(this[a+"inertiastart"]=b.oninertiastart)),this},draggable:function(a){return g(a)?(this.options.drag.enabled=a.enabled===!1?!1:!0,this.setPerAction("drag",a),this.setOnEvents("drag",a),/^x$|^y$|^xy$/.test(a.axis)?this.options.drag.axis=a.axis:null===a.axis&&delete this.options.drag.axis,this):j(a)?(this.options.drag.enabled=a,this):this.options.drag},setPerAction:function(a,b){for(var c in b)c in Ca[a]&&(g(b[c])?(this.options[a][c]=m(this.options[a][c]||{},b[c]),g(Ca.perAction[c])&&"enabled"in Ca.perAction[c]&&(this.options[a][c].enabled=b[c].enabled===!1?!1:!0)):j(b[c])&&g(Ca.perAction[c])?this.options[a][c].enabled=b[c]:void 0!==b[c]&&(this.options[a][c]=b[c]))},dropzone:function(a){return g(a)?(this.options.drop.enabled=a.enabled===!1?!1:!0,this.setOnEvents("drop",a),this.accept(a.accept),/^(pointer|center)$/.test(a.overlap)?this.options.drop.overlap=a.overlap:i(a.overlap)&&(this.options.drop.overlap=Math.max(Math.min(1,a.overlap),0)),this):j(a)?(this.options.drop.enabled=a,this):this.options.drop},dropCheck:function(a,b,c,d,e){var f=!1;if(!(e=e||this.getRect(d)))return this.options.dropChecker?this.options.dropChecker(a,f,this,d,b,c):!1;var g=this.options.drop.overlap;if("pointer"===g){var h,j,k=r(a),l=D(b,c);k.x+=l.x,k.y+=l.y,h=k.x>e.left&&k.x<e.right,j=k.y>e.top&&k.y<e.bottom,f=h&&j}var m=b.getRect(c);if("center"===g){var n=m.left+m.width/2,o=m.top+m.height/2;f=n>=e.left&&n<=e.right&&o>=e.top&&o<=e.bottom}if(i(g)){var p=Math.max(0,Math.min(e.right,m.right)-Math.max(e.left,m.left))*Math.max(0,Math.min(e.bottom,m.bottom)-Math.max(e.top,m.top)),q=p/(m.width*m.height);f=q>=g}return this.options.dropChecker&&(f=this.options.dropChecker(a,f,this,d,b,c)),f},dropChecker:function(a){return h(a)?(this.options.dropChecker=a,this):null===a?(delete this.options.getRect,this):this.options.dropChecker},accept:function(a){return c(a)?(this.options.drop.accept=a,this):l(a)?(this.options.drop.accept=a,this):null===a?(delete this.options.drop.accept,this):this.options.drop.accept},resizable:function(a){return g(a)?(this.options.resize.enabled=a.enabled===!1?!1:!0,this.setPerAction("resize",a),this.setOnEvents("resize",a),/^x$|^y$|^xy$/.test(a.axis)?this.options.resize.axis=a.axis:null===a.axis&&(this.options.resize.axis=Ca.resize.axis),j(a.square)&&(this.options.resize.square=a.square),this):j(a)?(this.options.resize.enabled=a,this):this.options.resize},squareResize:function(a){return j(a)?(this.options.resize.square=a,this):null===a?(delete this.options.resize.square,this):this.options.resize.square},gesturable:function(a){return g(a)?(this.options.gesture.enabled=a.enabled===!1?!1:!0,this.setPerAction("gesture",a),this.setOnEvents("gesture",a),this):j(a)?(this.options.gesture.enabled=a,this):this.options.gesture},autoScroll:function(a){return g(a)?a=m({actions:["drag","resize"]},a):j(a)&&(a={actions:["drag","resize"],enabled:a}),this.setOptions("autoScroll",a)},snap:function(a){var b=this.setOptions("snap",a);return b===this?this:b.drag},setOptions:function(a,b){var c,d=b&&f(b.actions)?b.actions:["drag"];if(g(b)||j(b)){for(c=0;c<d.length;c++){var e=/resize/.test(d[c])?"resize":d[c];if(g(this.options[e])){var h=this.options[e][a];g(b)?(m(h,b),h.enabled=b.enabled===!1?!1:!0,"snap"===a&&("grid"===h.mode?h.targets=[ca.createSnapGrid(m({offset:h.gridOffset||{x:0,y:0}},h.grid||{}))]:"anchor"===h.mode?h.targets=h.anchors:"path"===h.mode&&(h.targets=h.paths),"elementOrigin"in b&&(h.relativePoints=[b.elementOrigin]))):j(b)&&(h.enabled=b)}}return this}var i={},k=["drag","resize","gesture"];for(c=0;c<k.length;c++)a in Ca[k[c]]&&(i[k[c]]=this.options[k[c]][a]);return i},inertia:function(a){var b=this.setOptions("inertia",a);return b===this?this:b.drag},getAction:function(a,b,c){var d=this.defaultActionChecker(a,b,c);return this.options.actionChecker?this.options.actionChecker(a,d,this,c,b):d},defaultActionChecker:$,actionChecker:function(a){return h(a)?(this.options.actionChecker=a,this):null===a?(delete this.options.actionChecker,this):this.options.actionChecker},getRect:function(a){return a=a||this._element,this.selector&&!c(a)&&(a=this._context.querySelector(this.selector)),x(a)},rectChecker:function(a){return h(a)?(this.getRect=a,this):null===a?(delete this.options.getRect,this):this.getRect},styleCursor:function(a){return j(a)?(this.options.styleCursor=a,this):null===a?(delete this.options.styleCursor,this):this.options.styleCursor},preventDefault:function(a){return/^(always|never|auto)$/.test(a)?(this.options.preventDefault=a,this):j(a)?(this.options.preventDefault=a?"always":"never",this):this.options.preventDefault},origin:function(a){return l(a)?(this.options.origin=a,this):g(a)?(this.options.origin=a,this):this.options.origin},deltaSource:function(a){return"page"===a||"client"===a?(this.options.deltaSource=a,this):this.options.deltaSource},restrict:function(a){if(!g(a))return this.setOptions("restrict",a);for(var b,c=["drag","resize","gesture"],d=0;d<c.length;d++){var e=c[d];if(e in a){var f=m({actions:[e],restriction:a[e]},a);b=this.setOptions("restrict",f)}}return b},context:function(){return this._context},_context:oa,ignoreFrom:function(a){return l(a)?(this.options.ignoreFrom=a,this):c(a)?(this.options.ignoreFrom=a,this):this.options.ignoreFrom},allowFrom:function(a){return l(a)?(this.options.allowFrom=a,this):c(a)?(this.options.allowFrom=a,this):this.options.allowFrom},element:function(){return this._element},fire:function(a){if(!a||!a.type||!ia(Na,a.type))return this;var b,c,d,e="on"+a.type,f="";if(a.type in this._iEvents)for(b=this._iEvents[a.type],c=0,d=b.length;d>c&&!a.immediatePropagationStopped;c++)f=b[c].name,b[c](a);if(h(this[e])&&(f=this[e].name,this[e](a)),a.type in Oa&&(b=Oa[a.type]))for(c=0,d=b.length;d>c&&!a.immediatePropagationStopped;c++)f=b[c].name,b[c](a);return this},on:function(a,b,c){var d;if(k(a)&&-1!==a.search(" ")&&(a=a.trim().split(/ +/)),f(a)){for(d=0;d<a.length;d++)this.on(a[d],b,c);return this}if(g(a)){for(var e in a)this.on(e,a[e],b);return this}if("wheel"===a&&(a=Ma),c=c?!0:!1,ia(Na,a))a in this._iEvents?this._iEvents[a].push(b):this._iEvents[a]=[b];else if(this.selector){if(!Ba[a])for(Ba[a]={selectors:[],contexts:[],listeners:[]},d=0;d<xa.length;d++)Ua.add(xa[d],a,aa),Ua.add(xa[d],a,ba,!0);var h,i=Ba[a];for(h=i.selectors.length-1;h>=0&&(i.selectors[h]!==this.selector||i.contexts[h]!==this._context);h--);-1===h&&(h=i.selectors.length,i.selectors.push(this.selector),i.contexts.push(this._context),i.listeners.push([])),i.listeners[h].push([b,c])}else Ua.add(this._element,a,b,c);return this},off:function(a,b,c){var d;if(k(a)&&-1!==a.search(" ")&&(a=a.trim().split(/ +/)),f(a)){for(d=0;d<a.length;d++)this.off(a[d],b,c);return this}if(g(a)){for(var e in a)this.off(e,a[e],b);return this}var h,i=-1;if(c=c?!0:!1,"wheel"===a&&(a=Ma),ia(Na,a))h=this._iEvents[a],h&&-1!==(i=ha(h,b))&&this._iEvents[a].splice(i,1);else if(this.selector){var j=Ba[a],l=!1;if(!j)return this;for(i=j.selectors.length-1;i>=0;i--)if(j.selectors[i]===this.selector&&j.contexts[i]===this._context){var m=j.listeners[i];for(d=m.length-1;d>=0;d--){var n=m[d][0],o=m[d][1];if(n===b&&o===c){m.splice(d,1),m.length||(j.selectors.splice(i,1),j.contexts.splice(i,1),j.listeners.splice(i,1),Ua.remove(this._context,a,aa),Ua.remove(this._context,a,ba,!0),j.selectors.length||(Ba[a]=null)),l=!0;break}}if(l)break}}else Ua.remove(this._element,a,b,c);return this},set:function(a){g(a)||(a={}),this.options=m({},Ca.base);var b,c=["drag","drop","resize","gesture"],d=["draggable","dropzone","resizable","gesturable"],e=m(m({},Ca.perAction),a[f]||{});for(b=0;b<c.length;b++){var f=c[b];this.options[f]=m({},Ca[f]),this.setPerAction(f,e),this[d[b]](a[f])}var h=["accept","actionChecker","allowFrom","deltaSource","dropChecker","ignoreFrom","origin","preventDefault","rectChecker"];for(b=0,Ya=h.length;Ya>b;b++){var i=h[b];this.options[i]=Ca.base[i],i in a&&this[i](a[i])}return this},unset:function(){if(Ua.remove(this,"all"),k(this.selector))for(var a in Ba)for(var b=Ba[a],c=0;c<b.selectors.length;c++){b.selectors[c]===this.selector&&b.contexts[c]===this._context&&(b.selectors.splice(c,1),b.contexts.splice(c,1),b.listeners.splice(c,1),b.selectors.length||(Ba[a]=null)),Ua.remove(this._context,a,aa),Ua.remove(this._context,a,ba,!0);break}else Ua.remove(this,"all"),this.options.styleCursor&&(this._element.style.cursor="");return this.dropzone(!1),ya.splice(ha(ya,this),1),ca}},da.prototype.snap=ea(da.prototype.snap,"Interactable#snap is deprecated. See the new documentation for snapping at http://interactjs.io/docs/snapping"),da.prototype.restrict=ea(da.prototype.restrict,"Interactable#restrict is deprecated. See the new documentation for resticting at http://interactjs.io/docs/restriction"),da.prototype.inertia=ea(da.prototype.inertia,"Interactable#inertia is deprecated. See the new documentation for inertia at http://interactjs.io/docs/inertia"),da.prototype.autoScroll=ea(da.prototype.autoScroll,"Interactable#autoScroll is deprecated. See the new documentation for autoScroll at http://interactjs.io/docs/#autoscroll"),ca.isSet=function(a,b){return-1!==ya.indexOfElement(a,b&&b.context)},ca.on=function(a,b,c){if(k(a)&&-1!==a.search(" ")&&(a=a.trim().split(/ +/)),f(a)){for(var d=0;d<a.length;d++)ca.on(a[d],b,c);return ca}if(g(a)){for(var e in a)ca.on(e,a[e],b);return ca}return ia(Na,a)?Oa[a]?Oa[a].push(b):Oa[a]=[b]:Ua.add(oa,a,b,c),ca},ca.off=function(a,b,c){if(k(a)&&-1!==a.search(" ")&&(a=a.trim().split(/ +/)),f(a)){for(var d=0;d<a.length;d++)ca.off(a[d],b,c);return ca}if(g(a)){for(var e in a)ca.off(e,a[e],b);return ca}if(ia(Na,a)){var h;a in Oa&&-1!==(h=ha(Oa[a],b))&&Oa[a].splice(h,1)}else Ua.remove(oa,a,b,c);return ca},ca.enableDragging=ea(function(a){return null!==a&&void 0!==a?(La.drag=a,ca):La.drag},"interact.enableDragging is deprecated and will soon be removed."),ca.enableResizing=ea(function(a){return null!==a&&void 0!==a?(La.resize=a,ca):La.resize},"interact.enableResizing is deprecated and will soon be removed."),ca.enableGesturing=ea(function(a){return null!==a&&void 0!==a?(La.gesture=a,ca):La.gesture},"interact.enableGesturing is deprecated and will soon be removed."),ca.eventTypes=Na,ca.debug=function(){var a=za[0]||new T;return{interactions:za,target:a.target,dragging:a.dragging,resizing:a.resizing,gesturing:a.gesturing,prepared:a.prepared,matches:a.matches,matchElements:a.matchElements,prevCoords:a.prevCoords,startCoords:a.startCoords,pointerIds:a.pointerIds,pointers:a.pointers,addPointer:Va.addPointer,removePointer:Va.removePointer,recordPointer:Va.recordPointer,snap:a.snapStatus,restrict:a.restrictStatus,inertia:a.inertiaStatus,downTime:a.downTimes[0],downEvent:a.downEvent,downPointer:a.downPointer,prevEvent:a.prevEvent,Interactable:da,interactables:ya,pointerIsDown:a.pointerIsDown,defaultOptions:Ca,defaultActionChecker:$,actionCursors:Ka,dragMove:Va.dragMove,resizeMove:Va.resizeMove,gestureMove:Va.gestureMove,pointerUp:Va.pointerUp,pointerDown:Va.pointerDown,pointerMove:Va.pointerMove,pointerHover:Va.pointerHover,events:Ua,globalEvents:Oa,delegatedEvents:Ba}},ca.getTouchAverage=z,ca.getTouchBBox=A,ca.getTouchDistance=B,ca.getTouchAngle=C,ca.getElementRect=x,ca.matchesSelector=ja,ca.closest=I,ca.margin=function(a){return i(a)?(Ga=a,ca):Ga},ca.supportsTouch=function(){return Ea},ca.supportsPointerEvent=function(){return Fa},ca.stop=function(a){for(var b=za.length-1;b>0;b--)za[b].stop(a);return ca},ca.dynamicDrop=function(a){return j(a)?(Aa=a,ca):Aa},ca.pointerMoveTolerance=function(a){return i(a)?(Ha=a,this):Ha},ca.maxInteractions=function(a){return i(a)?(Ja=a,this):Ja},ca.createSnapGrid=function(a){return function(b,c){var d=0,e=0;g(a.offset)&&(d=a.offset.x,e=a.offset.y);var f=Math.round((b-d)/a.x),h=Math.round((c-e)/a.y),i=f*a.x+d,j=h*a.y+e;return{x:i,y:j,range:a.range}}},ga(oa),Ra in Element.prototype&&h(Element.prototype[Ra])||(ma=function(a,b,c){c=c||a.parentNode.querySelectorAll(b);for(var d=0,e=c.length;e>d;d++)if(c[d]===a)return!0;return!1}),function(){for(var b=0,c=["ms","moz","webkit","o"],d=0;d<c.length&&!a.requestAnimationFrame;++d)Sa=a[c[d]+"RequestAnimationFrame"],Ta=a[c[d]+"CancelAnimationFrame"]||a[c[d]+"CancelRequestAnimationFrame"];Sa||(Sa=function(a){var c=(new Date).getTime(),d=Math.max(0,16-(c-b)),e=setTimeout(function(){a(c+d)},d);return b=c+d,e}),Ta||(Ta=function(a){clearTimeout(a)})}(),"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=ca),exports.interact=ca):"function"==typeof define&&define.amd?define("interact",function(){return ca}):a.interact=ca}(window),window.Modernizr=function(a,b,c){function d(a){s.cssText=a}function e(a,b){return typeof a===b}function f(a,b){return!!~(""+a).indexOf(b)}function g(a,b){for(var d in a){var e=a[d];if(!f(e,"-")&&s[e]!==c)return"pfx"==b?e:!0}return!1}function h(a,b,d){for(var f in a){var g=b[a[f]];if(g!==c)return d===!1?a[f]:e(g,"function")?g.bind(d||b):g}return!1}function i(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),f=(a+" "+u.join(d+" ")+d).split(" ");return e(b,"string")||e(b,"undefined")?g(f,b):(f=(a+" "+v.join(d+" ")+d).split(" "),h(f,b,c))}var j,k,l,m="2.8.3",n={},o=!0,p=b.documentElement,q="modernizr",r=b.createElement(q),s=r.style,t=({}.toString,"Webkit Moz O ms"),u=t.split(" "),v=t.toLowerCase().split(" "),w={},x=[],y=x.slice,z={}.hasOwnProperty;l=e(z,"undefined")||e(z.call,"undefined")?function(a,b){return b in a&&e(a.constructor.prototype[b],"undefined")}:function(a,b){return z.call(a,b)},Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=y.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(y.call(arguments)));
return Object(g)===g?g:f}return b.apply(a,c.concat(y.call(arguments)))};return d}),w.csstransitions=function(){return i("transition")};for(var A in w)l(w,A)&&(k=A.toLowerCase(),n[k]=w[A](),x.push((n[k]?"":"no-")+k));return n.addTest=function(a,b){if("object"==typeof a)for(var d in a)l(a,d)&&n.addTest(d,a[d]);else{if(a=a.toLowerCase(),n[a]!==c)return n;b="function"==typeof b?b():b,"undefined"!=typeof o&&o&&(p.className+=" "+(b?"":"no-")+a),n[a]=b}return n},d(""),r=j=null,function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=s.elements;return"string"==typeof a?a.split(" "):a}function e(a){var b=r[a[p]];return b||(b={},q++,a[p]=q,r[q]=b),b}function f(a,c,d){if(c||(c=b),k)return c.createElement(a);d||(d=e(c));var f;return f=d.cache[a]?d.cache[a].cloneNode():o.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!f.canHaveChildren||n.test(a)||f.tagUrn?f:d.frag.appendChild(f)}function g(a,c){if(a||(a=b),k)return a.createDocumentFragment();c=c||e(a);for(var f=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)f.createElement(h[g]);return f}function h(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?f(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function i(a){a||(a=b);var d=e(a);return s.shivCSS&&!j&&!d.hasCSS&&(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||h(a,d),a}var j,k,l="3.7.0",m=a.html5||{},n=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,o=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,p="_html5shiv",q=0,r={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",j="hidden"in a,k=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){j=!0,k=!0}}();var s={elements:m.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:l,shivCSS:m.shivCSS!==!1,supportsUnknownElements:k,shivMethods:m.shivMethods!==!1,type:"default",shivDocument:i,createElement:f,createDocumentFragment:g};a.html5=s,i(b)}(this,b),n._version=m,n._domPrefixes=v,n._cssomPrefixes=u,n.testProp=function(a){return g([a])},n.testAllProps=i,n.prefixed=function(a,b,c){return b?i(a,b,c):i(a,"pfx")},p.className=p.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(o?" js "+x.join(" "):""),n}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==q.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=r.shift();s=1,a?a.t?o(function(){("c"==a.t?m.injectCss:m.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):s=0}function i(a,c,d,e,f,i,j){function k(b){if(!n&&g(l.readyState)&&(t.r=n=1,!s&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&o(function(){v.removeChild(l)},50);for(var d in A[c])A[c].hasOwnProperty(d)&&A[c][d].onload()}}var j=j||m.errorTimeout,l=b.createElement(a),n=0,q=0,t={t:d,s:c,e:f,a:i,x:j};1===A[c]&&(q=1,A[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,q)},r.splice(e,0,t),"img"!=a&&(q||2===A[c]?(v.insertBefore(l,u?null:p),o(k,j)):A[c].push(l))}function j(a,b,c,d,f){return s=0,b=b||"j",e(a)?i("c"==b?x:w,a,b,this.i++,c,d,f):(r.splice(this.i++,0,a),1==r.length&&h()),this}function k(){var a=m;return a.loader={load:j,i:0},a}var l,m,n=b.documentElement,o=a.setTimeout,p=b.getElementsByTagName("script")[0],q={}.toString,r=[],s=0,t="MozAppearance"in n.style,u=t&&!!b.createRange().compareNode,v=u?n:p.parentNode,n=a.opera&&"[object Opera]"==q.call(a.opera),n=!!b.attachEvent&&!n,w=t?"object":n?"script":"img",x=n?"script":w,y=Array.isArray||function(a){return"[object Array]"==q.call(a)},z=[],A={},B={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}};m=function(a){function b(a){var b,c,d,a=a.split("!"),e=z.length,f=a.pop(),g=a.length,f={url:f,origUrl:f,prefixes:a};for(c=0;g>c;c++)d=a[c].split("="),(b=B[d.shift()])&&(f=b(f,d));for(c=0;e>c;c++)f=z[c](f);return f}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(A[i.url]?i.noexec=!0:A[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),A[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(l=function(){var a=[].slice.call(arguments);m.apply(this,a),n()}),g(a,l,b,0,j);else if(Object(a)===a)for(i in h=function(){var b,c=0;for(b in a)a.hasOwnProperty(b)&&c++;return c}(),a)a.hasOwnProperty(i)&&(!c&&!--h&&(d(l)?l=function(){var a=[].slice.call(arguments);m.apply(this,a),n()}:l[i]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),n()}}(m[i])),g(a[i],l,b,i,j))}else!c&&n()}var h,i,j=!!a.test,k=a.load||a.both,l=a.callback||f,m=l,n=a.complete||f;c(j?a.yep:a.nope,!!k),k&&c(k)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(y(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):y(j)?m(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},m.addPrefix=function(a,b){B[a]=b},m.addFilter=function(a){z.push(a)},m.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",l=function(){b.removeEventListener("DOMContentLoaded",l,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k,l,n=b.createElement("script"),e=e||m.errorTimeout;n.src=a;for(l in d)n.setAttribute(l,d[l]);c=j?h:c||f,n.onreadystatechange=n.onload=function(){!k&&g(n.readyState)&&(k=1,c(),n.onload=n.onreadystatechange=null)},o(function(){k||(k=1,c(1))},e),i?n.onload():p.parentNode.insertBefore(n,p)},a.yepnope.injectCss=function(a,c,d,e,g,i){var j,e=b.createElement("link"),c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(p.parentNode.insertBefore(e,p),o(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))},function(){function a(){return window.pageXOffset||k.scrollLeft}function b(){return window.pageYOffset||k.scrollTop}function c(c){var d=c.getBoundingClientRect();return{top:d.top+b(),left:d.left+a()}}function d(a){var b=a.target,c=(parseFloat(b.getAttribute("data-x"))||0)+a.dx,d=(parseFloat(b.getAttribute("data-y"))||0)+a.dy;b.style.transform=b.style.webkitTransform="translate("+c+"px, "+d+"px)",b.style.zIndex=1e4,b.setAttribute("data-x",c),b.setAttribute("data-y",d)}function e(a){a.style.transform=a.style.webkitTransform="none",a.style.zIndex=1,a.setAttribute("data-x",0),a.setAttribute("data-y",0)}function f(){interact(".drag-element").draggable({inertia:!0,onmove:d,onend:function(a){classie.has(a.target,"drag-element--dropped")||classie.has(a.target,"drag-element--dropped-text")||e(a.target)}}),g();var a=new MutationObserver(function(){g()});a.observe(document.body,{childList:!0,subtree:!0}),interact(".paint-area").dropzone({accept:".drag-element",overlap:.75,ondragenter:function(a){classie.add(a.target,"paint-area--highlight")},ondragleave:function(a){classie.remove(a.target,"paint-area--highlight")},ondrop:function(a){var b="area";classie.has(a.target,"paint-area--text")&&(b="text");var c=a.relatedTarget;classie.add(c,"text"===b?"drag-element--dropped-text":"drag-element--dropped");var d=function(f){this.removeEventListener(m,d),"area"===b&&j(a.dragEvent,a.target,c.getAttribute("data-color")),setTimeout(function(){e(c),classie.remove(c,"text"===b?"drag-element--dropped-text":"drag-element--dropped")},"text"===b?0:250)};"text"===b&&j(a.dragEvent,a.target,c.getAttribute("data-color")),c.querySelector(".drop").addEventListener(m,d)},ondropdeactivate:function(a){classie.remove(a.target,"paint-area--highlight")}})}function g(){h(),i()}function h(){var a=document.querySelectorAll("body,body *");for(var b in a)a[b].classList&&classie.add(a[b],"paint-area")}function i(){var a,b,c=document.querySelectorAll("body *");for(var d in c)if(b=c[d],a=c[d].nextSibling,b.classList&&0===b.children.length&&b.innerText&&b.innerText.length>0&&!b.type&&classie.add(b,"paint-area--text"),a&&3==a.nodeType)if(a.textContent.trim().length>0)classie.add(b,"paint-area--text");else for(var e in b.childNodes){var f=b.childNodes[e];if(f.wholeText&&f.wholeText.trim().length>0){classie.add(b,"paint-area--text");break}}}function j(a,b,d){var e="area";if(classie.has(b,"paint-area--text")&&(e="text"),"area"===e){var f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttributeNS(null,"version","1.1"),f.setAttributeNS(null,"width","100%"),f.setAttributeNS(null,"height","100%"),f.setAttributeNS(null,"class","paint");var g=document.createElementNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate("+Number(a.pageX-c(b).left)+", "+Number(a.pageY-c(b).top)+")");var h=document.createElementNS("http://www.w3.org/2000/svg","circle");h.setAttributeNS(null,"cx",0),h.setAttributeNS(null,"cy",0),h.setAttributeNS(null,"r",Math.sqrt(Math.pow(b.offsetWidth,2)+Math.pow(b.offsetHeight,2))),h.setAttributeNS(null,"fill",d),f.appendChild(g),g.appendChild(h),b.appendChild(f)}setTimeout(function(){if(classie.add(b,"paint--active"),"text"===e){b.style.color=d;var a=function(c){c.target==this&&(this.removeEventListener(m,a),classie.remove(b,"paint--active"))};b.addEventListener(m,a)}else{var a=function(c){c.target==this&&"fill-opacity"!==c.propertyName&&(this.removeEventListener(m,a),b.style.backgroundColor=d,b.removeChild(f),setTimeout(function(){classie.remove(b,"paint--active")},25))};h.addEventListener(m,a)}},25)}var k=window.document.documentElement,l={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"},m=l[Modernizr.prefixed("transition")];f()}();var css=document.createElement("style");css.type="text/css",css.innerHTML='#info-wrap.hide { display: none; } .paint--active.paint-area { -webkit-transition: none; transition: none; } .paint--active.paint-area--text { -webkit-transition: color 0.3s; transition: color 0.3s; } .paint-area.paint-area--highlight:not(.paint-area--text) { box-shadow: inset 0 0 0 3px rgb(133,125,255); } .paint-area--text.paint-area--highlight { text-shadow: -1px -1px 0 rgba(133,125,255,0.5), 1px -1px 0 rgba(133,125,255,0.5), -1px 1px 0 rgba(133,125,255,0.5), 1px 1px 0 rgba(133,125,255,0.5); } .paint { position: absolute; top: 0; left: 0; z-index: 0; } .paint circle { fill-opacity: 0; -webkit-transform: scale3d(0,0,1); transform: scale3d(0,0,1); -webkit-transition: -webkit-transform 0.8s, fill-opacity 0.4s; transition: transform 0.8s, fill-opacity 0.4s; -webkit-transition-timing-function: ease-out; transition-timing-function: ease-out; } .paint--active .paint circle { fill-opacity: 1; -webkit-transform: scale3d(1,1,1); transform: scale3d(1,1,1); } .customizer { background: #444; height: 300px; overflow-y: scroll; position: fixed; top: 50%; left: 0; max-height: 100%; z-index: 10000; padding: 15px 10px; border-radius: 0 5px 5px 0; -webkit-transform: translate3d(0, -50%, 0); transform: translate3d(0, -50%, 0); } .color-1 { background: #f0f0f0; color: #f0f0f0; } .color-tool { list-style: none; margin: 0; padding: 0; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; } .color-tool li { width: 30px; height: 30px; display: block; margin: 5px; } .drag-element { display: block; position: relative; width: 100%; height: 100%; } .drag-element:hover { cursor: move; cursor: -webkit-grab; cursor: grab; } .drag-element:active { cursor: -webkit-grabbing; cursor: grabbing; } .drop { width: 20px; height: 20px; top: 5px; left: 5px; position: absolute; border-radius: 80% 0 55% 50% / 55% 0 80% 50%; -webkit-transform: rotate3d(0,0,1,-45deg); transform: rotate3d(0,0,1,-45deg); } .drop-helper-1, .drop-helper-2, .drop-helper-3, .drop-helper-4 { position: absolute; display: block; width: 6px; height: 6px; bottom: -10px; left: 50%; margin-left: -3px; border-radius: 50%; pointer-events: none; opacity: 0; } .drop-helper-3, .drop-helper-4 { width: 10px; height: 10px; margin-left: -5px; } .drop-helper-1 { -webkit-transform-origin: -33px 50%; transform-origin: -33px 50%; } .drop-helper-2 { -webkit-transform-origin: 45px 50%; transform-origin: 45px 50%; } .drop-helper-3 { -webkit-transform-origin: -18px 50%; transform-origin: -18px 50%; } .drop-helper-4 { -webkit-transform-origin: 30px 50%; transform-origin: 30px 50%; } .drag-element--dropped .drop { -webkit-transition: -webkit-transform 0.2s, opacity 0.2s; transition: transform 0.2s, opacity 0.2s; -webkit-transition-timing-function: cubic-bezier(0.6,0.04,0.98,0.335); transition-timing-function: cubic-bezier(0.6,0.04,0.98,0.335); -webkit-transform: translate3d(0,25px,0) rotate3d(0,0,1,-45deg) scale3d(0.2,0.2,1); transform: translate3d(0,25px,0) rotate3d(0,0,1,-45deg) scale3d(0.2,0.2,1); opacity: 0; } .drag-element--dropped .drop-helper-1, .drag-element--dropped .drop-helper-3 { -webkit-animation: drop-anim-1 0.3s ease-out 0.15s forwards; animation: drop-anim-1 0.3s ease-out 0.15s forwards; } .drag-element--dropped .drop-helper-2, .drag-element--dropped .drop-helper-4 { -webkit-animation: drop-anim-2 0.3s ease-out 0.15s forwards; animation: drop-anim-2 0.3s ease-out 0.15s forwards; } .drag-element--dropped .drop-helper-4 { -webkit-animation-duration: 0.2s; animation-duration: 0.2s; } @-webkit-keyframes drop-anim-1 { 0% { -webkit-transform: rotate3d(0,0,1,5deg); transform: rotate3d(0,0,1,5deg); opacity: 0; } 50% { opacity: 0.5; } 100% { -webkit-transform: rotate3d(0,0,1,-90deg); transform: rotate3d(0,0,1,-90deg); opacity: 0; } } @keyframes drop-anim-1 { 0% { -webkit-transform: rotate3d(0,0,1,5deg); transform: rotate3d(0,0,1,5deg); opacity: 0; } 50% { opacity: 0.5; } 100% { -webkit-transform: rotate3d(0,0,1,-90deg); transform: rotate3d(0,0,1,-90deg); opacity: 0; } } @-webkit-keyframes drop-anim-2 { 0% { -webkit-transform: rotate3d(0,0,1,-5deg); transform: rotate3d(0,0,1,-5deg); opacity: 0; } 50% { opacity: 0.5; } 100% { -webkit-transform: rotate3d(0,0,1,90deg); transform: rotate3d(0,0,1,90deg); opacity: 0; } } @keyframes drop-anim-2 { 0% { -webkit-transform: rotate3d(0,0,1,-5deg); transform: rotate3d(0,0,1,-5deg); opacity: 0; } 50% { opacity: 0.5; } 100% { -webkit-transform: rotate3d(0,0,1,90deg); transform: rotate3d(0,0,1,90deg); opacity: 0; } } .drag-element--dropped-text .drop { -webkit-transition: opacity 0.3s; transition: opacity 0.3s; opacity: 0; } .reset-button { background: none; padding: 0; margin: 0; border: none; width: 30px; height: 30px; margin: 0; color: transparent; font-size: 0px; background: url("chrome-extension://gdoiopdelonmejbbcfoiibojafcpihhm/images/drop_reset.svg") no-repeat center center; background-size: 100%; } #info-wrap { color: #fff; position: fixed; width: 100%; height: 100%; top: 0; left: 0; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; background: rgba(0,0,0,0.7); z-index: 999999; font-family: "Avenir", "Helvetica Neue", Arial, sans-serif; } .info { width: 90%; max-width: 500px; background: #333; padding: 2.5em 2em; font-size: 15px; line-height: 1.5; text-align: center; box-shadow: 0 0 30px rgba(0,0,0,0.2); } .info h3 { margin: 0; font-size: 1.5em; } .info img { width: 52px; height: 52px; display: block; margin: 0 auto 20px; } #info-close { border: 3px solid #fff; color: #fff; background: none; text-transform: uppercase; font-weight: bold; padding: 1em 2em; letter-spacing: 1px; margin: 1em 0 0 0; } @media screen and (max-width: 50em) { body { padding-top: 100px; } .customizer { top: 0; width: 100%; height: auto; padding: 30px 0; -webkit-transform: none; transform: none; border-radius: 0; } .color-tool { -webkit-flex-direction: row; flex-direction: row; -webkit-justify-content: center; justify-content: center; } .color-tool li { margin: 5px 15px 0px 15px; } } #panel { position: absolute; right: 0; width: 180px; top: 0; bottom: 0; box-shadow: 0px 0px 15px black; background: white; padding: 10px; -webkit-transform-origin: 100% 50%; -webkit-transform: scaleX(0.00001); -webkit-transition: -webkit-transform 0.2s ease-in-out; outline: 0; } #panel:target { -webkit-transform: scaleX(1); }',document.body.appendChild(css);var application={};application.init=function(){this.openTutorial()},application.openTutorial=function(){var a,b=isChromeExtension()?chrome.extension.getURL("images/drag.svg"):"https://photos-2.dropbox.com/t/2/AABYFRE0xgopuqn92_7Lf6_qepJpYS6-y0GFTzQlFAeh3w/12/46483432/png/1024x768/3/1430769600/0/2/drag.svg/COiPlRYgASACIAMoAQ/zoAaPbfXjGS6wyLHX6gTCX2Otonjns6ge5Ecg-ZWw4A",c=isChromeExtension()?chrome.extension.getURL("images/time.svg"):"",d=["#FFEBEE","#FFCDD2","#EF9A9A","#E57373","#EF5350","#F44336","#E53935","#D32F2F","#C62828","#B71C1C","#FCE4EC","#F8BBD0","#F48FB1","#F06292","#EC407A","#E91E63","#D81B60","#C2185B","#AD1457","#880E4F","#F3E5F5","#E1BEE7","#CE93D8","#BA68C8","#AB47BC","#9C27B0","#8E24AA","#7B1FA2","#6A1B9A","#4A148C","#EDE7F6","#D1C4E9","#B39DDB","#9575CD","#7E57C2","#673AB7","#5E35B1","#512DA8","#4527A0","#311B92","#E8EAF6","#C5CAE9","#9FA8DA","#7986CB","#5C6BC0","#3F51B5","#3949AB","#303F9F","#283593","#1A237E","#E3F2FD","#BBDEFB","#90CAF9","#64B5F6","#42A5F5","#2196F3","#1E88E5","#1976D2","#1565C0","#0D47A1","#E1F5FE","#B3E5FC","#81D4FA","#4FC3F7","#29B6F6","#03A9F4","#039BE5","#0288D1","#0277BD","#01579B","#E0F7FA","#B2EBF2","#80DEEA","#4DD0E1","#26C6DA","#00BCD4","#00ACC1","#0097A7","#00838F","#006064","#E0F2F1","#B2DFDB","#80CBC4","#4DB6AC","#26A69A","#009688","#00897B","#00796B","#00695C","#004D40","#E8F5E9","#C8E6C9","#A5D6A7","#81C784","#66BB6A","#4CAF50","#43A047","#388E3C","#2E7D32","#1B5E20","#F1F8E9","#DCEDC8","#C5E1A5","#AED581","#9CCC65","#8BC34A","#7CB342","#689F38","#558B2F","#33691E","#F9FBE7","#F0F4C3","#E6EE9C","#DCE775","#D4E157","#CDDC39","#C0CA33","#AFB42B","#9E9D24","#827717","#FFFDE7","#FFF9C4","#FFF59D","#FFF176","#FFEE58","#FFEB3B","#FDD835","#FBC02D","#F9A825","#F57F17","#FFF8E1","#FFECB3","#FFE082","#FFD54F","#FFCA28","#FFC107","#FFB300","#FFA000","#FF8F00","#FF6F00","#FFF3E0","#FFE0B2","#FFCC80","#FFB74D","#FFA726","#FF9800","#FB8C00","#F57C00","#EF6C00","#E65100","#FBE9E7","#FFCCBC","#FFAB91","#FF8A65","#FF7043","#FF5722","#F4511E","#E64A19","#D84315","#BF360C","#EFEBE9","#D7CCC8","#BCAAA4","#A1887F","#8D6E63","#795548","#6D4C41","#5D4037","#4E342E","#3E2723","#FAFAFA","#F5F5F5","#EEEEEE","#E0E0E0","#BDBDBD","#9E9E9E","#757575","#616161","#424242","#212121","#ECEFF1","#CFD8DC","#B0BEC5","#90A4AE","#78909C","#607D8B","#546E7A","#455A64","#37474F","#263238"],e="";for(var f in d)a='style="background: '+d[f]+"; color: "+d[f]+';"',e+='<li class="color" '+a+'>    <div class="drag-element" data-color="'+d[f]+'">        <div class="drop" '+a+'></div>        <i class="drop-helper-1" '+a+'></i>        <i class="drop-helper-2" '+a+'></i>        <i class="drop-helper-3" '+a+'></i>        <i class="drop-helper-4" '+a+"></i>    </div></li>";document.body.insertAdjacentHTML("afterbegin",'<div class="customizer">  <ul class="color-tool">'+e+'      <li>          <button class="reset-button" title="Reser colors">Reset colors</button>       </li>   </ul> </div>'),document.querySelector("button.reset-button").addEventListener("click",resetColors),isChromeExtension()&&chrome.storage.sync.get("colordrop-tutorial",function(a){a["colordrop-tutorial"]||(document.body.insertAdjacentHTML("afterbegin",'<div id="info-wrap"><div class="info"><h3>Interactive Coloring Concept</h3><p><img src="'+b+'" alt="drag icon"/>Drag any color from the left toolbar to an area or text in the mockup. A blue outline will indicate a droppable element.</p><p><img src="'+c+'" alt="drag icon"/>On mobile, wait a tiny bit until you drag the color drop.</p><button id="info-close">Got it!</button></div></div>'),document.getElementById("info-close").addEventListener("click",function(){chrome.storage.sync.set({"colordrop-tutorial":!0},function(){classie.add(document.getElementById("info-wrap"),"hide")})}))})},application.init();