-
Notifications
You must be signed in to change notification settings - Fork 1
/
reasons.min.js
2 lines (2 loc) · 40.3 KB
/
reasons.min.js
1
2
(function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Reasons=t()}})(function(){var t;return function(){function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var u=n[s]={exports:{}};e[s][0].call(u.exports,function(t){var n=e[s][1][t];return r(n||t)},u,u.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)r(i[s]);return r}return t}()({1:[function(t,e,n){"use strict";function i(t){return t.isEdge=o,t.isNode=s,t.export=h,t.collides=a,t.move=c,r(t)}function r(t){return t.id=t.id||Math.random().toString(36).slice(-5),t.isEdge()?(t.from=f.flatten([t.from]).map(t=>t.id||t),t.to=t.to.id||t.to,t.type=t.type||"donc",t.paths=[]):(t.text=t.text||"Argument",t.width=d,t.height=3.5*y,u(t,{x:t.x||0,y:t.y||0})),t}function o(){return!(!this.to||!this.from)}function s(){return!this.isEdge()}function a(t){if(this.isEdge()){let e=!1;if(this.paths.forEach(n=>{p(t,n)<.05&&(e=!0)}),!this.center)return!1;let n=5*this.type.length;return e=!(t.x<this.center.x-n||t.x>this.center.x+n||t.y<this.center.y-10||t.y>this.center.y+10),e}return t.isNode&&t.isNode()?!(this.x2<t.x1||this.x1>t.x2||this.y1>t.y2||this.y2<t.y1):t.x>this.x1&&t.x<this.x2&&t.y>this.y1&&t.y<this.y2}function c(t){this.isNode()&&(this.x=t.x,this.y=t.y,u(this,t))}function h(){return this.isEdge()?{id:this.id,type:this.type,from:l(this.from),to:l(this.to)}:{id:this.id,text:this.text,x:parseInt(this.x1+this.width/2),y:parseInt(this.y1+this.height/2),lineType:this.lineType?this.lineType:"solid"}}function u(t,e){t.isNode()&&(t.x1=parseInt(e.x-t.width/2),t.x2=parseInt(e.x+t.width/2),t.y1=parseInt(e.y-t.height/2),t.y2=parseInt(e.y+t.height/2))}function l(t){return t instanceof Array?t.map(t=>t.id||t):t.id||t}function p(t,e){return Math.abs(Math.atan2(t.y-e.y1,t.x-e.x1)-Math.atan2(e.y2-t.y,e.x2-t.x))}const f=t("./Utils"),d=200,y=16;e.exports={mixin:i,isEdge:o,isNode:s,save:h}},{"./Utils":2}],2:[function(t,e,n){e.exports={buildNode:function(t,e,n){const i=document.createElement(t);for(var r in e)i[r]=e[r];for(var r in n)i.setAttribute(r,n[r]);return i},intersection:function(t,e){return t.filter(function(t){return-1!==e.indexOf(t)})},unique:t("array-unique"),flatten:t("array-flatten"),diff:t("array-difference")}},{"array-difference":10,"array-flatten":11,"array-unique":12}],3:[function(t,e,n){arguments[4][1][0].apply(n,arguments)},{"./Utils":2,dup:1}],4:[function(t,e,n){"use strict";function i(t){t instanceof Array&&t.sort((t,e)=>t.to?1:-1).forEach(t=>this.add(t))}const r=t("./utils"),o=t("./element");e.exports=i,i.prototype=Object.create(Array.prototype),i.prototype.add=function(t){if(o.mixin(t),t.isNode())this.push(t);else{if(this.hasDuplicate(t)||this.isFromEdge(t)||this.isToEdge(t))return!1;let e=r.intersection(r.flatten(t.from.map(t=>this.children(t))),this.children(t.to)).map(t=>t.id);if(e.length>0){r.flatten([t.from,t.to]).map(t=>t.id||t);this.edges().forEach(e=>{r.intersection(t.from,e.from).length>0&&this.remove(e),e.from.includes(t.to)&&(this.push(o.mixin({from:r.flatten([e.from,t.from]),to:e.to,type:e.type})),this.remove(e))})}else this.push(t)}},i.prototype.remove=function(t){let e=this.indexOf(t);if(e>-1)if(t.isNode()){let n=this.edges().filter(e=>e.to==t.id),i=this.edges().filter(e=>e.from.includes(t.id)),r=i.filter(t=>t.from.length>1);this.splice(e,1),n.forEach(t=>{this.indexOf(t)>-1&&this.splice(this.indexOf(t),1)}),i.forEach(t=>{this.indexOf(t)>-1&&this.splice(this.indexOf(t),1)}),i.filter(t=>t.from instanceof Array).map(e=>{e.from.indexOf(t)>-1&&e.from.splice(e.from.indexOf(t),1),1===e.from.length&&(e.from=e.from[0])}),r.forEach(e=>{e.from.splice(e.from.indexOf(t.id),1),this.push(e)})}else this.splice(e,1);return this},i.prototype.focus=function(t){let e=this.indexOf(t);return e>-1&&this.push(this.splice(e,1)[0]),this.forEach(function(e){e.focused=e===t}),t},i.prototype.undoFocus=function(){const t=this.pop();return this.unshift(t),this.forEach(function(e){e.focused=e===t}),t},i.prototype.unfocus=function(){return this.forEach(function(t){t.focused=!1}),this},i.prototype.last=function(){return this[this.length-1]},i.prototype.edges=function(){return this.filter(t=>t.from&&t.to)},i.prototype.nodes=function(){return this.filter(t=>!t.from||!t.to)},i.prototype.elements=function(){return this},i.prototype.parents=function(t){return t instanceof Object&&(t=t.id),r.flatten(this.edges().filter(e=>e.to==t).map(t=>t.from)).map(t=>this.find(e=>e.id==t))},i.prototype.children=function(t){return t instanceof Object&&(t=t.id),r.unique(this.edges().filter(e=>r.flatten([e.from]).map(t=>t.id||t).indexOf(t)>-1).map(t=>t.to).map(t=>this.find(e=>e==t||e.id==t)))},i.prototype.hasDuplicate=function(t){o.mixin(t);let e=!1;return t.isEdge()&&this.edges().forEach(n=>{t.to===n.to&&t.from.toString()===n.from.toString()&&(e=!0)}),e},i.prototype.isFromEdge=function(t){var e=!1;return t.from.forEach(t=>{var n=this.edges().find(e=>e.id==t);n&&(e=!0)}),e},i.prototype.isToEdge=function(t){let e=this.find(e=>e.id==t.to);if(e&&e.isEdge())return!0}},{"./element":3,"./utils":8}],5:[function(t,e,n){"use strict";function i(t){this.DOM=document.querySelector(t),this.DOM&&(s.init(this),o.setup(this),o.addEventListeners(this))}const r=t("./graph"),o=t("./ui"),s=t("./view");e.exports=i,i.prototype.render=function(t){return this.graph=new r(t),s.draw(this),s.resize(this),s.zero(this),s.draw(this),this},i.prototype.export=function(){return this.graph.map(t=>t.export())}},{"./graph":4,"./ui":7,"./view":9}],6:[function(t,e,n){const i=t("./mapper");e.exports={mapper:function(t){return new i(t)}}},{"./mapper":5}],7:[function(t,e,n){"use strict";function i(t){r();const e=x.buildNode("style");e.innerHTML=`\n #${t.DOM.id} {\n min-height: 100px;\n }\n `,document.head.appendChild(e),g.resize(t),t.History=[],t.Future=[]}function r(){if(!document.head.querySelector("style[data-reasons-shared]")){const t=x.buildNode("style",void 0,{"data-reasons-shared":!0});t.innerHTML='\n body.modal {\n overflow-y: hidden;\n }\n #reason-overlay {\n font-size: 18px;\n position: fixed;\n top: 0; left: 0; right: 0;\n height: 100vh;\n background: rgba(0,0,0,0.75);\n touch-action: none;\n }\n #edit-reason-input {\n font-size: 18px;\n padding: 1rem 1rem 0 1rem;\n margin-top: 10vh;\n box-sizing: border-box;\n }\n #reason-overlay__wrapper {\n margin: auto;\n margin-top: 10vh;\n width:50%;\n padding: 1rem;\n flex-direction: column;\n display: flex;\n }\n #reasons-overlay-toolbar {\n margin: 0.75rem -0.5rem;\n }\n .reason-overlay__button {\n font-size: inherit;\n background-color: white;\n padding: 0.5rem 1rem;\n border: 1px solid grey;\n border-radius: 4px;\n margin: 0 0.5rem;\n }\n [data-reasons-layout="inline"] {\n touch-action: pinch-zoom;\n }\n .show-touch, .show-pointer {\n display: none;\n }\n ',document.head.appendChild(t)}}function o(t){function e(e){const n=x(e);return{position:n,collision:t.graph.elements().find(t=>t.collides(n))}}function n(){u(t.History,t);const e=t.Future.pop();e&&(t.graph=new E(JSON.parse(e)),t.dirty=!0)}function i(){u(t.Future,t);const e=t.History.pop();e&&(t.graph=new E(JSON.parse(e)),t.dirty=!0)}const r=new w(t.DOM,{});t.inline||r.get("pan").set({direction:w.DIRECTION_ALL}),r.get("pinch").set({enable:!0}),r.add(new w.Swipe({pointers:3})),t.altered=!0,t.editMode=!1,t.dirty=!1;let o=null,h=null,l=null,p=null,f=!1;const x=e=>{const{x:n,y:i}=t.offset,r=e.target.getClientRects()[0];return{x:parseInt((e.x||e.pageX)-parseInt(r.left))/t.scale-n,y:parseInt((e.y||e.pageY)-parseInt(r.top))/t.scale-i}},b=n=>{const{position:i,collision:r}=e(n);r?d(t,r):(t.graph.add({x:i.x,y:i.y}),o=t.graph.last(),t.graph.focus(o),t.altered=!0,d(t,o,!0)),c(t)};r.on("doubletap",t=>{const e=t.srcEvent;e.preventDefault(),b(e)}),r.on("swipe",e=>{e.direction&w.DIRECTION_HORIZONTAL&&(t._isSwipping=!0,e.direction===w.DIRECTION_LEFT?i():n(),setTimeout(()=>{t._isSwipping=!1},250))}),r.on("panstart",function(n){const i=n.srcEvent,{collision:r}=e(i);t._isSwipping||(r?O(i):t._startPan={...t.offset})});const M=function(n){const i=n.srcEvent,{collision:r}=e(i);if(r)return D(i);h||t._isSwipping||(t.offset={x:t._startPan.x+n.deltaX/t.scale,y:t._startPan.y+n.deltaY/t.scale},t.dirty=!0,g.zero(t),c(t))};r.on("panmove",M);const O=n=>{const{position:i,collision:r}=e(n);h||(r&&(o=r,t.graph.focus(o),t.dirty=!0,l=i,p={x:o.x1+o.width/2-i.x,y:o.y1+o.height/2-i.y},h=o),c(t))};t.DOM.addEventListener("mousedown",O);const D=e=>{window.currentMapper=t;const n=x(e);if(t.graph.forEach(e=>{e.collides(n)?(e.hovering||(t.dirty=!0),e.hovering=!0):(e.hovering&&(t.dirty=!0),e.hovering=!1)}),h){const n=x(e);h.move({x:n.x+p.x,y:n.y+p.y}),t.dirty=!0}c(t)};t.DOM.addEventListener("mousemove",D);const A=n=>{const{collision:i}=e(n);if(h){const e=t.graph.nodes().find(t=>h.collides(t)&&h.id!==t.id);e&&(t.graph.add({from:h,to:e}),h.move(l)),t.altered=!0,h=null}else i||(o=null,t.graph.unfocus(),t.dirty=!0);c(t)};t.DOM.addEventListener("mouseup",A),t.DOM.addEventListener("touchend",A),window.addEventListener("click",e=>{t.editMode&&"reason-overlay"===e.target.id&&m(t)}),window.addEventListener("keydown",e=>{window.currentMapper===t&&(t.editMode?(T.isEventKey(e,"Escape")&&m(t),T.isEventKey(e,"Enter")&&y(t)):(v(e)&&(f=!0),!v(e)&&T.isEventKey(e,"tab")&&(e.preventDefault(),e.shiftKey?t.graph.undoFocus():(o=t.graph[0],t.graph.focus(o)),console.log(t.graph.map(t=>t.id)),t.dirty=!0),f&&T.isEventKey(e,"z")&&(e.preventDefault(),i()),f&&T.isEventKey(e,"y")&&(e.preventDefault(),n()),o&&T.isEventKey(e,"Enter")&&d(t,o),(T.isEventKey(e,"Delete")||T.isEventKey(e,"Backspace"))&&("INPUT"!==document.activeElement.tagName&&e.preventDefault(),o&&s(t,o))),c(t))}),window.addEventListener("keyup",t=>{v(t)&&(f=!1)}),window.addEventListener("resize",e=>{t.dirty=!0,g.resize(t),g.zero(t),c(t)});const C=e=>{e.target.id===t.DOM.firstElementChild.id||"wheel"===e.type&&e.target.id===t.DOM.id?(e.preventDefault(),t.dirty=!0,g.setScale(t,e.deltaY),g.zero(t),c(t)):t.inline&&!e.metaKey&&a(t)};window.addEventListener("wheel",C,{passive:!1});let S=1;r.on("pinch",e=>{if(t._isSwipping)return;t.inline&&M(e),e.preventDefault();let n=e.scale-S;t.dirty=!0,g.setScale(t,1e3*n,!0),g.zero(t),c(t),S=e.scale}),r.on("pinchend",()=>{S=1})}function s(t,e){t.graph.remove(e),t.dirty=!0}function a(t){console.log("Please hold CMD while scrolling to zoom")}function c(t){(t.altered||t.dirty)&&(b&&window.cancelAnimationFrame(b),b=window.requestAnimationFrame(function(){h(t)}))}function h(t){(t.altered||t.dirty)&&(t.altered&&(u(t.History,t),t.Future.length=0),g.draw(t),t.altered=!1,t.dirty=!1)}function u(t,e){const n=0==t.length?JSON.stringify([]):t[t.length-1],i=JSON.stringify(e.graph.map(function(t){return t.export(e.offset)}));i!==n&&t.push(i)}function l(t,e,n){e.lineType=n,t.altered=!0,c(t)}function p(t,e){const n=x.buildNode("div",{id:"reasons-overlay-toolbar"});return n.setAttribute("style","display: flex; flex-direction: row;"),n.appendChild(x.buildNode("div",{style:"flex-grow: 1;"})),n.appendChild(f({name:"Prémisse",onclick:()=>l(t,e,"solid")})),n.appendChild(f({name:"Objection",onclick:()=>l(t,e,"dashed")})),n.appendChild(f({name:"Supprimer",onclick:()=>{confirm("Voulez-vous vraiment supprimer cet élément ?")&&(s(t,e),m(t),c(t))}})),n.appendChild(f({name:"OK",onclick:()=>{y(t),c(t)}})),n}function f(t){const{name:e}=t;delete t.name;const n=x.buildNode("button",t,{class:"reason-overlay__button"});return n.innerHTML=e,n}function d(t,e,n=!1){t.editMode=!0;let i=x.buildNode("div",{id:"reason-overlay"});const r=x.buildNode("div",{id:"reason-overlay__wrapper"});let o=x.buildNode("textarea",{id:"edit-reason-input",value:e.text||e.type});o.setAttribute("data-element",e.id),i.appendChild(r),r.appendChild(o),r.appendChild(p(t,e)),document.body.appendChild(i),document.body.classList.add("modal"),n&&(o.select(),o.setSelectionRange(0,o.value.length)),o.scrollIntoView()}function y(t){let e=document.querySelector("#edit-reason-input"),n=t.graph.elements().find(t=>t.id==e.getAttribute("data-element"));n.isNode()?n.text=e.value:n.type=e.value,m(t)}function m(t){t.editMode=!1,t.altered=!0,document.querySelector("#reason-overlay").remove(),document.body.classList.remove("modal")}function v(t){return!!(t.metaKey||T.isEventKey(t,"Alt")||T.isEventKey(t,"Meta")||T.isEventKey(t,"Command")||T.isEventKey(t,"Control")||T.isEventKey(t,"Win")||T.isEventKey(t,"ControlLeft")||T.isEventKey(t,"ControlRight"))}const g=t("./view"),x=t("./utils"),E=t("./graph"),T=t("keycode"),w=t("hammerjs");let b;e.exports={addEventListeners:o,setup:i}},{"./graph":4,"./utils":8,"./view":9,hammerjs:13,keycode:14}],8:[function(t,e,n){arguments[4][2][0].apply(n,arguments)},{"array-difference":10,"array-flatten":11,"array-unique":12,dup:2}],9:[function(t,e,n){"use strict";function i(t){return t}function r(t){let e=t.DOM.getBoundingClientRect();t.context.clearRect(0,0,e.width/t.scale,e.height/t.scale)}function o(t,{context:e,offset:n}){e.font=y+"px sans-serif";const i=h(t.text,e),r=t.hovering?v:g,o="255,0,0",s=t.focused?.9:t.hovering?.75:.5,a=n.x,u=n.y;t.height=i.length*y*1.22+y*(i.length>1?2:1.75),c(t),e.clearRect(t.x1+a,t.y1+u,t.width,t.height),e.strokeStyle="rgba("+r+","+s+")",e.lineJoin="round",e.lineWidth=m,"dashed"==t.lineType&&(e.lineWidth*=.75,e.strokeStyle="rgba("+o+",1)"),e.strokeRect(t.x1+m/2+a,t.y1+m/2+u,t.width-m,t.height-m),e.setLineDash([]),e.fillStyle="rgba("+r+",0.8)",e.textAlign="center";const l=1.25*y,p=t.x1+a+t.width/2,f=t.y1+u+2*m;i.forEach((n,i)=>{e.fillText(n,p,f+(i+1)*l,t.width)})}function s(t,{context:e,offset:n}){a(t);const i=n.x,r=n.y,o=t.hovering?v:g,s="255,0,0",c=t.focused?.9:t.hovering?.75:.5;e.strokeStyle="rgba("+o+","+c+")",e.lineWidth=4;let h=p.flatten([t.from]),l=E.filter(t=>h.includes(t.id));"dashed"==l[0].lineType&&(e.setLineDash([10,10]),e.strokeStyle="rgba("+s+",1)","donc"==t.type&&(t.type="objection !")),e.beginPath(),t.paths.forEach(t=>{e.moveTo(t.x1+i,t.y1+r),e.lineTo(t.x2+i,t.y2+r)});let f=t.paths[t.paths.length-1],y=u(f);e.lineTo(y.x1+i,y.y1+r),e.moveTo(f.x2+i,f.y2+r),e.lineTo(y.x2+i,y.y2+r),e.stroke(),e.setLineDash([]);let m=e.measureText(t.type).width+d;e.clearRect(t.center.x+i-m/2,t.center.y+r-15,m,25),e.fillStyle="rgba("+o+",0.8)",e.font="14px sans-serif",e.textAlign="center",e.fillText(t.type,t.center.x+i,t.center.y+r),t.intersection&&e.fillRect(t.intersection.x+i,t.intersection.y+r,10,10)}function a(t){let e=p.flatten([t.from,t.to]),n=E.filter(t=>e.includes(t.id)),r=n.map(t=>({x:i(t.x1+t.width/2),y:i(t.y1+t.height/2)})),o=r.map(t=>t.x),s=r.map(t=>t.y);t.center={x:i(Math.max(...o)-(Math.max(...o)-Math.min(...o))/2),y:i(Math.max(...s)-(Math.max(...s)-Math.min(...s))/2)},t.paths=t.from.map(e=>{let i=n.find(t=>t.id==e);return{x1:i.x1+(i.x2-i.x1)/2,y1:i.y1+(i.y2-i.y1)/2,x2:t.center.x,y2:t.center.y}});let a=n.find(e=>e.id==t.to),c=l(t.center,a,5);t.paths.push({x1:t.center.x,y1:t.center.y,x2:a.x1+(a.x2-a.x1)/2-c.x,y2:a.y1+(a.y2-a.y1)/2+c.y})}function c(t){t.x2=t.x1+t.width,t.y2=t.y1+t.height}function h(t,e){let n=t.split(" "),i=[],r="";return n.forEach(t=>{let n=e.measureText(r+" "+t).width;n<f-2*d?r+=" "+t:(i.push(r),r=t)}),i.push(r),i}function u(t){let e=Math.atan2(t.y1-t.y2,t.x1-t.x2);return{x1:t.x2+10*Math.cos(e+.5),y1:t.y2+10*Math.sin(e+.5),x2:t.x2+10*Math.cos(e-.5),y2:t.y2+10*Math.sin(e-.5)}}function l(t,e,n){let i={x:e.x1+e.width/2,y:e.y1+e.height/2},r=Math.atan2(t.y-i.y,i.x-t.x),o=Math.abs(Math.cos(r)),s=Math.abs(Math.sin(r)),a=e.width/2*s<=e.height/2*o?e.width/2/o:e.height/2/s;return a+=n||0,{x:a*Math.cos(r),y:a*Math.sin(r)}}t("./Element");const p=t("./utils"),f=200,d=10,y=16,m=4,v="81,36,122",g="0,0,0";let x=1,E={};e.exports=function(){function t(t){x=window.devicePixelRatio||1,t.scale=1,t.offset={x:0,y:0},t.inline="inline"==t.DOM.getAttribute("data-reasons-layout");let e=t.DOM.getBoundingClientRect(),n=p.buildNode("canvas",{id:"reasons-"+t.DOM.id},{width:e.width,height:e.height||window.innerHeight});t.context=n.getContext("2d",{alpha:!0}),t.DOM.style["min-height"]="100px",t.DOM.style["min-width"]="100px",t.DOM.appendChild(n),i(t)}function e(t){r(t),E=t.graph,E.edges().forEach(e=>s(e,t)),E.nodes().forEach(e=>o(e,t))}function n(t){let e=t.graph.nodes().map(t=>({x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2})).reduce((t,e)=>({x1:Math.min(t.x1,e.x1),x2:Math.max(t.x2,e.x2),y1:Math.min(t.y1,e.y1),y2:Math.max(t.y2,e.y2)})),n={x:(t.DOM.clientWidth-t.DOM.clientLeft)/2/t.scale+t.DOM.clientLeft-((e.x2-e.x1)/2+e.x1),y:(t.DOM.clientHeight-t.DOM.clientTop)/2/t.scale+t.DOM.clientTop-((e.y2-e.y1)/2+e.y1)};t.graph.nodes().forEach(t=>{t.x1+=n.x,t.x2+=n.x,t.y1+=n.y,t.y2+=n.y})}function i(t){t.DOM.width=t.DOM.clientWidth-t.DOM.clientLeft,t.DOM.height=t.DOM.clientHeight-t.DOM.clientTop;const e=t.DOM.querySelector("canvas");e.width=t.DOM.width*x,e.height=t.DOM.height*x,t.DOM.style.overflow="hidden",e.style["transform-origin"]="top left",e.style.transform="scale("+1/x+")",t.context.scale(x*t.scale,x*t.scale)}function a(t,e,n=!0){const i=n?1+e/1e3:e,r=t.scale*i;r<10&&r>.4&&(t.scale=t.scale*i,t.context.scale(i,i))}return{init:t,draw:e,zero:n,setScale:a,resize:i}}()},{"./Element":1,"./utils":8}],10:[function(e,n,i){(function(e){function i(t,e){var n,i,o=[];for(n=0,i=t.length;n<i;++n)-1===r.call(e,t[n])&&o.push(t[n]);for(n=0,i=e.length;n<i;++n)-1===r.call(t,e[n])&&o.push(e[n]);return o}var r=Array.prototype.indexOf||function(t){var e,n;if(null==this)throw new TypeError("indexOf called on null or undefined");for(e=0,n=this.length;e<n;++e)if(this[e]===t)return e;return-1};"object"==typeof n&&n.exports?n.exports=i:"function"==typeof t&&t.amd?t(function(){return i}):e.difference=i})(this)},{}],11:[function(t,e,n){"use strict";function i(t){if(!Array.isArray(t))throw new TypeError("Expected value to be an array");return r(t)}function r(t){return a(t,[])}function o(t,e){if(!Array.isArray(t))throw new TypeError("Expected value to be an array");return s(t,e)}function s(t,e){if("number"!=typeof e)throw new TypeError("Expected the depth to be a number");return c(t,[],e)}function a(t,e){for(var n=0;n<t.length;n++){var i=t[n];Array.isArray(i)?a(i,e):e.push(i)}return e}function c(t,e,n){n--;for(var i=0;i<t.length;i++){var r=t[i];n>-1&&Array.isArray(r)?c(r,e,n):e.push(r)}return e}e.exports=i,e.exports.from=r,e.exports.depth=o,e.exports.fromDepth=s},{}],12:[function(t,e,n){"use strict";e.exports=function(t){if(!Array.isArray(t))throw new TypeError("array-unique expects an array.");for(var e=t.length,n=-1;n++<e;)for(var i=n+1;i<t.length;++i)t[n]===t[i]&&t.splice(i--,1);return t},e.exports.immutable=function(t){if(!Array.isArray(t))throw new TypeError("array-unique expects an array.");for(var n=t.length,i=new Array(n),r=0;r<n;r++)i[r]=t[r];return e.exports(i)}},{}],13:[function(e,n,i){(function(e,i,r,o){"use strict";function s(t,e,n){return setTimeout(l(t,n),e)}function a(t,e,n){return!!Array.isArray(t)&&(c(t,n[e],n),!0)}function c(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==o)for(i=0;i<t.length;)e.call(n,t[i],i,t),i++;else for(i in t)t.hasOwnProperty(i)&&e.call(n,t[i],i,t)}function h(t,n,i){var r="DEPRECATED METHOD: "+n+"\n"+i+" AT \n";return function(){var n=new Error("get-stack-trace"),i=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=e.console&&(e.console.warn||e.console.log);return o&&o.call(e.console,r,i),t.apply(this,arguments)}}function u(t,e,n){var i,r=e.prototype;i=t.prototype=Object.create(r),i.constructor=t,i._super=r,n&&ft(i,n)}function l(t,e){return function(){return t.apply(e,arguments)}}function p(t,e){return typeof t==mt?t.apply(e&&e[0]||o,e):t}function f(t,e){return t===o?e:t}function d(t,e,n){c(g(e),function(e){t.addEventListener(e,n,!1)})}function y(t,e,n){c(g(e),function(e){t.removeEventListener(e,n,!1)})}function m(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function v(t,e){return t.indexOf(e)>-1}function g(t){return t.trim().split(/\s+/g)}function x(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;i<t.length;){if(n&&t[i][n]==e||!n&&t[i]===e)return i;i++}return-1}function E(t){return Array.prototype.slice.call(t,0)}function T(t,e,n){for(var i=[],r=[],o=0;o<t.length;){var s=e?t[o][e]:t[o];x(r,s)<0&&i.push(t[o]),r[o]=s,o++}return n&&(i=e?i.sort(function(t,n){return t[e]>n[e]}):i.sort()),i}function w(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),s=0;s<dt.length;){if(n=dt[s],i=n?n+r:e,i in t)return i;s++}return o}function b(){return wt++}function M(t){var n=t.ownerDocument||t;return n.defaultView||n.parentWindow||e}function O(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){p(t.options.enable,[t])&&n.handler(e)},this.init()}function D(t){var e,n=t.options.inputClass;return e=n||(Ot?Y:Dt?W:Mt?j:F),new e(t,A)}function A(t,e,n){var i=n.pointers.length,r=n.changedPointers.length,o=e&Nt&&i-r==0,s=e&(Lt|Pt)&&i-r==0;n.isFirst=!!o,n.isFinal=!!s,o&&(t.session={}),n.eventType=e,C(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function C(t,e){var n=t.session,i=e.pointers,r=i.length;n.firstInput||(n.firstInput=_(e)),r>1&&!n.firstMultiple?n.firstMultiple=_(e):1===r&&(n.firstMultiple=!1);var o=n.firstInput,s=n.firstMultiple,a=s?s.center:o.center,c=e.center=N(i);e.timeStamp=xt(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=R(a,c),e.distance=P(a,c),S(n,e),e.offsetDirection=L(e.deltaX,e.deltaY);var h=z(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=h.x,e.overallVelocityY=h.y,e.overallVelocity=gt(h.x)>gt(h.y)?h.x:h.y,e.scale=s?q(s.pointers,i):1,e.rotation=s?k(s.pointers,i):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,I(n,e);var u=t.element;m(e.srcEvent.target,u)&&(u=e.srcEvent.target),e.target=u}function S(t,e){var n=e.center,i=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};e.eventType!==Nt&&o.eventType!==Lt||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=r.x+(n.x-i.x),e.deltaY=r.y+(n.y-i.y)}function I(t,e){var n,i,r,s,a=t.lastInterval||e,c=e.timeStamp-a.timeStamp;if(e.eventType!=Pt&&(c>_t||a.velocity===o)){var h=e.deltaX-a.deltaX,u=e.deltaY-a.deltaY,l=z(c,h,u);i=l.x,r=l.y,n=gt(l.x)>gt(l.y)?l.x:l.y,s=L(h,u),t.lastInterval=e}else n=a.velocity,i=a.velocityX,r=a.velocityY,s=a.direction;e.velocity=n,e.velocityX=i,e.velocityY=r,e.direction=s}function _(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:vt(t.pointers[n].clientX),clientY:vt(t.pointers[n].clientY)},n++;return{timeStamp:xt(),pointers:e,center:N(e),deltaX:t.deltaX,deltaY:t.deltaY}}function N(t){var e=t.length;if(1===e)return{x:vt(t[0].clientX),y:vt(t[0].clientY)};for(var n=0,i=0,r=0;r<e;)n+=t[r].clientX,i+=t[r].clientY,r++;return{x:vt(n/e),y:vt(i/e)}}function z(t,e,n){return{x:e/t||0,y:n/t||0}}function L(t,e){return t===e?Rt:gt(t)>=gt(e)?t<0?kt:qt:e<0?Ft:Yt}function P(t,e,n){n||(n=Kt);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function R(t,e,n){n||(n=Kt);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}function k(t,e){return R(e[1],e[0],jt)+R(t[1],t[0],jt)}function q(t,e){return P(e[0],e[1],jt)/P(t[0],t[1],jt)}function F(){this.evEl=Vt,this.evWin=Bt,this.pressed=!1,O.apply(this,arguments)}function Y(){this.evEl=Zt,this.evWin=$t,O.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function X(){this.evTarget=te,this.evWin=ee,this.started=!1,O.apply(this,arguments)}function H(t,e){var n=E(t.touches),i=E(t.changedTouches);return e&(Lt|Pt)&&(n=T(n.concat(i),"identifier",!0)),[n,i]}function W(){this.evTarget=ie,this.targetIds={},O.apply(this,arguments)}function K(t,e){var n=E(t.touches),i=this.targetIds;if(e&(Nt|zt)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,s=E(t.changedTouches),a=[],c=this.target;if(o=n.filter(function(t){return m(t.target,c)}),e===Nt)for(r=0;r<o.length;)i[o[r].identifier]=!0,r++;for(r=0;r<s.length;)i[s[r].identifier]&&a.push(s[r]),e&(Lt|Pt)&&delete i[s[r].identifier],r++;return a.length?[T(o.concat(a),"identifier",!0),a]:void 0}function j(){O.apply(this,arguments);var t=l(this.handler,this);this.touch=new W(this.manager,t),this.mouse=new F(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function U(t,e){t&Nt?(this.primaryTouch=e.changedPointers[0].identifier,V.call(this,e)):t&(Lt|Pt)&&V.call(this,e)}function V(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var i=this.lastTouches,r=function(){var t=i.indexOf(n);t>-1&&i.splice(t,1)};setTimeout(r,re)}}function B(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],o=Math.abs(e-r.x),s=Math.abs(n-r.y);if(o<=oe&&s<=oe)return!0}return!1}function J(t,e){this.manager=t,this.set(e)}function G(t){if(v(t,le))return le;var e=v(t,pe),n=v(t,fe);return e&&n?le:e||n?e?pe:fe:v(t,ue)?ue:he}function Z(){if(!ae)return!1;var t={},n=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(i){t[i]=!n||e.CSS.supports("touch-action",i)}),t}function $(t){this.options=ft({},this.defaults,t||{}),this.id=b(),this.manager=null,this.options.enable=f(this.options.enable,!0),this.state=ye,this.simultaneous={},this.requireFail=[]}function Q(t){return t&Ee?"cancel":t&ge?"end":t&ve?"move":t&me?"start":""}function tt(t){return t==Yt?"down":t==Ft?"up":t==kt?"left":t==qt?"right":""}function et(t,e){var n=e.manager;return n?n.get(t):t}function nt(){$.apply(this,arguments)}function it(){nt.apply(this,arguments),this.pX=null,this.pY=null}function rt(){nt.apply(this,arguments)}function ot(){$.apply(this,arguments),this._timer=null,this._input=null}function st(){nt.apply(this,arguments)}function at(){nt.apply(this,arguments)}function ct(){$.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ht(t,e){return e=e||{},e.recognizers=f(e.recognizers,ht.defaults.preset),new ut(t,e)}function ut(t,e){this.options=ft({},ht.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=D(this),this.touchAction=new J(this,this.options.touchAction),lt(this,!0),c(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function lt(t,e){var n,i=t.element;i.style&&(c(t.options.cssProps,function(r,o){n=w(i.style,o),e?(t.oldCssProps[n]=i.style[n],i.style[n]=r):i.style[n]=t.oldCssProps[n]||""}),e||(t.oldCssProps={}))}function pt(t,e){var n=i.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}var ft,dt=["","webkit","Moz","MS","ms","o"],yt=i.createElement("div"),mt="function",vt=Math.round,gt=Math.abs,xt=Date.now;ft="function"!=typeof Object.assign?function(t){if(t===o||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==o&&null!==i)for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])}return e}:Object.assign;var Et=h(function(t,e,n){for(var i=Object.keys(e),r=0;r<i.length;)(!n||n&&t[i[r]]===o)&&(t[i[r]]=e[i[r]]),r++;return t},"extend","Use `assign`."),Tt=h(function(t,e){return Et(t,e,!0)},"merge","Use `assign`."),wt=1,bt=/mobile|tablet|ip(ad|hone|od)|android/i,Mt="ontouchstart"in e,Ot=w(e,"PointerEvent")!==o,Dt=Mt&&bt.test(navigator.userAgent),At="touch",Ct="pen",St="mouse",It="kinect",_t=25,Nt=1,zt=2,Lt=4,Pt=8,Rt=1,kt=2,qt=4,Ft=8,Yt=16,Xt=kt|qt,Ht=Ft|Yt,Wt=Xt|Ht,Kt=["x","y"],jt=["clientX","clientY"];O.prototype={handler:function(){},init:function(){this.evEl&&d(this.element,this.evEl,this.domHandler),this.evTarget&&d(this.target,this.evTarget,this.domHandler),this.evWin&&d(M(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&y(this.element,this.evEl,this.domHandler),this.evTarget&&y(this.target,this.evTarget,this.domHandler),this.evWin&&y(M(this.element),this.evWin,this.domHandler)}};var Ut={mousedown:Nt,mousemove:zt,mouseup:Lt},Vt="mousedown",Bt="mousemove mouseup";u(F,O,{handler:function(t){var e=Ut[t.type];e&Nt&&0===t.button&&(this.pressed=!0),e&zt&&1!==t.which&&(e=Lt),this.pressed&&(e&Lt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:St,srcEvent:t}))}});var Jt={pointerdown:Nt,pointermove:zt,pointerup:Lt,pointercancel:Pt,pointerout:Pt},Gt={2:At,3:Ct,4:St,5:It},Zt="pointerdown",$t="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Zt="MSPointerDown",$t="MSPointerMove MSPointerUp MSPointerCancel"),u(Y,O,{handler:function(t){var e=this.store,n=!1,i=t.type.toLowerCase().replace("ms",""),r=Jt[i],o=Gt[t.pointerType]||t.pointerType,s=o==At,a=x(e,t.pointerId,"pointerId");r&Nt&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):r&(Lt|Pt)&&(n=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(a,1))}});var Qt={touchstart:Nt,touchmove:zt,touchend:Lt,touchcancel:Pt},te="touchstart",ee="touchstart touchmove touchend touchcancel";u(X,O,{handler:function(t){var e=Qt[t.type];if(e===Nt&&(this.started=!0),this.started){var n=H.call(this,t,e);e&(Lt|Pt)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:At,srcEvent:t})}}});var ne={touchstart:Nt,touchmove:zt,touchend:Lt,touchcancel:Pt},ie="touchstart touchmove touchend touchcancel";u(W,O,{handler:function(t){var e=ne[t.type],n=K.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:At,srcEvent:t})}});var re=2500,oe=25;u(j,O,{handler:function(t,e,n){var i=n.pointerType==At,r=n.pointerType==St;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)U.call(this,e,n);else if(r&&B.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var se=w(yt.style,"touchAction"),ae=se!==o,ce="compute",he="auto",ue="manipulation",le="none",pe="pan-x",fe="pan-y",de=Z();J.prototype={set:function(t){t==ce&&(t=this.compute()),ae&&this.manager.element.style&&de[t]&&(this.manager.element.style[se]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return c(this.manager.recognizers,function(e){p(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),G(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var i=this.actions,r=v(i,le)&&!de[le],o=v(i,fe)&&!de[fe],s=v(i,pe)&&!de[pe];if(r){var a=1===t.pointers.length,c=t.distance<2,h=t.deltaTime<250;if(a&&c&&h)return}if(!s||!o)return r||o&&n&Xt||s&&n&Ht?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var ye=1,me=2,ve=4,ge=8,xe=ge,Ee=16,Te=32;$.prototype={defaults:{},set:function(t){return ft(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(a(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=et(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return a(t,"dropRecognizeWith",this)?this:(t=et(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(a(t,"requireFailure",this))return this
;var e=this.requireFail;return t=et(t,this),-1===x(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(a(t,"dropRequireFailure",this))return this;t=et(t,this);var e=x(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){n.manager.emit(e,t)}var n=this,i=this.state;i<ge&&e(n.options.event+Q(i)),e(n.options.event),t.additionalEvent&&e(t.additionalEvent),i>=ge&&e(n.options.event+Q(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=Te},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(Te|ye)))return!1;t++}return!0},recognize:function(t){var e=ft({},t);if(!p(this.options.enable,[this,e]))return this.reset(),void(this.state=Te);this.state&(xe|Ee|Te)&&(this.state=ye),this.state=this.process(e),this.state&(me|ve|ge|Ee)&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},u(nt,$,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,n=t.eventType,i=e&(me|ve),r=this.attrTest(t);return i&&(n&Pt||!r)?e|Ee:i||r?n&Lt?e|ge:e&me?e|ve:me:Te}}),u(it,nt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Wt},getTouchAction:function(){var t=this.options.direction,e=[];return t&Xt&&e.push(fe),t&Ht&&e.push(pe),e},directionTest:function(t){var e=this.options,n=!0,i=t.distance,r=t.direction,o=t.deltaX,s=t.deltaY;return r&e.direction||(e.direction&Xt?(r=0===o?Rt:o<0?kt:qt,n=o!=this.pX,i=Math.abs(t.deltaX)):(r=0===s?Rt:s<0?Ft:Yt,n=s!=this.pY,i=Math.abs(t.deltaY))),t.direction=r,n&&i>e.threshold&&r&e.direction},attrTest:function(t){return nt.prototype.attrTest.call(this,t)&&(this.state&me||!(this.state&me)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=tt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),u(rt,nt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[le]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&me)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),u(ot,$,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[he]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!i||!n||t.eventType&(Lt|Pt)&&!r)this.reset();else if(t.eventType&Nt)this.reset(),this._timer=s(function(){this.state=xe,this.tryEmit()},e.time,this);else if(t.eventType&Lt)return xe;return Te},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===xe&&(t&&t.eventType&Lt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=xt(),this.manager.emit(this.options.event,this._input)))}}),u(st,nt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[le]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&me)}}),u(at,nt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Xt|Ht,pointers:1},getTouchAction:function(){return it.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(Xt|Ht)?e=t.overallVelocity:n&Xt?e=t.overallVelocityX:n&Ht&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&>(e)>this.options.velocity&&t.eventType&Lt},emit:function(t){var e=tt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),u(ct,$,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ue]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),t.eventType&Nt&&0===this.count)return this.failTimeout();if(i&&r&&n){if(t.eventType!=Lt)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||P(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,a&&o?this.count+=1:this.count=1,this._input=t;var c=this.count%e.taps;if(0===c)return this.hasRequireFailures()?(this._timer=s(function(){this.state=xe,this.tryEmit()},e.interval,this),me):xe}return Te},failTimeout:function(){return this._timer=s(function(){this.state=Te},this.options.interval,this),Te},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==xe&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ht.VERSION="2.0.7",ht.defaults={domEvents:!1,touchAction:ce,enable:!0,inputTarget:null,inputClass:null,preset:[[st,{enable:!1}],[rt,{enable:!1},["rotate"]],[at,{direction:Xt}],[it,{direction:Xt},["swipe"]],[ct],[ct,{event:"doubletap",taps:2},["tap"]],[ot]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var we=1,be=2;ut.prototype={set:function(t){return ft(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?be:we},recognize:function(t){var e=this.session;if(!e.stopped){var n;this.touchAction.preventDefaults(t);var i=this.recognizers,r=e.curRecognizer;(!r||r&&r.state&xe)&&(r=e.curRecognizer=null);for(var o=0;o<i.length;)n=i[o],e.stopped===be||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(t),!r&&n.state&(me|ve|ge)&&(r=e.curRecognizer=n),o++}},get:function(t){if(t instanceof $)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(a(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(a(t,"remove",this))return this;if(t=this.get(t),t){var e=this.recognizers,n=x(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(t!==o&&e!==o){var n=this.handlers;return c(g(t),function(t){n[t]=n[t]||[],n[t].push(e)}),this}},off:function(t,e){if(t!==o){var n=this.handlers;return c(g(t),function(t){e?n[t]&&n[t].splice(x(n[t],e),1):delete n[t]}),this}},emit:function(t,e){this.options.domEvents&&pt(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var i=0;i<n.length;)n[i](e),i++}},destroy:function(){this.element&<(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},ft(ht,{INPUT_START:Nt,INPUT_MOVE:zt,INPUT_END:Lt,INPUT_CANCEL:Pt,STATE_POSSIBLE:ye,STATE_BEGAN:me,STATE_CHANGED:ve,STATE_ENDED:ge,STATE_RECOGNIZED:xe,STATE_CANCELLED:Ee,STATE_FAILED:Te,DIRECTION_NONE:Rt,DIRECTION_LEFT:kt,DIRECTION_RIGHT:qt,DIRECTION_UP:Ft,DIRECTION_DOWN:Yt,DIRECTION_HORIZONTAL:Xt,DIRECTION_VERTICAL:Ht,DIRECTION_ALL:Wt,Manager:ut,Input:O,TouchAction:J,TouchInput:W,MouseInput:F,PointerEventInput:Y,TouchMouseInput:j,SingleTouchInput:X,Recognizer:$,AttrRecognizer:nt,Tap:ct,Pan:it,Swipe:at,Pinch:rt,Rotate:st,Press:ot,on:d,off:y,each:c,merge:Tt,extend:Et,assign:ft,inherit:u,bindFn:l,prefixed:w});var Me=void 0!==e?e:"undefined"!=typeof self?self:{};Me.Hammer=ht,"function"==typeof t&&t.amd?t(function(){return ht}):void 0!==n&&n.exports?n.exports=ht:e[r]=ht})(window,document,"Hammer")},{}],14:[function(t,e,n){function i(t){if(t&&"object"==typeof t){var e=t.which||t.keyCode||t.charCode;e&&(t=e)}if("number"==typeof t)return a[t];var n=String(t),i=r[n.toLowerCase()];if(i)return i;i=o[n.toLowerCase()];return i||(1===n.length?n.charCodeAt(0):void 0)}i.isEventKey=function(t,e){if(t&&"object"==typeof t){var n=t.which||t.keyCode||t.charCode;if(null==n)return!1;if("string"==typeof e){var i=r[e.toLowerCase()];if(i)return i===n;i=o[e.toLowerCase()];if(i)return i===n}else if("number"==typeof e)return e===n;return!1}},n=e.exports=i;var r=n.code=n.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=n.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(s=97;s<123;s++)r[String.fromCharCode(s)]=s-32;for(var s=48;s<58;s++)r[s-48]=s;for(s=1;s<13;s++)r["f"+s]=s+111;for(s=0;s<10;s++)r["numpad "+s]=s+96;var a=n.names=n.title={};for(s in r)a[r[s]]=s;for(var c in o)r[c]=o[c]},{}]},{},[6])(6)});