{"version":3,"sources":["webpack:///./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack:///./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack:///./src/components/organisms/image-zoom/animations.ts","webpack:///./src/components/organisms/image-zoom/ImageZoom.tsx","webpack:///./src/components/organisms/image-zoom/Wrapper.tsx","webpack:///./node_modules/isarray/index.js","webpack:///./node_modules/base64-js/index.js","webpack:///./node_modules/node-libs-browser/node_modules/buffer/index.js","webpack:///./src/images/image-zoom/icon-zoom-in.svg","webpack:///./src/components/atoms/button/Button.tsx","webpack:///./node_modules/ieee754/index.js","webpack:///./src/images/image-zoom/icon-zoom-out.svg","webpack:///./node_modules/regenerator-runtime/runtime.js","webpack:///./node_modules/@babel/runtime/regenerator/index.js","webpack:///./node_modules/hammerjs/hammer.js"],"names":["asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","this","args","arguments","apply","err","undefined","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","imageZoomAnimation","initial","display","opacity","scale","close","transition","duration","ease","open","ImageZoom","Constructor","protoProps","staticProps","afterRenderQueue","scaleRange","min","max","zoomSliderHeight","navigatorBackgroundPadding","state","top","left","width","height","animateIn","a","animationControls","start","animateOut","set","document","body","style","overflow","onMouseWheel","fabricEvent","image","scaleX","delta","e","deltaY","Math","setImageScale","onObjectMove","applyImagePositionBounds","updateMapControl","mapControl","applyMapControlPositionBounds","updateImagePosition","sliderHandle","applySliderHandleBounds","updateImageScaleBySliderHandle","onSelectionCreated","type","canvas","discardActiveObject","afterCanvasRender","forEach","callback","onZoomInClick","scaleIncrease","onZoomOutClick","scaleDecrease","onPinch","pinchStartScale","onPinchEnd","onMouseUp","onResize","resizeTimeout","window","clearTimeout","setTimeout","resize","calculateCanvasDimensions","calculateCanvasPosition","setDimensions","calcOffset","setImagePosition","updateMap","updateSlider","updateSliderHandle","updateZoomControls","requestRenderAll","fabric","prototype","originX","originY","isDesktopOrDown","componentDidMount","setState","innerHeight","innerWidth","UNSAFE_componentWillReceiveProps","nextProps","src","openPopup","closePopup","Canvas","canvasElement","centeredScaling","preserveObjectStacking","selectionColor","selectionBorderColor","loadAndCreateImage","hasControls","selectable","hoverCursor","moveCursor","add","navigatorBackground","createNavigatorBackground","map","createMap","createMapControl","slider","createSlider","createSliderHandle","iconZoomOut","getZoomOutProperties","zoomOut","iconZoomIn","getZoomInProperties","zoomIn","addEventListeners","queue","removeEventListeners","options","Image","onload","Rect","fill","getMapBackgroundProperties","stroke","strokeWidth","hasBorders","getMapControlProperties","imageElement","getElement","getMapProperties","getSliderProperties","rx","ry","Circle","radius","padding","lockMovementY","getSliderHandleProperties","visible","isMobileOrDown","navigatorWidth","navigatorBackgroundLeft","getHeight","mapHeight","navigatorBackgroundBottom","scaleY","getScalePercentage","widthScale","getWidth","heightScale","setCoords","progress","scaleDiff","imageHeight","imageWidth","viewportCenterObject","on","addEventListener","element","hammer","Hammer","get","enable","dispose","destroy","removeEventListener","push","scaledImageWidth","scaledImageHeight","imageTopLeft","Point","x","y","minTop","maxTop","minLeft","maxLeft","pageHeader","querySelector","clientHeight","render","StyledImageZoom","animate","ref","el","variants","CloseButton","label","buttonCloseText","onClick","onClose","onHoverEnd","onHoverCloseButtonEnd","onHoverStart","onHoverCloseButtonStart","Component","styled","motion","div","Colors","WHITE","Button","rem","Wrapper","dictionary","useDictionary","useAnimation","useAppState","zoomImageSrc","dispatch","onImageZoomClose","useCallback","payload","Actions","SET_ZOOM_IMAGE_SRC","SET_CURSOR_OVERLAY_TYPE","toString","module","exports","Array","isArray","arr","call","byteLength","b64","lens","getLens","validLen","placeHoldersLen","toByteArray","tmp","Arr","_byteLength","curByte","len","revLookup","charCodeAt","fromByteArray","uint8","extraBytes","parts","len2","encodeChunk","lookup","join","Uint8Array","code","Error","indexOf","end","num","output","base64","ieee754","kMaxLength","Buffer","TYPED_ARRAY_SUPPORT","createBuffer","that","RangeError","__proto__","encodingOrOffset","allocUnsafe","from","TypeError","ArrayBuffer","array","byteOffset","fromArrayLike","fromArrayBuffer","string","encoding","isEncoding","actual","write","slice","fromString","obj","isBuffer","checked","copy","buffer","val","data","fromObject","assertSize","size","isView","loweredCase","utf8ToBytes","base64ToBytes","toLowerCase","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","b","n","m","bidirectionalIndexOf","dir","isNaN","arrayIndexOf","lastIndexOf","indexSize","arrLength","valLength","String","read","buf","readUInt16BE","foundIndex","found","j","hexWrite","offset","Number","remaining","strLen","parsed","parseInt","substr","utf8Write","blitBuffer","asciiWrite","str","byteArray","asciiToBytes","latin1Write","base64Write","ucs2Write","units","c","hi","lo","utf16leToBytes","res","secondByte","thirdByte","fourthByte","tempCodePoint","firstByte","codePoint","bytesPerSequence","codePoints","fromCharCode","decodeCodePointsArray","SlowBuffer","alloc","INSPECT_MAX_BYTES","global","foo","subarray","typedArraySupport","poolSize","_augment","Symbol","species","allocUnsafeSlow","_isBuffer","compare","concat","list","pos","swap16","swap32","swap64","equals","inspect","match","thisStart","thisEnd","thisCopy","targetCopy","includes","isFinite","toJSON","_arr","ret","out","toHex","bytes","checkOffset","ext","checkInt","objectWriteUInt16","littleEndian","objectWriteUInt32","checkIEEE754","writeFloat","noAssert","writeDouble","newBuf","sliceLen","readUIntLE","mul","readUIntBE","readUInt8","readUInt16LE","readUInt32LE","readUInt32BE","readIntLE","pow","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","readFloatBE","readDoubleLE","readDoubleBE","writeUIntLE","writeUIntBE","writeUInt8","floor","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE","targetStart","INVALID_BASE64_RE","Infinity","leadSurrogate","trim","replace","stringtrim","base64clean","dst","StyledButton","button","SHIP_GREY","ALTO","className","to","as","Link","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","d","s","NaN","rt","abs","log","LN2","runtime","Op","hasOwn","hasOwnProperty","$Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","method","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","makeInvokeMethod","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","invoke","result","__await","unwrapped","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","constructor","displayName","isGeneratorFunction","genFun","ctor","name","mark","setPrototypeOf","awrap","async","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","Function","exportName","assign","VENDOR_PREFIXES","TEST_ELEMENT","createElement","round","now","Date","setTimeoutContext","timeout","bindFn","invokeArrayArg","each","deprecate","message","deprecationMessage","stack","console","warn","index","source","nextKey","extend","dest","merge","inherit","child","base","properties","childP","baseP","_super","boolOrFn","ifUndefined","val1","val2","types","handler","splitStr","hasParent","node","parent","parentNode","inStr","find","split","inArray","findByKey","toArray","uniqueArray","sort","results","prefixed","property","prefix","prop","camelProp","toUpperCase","_uniqueId","getWindowForElement","doc","ownerDocument","defaultView","parentWindow","SUPPORT_TOUCH","SUPPORT_POINTER_EVENTS","SUPPORT_ONLY_TOUCH","test","navigator","userAgent","PROPS_XY","PROPS_CLIENT_XY","Input","manager","inputTarget","domHandler","ev","init","inputHandler","eventType","input","pointersLen","pointers","changedPointersLen","changedPointers","isFirst","isFinal","session","pointersLength","firstInput","simpleCloneInputData","firstMultiple","offsetCenter","center","getCenter","timeStamp","deltaTime","angle","getAngle","distance","getDistance","offsetDelta","prevDelta","prevInput","deltaX","computeDeltaXY","offsetDirection","getDirection","overallVelocity","getVelocity","overallVelocityX","overallVelocityY","rotation","getRotation","maxPointers","velocity","velocityX","velocityY","direction","last","lastInterval","v","computeIntervalInputData","srcEvent","computeInputData","emit","recognize","clientX","clientY","p1","p2","sqrt","atan2","PI","evEl","evTarget","evWin","MOUSE_INPUT_MAP","mousedown","mousemove","mouseup","MouseInput","pressed","which","pointerType","POINTER_INPUT_MAP","pointerdown","pointermove","pointerup","pointercancel","pointerout","IE10_POINTER_TYPE_ENUM","2","3","4","5","POINTER_ELEMENT_EVENTS","POINTER_WINDOW_EVENTS","PointerEventInput","store","pointerEvents","MSPointerEvent","PointerEvent","removePointer","eventTypeNormalized","isTouch","storeIndex","pointerId","splice","SINGLE_TOUCH_INPUT_MAP","touchstart","touchmove","touchend","touchcancel","SingleTouchInput","started","normalizeSingleTouches","all","touches","changed","changedTouches","TOUCH_INPUT_MAP","TouchInput","targetIds","getTouches","allTouches","identifier","targetTouches","changedTargetTouches","filter","touch","TouchMouseInput","mouse","primaryTouch","lastTouches","recordTouches","eventData","setLastTouch","lastTouch","lts","isSyntheticEvent","t","dx","dy","inputEvent","inputData","isMouse","sourceCapabilities","firesTouchEvents","PREFIXED_TOUCH_ACTION","NATIVE_TOUCH_ACTION","TOUCH_ACTION_MAP","touchMap","cssSupports","CSS","supports","getTouchActionProps","TouchAction","compute","actions","update","touchAction","recognizers","recognizer","getTouchAction","hasPanX","hasPanY","cleanTouchActions","preventDefaults","prevented","preventDefault","hasNone","isTapPointer","isTapMovement","isTapTouchTime","DIRECTION_LEFT","DIRECTION_UP","preventSrc","Recognizer","defaults","id","simultaneous","requireFail","stateStr","directionStr","getRecognizerByNameIfManager","otherRecognizer","AttrRecognizer","PanRecognizer","pX","pY","PinchRecognizer","PressRecognizer","_timer","_input","RotateRecognizer","SwipeRecognizer","TapRecognizer","pTime","pCenter","count","preset","Manager","recognizeWith","dropRecognizeWith","requireFailure","dropRequireFailure","hasRequireFailures","canRecognizeWith","event","additionalEvent","tryEmit","canEmit","inputDataClone","process","attrTest","optionPointers","isRecognized","isValid","threshold","DIRECTION_HORIZONTAL","directionTest","hasMoved","inOut","time","validPointers","validMovement","validTime","taps","interval","posThreshold","validTouchTime","failTimeout","validInterval","validMultiTap","tapCount","VERSION","domEvents","inputClass","cssProps","userSelect","touchSelect","touchCallout","contentZooming","userDrag","tapHighlightColor","handlers","oldCssProps","toggleCssProps","item","force","stopped","curRecognizer","existing","remove","events","off","gestureEvent","createEvent","initEvent","gesture","dispatchEvent","triggerDomEvent","INPUT_START","INPUT_MOVE","INPUT_END","INPUT_CANCEL","STATE_POSSIBLE","STATE_BEGAN","STATE_CHANGED","STATE_ENDED","STATE_RECOGNIZED","STATE_CANCELLED","STATE_FAILED","DIRECTION_NONE","DIRECTION_RIGHT","DIRECTION_DOWN","DIRECTION_VERTICAL","DIRECTION_ALL","Tap","Pan","Swipe","Pinch","Rotate","Press"],"mappings":";2LAAA,SAASA,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQC,EAAKC,GACpE,IACE,IAAIC,EAAOP,EAAIK,GAAKC,GAChBE,EAAQD,EAAKC,MACjB,MAAOC,GAEP,YADAP,EAAOO,GAILF,EAAKG,KACPT,EAAQO,GAERG,QAAQV,QAAQO,GAAOI,KAAKT,EAAOC,GAIxB,SAASS,EAAkBC,GACxC,OAAO,WACL,IAAIC,EAAOC,KACPC,EAAOC,UACX,OAAO,IAAIP,SAAQ,SAAUV,EAASC,GACpC,IAAIF,EAAMc,EAAGK,MAAMJ,EAAME,GAEzB,SAASd,EAAMK,GACbT,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQ,OAAQI,GAGlE,SAASJ,EAAOgB,GACdrB,EAAmBC,EAA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oG,gBAxnEoB,EAynEpBnG,aAxnEiB,EAynEjBoG,eAxnEmB,GAynEnBxD,qBAxnEyB7C,EAynEzBsG,mBAxnEuBrG,GAynEvBsG,cAxnEkB1D,GAynElBlB,QAASA,GACT9L,MAAOA,EACPiJ,YAAaA,GACbnC,WAAYA,GACZzC,WAAYA,EACZiB,kBAAmBA,GACnBiC,gBAAiBA,GACjBjB,iBAAkBA,GAClBgE,WAAYA,GACZS,eAAgBA,GAChB4F,IAAKlF,GACLmF,IAAK5F,GACL6F,MAAOrF,GACPsF,MAAO3F,GACP4F,OAAQxF,GACRyF,MAAO5F,GACP7pB,GAAI1C,EACJuwB,IAAKrwB,EACLqd,KAAMA,EACNY,MAAOA,EACPF,OAAQA,EACRrB,OAAQA,EACRwB,QAASA,EACTf,OAAQA,EACR0C,SAAUA,UAIuB,IAAXrjB,EAAyBA,EAAyB,oBAATxF,KAAuBA,KAAO,IAEpF4L,OAASA,QArkFtB,KAwkFI,aACE,OAAOA,IACR,8BA1kFL,CAglFGpG,OAAQvC","file":"12-6c83a5a1718739073c36.js","sourcesContent":["function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","import { Variants } from 'framer-motion'\n\nexport const imageZoomAnimation: Variants = {\n initial: {\n display: 'none',\n opacity: 0,\n scale: 0.8,\n },\n close: {\n opacity: 0,\n scale: 0.8,\n transition: {\n duration: 0.3,\n ease: 'easeOut',\n },\n },\n open: {\n display: 'block',\n opacity: 1,\n scale: 1,\n transition: {\n duration: 0.3,\n ease: 'easeInOut',\n },\n },\n}\n","/* eslint-disable no-throw-literal */\nimport { AnimationControls, motion } from 'framer-motion'\nimport Button, { ButtonProps } from '../../atoms/button/Button'\nimport { isDesktopOrDown, isMobileOrDown } from '../../../utils/mediaQueries'\nimport React, { Component } from 'react'\nimport Colors from '../../../tokens/Colors'\nimport { fabric } from 'fabric'\nimport Hammer from 'hammerjs'\nimport iconZoomIn from '../../../images/image-zoom/icon-zoom-in.svg'\nimport iconZoomOut from '../../../images/image-zoom/icon-zoom-out.svg'\nimport { imageZoomAnimation } from './animations'\nimport { rem } from '../../../utils/rem'\nimport styled from 'styled-components'\n\ninterface ScaleRange {\n max: number\n min: number\n}\n\nexport interface ImageZoomProps {\n animationControls: AnimationControls\n buttonCloseText: string\n onClose: () => void\n onHoverCloseButtonEnd: ButtonProps['onHoverEnd']\n onHoverCloseButtonStart: ButtonProps['onHoverStart']\n src: string | null\n}\n\ninterface ImageZoomState {\n height: number\n left: number\n top: number\n width: number\n}\n\nclass ImageZoom extends Component {\n /**\n * The element of the component\n * @var {HTMLCanvasElement}\n */\n private element!: HTMLDivElement | null\n\n /**\n * The canvas html element\n * @var {HTMLCanvasElement}\n */\n private canvasElement!: HTMLCanvasElement | null\n\n /**\n * The Fabric canvas element\n */\n private canvas!: fabric.Canvas\n\n /**\n * The resize timout handler\n * @var {number}\n */\n private resizeTimeout!: number\n\n /**\n * Queue with methods that will execute after render\n */\n private afterRenderQueue: (() => void)[] = []\n\n /**\n * Default ScaleRange\n * Will be updated depending on the image size\n */\n private scaleRange: ScaleRange = {\n min: 0,\n max: 1,\n }\n\n /**\n * The image to display\n */\n private image!: fabric.Image\n\n /**\n * Dynamic map height\n * @var {number}\n */\n private mapHeight!: number\n\n /**\n * The height of the zoom slider\n * @var {number}\n */\n private zoomSliderHeight = 36\n\n /**\n * Padding to apply to the navigator background\n */\n private navigatorBackgroundPadding = 10\n\n /**\n * The state interface\n */\n public state: ImageZoomState = {\n top: 0,\n left: 0,\n width: 0,\n height: 0,\n }\n\n /**\n * The background of the map\n */\n private navigatorBackground!: fabric.Rect\n\n /**\n * The scaled version of the image\n * @var {Image}\n */\n private map!: fabric.Image\n\n /**\n * The map control\n * @var {Rect}\n */\n private mapControl!: fabric.Rect\n\n /**\n * @var {Rect}\n */\n private slider!: fabric.Rect\n\n /**\n * @var {Circle}\n */\n private sliderHandle!: fabric.Circle\n\n /**\n * @var {Image}\n */\n private zoomOut!: fabric.Image\n\n /**\n * @var {Image}\n */\n private zoomIn!: fabric.Image\n\n /**\n * Hammer js instance\n */\n private hammer!: HammerManager\n\n /**\n * The scale of the image when the pinching starts\n */\n private pinchStartScale!: number | null\n\n /**\n * Get the width of the navigator based on the window width\n * @return {number}\n */\n private get navigatorWidth(): number {\n return isDesktopOrDown() ? 220 : 280\n }\n\n /**\n * Get the left position of the navigator\n * @return {number}\n */\n private get navigatorBackgroundLeft(): number {\n return isDesktopOrDown() ? 30 : 60\n }\n\n /**\n * Get the bottom position of the navigator\n * @return {number}\n */\n private get navigatorBackgroundBottom(): number {\n return isDesktopOrDown() ? 30 : 60\n }\n\n /**\n * Image Zoom component constructor\n * @param props\n */\n constructor(props: ImageZoomProps) {\n super(props)\n\n // Set default fabric properties\n fabric.Object.prototype.set({\n originX: 'center',\n originY: 'center',\n })\n }\n\n public componentDidMount(): void {\n this.setState({\n height: window.innerHeight,\n width: window.innerWidth,\n })\n }\n\n /**\n * Check if component will receive props\n * @param nextProps\n * @param nextContext\n */\n public UNSAFE_componentWillReceiveProps(nextProps: ImageZoomProps): void {\n if (this.props.src === null && nextProps.src) {\n void this.openPopup(nextProps.src)\n } else if (this.props.src !== null && nextProps.src === null) {\n void this.closePopup()\n }\n }\n\n /**\n * Open the image zoom popup\n * @param src\n */\n private async openPopup(src: string): Promise {\n // Create the canvas\n this.canvas = new fabric.Canvas(this.canvasElement, {\n centeredScaling: true,\n preserveObjectStacking: true,\n selectionColor: 'rgba(255, 255, 255, 0)',\n selectionBorderColor: 'rgba(255, 255, 255, 0)',\n })\n\n // Load and create image from src\n this.image = await this.loadAndCreateImage(src, {\n hasControls: false,\n selectable: true,\n hoverCursor: 'grab',\n moveCursor: 'grabbing',\n })\n\n // Add objects to canvas\n this.canvas.add(this.image)\n\n // Set the position of the image\n this.setImagePosition()\n\n // Create a background around the map\n this.navigatorBackground = this.createNavigatorBackground()\n this.canvas.add(this.navigatorBackground)\n\n // Create the map\n this.map = this.createMap()\n this.canvas.add(this.map)\n\n // Create the map controls\n this.mapControl = this.createMapControl()\n this.canvas.add(this.mapControl)\n\n // Create slider (background)\n this.slider = this.createSlider()\n this.canvas.add(this.slider)\n\n // Create slider (handle)\n this.sliderHandle = this.createSliderHandle()\n this.canvas.add(this.sliderHandle)\n\n // Create zoom out button\n this.zoomOut = await this.loadAndCreateImage(iconZoomOut, {\n selectable: false,\n hoverCursor: 'pointer',\n ...this.getZoomOutProperties(),\n })\n this.canvas.add(this.zoomOut)\n\n // Create zoom out button\n this.zoomIn = await this.loadAndCreateImage(iconZoomIn, {\n selectable: false,\n hoverCursor: 'pointer',\n ...this.getZoomInProperties(),\n })\n this.canvas.add(this.zoomIn)\n\n // Render the canvas\n this.canvas.requestRenderAll()\n\n // Add event listeners\n this.addEventListeners()\n\n // Resize the canvas\n this.resize()\n\n // Animate in\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this.queue(() => setTimeout(this.animateIn, 100))\n }\n\n /**\n * Close the popup\n */\n private async closePopup(): Promise {\n await this.animateOut()\n this.removeEventListeners()\n }\n\n /**\n * Load the image and return a fabric Image back\n * @param src\n * @param options\n */\n private async loadAndCreateImage(\n src: string,\n options: fabric.IImageOptions,\n ): Promise {\n return new Promise(\n (resolve: (image: fabric.Image) => void, reject: () => void) => {\n const image = new Image()\n image.onload = (e: Event): void =>\n resolve(new fabric.Image(image, options))\n image.src = src\n },\n )\n }\n\n /**\n * Create map background\n */\n private createNavigatorBackground(): fabric.Rect {\n // Double check parameters\n if (!this.image.width || !this.image.height) {\n throw \"Can't get necessary properties\"\n }\n\n // Return new image based on the main image\n return new fabric.Rect({\n fill: 'white',\n selectable: false,\n hoverCursor: 'default',\n ...this.getMapBackgroundProperties(),\n })\n }\n\n /**\n * Create the map control\n * @return {Rect}\n */\n private createMapControl(): fabric.Rect {\n return new fabric.Rect({\n fill: 'rgba(255, 255, 255, .25)',\n stroke: '#414042',\n strokeWidth: 1,\n selectable: true,\n hasControls: false,\n hasBorders: false,\n hoverCursor: 'grab',\n moveCursor: 'grabbing',\n ...this.getMapControlProperties(),\n })\n }\n\n /**\n * Create the map\n * @return {Image}\n */\n private createMap(): fabric.Image {\n const imageElement = this.image.getElement()\n\n // Return new image based on the main image\n return new fabric.Image(imageElement, {\n hoverCursor: 'default',\n selectable: false,\n ...this.getMapProperties(),\n })\n }\n\n /**\n * Create the background of the slider\n * @return {Rect}\n */\n private createSlider(): fabric.Rect {\n return new fabric.Rect({\n ...this.getSliderProperties(),\n hoverCursor: 'default',\n selectable: false,\n height: 6,\n fill: '#f4f4f4',\n rx: 3,\n ry: 3,\n })\n }\n\n /**\n * Create the slider handle\n * @return {Circle}\n */\n private createSliderHandle(): fabric.Circle {\n return new fabric.Circle({\n hoverCursor: 'grab',\n moveCursor: 'grabbing',\n radius: 6,\n padding: 10,\n hasControls: false,\n hasBorders: false,\n fill: '#414042',\n lockMovementY: true,\n ...this.getSliderHandleProperties(),\n })\n }\n\n /**\n * Get the zoom out properties\n */\n private getZoomOutProperties(): Record {\n const { left, top, width, height } = this.navigatorBackground\n if (!left || !top || !width || !height) {\n throw \"Can't get necessary properties\"\n }\n\n return {\n visible: !isMobileOrDown(),\n top: top - height / 2 + 25,\n left: left - width / 2 + 25,\n padding: 10,\n }\n }\n\n /**\n * Get the zoom out properties\n */\n private getZoomInProperties(): Record {\n const { left, top, width, height } = this.navigatorBackground\n if (!left || !top || !width || !height) {\n throw \"Can't get necessary properties\"\n }\n return {\n visible: !isMobileOrDown(),\n top: top - height / 2 + 25,\n left: left + width / 2 - 25,\n padding: 10,\n }\n }\n\n /**\n * @return {object}\n */\n private getMapProperties(): Record {\n // Double check parameters\n if (!this.image.width || !this.image.height) {\n throw \"Can't get necessary properties\"\n }\n\n // Create scaled reference image\n const scale = this.navigatorWidth / this.image.width\n const left =\n this.navigatorWidth / 2 +\n this.navigatorBackgroundLeft +\n this.navigatorBackgroundPadding\n\n const top =\n this.canvas.getHeight() -\n this.mapHeight / 2 -\n this.navigatorBackgroundBottom -\n this.navigatorBackgroundPadding\n\n return {\n visible: !isMobileOrDown(),\n scaleX: scale,\n scaleY: scale,\n left,\n top,\n }\n }\n\n /**\n * @return {Record}\n */\n private getMapBackgroundProperties(): Record {\n // Double check parameters\n if (!this.image.width || !this.image.height) {\n throw \"Can't get necessary properties\"\n }\n\n // Calculate map height and update the property\n const scale = this.navigatorWidth / this.image.width\n this.mapHeight = this.image.height * scale\n\n const left =\n this.navigatorWidth / 2 +\n this.navigatorBackgroundLeft +\n this.navigatorBackgroundPadding\n\n const top =\n this.canvas.getHeight() -\n (this.mapHeight + this.zoomSliderHeight) / 2 -\n this.navigatorBackgroundBottom -\n this.navigatorBackgroundPadding\n\n return {\n left,\n top,\n width: this.navigatorWidth + this.navigatorBackgroundPadding * 2,\n height:\n this.mapHeight +\n this.navigatorBackgroundPadding * 2 +\n this.zoomSliderHeight,\n visible: !isMobileOrDown(),\n }\n }\n\n /**\n * Get slider properties\n * @return {Record}\n */\n private getSliderProperties(): Record {\n const { left, top, width, height } = this.navigatorBackground\n if (!left || !top || !width || !height) {\n throw \"Can't get necessary properties\"\n }\n return {\n top: top - height / 2 + 25,\n left,\n width: width - 100,\n visible: !isMobileOrDown(),\n }\n }\n\n /**\n * Get the slider handle properties\n */\n private getSliderHandleProperties(): Record {\n // Get the position of the slider as base for the calculations\n const { left, top, width, height } = this.slider\n\n if (!left || !top || !width || !height) {\n throw \"Can't get necessary properties\"\n }\n\n const percentage = this.getScalePercentage()\n const offset = (width / 100) * percentage\n\n return {\n left: left - width / 2 + offset,\n top,\n visible: !isMobileOrDown(),\n }\n }\n\n /**\n * Get the percentage\n * @return {number}\n */\n private getScalePercentage(): number {\n if (!this.image.scaleX) {\n throw \"Can't get necessary properties\"\n }\n\n return (\n ((this.image.scaleX - this.scaleRange.min) /\n (this.scaleRange.max - this.scaleRange.min)) *\n 100\n )\n }\n\n /**\n * Calculate the map control properties\n * @return {Record}\n */\n private getMapControlProperties(): Record {\n if (\n !this.image.width ||\n !this.image.top ||\n !this.image.scaleX ||\n !this.image.height ||\n !this.image.scaleY ||\n !this.image.left ||\n !this.map.top ||\n !this.map.left\n ) {\n throw \"Can't get necessary properties\"\n }\n\n const widthScale =\n (this.image.width * this.image.scaleX) / this.canvas.getWidth()\n const heightScale =\n (this.image.height * this.image.scaleY) / this.canvas.getHeight()\n const width = this.navigatorWidth / widthScale\n const height = this.mapHeight / heightScale\n const top =\n this.map.top +\n height / 2 -\n this.image.top * (height / this.canvas.getHeight())\n const left =\n this.map.left +\n width / 2 -\n this.image.left * (width / this.canvas.getWidth())\n\n // Return the width, height, top and left of the image\n return {\n visible: !isMobileOrDown(),\n width,\n height,\n top,\n left,\n }\n }\n\n /**\n * Update the map control\n */\n private updateMapControl(): void {\n this.mapControl.set({\n ...this.getMapControlProperties(),\n })\n this.mapControl.setCoords()\n }\n\n /**\n * Update the image position based on the map control\n */\n private updateImagePosition(): void {\n if (\n !this.mapControl.left ||\n !this.mapControl.width ||\n !this.map.left ||\n !this.mapControl.top ||\n !this.map.top\n ) {\n throw \"Can't get necessary properties\"\n }\n\n const scale = this.canvas.getWidth() / this.mapControl.width\n const left =\n -(this.mapControl.left - this.map.left) * scale +\n this.canvas.getWidth() / 2\n const top =\n -(this.mapControl.top - this.map.top) * scale +\n this.canvas.getHeight() / 2\n\n this.image.set({ left, top })\n this.image.setCoords()\n }\n\n /**\n * Update the scale of the image based on the slider handle\n */\n private updateImageScaleBySliderHandle(): void {\n if (\n !this.sliderHandle.left ||\n !this.sliderHandle.width ||\n !this.slider.width ||\n !this.slider.left\n ) {\n throw \"Can't get necessary properties\"\n }\n\n const progress =\n (this.sliderHandle.left -\n this.sliderHandle.width / 2 -\n (this.slider.left - this.slider.width / 2)) /\n this.slider.width\n const scaleDiff = this.scaleRange.max - this.scaleRange.min\n const scale = this.scaleRange.min + scaleDiff * progress\n\n this.image.set({\n scaleX: scale,\n scaleY: scale,\n })\n this.image.setCoords()\n }\n\n /**\n * Update the map and the map background\n */\n private updateMap(): void {\n this.navigatorBackground.set({\n ...this.getMapBackgroundProperties(),\n })\n this.map.set({\n ...this.getMapProperties(),\n })\n\n this.navigatorBackground.setCoords()\n this.map.setCoords()\n }\n\n /**\n * Update the slider\n */\n private updateSlider(): void {\n this.slider.set({\n ...this.getSliderProperties(),\n })\n this.slider.setCoords()\n }\n\n /**\n * Update the position of the zoom controls\n */\n private updateZoomControls(): void {\n // Update zoom in properties\n this.zoomIn.set({\n ...this.getZoomInProperties(),\n })\n // Update zoom out properties\n this.zoomOut.set({\n ...this.getZoomOutProperties(),\n })\n\n // Update coords\n this.zoomIn.setCoords()\n this.zoomOut.setCoords()\n }\n\n /**\n * Update the slider handle\n */\n private updateSliderHandle(): void {\n this.sliderHandle.set({\n ...this.getSliderHandleProperties(),\n })\n this.sliderHandle.setCoords()\n }\n\n /**\n * Set the position of the image\n */\n private setImagePosition(): void {\n // Get the width and height of the image\n const imageHeight = this.image.height as number\n const imageWidth = this.image.width as number\n\n // Center image\n this.canvas.viewportCenterObject(this.image)\n\n // Check how much we have to zoom to fit the image\n const heightScale = this.canvas.getHeight() / imageHeight\n const widthScale = this.canvas.getWidth() / imageWidth\n\n // Pick the lowest value to determine which scale to use\n const scale = Math.max(heightScale, widthScale)\n\n // Set the default scale range\n this.scaleRange.min = scale\n\n // Always allow to scale to original size\n this.scaleRange.max = Math.max(scale + 1, 1)\n\n // Apply scaling\n this.image.scale(scale)\n this.image.setCoords()\n }\n\n /**\n * Animate in\n * @return {Promise}\n */\n private animateIn = async (): Promise =>\n this.props.animationControls.start('open')\n\n /**\n * Animate out\n * @return {Promise}\n */\n private animateOut = async (): Promise =>\n this.props.animationControls.start('close').then(() => {\n this.props.animationControls.set({\n display: 'none',\n })\n\n document.body.style.overflow = ''\n })\n\n /**\n * Add event listeners to canvas\n */\n private addEventListeners(): void {\n // Canvas events\n this.canvas.on('mouse:wheel', this.onMouseWheel)\n this.canvas.on('mouse:up', this.onMouseUp)\n this.canvas.on('object:moving', this.onObjectMove)\n this.canvas.on('selection:created', this.onSelectionCreated)\n this.canvas.on('after:render', this.afterCanvasRender)\n\n this.zoomIn.on('mousedown', this.onZoomInClick)\n this.zoomOut.on('mousedown', this.onZoomOutClick)\n\n // Window events\n window.addEventListener('resize', this.onResize)\n\n // Touch gestures events\n if (this.element) {\n this.hammer = new Hammer(this.element)\n this.hammer.get('pinch').set({ enable: true })\n this.hammer.on('pinch', this.onPinch)\n this.hammer.on('pinchend', this.onPinchEnd)\n }\n }\n\n /**\n * Remove event listeners from canvas\n */\n private removeEventListeners(): void {\n this.canvas.dispose()\n this.hammer.destroy()\n window.removeEventListener('resize', this.onResize)\n }\n\n /**\n * Update the scale of the image\n * @param scale\n */\n private setImageScale(scale: number): void {\n // Apply scaling\n this.image.scale(scale)\n\n // Update the map control\n this.updateMapControl()\n\n // Cap the map control bounds\n this.applyMapControlPositionBounds()\n\n // Cap the image moving capabilities\n this.applyImagePositionBounds()\n\n // Update slider handle\n this.updateSliderHandle()\n\n // Render the canvas\n this.canvas.requestRenderAll()\n }\n\n /**\n * Push callback to after render queue\n * @param callback\n */\n public queue(callback: () => void): void {\n this.afterRenderQueue.push(callback)\n }\n\n /**\n * Canvas mousewheel event\n * @param {IEvent} fe The fabric event\n */\n public onMouseWheel = (fabricEvent: fabric.IEvent): void => {\n if (!this.image.scaleX) {\n throw \"Can't get necessary properties\"\n }\n\n // Get the original mousewheel event\n const e = fabricEvent.e as MouseWheelEvent\n const delta = e.deltaY\n\n // Apply delta\n let scale = this.image.scaleX + delta / 200\n\n // Apply min and max scale values\n scale = Math.min(scale, this.scaleRange.max)\n scale = Math.max(scale, this.scaleRange.min)\n\n this.setImageScale(scale)\n }\n\n /**\n * Object move event handler\n * Check bounding box while moving the image object\n */\n public onObjectMove = (e: fabric.IEvent): void => {\n if (e.target === this.image) {\n this.applyImagePositionBounds()\n this.updateMapControl()\n }\n\n if (e.target === this.mapControl) {\n this.applyMapControlPositionBounds()\n this.updateImagePosition()\n }\n\n if (e.target === this.sliderHandle) {\n this.applySliderHandleBounds()\n\n this.updateImageScaleBySliderHandle()\n this.updateMapControl()\n\n this.applyMapControlPositionBounds()\n this.applyImagePositionBounds()\n }\n }\n\n /**\n * Disable group selection\n */\n public onSelectionCreated = (e: fabric.IEvent): void => {\n if (e.target && e.target.type === 'activeSelection') {\n this.canvas.discardActiveObject()\n }\n }\n\n /**\n * After canvas render event handler\n */\n public afterCanvasRender = (): void => {\n // Return if queue is empty\n if (this.afterRenderQueue.length === 0) {\n return\n }\n\n // Execute each callback\n this.afterRenderQueue.forEach((callback: () => void) => callback())\n\n // Reset render queue\n this.afterRenderQueue = []\n }\n\n /**\n * On zoom in click\n */\n public onZoomInClick = (): void => {\n if (!this.image.scaleX) {\n throw \"Can't get necessary properties\"\n }\n\n // get 10% zoom increase\n const scaleIncrease = (this.scaleRange.max - this.scaleRange.min) * 0.1\n const scale = Math.min(\n this.image.scaleX + scaleIncrease,\n this.scaleRange.max,\n )\n\n this.setImageScale(scale)\n }\n\n /**\n * On zoom out click\n */\n public onZoomOutClick = (): void => {\n if (!this.image.scaleX) {\n throw \"Can't get necessary properties\"\n }\n\n // get 10% zoom decrease\n const scaleDecrease = (this.scaleRange.max - this.scaleRange.min) * 0.1\n const scale = Math.max(\n this.image.scaleX - scaleDecrease,\n this.scaleRange.min,\n )\n\n this.setImageScale(scale)\n }\n\n /**\n * On touch gesture\n * @param e\n */\n public onPinch = (e: HammerInput): void => {\n // Double check for parameters\n if (!this.image.scaleX) {\n return\n }\n\n if (!this.pinchStartScale) {\n this.pinchStartScale = this.image.scaleX\n }\n\n let scale = this.pinchStartScale * e.scale\n scale = Math.min(scale, this.scaleRange.max)\n scale = Math.max(scale, this.scaleRange.min)\n\n this.setImageScale(scale)\n }\n\n /**\n * On pinch end event handler\n */\n public onPinchEnd = (): void => {\n // Reset the start scale on end\n this.pinchStartScale = null\n }\n\n /**\n * Always disable selection when the dragging is stopped\n */\n public onMouseUp = (): void => {\n this.canvas.discardActiveObject()\n }\n\n /**\n * Apply position bounds\n */\n private applyImagePositionBounds(): void {\n // Check if properties exists\n if (\n !this.image.left ||\n !this.image.top ||\n !this.image.width ||\n !this.image.scaleX ||\n !this.image.height ||\n !this.image.scaleY\n ) {\n return\n }\n\n // Get the scaled image width and height\n const scaledImageWidth = this.image.width * this.image.scaleX\n const scaledImageHeight = this.image.height * this.image.scaleY\n\n // Get the top left point of the image\n const imageTopLeft = new fabric.Point(\n this.image.left - scaledImageWidth / 2,\n this.image.top - scaledImageHeight / 2,\n )\n\n // Cap left position based on image scale\n if (imageTopLeft.x < this.canvas.getWidth() - scaledImageWidth) {\n this.image.set({\n left: this.canvas.getWidth() - scaledImageWidth + scaledImageWidth / 2,\n })\n } else if (imageTopLeft.x > 0) {\n this.image.set({\n left: scaledImageWidth / 2,\n })\n }\n\n // Cap top position based on image scale\n if (imageTopLeft.y < this.canvas.getHeight() - scaledImageHeight) {\n this.image.set({\n top:\n this.canvas.getHeight() - scaledImageHeight + scaledImageHeight / 2,\n })\n } else if (imageTopLeft.y > 0) {\n this.image.set({\n top: scaledImageHeight / 2,\n })\n }\n }\n\n /**\n * Apply bounds to map control\n */\n private applyMapControlPositionBounds(): void {\n // Double check properties\n if (\n !this.mapControl.top ||\n !this.map.top ||\n !this.map.height ||\n !this.mapControl.height ||\n !this.map.scaleX ||\n !this.map.scaleY ||\n !this.mapControl.width ||\n !this.map.left ||\n !this.map.width ||\n !this.mapControl.left\n ) {\n throw \"Can't get necessary properties\"\n }\n\n // Apply min height\n const minTop =\n this.map.top -\n (this.map.height * this.map.scaleY - this.mapControl.height) / 2\n if (this.mapControl.top < minTop) {\n this.mapControl.set({ top: minTop })\n }\n\n // Apply min height\n const maxTop =\n this.map.top +\n (this.map.height * this.map.scaleY - this.mapControl.height) / 2\n if (this.mapControl.top > maxTop) {\n this.mapControl.set({ top: maxTop })\n }\n\n // Apply min left\n const minLeft =\n this.map.left -\n (this.map.width * this.map.scaleX - this.mapControl.width) / 2\n if (this.mapControl.left < minLeft) {\n this.mapControl.set({ left: minLeft })\n }\n\n // Apply max left\n const maxLeft =\n this.map.left +\n (this.map.width * this.map.scaleX - this.mapControl.width) / 2\n if (this.mapControl.left > maxLeft) {\n this.mapControl.set({ left: maxLeft })\n }\n }\n\n /**\n * Calculate the width and height of the canvas\n */\n private calculateCanvasDimensions(): void {\n const pageHeader = document.querySelector('.page-header')\n // Return the full window height if the page header isn't available\n // or if the show header flag is turned off\n if (!pageHeader) {\n this.setState({\n width: window.innerWidth,\n height: window.innerHeight,\n })\n return\n }\n this.setState({\n width: window.innerWidth,\n height: window.innerHeight - pageHeader.clientHeight,\n })\n }\n\n /**\n * Calculate the position of the canvas based on the page header\n */\n private calculateCanvasPosition(): void {\n const pageHeader = document.querySelector('.page-header')\n // Return the full window height if the page header isn't available\n if (!pageHeader) {\n this.setState({\n left: 0,\n top: 0,\n })\n return\n }\n this.setState({\n left: 0,\n top: pageHeader.clientHeight,\n })\n }\n\n /**\n * Apply horizontal bounds for slider handle\n */\n public applySliderHandleBounds(): void {\n if (\n !this.sliderHandle.left ||\n !this.sliderHandle.width ||\n !this.slider.left ||\n !this.slider.width\n ) {\n throw \"Can't get necessary properties\"\n }\n\n // Apply min left bounds\n const minLeft =\n this.slider.left - this.slider.width / 2 + this.sliderHandle.width / 2\n if (this.sliderHandle.left < minLeft) {\n this.sliderHandle.set({ left: minLeft })\n }\n\n // Apply max left bounds\n const maxLeft =\n this.slider.left + this.slider.width / 2 - this.sliderHandle.width / 2\n if (this.sliderHandle.left > maxLeft) {\n this.sliderHandle.set({ left: maxLeft })\n }\n }\n\n /**\n * Window resize event\n * @param e\n */\n public onResize = (): void => {\n if (this.resizeTimeout) {\n window.clearTimeout(this.resizeTimeout)\n }\n this.resizeTimeout = window.setTimeout(this.resize, 500)\n }\n\n /**\n * Canvas resize handler\n */\n public resize = (): void => {\n // Apply new size to canvas\n this.calculateCanvasDimensions()\n this.calculateCanvasPosition()\n\n this.canvas.setDimensions({\n width: this.state.width,\n height: this.state.height,\n })\n\n this.canvas.calcOffset()\n\n // Set positions of element\n this.setImagePosition()\n\n // Update the position of the map\n this.updateMap()\n\n // Update the position of the slider\n this.updateSlider()\n this.updateSliderHandle()\n this.updateZoomControls()\n\n // Update the map control\n this.updateMapControl()\n\n // Render the canvas\n this.canvas.requestRenderAll()\n\n // Make sure the overflow is still disabled\n document.body.style.overflow = 'hidden'\n }\n\n /**\n * Render the component\n */\n public render(): JSX.Element {\n return (\n (this.element = el)}\n style={{\n top: this.state.top,\n left: this.state.left,\n width: this.state.width,\n height: this.state.height,\n }}\n variants={imageZoomAnimation}\n >\n (this.canvasElement = el)}\n width={this.state.width}\n />\n \n \n )\n }\n}\n\nconst StyledImageZoom = styled(motion.div)`\n position: fixed;\n background: ${Colors.WHITE};\n z-index: 1001;\n`\n\nconst Canvas = styled.canvas`\n position: absolute;\n left: 0;\n top: 0;\n`\n\nconst CloseButton = styled(Button)`\n position: absolute;\n top: ${rem(60)};\n right: ${rem(60)};\n z-index: 1002;\n`\n\nexport default ImageZoom\n","import React, { FunctionComponent, useCallback } from 'react'\nimport { Actions } from '../../../contexts/app-state/AppStateReducer'\nimport ImageZoom from './ImageZoom'\nimport { useAnimation } from 'framer-motion'\nimport { useAppState } from '../../../contexts/app-state/AppStateContext'\nimport useDictionary from '../../../hooks/use-dictionary/useDictionary'\n\nconst Wrapper: FunctionComponent = () => {\n const dictionary = useDictionary()\n const animationControls = useAnimation()\n const [{ zoomImageSrc }, dispatch] = useAppState()\n\n const onImageZoomClose = useCallback(() => {\n dispatch({\n payload: null,\n type: Actions.SET_ZOOM_IMAGE_SRC,\n })\n }, [])\n\n const onHoverCloseButtonEnd = useCallback(() => {\n dispatch({\n payload: null,\n type: Actions.SET_CURSOR_OVERLAY_TYPE,\n })\n }, [])\n\n const onHoverCloseButtonStart = useCallback(() => {\n dispatch({\n payload: 'minimize',\n type: Actions.SET_CURSOR_OVERLAY_TYPE,\n })\n }, [])\n\n return (\n \n )\n}\n\nexport default Wrapper\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};","'use strict';\n\nexports.byteLength = byteLength;\nexports.toByteArray = toByteArray;\nexports.fromByteArray = fromByteArray;\nvar lookup = [];\nvar revLookup = [];\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i];\n revLookup[code.charCodeAt(i)] = i;\n} // Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\n\n\nrevLookup['-'.charCodeAt(0)] = 62;\nrevLookup['_'.charCodeAt(0)] = 63;\n\nfunction getLens(b64) {\n var len = b64.length;\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4');\n } // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n\n\n var validLen = b64.indexOf('=');\n if (validLen === -1) validLen = len;\n var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;\n return [validLen, placeHoldersLen];\n} // base64 is 4/3 + up to two characters of the original data\n\n\nfunction byteLength(b64) {\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n}\n\nfunction _byteLength(b64, validLen, placeHoldersLen) {\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n}\n\nfunction toByteArray(b64) {\n var tmp;\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));\n var curByte = 0; // if there are placeholders, only get up to the last complete 4 chars\n\n var len = placeHoldersLen > 0 ? validLen - 4 : validLen;\n var i;\n\n for (i = 0; i < len; i += 4) {\n tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];\n arr[curByte++] = tmp >> 16 & 0xFF;\n arr[curByte++] = tmp >> 8 & 0xFF;\n arr[curByte++] = tmp & 0xFF;\n }\n\n if (placeHoldersLen === 2) {\n tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;\n arr[curByte++] = tmp & 0xFF;\n }\n\n if (placeHoldersLen === 1) {\n tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;\n arr[curByte++] = tmp >> 8 & 0xFF;\n arr[curByte++] = tmp & 0xFF;\n }\n\n return arr;\n}\n\nfunction tripletToBase64(num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];\n}\n\nfunction encodeChunk(uint8, start, end) {\n var tmp;\n var output = [];\n\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF);\n output.push(tripletToBase64(tmp));\n }\n\n return output.join('');\n}\n\nfunction fromByteArray(uint8) {\n var tmp;\n var len = uint8.length;\n var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes\n\n var parts = [];\n var maxChunkLength = 16383; // must be multiple of 3\n // go through the array every three bytes, we'll deal with trailing stuff later\n\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));\n } // pad the end with zeros, but make sure to not forget the extra bytes\n\n\n if (extraBytes === 1) {\n tmp = uint8[len - 1];\n parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '==');\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1];\n parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '=');\n }\n\n return parts.join('');\n}","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n/* eslint-disable no-proto */\n'use strict';\n\nvar base64 = require('base64-js');\n\nvar ieee754 = require('ieee754');\n\nvar isArray = require('isarray');\n\nexports.Buffer = Buffer;\nexports.SlowBuffer = SlowBuffer;\nexports.INSPECT_MAX_BYTES = 50;\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\n\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : typedArraySupport();\n/*\n * Export kMaxLength after typed array support is determined.\n */\n\nexports.kMaxLength = kMaxLength();\n\nfunction typedArraySupport() {\n try {\n var arr = new Uint8Array(1);\n arr.__proto__ = {\n __proto__: Uint8Array.prototype,\n foo: function foo() {\n return 42;\n }\n };\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0; // ie10 has broken `subarray`\n } catch (e) {\n return false;\n }\n}\n\nfunction kMaxLength() {\n return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff;\n}\n\nfunction createBuffer(that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length');\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length);\n that.__proto__ = Buffer.prototype;\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length);\n }\n\n that.length = length;\n }\n\n return that;\n}\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\n\nfunction Buffer(arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length);\n } // Common case.\n\n\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error('If encoding is specified then the first argument must be a string');\n }\n\n return allocUnsafe(this, arg);\n }\n\n return from(this, arg, encodingOrOffset, length);\n}\n\nBuffer.poolSize = 8192; // not used by this implementation\n// TODO: Legacy, not needed anymore. Remove in next major version.\n\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype;\n return arr;\n};\n\nfunction from(that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number');\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length);\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset);\n }\n\n return fromObject(that, value);\n}\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\n\n\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length);\n};\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype;\n Buffer.__proto__ = Uint8Array;\n\n if (typeof Symbol !== 'undefined' && Symbol.species && Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n });\n }\n}\n\nfunction assertSize(size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number');\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative');\n }\n}\n\nfunction alloc(that, size, fill, encoding) {\n assertSize(size);\n\n if (size <= 0) {\n return createBuffer(that, size);\n }\n\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill);\n }\n\n return createBuffer(that, size);\n}\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\n\n\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding);\n};\n\nfunction allocUnsafe(that, size) {\n assertSize(size);\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0;\n }\n }\n\n return that;\n}\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\n\n\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size);\n};\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\n\n\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size);\n};\n\nfunction fromString(that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8';\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding');\n }\n\n var length = byteLength(string, encoding) | 0;\n that = createBuffer(that, length);\n var actual = that.write(string, encoding);\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual);\n }\n\n return that;\n}\n\nfunction fromArrayLike(that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0;\n that = createBuffer(that, length);\n\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255;\n }\n\n return that;\n}\n\nfunction fromArrayBuffer(that, array, byteOffset, length) {\n array.byteLength; // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds');\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds');\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array);\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset);\n } else {\n array = new Uint8Array(array, byteOffset, length);\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array;\n that.__proto__ = Buffer.prototype;\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array);\n }\n\n return that;\n}\n\nfunction fromObject(that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0;\n that = createBuffer(that, len);\n\n if (that.length === 0) {\n return that;\n }\n\n obj.copy(that, 0, 0, len);\n return that;\n }\n\n if (obj) {\n if (typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0);\n }\n\n return fromArrayLike(that, obj);\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data);\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.');\n}\n\nfunction checked(length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes');\n }\n\n return length | 0;\n}\n\nfunction SlowBuffer(length) {\n if (+length != length) {\n // eslint-disable-line eqeqeq\n length = 0;\n }\n\n return Buffer.alloc(+length);\n}\n\nBuffer.isBuffer = function isBuffer(b) {\n return !!(b != null && b._isBuffer);\n};\n\nBuffer.compare = function compare(a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers');\n }\n\n if (a === b) return 0;\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n};\n\nBuffer.isEncoding = function isEncoding(encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true;\n\n default:\n return false;\n }\n};\n\nBuffer.concat = function concat(list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers');\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0);\n }\n\n var i;\n\n if (length === undefined) {\n length = 0;\n\n for (i = 0; i < list.length; ++i) {\n length += list[i].length;\n }\n }\n\n var buffer = Buffer.allocUnsafe(length);\n var pos = 0;\n\n for (i = 0; i < list.length; ++i) {\n var buf = list[i];\n\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers');\n }\n\n buf.copy(buffer, pos);\n pos += buf.length;\n }\n\n return buffer;\n};\n\nfunction byteLength(string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length;\n }\n\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength;\n }\n\n if (typeof string !== 'string') {\n string = '' + string;\n }\n\n var len = string.length;\n if (len === 0) return 0; // Use a for loop to avoid recursion\n\n var loweredCase = false;\n\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len;\n\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length;\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2;\n\n case 'hex':\n return len >>> 1;\n\n case 'base64':\n return base64ToBytes(string).length;\n\n default:\n if (loweredCase) return utf8ToBytes(string).length; // assume utf8\n\n encoding = ('' + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n}\n\nBuffer.byteLength = byteLength;\n\nfunction slowToString(encoding, start, end) {\n var loweredCase = false; // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n\n if (start === undefined || start < 0) {\n start = 0;\n } // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n\n\n if (start > this.length) {\n return '';\n }\n\n if (end === undefined || end > this.length) {\n end = this.length;\n }\n\n if (end <= 0) {\n return '';\n } // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n\n\n end >>>= 0;\n start >>>= 0;\n\n if (end <= start) {\n return '';\n }\n\n if (!encoding) encoding = 'utf8';\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end);\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end);\n\n case 'ascii':\n return asciiSlice(this, start, end);\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end);\n\n case 'base64':\n return base64Slice(this, start, end);\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end);\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);\n encoding = (encoding + '').toLowerCase();\n loweredCase = true;\n }\n }\n} // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\n\n\nBuffer.prototype._isBuffer = true;\n\nfunction swap(b, n, m) {\n var i = b[n];\n b[n] = b[m];\n b[m] = i;\n}\n\nBuffer.prototype.swap16 = function swap16() {\n var len = this.length;\n\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits');\n }\n\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1);\n }\n\n return this;\n};\n\nBuffer.prototype.swap32 = function swap32() {\n var len = this.length;\n\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits');\n }\n\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3);\n swap(this, i + 1, i + 2);\n }\n\n return this;\n};\n\nBuffer.prototype.swap64 = function swap64() {\n var len = this.length;\n\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits');\n }\n\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7);\n swap(this, i + 1, i + 6);\n swap(this, i + 2, i + 5);\n swap(this, i + 3, i + 4);\n }\n\n return this;\n};\n\nBuffer.prototype.toString = function toString() {\n var length = this.length | 0;\n if (length === 0) return '';\n if (arguments.length === 0) return utf8Slice(this, 0, length);\n return slowToString.apply(this, arguments);\n};\n\nBuffer.prototype.equals = function equals(b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer');\n if (this === b) return true;\n return Buffer.compare(this, b) === 0;\n};\n\nBuffer.prototype.inspect = function inspect() {\n var str = '';\n var max = exports.INSPECT_MAX_BYTES;\n\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');\n if (this.length > max) str += ' ... ';\n }\n\n return '';\n};\n\nBuffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer');\n }\n\n if (start === undefined) {\n start = 0;\n }\n\n if (end === undefined) {\n end = target ? target.length : 0;\n }\n\n if (thisStart === undefined) {\n thisStart = 0;\n }\n\n if (thisEnd === undefined) {\n thisEnd = this.length;\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index');\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0;\n }\n\n if (thisStart >= thisEnd) {\n return -1;\n }\n\n if (start >= end) {\n return 1;\n }\n\n start >>>= 0;\n end >>>= 0;\n thisStart >>>= 0;\n thisEnd >>>= 0;\n if (this === target) return 0;\n var x = thisEnd - thisStart;\n var y = end - start;\n var len = Math.min(x, y);\n var thisCopy = this.slice(thisStart, thisEnd);\n var targetCopy = target.slice(start, end);\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i];\n y = targetCopy[i];\n break;\n }\n }\n\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n}; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\n\n\nfunction bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}\n\nfunction arrayIndexOf(arr, val, byteOffset, encoding, dir) {\n var indexSize = 1;\n var arrLength = arr.length;\n var valLength = val.length;\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase();\n\n if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1;\n }\n\n indexSize = 2;\n arrLength /= 2;\n valLength /= 2;\n byteOffset /= 2;\n }\n }\n\n function read(buf, i) {\n if (indexSize === 1) {\n return buf[i];\n } else {\n return buf.readUInt16BE(i * indexSize);\n }\n }\n\n var i;\n\n if (dir) {\n var foundIndex = -1;\n\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i;\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;\n } else {\n if (foundIndex !== -1) i -= i - foundIndex;\n foundIndex = -1;\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;\n\n for (i = byteOffset; i >= 0; i--) {\n var found = true;\n\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false;\n break;\n }\n }\n\n if (found) return i;\n }\n }\n\n return -1;\n}\n\nBuffer.prototype.includes = function includes(val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1;\n};\n\nBuffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true);\n};\n\nBuffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false);\n};\n\nfunction hexWrite(buf, string, offset, length) {\n offset = Number(offset) || 0;\n var remaining = buf.length - offset;\n\n if (!length) {\n length = remaining;\n } else {\n length = Number(length);\n\n if (length > remaining) {\n length = remaining;\n }\n } // must be an even number of digits\n\n\n var strLen = string.length;\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string');\n\n if (length > strLen / 2) {\n length = strLen / 2;\n }\n\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16);\n if (isNaN(parsed)) return i;\n buf[offset + i] = parsed;\n }\n\n return i;\n}\n\nfunction utf8Write(buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);\n}\n\nfunction asciiWrite(buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length);\n}\n\nfunction latin1Write(buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length);\n}\n\nfunction base64Write(buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length);\n}\n\nfunction ucs2Write(buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);\n}\n\nBuffer.prototype.write = function write(string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8';\n length = this.length;\n offset = 0; // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset;\n length = this.length;\n offset = 0; // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0;\n\n if (isFinite(length)) {\n length = length | 0;\n if (encoding === undefined) encoding = 'utf8';\n } else {\n encoding = length;\n length = undefined;\n } // legacy write(string, encoding, offset, length) - remove in v0.13\n\n } else {\n throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');\n }\n\n var remaining = this.length - offset;\n if (length === undefined || length > remaining) length = remaining;\n\n if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds');\n }\n\n if (!encoding) encoding = 'utf8';\n var loweredCase = false;\n\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length);\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length);\n\n case 'ascii':\n return asciiWrite(this, string, offset, length);\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length);\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length);\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length);\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);\n encoding = ('' + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n};\n\nBuffer.prototype.toJSON = function toJSON() {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n };\n};\n\nfunction base64Slice(buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf);\n } else {\n return base64.fromByteArray(buf.slice(start, end));\n }\n}\n\nfunction utf8Slice(buf, start, end) {\n end = Math.min(buf.length, end);\n var res = [];\n var i = start;\n\n while (i < end) {\n var firstByte = buf[i];\n var codePoint = null;\n var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1;\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint;\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte;\n }\n\n break;\n\n case 2:\n secondByte = buf[i + 1];\n\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F;\n\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint;\n }\n }\n\n break;\n\n case 3:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F;\n\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint;\n }\n }\n\n break;\n\n case 4:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n fourthByte = buf[i + 3];\n\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F;\n\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint;\n }\n }\n\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD;\n bytesPerSequence = 1;\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000;\n res.push(codePoint >>> 10 & 0x3FF | 0xD800);\n codePoint = 0xDC00 | codePoint & 0x3FF;\n }\n\n res.push(codePoint);\n i += bytesPerSequence;\n }\n\n return decodeCodePointsArray(res);\n} // Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\n\n\nvar MAX_ARGUMENTS_LENGTH = 0x1000;\n\nfunction decodeCodePointsArray(codePoints) {\n var len = codePoints.length;\n\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints); // avoid extra slice()\n } // Decode in chunks to avoid \"call stack size exceeded\".\n\n\n var res = '';\n var i = 0;\n\n while (i < len) {\n res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));\n }\n\n return res;\n}\n\nfunction asciiSlice(buf, start, end) {\n var ret = '';\n end = Math.min(buf.length, end);\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F);\n }\n\n return ret;\n}\n\nfunction latin1Slice(buf, start, end) {\n var ret = '';\n end = Math.min(buf.length, end);\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i]);\n }\n\n return ret;\n}\n\nfunction hexSlice(buf, start, end) {\n var len = buf.length;\n if (!start || start < 0) start = 0;\n if (!end || end < 0 || end > len) end = len;\n var out = '';\n\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i]);\n }\n\n return out;\n}\n\nfunction utf16leSlice(buf, start, end) {\n var bytes = buf.slice(start, end);\n var res = '';\n\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);\n }\n\n return res;\n}\n\nBuffer.prototype.slice = function slice(start, end) {\n var len = this.length;\n start = ~~start;\n end = end === undefined ? len : ~~end;\n\n if (start < 0) {\n start += len;\n if (start < 0) start = 0;\n } else if (start > len) {\n start = len;\n }\n\n if (end < 0) {\n end += len;\n if (end < 0) end = 0;\n } else if (end > len) {\n end = len;\n }\n\n if (end < start) end = start;\n var newBuf;\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end);\n newBuf.__proto__ = Buffer.prototype;\n } else {\n var sliceLen = end - start;\n newBuf = new Buffer(sliceLen, undefined);\n\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start];\n }\n }\n\n return newBuf;\n};\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\n\n\nfunction checkOffset(offset, ext, length) {\n if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint');\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length');\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n var val = this[offset];\n var mul = 1;\n var i = 0;\n\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul;\n }\n\n return val;\n};\n\nBuffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length);\n }\n\n var val = this[offset + --byteLength];\n var mul = 1;\n\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul;\n }\n\n return val;\n};\n\nBuffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length);\n return this[offset];\n};\n\nBuffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] | this[offset + 1] << 8;\n};\n\nBuffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] << 8 | this[offset + 1];\n};\n\nBuffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000;\n};\n\nBuffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);\n};\n\nBuffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n var val = this[offset];\n var mul = 1;\n var i = 0;\n\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul;\n }\n\n mul *= 0x80;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n return val;\n};\n\nBuffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n var i = byteLength;\n var mul = 1;\n var val = this[offset + --i];\n\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul;\n }\n\n mul *= 0x80;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n return val;\n};\n\nBuffer.prototype.readInt8 = function readInt8(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length);\n if (!(this[offset] & 0x80)) return this[offset];\n return (0xff - this[offset] + 1) * -1;\n};\n\nBuffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n var val = this[offset] | this[offset + 1] << 8;\n return val & 0x8000 ? val | 0xFFFF0000 : val;\n};\n\nBuffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n var val = this[offset + 1] | this[offset] << 8;\n return val & 0x8000 ? val | 0xFFFF0000 : val;\n};\n\nBuffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;\n};\n\nBuffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];\n};\n\nBuffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, true, 23, 4);\n};\n\nBuffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, false, 23, 4);\n};\n\nBuffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, true, 52, 8);\n};\n\nBuffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, false, 52, 8);\n};\n\nfunction checkInt(buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance');\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds');\n if (offset + ext > buf.length) throw new RangeError('Index out of range');\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n byteLength = byteLength | 0;\n\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n var mul = 1;\n var i = 0;\n this[offset] = value & 0xFF;\n\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = value / mul & 0xFF;\n }\n\n return offset + byteLength;\n};\n\nBuffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n byteLength = byteLength | 0;\n\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n var i = byteLength - 1;\n var mul = 1;\n this[offset + i] = value & 0xFF;\n\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = value / mul & 0xFF;\n }\n\n return offset + byteLength;\n};\n\nBuffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);\n this[offset] = value & 0xff;\n return offset + 1;\n};\n\nfunction objectWriteUInt16(buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1;\n\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & 0xff << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8;\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff;\n this[offset + 1] = value >>> 8;\n } else {\n objectWriteUInt16(this, value, offset, true);\n }\n\n return offset + 2;\n};\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 8;\n this[offset + 1] = value & 0xff;\n } else {\n objectWriteUInt16(this, value, offset, false);\n }\n\n return offset + 2;\n};\n\nfunction objectWriteUInt32(buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1;\n\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 0xff;\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = value >>> 24;\n this[offset + 2] = value >>> 16;\n this[offset + 1] = value >>> 8;\n this[offset] = value & 0xff;\n } else {\n objectWriteUInt32(this, value, offset, true);\n }\n\n return offset + 4;\n};\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 0xff;\n } else {\n objectWriteUInt32(this, value, offset, false);\n }\n\n return offset + 4;\n};\n\nBuffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1);\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n var i = 0;\n var mul = 1;\n var sub = 0;\n this[offset] = value & 0xFF;\n\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1;\n }\n\n this[offset + i] = (value / mul >> 0) - sub & 0xFF;\n }\n\n return offset + byteLength;\n};\n\nBuffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1);\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n var i = byteLength - 1;\n var mul = 1;\n var sub = 0;\n this[offset + i] = value & 0xFF;\n\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1;\n }\n\n this[offset + i] = (value / mul >> 0) - sub & 0xFF;\n }\n\n return offset + byteLength;\n};\n\nBuffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);\n if (value < 0) value = 0xff + value + 1;\n this[offset] = value & 0xff;\n return offset + 1;\n};\n\nBuffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff;\n this[offset + 1] = value >>> 8;\n } else {\n objectWriteUInt16(this, value, offset, true);\n }\n\n return offset + 2;\n};\n\nBuffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 8;\n this[offset + 1] = value & 0xff;\n } else {\n objectWriteUInt16(this, value, offset, false);\n }\n\n return offset + 2;\n};\n\nBuffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff;\n this[offset + 1] = value >>> 8;\n this[offset + 2] = value >>> 16;\n this[offset + 3] = value >>> 24;\n } else {\n objectWriteUInt32(this, value, offset, true);\n }\n\n return offset + 4;\n};\n\nBuffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);\n if (value < 0) value = 0xffffffff + value + 1;\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 0xff;\n } else {\n objectWriteUInt32(this, value, offset, false);\n }\n\n return offset + 4;\n};\n\nfunction checkIEEE754(buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range');\n if (offset < 0) throw new RangeError('Index out of range');\n}\n\nfunction writeFloat(buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38);\n }\n\n ieee754.write(buf, value, offset, littleEndian, 23, 4);\n return offset + 4;\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert);\n};\n\nBuffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert);\n};\n\nfunction writeDouble(buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308);\n }\n\n ieee754.write(buf, value, offset, littleEndian, 52, 8);\n return offset + 8;\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert);\n};\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert);\n}; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\n\n\nBuffer.prototype.copy = function copy(target, targetStart, start, end) {\n if (!start) start = 0;\n if (!end && end !== 0) end = this.length;\n if (targetStart >= target.length) targetStart = target.length;\n if (!targetStart) targetStart = 0;\n if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done\n\n if (end === start) return 0;\n if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions\n\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds');\n }\n\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds');\n if (end < 0) throw new RangeError('sourceEnd out of bounds'); // Are we oob?\n\n if (end > this.length) end = this.length;\n\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start;\n }\n\n var len = end - start;\n var i;\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start];\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start];\n }\n } else {\n Uint8Array.prototype.set.call(target, this.subarray(start, start + len), targetStart);\n }\n\n return len;\n}; // Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\n\n\nBuffer.prototype.fill = function fill(val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start;\n start = 0;\n end = this.length;\n } else if (typeof end === 'string') {\n encoding = end;\n end = this.length;\n }\n\n if (val.length === 1) {\n var code = val.charCodeAt(0);\n\n if (code < 256) {\n val = code;\n }\n }\n\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string');\n }\n\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding);\n }\n } else if (typeof val === 'number') {\n val = val & 255;\n } // Invalid ranges are not set to a default, so can range check early.\n\n\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index');\n }\n\n if (end <= start) {\n return this;\n }\n\n start = start >>> 0;\n end = end === undefined ? this.length : end >>> 0;\n if (!val) val = 0;\n var i;\n\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val;\n }\n } else {\n var bytes = Buffer.isBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString());\n var len = bytes.length;\n\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len];\n }\n }\n\n return this;\n}; // HELPER FUNCTIONS\n// ================\n\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g;\n\nfunction base64clean(str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, ''); // Node converts strings with length < 2 to ''\n\n if (str.length < 2) return ''; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n\n while (str.length % 4 !== 0) {\n str = str + '=';\n }\n\n return str;\n}\n\nfunction stringtrim(str) {\n if (str.trim) return str.trim();\n return str.replace(/^\\s+|\\s+$/g, '');\n}\n\nfunction toHex(n) {\n if (n < 16) return '0' + n.toString(16);\n return n.toString(16);\n}\n\nfunction utf8ToBytes(string, units) {\n units = units || Infinity;\n var codePoint;\n var length = string.length;\n var leadSurrogate = null;\n var bytes = [];\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i); // is surrogate component\n\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n continue;\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n continue;\n } // valid lead\n\n\n leadSurrogate = codePoint;\n continue;\n } // 2 leads in a row\n\n\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n leadSurrogate = codePoint;\n continue;\n } // valid surrogate pair\n\n\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n }\n\n leadSurrogate = null; // encode utf8\n\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break;\n bytes.push(codePoint);\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break;\n bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80);\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break;\n bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break;\n bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);\n } else {\n throw new Error('Invalid code point');\n }\n }\n\n return bytes;\n}\n\nfunction asciiToBytes(str) {\n var byteArray = [];\n\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF);\n }\n\n return byteArray;\n}\n\nfunction utf16leToBytes(str, units) {\n var c, hi, lo;\n var byteArray = [];\n\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break;\n c = str.charCodeAt(i);\n hi = c >> 8;\n lo = c % 256;\n byteArray.push(lo);\n byteArray.push(hi);\n }\n\n return byteArray;\n}\n\nfunction base64ToBytes(str) {\n return base64.toByteArray(base64clean(str));\n}\n\nfunction blitBuffer(src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if (i + offset >= dst.length || i >= src.length) break;\n dst[i + offset] = src[i];\n }\n\n return i;\n}\n\nfunction isnan(val) {\n return val !== val; // eslint-disable-line no-self-compare\n}","module.exports = \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgdmlld0JveD0iMCAwIDEwIDEwIj4KICA8ZGVmcz4KICAgIDxzdHlsZT4KICAgICAgLmNscy0xIHsKICAgICAgICBmaWxsOiAjNDE0MDQyOwogICAgICAgIGZpbGwtcnVsZTogZXZlbm9kZDsKICAgICAgfQogICAgPC9zdHlsZT4KICA8L2RlZnM+CiAgPHBhdGggaWQ9Il8iIGRhdGEtbmFtZT0iKyIgY2xhc3M9ImNscy0xIiBkPSJNMTY3MywxMzIyaC00djRoLTJ2LTRoLTR2LTJoNHYtNGgydjRoNHYyWiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTE2NjMgLTEzMTYpIi8+Cjwvc3ZnPgo=\"","import { HoverHandlers, motion } from 'framer-motion'\nimport React, { FunctionComponent, MouseEvent } from 'react'\nimport Colors from '../../../tokens/Colors'\nimport { Link } from 'gatsby'\nimport { rem } from '../../../utils/rem'\nimport styled from 'styled-components'\n\nexport interface ButtonProps {\n className?: string\n label: string\n onClick?: (event: MouseEvent) => void\n onHoverEnd?: HoverHandlers['onHoverEnd']\n onHoverStart?: HoverHandlers['onHoverStart']\n to?: string\n}\n\nconst Button: FunctionComponent = ({\n className,\n label,\n to,\n ...props\n}) =>\n to ? (\n \n {label}\n \n ) : (\n \n {label}\n \n )\n\nconst StyledButton = styled(motion.button)`\n font-size: ${rem(15)};\n font-weight: 700;\n background: ${Colors.WHITE};\n text-decoration: none;\n color: ${Colors.SHIP_GREY};\n padding: 0 ${rem(24)};\n line-height: ${rem(40)};\n height: ${rem(40)};\n border-radius: ${rem(20)};\n display: inline-block;\n transition: background 200ms ease-out;\n border: none;\n cursor: pointer;\n outline: none;\n\n &:hover {\n transition: background 200ms ease-in;\n background: ${Colors.ALTO};\n }\n\n .hide-cursor & {\n cursor: none;\n }\n`\n\nexport default Button\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = -7;\n var i = isLE ? nBytes - 1 : 0;\n var d = isLE ? -1 : 1;\n var s = buffer[offset + i];\n i += d;\n e = s & (1 << -nBits) - 1;\n s >>= -nBits;\n nBits += eLen;\n\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : (s ? -1 : 1) * Infinity;\n } else {\n m = m + Math.pow(2, mLen);\n e = e - eBias;\n }\n\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen);\n};\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;\n var i = isLE ? 0 : nBytes - 1;\n var d = isLE ? 1 : -1;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n value = Math.abs(value);\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0;\n e = eMax;\n } else {\n e = Math.floor(Math.log(value) / Math.LN2);\n\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * Math.pow(2, 1 - eBias);\n }\n\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\n e = 0;\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = e << mLen | m;\n eLen += mLen;\n\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128;\n};","module.exports = \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIyIiB2aWV3Qm94PSIwIDAgMTAgMiI+CiAgPGRlZnM+CiAgICA8c3R5bGU+CiAgICAgIC5jbHMtMSB7CiAgICAgICAgZmlsbDogIzQxNDA0MjsKICAgICAgfQogICAgPC9zdHlsZT4KICA8L2RlZnM+CiAgPHJlY3QgaWQ9Il8tIiBkYXRhLW5hbWU9Ii0iIGNsYXNzPSJjbHMtMSIgd2lkdGg9IjEwIiBoZWlnaHQ9IjIiLz4KPC9zdmc+Cg==\"","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","module.exports = require(\"regenerator-runtime\");\n","/*! Hammer.JS - v2.0.7 - 2016-04-22\n * http://hammerjs.github.io/\n *\n * Copyright (c) 2016 Jorik Tangelder;\n * Licensed under the MIT license */\n(function (window, document, exportName, undefined) {\n 'use strict';\n\n var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];\n var TEST_ELEMENT = document.createElement('div');\n var TYPE_FUNCTION = 'function';\n var round = Math.round;\n var abs = Math.abs;\n var now = Date.now;\n /**\n * set a timeout with a given scope\n * @param {Function} fn\n * @param {Number} timeout\n * @param {Object} context\n * @returns {number}\n */\n\n function setTimeoutContext(fn, timeout, context) {\n return setTimeout(bindFn(fn, context), timeout);\n }\n /**\n * if the argument is an array, we want to execute the fn on each entry\n * if it aint an array we don't want to do a thing.\n * this is used by all the methods that accept a single and array argument.\n * @param {*|Array} arg\n * @param {String} fn\n * @param {Object} [context]\n * @returns {Boolean}\n */\n\n\n function invokeArrayArg(arg, fn, context) {\n if (Array.isArray(arg)) {\n each(arg, context[fn], context);\n return true;\n }\n\n return false;\n }\n /**\n * walk objects and arrays\n * @param {Object} obj\n * @param {Function} iterator\n * @param {Object} context\n */\n\n\n function each(obj, iterator, context) {\n var i;\n\n if (!obj) {\n return;\n }\n\n if (obj.forEach) {\n obj.forEach(iterator, context);\n } else if (obj.length !== undefined) {\n i = 0;\n\n while (i < obj.length) {\n iterator.call(context, obj[i], i, obj);\n i++;\n }\n } else {\n for (i in obj) {\n obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);\n }\n }\n }\n /**\n * wrap a method with a deprecation warning and stack trace\n * @param {Function} method\n * @param {String} name\n * @param {String} message\n * @returns {Function} A new function wrapping the supplied method.\n */\n\n\n function deprecate(method, name, message) {\n var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\\n' + message + ' AT \\n';\n return function () {\n var e = new Error('get-stack-trace');\n var stack = e && e.stack ? e.stack.replace(/^[^\\(]+?[\\n$]/gm, '').replace(/^\\s+at\\s+/gm, '').replace(/^Object.\\s*\\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';\n var log = window.console && (window.console.warn || window.console.log);\n\n if (log) {\n log.call(window.console, deprecationMessage, stack);\n }\n\n return method.apply(this, arguments);\n };\n }\n /**\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} target\n * @param {...Object} objects_to_assign\n * @returns {Object} target\n */\n\n\n var assign;\n\n if (typeof Object.assign !== 'function') {\n assign = function assign(target) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n var output = Object(target);\n\n for (var index = 1; index < arguments.length; index++) {\n var source = arguments[index];\n\n if (source !== undefined && source !== null) {\n for (var nextKey in source) {\n if (source.hasOwnProperty(nextKey)) {\n output[nextKey] = source[nextKey];\n }\n }\n }\n }\n\n return output;\n };\n } else {\n assign = Object.assign;\n }\n /**\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} dest\n * @param {Object} src\n * @param {Boolean} [merge=false]\n * @returns {Object} dest\n */\n\n\n var extend = deprecate(function extend(dest, src, merge) {\n var keys = Object.keys(src);\n var i = 0;\n\n while (i < keys.length) {\n if (!merge || merge && dest[keys[i]] === undefined) {\n dest[keys[i]] = src[keys[i]];\n }\n\n i++;\n }\n\n return dest;\n }, 'extend', 'Use `assign`.');\n /**\n * merge the values from src in the dest.\n * means that properties that exist in dest will not be overwritten by src\n * @param {Object} dest\n * @param {Object} src\n * @returns {Object} dest\n */\n\n var merge = deprecate(function merge(dest, src) {\n return extend(dest, src, true);\n }, 'merge', 'Use `assign`.');\n /**\n * simple class inheritance\n * @param {Function} child\n * @param {Function} base\n * @param {Object} [properties]\n */\n\n function inherit(child, base, properties) {\n var baseP = base.prototype,\n childP;\n childP = child.prototype = Object.create(baseP);\n childP.constructor = child;\n childP._super = baseP;\n\n if (properties) {\n assign(childP, properties);\n }\n }\n /**\n * simple function bind\n * @param {Function} fn\n * @param {Object} context\n * @returns {Function}\n */\n\n\n function bindFn(fn, context) {\n return function boundFn() {\n return fn.apply(context, arguments);\n };\n }\n /**\n * let a boolean value also be a function that must return a boolean\n * this first item in args will be used as the context\n * @param {Boolean|Function} val\n * @param {Array} [args]\n * @returns {Boolean}\n */\n\n\n function boolOrFn(val, args) {\n if (typeof val == TYPE_FUNCTION) {\n return val.apply(args ? args[0] || undefined : undefined, args);\n }\n\n return val;\n }\n /**\n * use the val2 when val1 is undefined\n * @param {*} val1\n * @param {*} val2\n * @returns {*}\n */\n\n\n function ifUndefined(val1, val2) {\n return val1 === undefined ? val2 : val1;\n }\n /**\n * addEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\n\n\n function addEventListeners(target, types, handler) {\n each(splitStr(types), function (type) {\n target.addEventListener(type, handler, false);\n });\n }\n /**\n * removeEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\n\n\n function removeEventListeners(target, types, handler) {\n each(splitStr(types), function (type) {\n target.removeEventListener(type, handler, false);\n });\n }\n /**\n * find if a node is in the given parent\n * @method hasParent\n * @param {HTMLElement} node\n * @param {HTMLElement} parent\n * @return {Boolean} found\n */\n\n\n function hasParent(node, parent) {\n while (node) {\n if (node == parent) {\n return true;\n }\n\n node = node.parentNode;\n }\n\n return false;\n }\n /**\n * small indexOf wrapper\n * @param {String} str\n * @param {String} find\n * @returns {Boolean} found\n */\n\n\n function inStr(str, find) {\n return str.indexOf(find) > -1;\n }\n /**\n * split string on whitespace\n * @param {String} str\n * @returns {Array} words\n */\n\n\n function splitStr(str) {\n return str.trim().split(/\\s+/g);\n }\n /**\n * find if a array contains the object using indexOf or a simple polyFill\n * @param {Array} src\n * @param {String} find\n * @param {String} [findByKey]\n * @return {Boolean|Number} false when not found, or the index\n */\n\n\n function inArray(src, find, findByKey) {\n if (src.indexOf && !findByKey) {\n return src.indexOf(find);\n } else {\n var i = 0;\n\n while (i < src.length) {\n if (findByKey && src[i][findByKey] == find || !findByKey && src[i] === find) {\n return i;\n }\n\n i++;\n }\n\n return -1;\n }\n }\n /**\n * convert array-like objects to real arrays\n * @param {Object} obj\n * @returns {Array}\n */\n\n\n function toArray(obj) {\n return Array.prototype.slice.call(obj, 0);\n }\n /**\n * unique array with objects based on a key (like 'id') or just by the array's value\n * @param {Array} src [{id:1},{id:2},{id:1}]\n * @param {String} [key]\n * @param {Boolean} [sort=False]\n * @returns {Array} [{id:1},{id:2}]\n */\n\n\n function uniqueArray(src, key, sort) {\n var results = [];\n var values = [];\n var i = 0;\n\n while (i < src.length) {\n var val = key ? src[i][key] : src[i];\n\n if (inArray(values, val) < 0) {\n results.push(src[i]);\n }\n\n values[i] = val;\n i++;\n }\n\n if (sort) {\n if (!key) {\n results = results.sort();\n } else {\n results = results.sort(function sortUniqueArray(a, b) {\n return a[key] > b[key];\n });\n }\n }\n\n return results;\n }\n /**\n * get the prefixed property\n * @param {Object} obj\n * @param {String} property\n * @returns {String|Undefined} prefixed\n */\n\n\n function prefixed(obj, property) {\n var prefix, prop;\n var camelProp = property[0].toUpperCase() + property.slice(1);\n var i = 0;\n\n while (i < VENDOR_PREFIXES.length) {\n prefix = VENDOR_PREFIXES[i];\n prop = prefix ? prefix + camelProp : property;\n\n if (prop in obj) {\n return prop;\n }\n\n i++;\n }\n\n return undefined;\n }\n /**\n * get a unique id\n * @returns {number} uniqueId\n */\n\n\n var _uniqueId = 1;\n\n function uniqueId() {\n return _uniqueId++;\n }\n /**\n * get the window object of an element\n * @param {HTMLElement} element\n * @returns {DocumentView|Window}\n */\n\n\n function getWindowForElement(element) {\n var doc = element.ownerDocument || element;\n return doc.defaultView || doc.parentWindow || window;\n }\n\n var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;\n var SUPPORT_TOUCH = ('ontouchstart' in window);\n var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;\n var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);\n var INPUT_TYPE_TOUCH = 'touch';\n var INPUT_TYPE_PEN = 'pen';\n var INPUT_TYPE_MOUSE = 'mouse';\n var INPUT_TYPE_KINECT = 'kinect';\n var COMPUTE_INTERVAL = 25;\n var INPUT_START = 1;\n var INPUT_MOVE = 2;\n var INPUT_END = 4;\n var INPUT_CANCEL = 8;\n var DIRECTION_NONE = 1;\n var DIRECTION_LEFT = 2;\n var DIRECTION_RIGHT = 4;\n var DIRECTION_UP = 8;\n var DIRECTION_DOWN = 16;\n var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;\n var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;\n var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;\n var PROPS_XY = ['x', 'y'];\n var PROPS_CLIENT_XY = ['clientX', 'clientY'];\n /**\n * create new input type manager\n * @param {Manager} manager\n * @param {Function} callback\n * @returns {Input}\n * @constructor\n */\n\n function Input(manager, callback) {\n var self = this;\n this.manager = manager;\n this.callback = callback;\n this.element = manager.element;\n this.target = manager.options.inputTarget; // smaller wrapper around the handler, for the scope and the enabled state of the manager,\n // so when disabled the input events are completely bypassed.\n\n this.domHandler = function (ev) {\n if (boolOrFn(manager.options.enable, [manager])) {\n self.handler(ev);\n }\n };\n\n this.init();\n }\n\n Input.prototype = {\n /**\n * should handle the inputEvent data and trigger the callback\n * @virtual\n */\n handler: function handler() {},\n\n /**\n * bind the events\n */\n init: function init() {\n this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n },\n\n /**\n * unbind the events\n */\n destroy: function destroy() {\n this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n }\n };\n /**\n * create new input type manager\n * called by the Manager constructor\n * @param {Hammer} manager\n * @returns {Input}\n */\n\n function createInputInstance(manager) {\n var Type;\n var inputClass = manager.options.inputClass;\n\n if (inputClass) {\n Type = inputClass;\n } else if (SUPPORT_POINTER_EVENTS) {\n Type = PointerEventInput;\n } else if (SUPPORT_ONLY_TOUCH) {\n Type = TouchInput;\n } else if (!SUPPORT_TOUCH) {\n Type = MouseInput;\n } else {\n Type = TouchMouseInput;\n }\n\n return new Type(manager, inputHandler);\n }\n /**\n * handle input events\n * @param {Manager} manager\n * @param {String} eventType\n * @param {Object} input\n */\n\n\n function inputHandler(manager, eventType, input) {\n var pointersLen = input.pointers.length;\n var changedPointersLen = input.changedPointers.length;\n var isFirst = eventType & INPUT_START && pointersLen - changedPointersLen === 0;\n var isFinal = eventType & (INPUT_END | INPUT_CANCEL) && pointersLen - changedPointersLen === 0;\n input.isFirst = !!isFirst;\n input.isFinal = !!isFinal;\n\n if (isFirst) {\n manager.session = {};\n } // source event is the normalized value of the domEvents\n // like 'touchstart, mouseup, pointerdown'\n\n\n input.eventType = eventType; // compute scale, rotation etc\n\n computeInputData(manager, input); // emit secret event\n\n manager.emit('hammer.input', input);\n manager.recognize(input);\n manager.session.prevInput = input;\n }\n /**\n * extend the data with some usable properties like scale, rotate, velocity etc\n * @param {Object} manager\n * @param {Object} input\n */\n\n\n function computeInputData(manager, input) {\n var session = manager.session;\n var pointers = input.pointers;\n var pointersLength = pointers.length; // store the first input to calculate the distance and direction\n\n if (!session.firstInput) {\n session.firstInput = simpleCloneInputData(input);\n } // to compute scale and rotation we need to store the multiple touches\n\n\n if (pointersLength > 1 && !session.firstMultiple) {\n session.firstMultiple = simpleCloneInputData(input);\n } else if (pointersLength === 1) {\n session.firstMultiple = false;\n }\n\n var firstInput = session.firstInput;\n var firstMultiple = session.firstMultiple;\n var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;\n var center = input.center = getCenter(pointers);\n input.timeStamp = now();\n input.deltaTime = input.timeStamp - firstInput.timeStamp;\n input.angle = getAngle(offsetCenter, center);\n input.distance = getDistance(offsetCenter, center);\n computeDeltaXY(session, input);\n input.offsetDirection = getDirection(input.deltaX, input.deltaY);\n var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);\n input.overallVelocityX = overallVelocity.x;\n input.overallVelocityY = overallVelocity.y;\n input.overallVelocity = abs(overallVelocity.x) > abs(overallVelocity.y) ? overallVelocity.x : overallVelocity.y;\n input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;\n input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;\n input.maxPointers = !session.prevInput ? input.pointers.length : input.pointers.length > session.prevInput.maxPointers ? input.pointers.length : session.prevInput.maxPointers;\n computeIntervalInputData(session, input); // find the correct target\n\n var target = manager.element;\n\n if (hasParent(input.srcEvent.target, target)) {\n target = input.srcEvent.target;\n }\n\n input.target = target;\n }\n\n function computeDeltaXY(session, input) {\n var center = input.center;\n var offset = session.offsetDelta || {};\n var prevDelta = session.prevDelta || {};\n var prevInput = session.prevInput || {};\n\n if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {\n prevDelta = session.prevDelta = {\n x: prevInput.deltaX || 0,\n y: prevInput.deltaY || 0\n };\n offset = session.offsetDelta = {\n x: center.x,\n y: center.y\n };\n }\n\n input.deltaX = prevDelta.x + (center.x - offset.x);\n input.deltaY = prevDelta.y + (center.y - offset.y);\n }\n /**\n * velocity is calculated every x ms\n * @param {Object} session\n * @param {Object} input\n */\n\n\n function computeIntervalInputData(session, input) {\n var last = session.lastInterval || input,\n deltaTime = input.timeStamp - last.timeStamp,\n velocity,\n velocityX,\n velocityY,\n direction;\n\n if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {\n var deltaX = input.deltaX - last.deltaX;\n var deltaY = input.deltaY - last.deltaY;\n var v = getVelocity(deltaTime, deltaX, deltaY);\n velocityX = v.x;\n velocityY = v.y;\n velocity = abs(v.x) > abs(v.y) ? v.x : v.y;\n direction = getDirection(deltaX, deltaY);\n session.lastInterval = input;\n } else {\n // use latest velocity info if it doesn't overtake a minimum period\n velocity = last.velocity;\n velocityX = last.velocityX;\n velocityY = last.velocityY;\n direction = last.direction;\n }\n\n input.velocity = velocity;\n input.velocityX = velocityX;\n input.velocityY = velocityY;\n input.direction = direction;\n }\n /**\n * create a simple clone from the input used for storage of firstInput and firstMultiple\n * @param {Object} input\n * @returns {Object} clonedInputData\n */\n\n\n function simpleCloneInputData(input) {\n // make a simple copy of the pointers because we will get a reference if we don't\n // we only need clientXY for the calculations\n var pointers = [];\n var i = 0;\n\n while (i < input.pointers.length) {\n pointers[i] = {\n clientX: round(input.pointers[i].clientX),\n clientY: round(input.pointers[i].clientY)\n };\n i++;\n }\n\n return {\n timeStamp: now(),\n pointers: pointers,\n center: getCenter(pointers),\n deltaX: input.deltaX,\n deltaY: input.deltaY\n };\n }\n /**\n * get the center of all the pointers\n * @param {Array} pointers\n * @return {Object} center contains `x` and `y` properties\n */\n\n\n function getCenter(pointers) {\n var pointersLength = pointers.length; // no need to loop when only one touch\n\n if (pointersLength === 1) {\n return {\n x: round(pointers[0].clientX),\n y: round(pointers[0].clientY)\n };\n }\n\n var x = 0,\n y = 0,\n i = 0;\n\n while (i < pointersLength) {\n x += pointers[i].clientX;\n y += pointers[i].clientY;\n i++;\n }\n\n return {\n x: round(x / pointersLength),\n y: round(y / pointersLength)\n };\n }\n /**\n * calculate the velocity between two points. unit is in px per ms.\n * @param {Number} deltaTime\n * @param {Number} x\n * @param {Number} y\n * @return {Object} velocity `x` and `y`\n */\n\n\n function getVelocity(deltaTime, x, y) {\n return {\n x: x / deltaTime || 0,\n y: y / deltaTime || 0\n };\n }\n /**\n * get the direction between two points\n * @param {Number} x\n * @param {Number} y\n * @return {Number} direction\n */\n\n\n function getDirection(x, y) {\n if (x === y) {\n return DIRECTION_NONE;\n }\n\n if (abs(x) >= abs(y)) {\n return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;\n }\n\n return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;\n }\n /**\n * calculate the absolute distance between two points\n * @param {Object} p1 {x, y}\n * @param {Object} p2 {x, y}\n * @param {Array} [props] containing x and y keys\n * @return {Number} distance\n */\n\n\n function getDistance(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n\n var x = p2[props[0]] - p1[props[0]],\n y = p2[props[1]] - p1[props[1]];\n return Math.sqrt(x * x + y * y);\n }\n /**\n * calculate the angle between two coordinates\n * @param {Object} p1\n * @param {Object} p2\n * @param {Array} [props] containing x and y keys\n * @return {Number} angle\n */\n\n\n function getAngle(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n\n var x = p2[props[0]] - p1[props[0]],\n y = p2[props[1]] - p1[props[1]];\n return Math.atan2(y, x) * 180 / Math.PI;\n }\n /**\n * calculate the rotation degrees between two pointersets\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} rotation\n */\n\n\n function getRotation(start, end) {\n return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);\n }\n /**\n * calculate the scale factor between two pointersets\n * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} scale\n */\n\n\n function getScale(start, end) {\n return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);\n }\n\n var MOUSE_INPUT_MAP = {\n mousedown: INPUT_START,\n mousemove: INPUT_MOVE,\n mouseup: INPUT_END\n };\n var MOUSE_ELEMENT_EVENTS = 'mousedown';\n var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';\n /**\n * Mouse events input\n * @constructor\n * @extends Input\n */\n\n function MouseInput() {\n this.evEl = MOUSE_ELEMENT_EVENTS;\n this.evWin = MOUSE_WINDOW_EVENTS;\n this.pressed = false; // mousedown state\n\n Input.apply(this, arguments);\n }\n\n inherit(MouseInput, Input, {\n /**\n * handle mouse events\n * @param {Object} ev\n */\n handler: function MEhandler(ev) {\n var eventType = MOUSE_INPUT_MAP[ev.type]; // on start we want to have the left mouse button down\n\n if (eventType & INPUT_START && ev.button === 0) {\n this.pressed = true;\n }\n\n if (eventType & INPUT_MOVE && ev.which !== 1) {\n eventType = INPUT_END;\n } // mouse must be down\n\n\n if (!this.pressed) {\n return;\n }\n\n if (eventType & INPUT_END) {\n this.pressed = false;\n }\n\n this.callback(this.manager, eventType, {\n pointers: [ev],\n changedPointers: [ev],\n pointerType: INPUT_TYPE_MOUSE,\n srcEvent: ev\n });\n }\n });\n var POINTER_INPUT_MAP = {\n pointerdown: INPUT_START,\n pointermove: INPUT_MOVE,\n pointerup: INPUT_END,\n pointercancel: INPUT_CANCEL,\n pointerout: INPUT_CANCEL\n }; // in IE10 the pointer types is defined as an enum\n\n var IE10_POINTER_TYPE_ENUM = {\n 2: INPUT_TYPE_TOUCH,\n 3: INPUT_TYPE_PEN,\n 4: INPUT_TYPE_MOUSE,\n 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816\n\n };\n var POINTER_ELEMENT_EVENTS = 'pointerdown';\n var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel'; // IE10 has prefixed support, and case-sensitive\n\n if (window.MSPointerEvent && !window.PointerEvent) {\n POINTER_ELEMENT_EVENTS = 'MSPointerDown';\n POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';\n }\n /**\n * Pointer events input\n * @constructor\n * @extends Input\n */\n\n\n function PointerEventInput() {\n this.evEl = POINTER_ELEMENT_EVENTS;\n this.evWin = POINTER_WINDOW_EVENTS;\n Input.apply(this, arguments);\n this.store = this.manager.session.pointerEvents = [];\n }\n\n inherit(PointerEventInput, Input, {\n /**\n * handle mouse events\n * @param {Object} ev\n */\n handler: function PEhandler(ev) {\n var store = this.store;\n var removePointer = false;\n var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');\n var eventType = POINTER_INPUT_MAP[eventTypeNormalized];\n var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;\n var isTouch = pointerType == INPUT_TYPE_TOUCH; // get index of the event in the store\n\n var storeIndex = inArray(store, ev.pointerId, 'pointerId'); // start and mouse must be down\n\n if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {\n if (storeIndex < 0) {\n store.push(ev);\n storeIndex = store.length - 1;\n }\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n removePointer = true;\n } // it not found, so the pointer hasn't been down (so it's probably a hover)\n\n\n if (storeIndex < 0) {\n return;\n } // update the event in the store\n\n\n store[storeIndex] = ev;\n this.callback(this.manager, eventType, {\n pointers: store,\n changedPointers: [ev],\n pointerType: pointerType,\n srcEvent: ev\n });\n\n if (removePointer) {\n // remove from the store\n store.splice(storeIndex, 1);\n }\n }\n });\n var SINGLE_TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n };\n var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';\n var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';\n /**\n * Touch events input\n * @constructor\n * @extends Input\n */\n\n function SingleTouchInput() {\n this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;\n this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;\n this.started = false;\n Input.apply(this, arguments);\n }\n\n inherit(SingleTouchInput, Input, {\n handler: function TEhandler(ev) {\n var type = SINGLE_TOUCH_INPUT_MAP[ev.type]; // should we handle the touch events?\n\n if (type === INPUT_START) {\n this.started = true;\n }\n\n if (!this.started) {\n return;\n }\n\n var touches = normalizeSingleTouches.call(this, ev, type); // when done, reset the started state\n\n if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {\n this.started = false;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n }\n });\n /**\n * @this {TouchInput}\n * @param {Object} ev\n * @param {Number} type flag\n * @returns {undefined|Array} [all, changed]\n */\n\n function normalizeSingleTouches(ev, type) {\n var all = toArray(ev.touches);\n var changed = toArray(ev.changedTouches);\n\n if (type & (INPUT_END | INPUT_CANCEL)) {\n all = uniqueArray(all.concat(changed), 'identifier', true);\n }\n\n return [all, changed];\n }\n\n var TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n };\n var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';\n /**\n * Multi-user touch events input\n * @constructor\n * @extends Input\n */\n\n function TouchInput() {\n this.evTarget = TOUCH_TARGET_EVENTS;\n this.targetIds = {};\n Input.apply(this, arguments);\n }\n\n inherit(TouchInput, Input, {\n handler: function MTEhandler(ev) {\n var type = TOUCH_INPUT_MAP[ev.type];\n var touches = getTouches.call(this, ev, type);\n\n if (!touches) {\n return;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n }\n });\n /**\n * @this {TouchInput}\n * @param {Object} ev\n * @param {Number} type flag\n * @returns {undefined|Array} [all, changed]\n */\n\n function getTouches(ev, type) {\n var allTouches = toArray(ev.touches);\n var targetIds = this.targetIds; // when there is only one touch, the process can be simplified\n\n if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {\n targetIds[allTouches[0].identifier] = true;\n return [allTouches, allTouches];\n }\n\n var i,\n targetTouches,\n changedTouches = toArray(ev.changedTouches),\n changedTargetTouches = [],\n target = this.target; // get target touches from touches\n\n targetTouches = allTouches.filter(function (touch) {\n return hasParent(touch.target, target);\n }); // collect touches\n\n if (type === INPUT_START) {\n i = 0;\n\n while (i < targetTouches.length) {\n targetIds[targetTouches[i].identifier] = true;\n i++;\n }\n } // filter changed touches to only contain touches that exist in the collected target ids\n\n\n i = 0;\n\n while (i < changedTouches.length) {\n if (targetIds[changedTouches[i].identifier]) {\n changedTargetTouches.push(changedTouches[i]);\n } // cleanup removed touches\n\n\n if (type & (INPUT_END | INPUT_CANCEL)) {\n delete targetIds[changedTouches[i].identifier];\n }\n\n i++;\n }\n\n if (!changedTargetTouches.length) {\n return;\n }\n\n return [// merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'\n uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true), changedTargetTouches];\n }\n /**\n * Combined touch and mouse input\n *\n * Touch has a higher priority then mouse, and while touching no mouse events are allowed.\n * This because touch devices also emit mouse events while doing a touch.\n *\n * @constructor\n * @extends Input\n */\n\n\n var DEDUP_TIMEOUT = 2500;\n var DEDUP_DISTANCE = 25;\n\n function TouchMouseInput() {\n Input.apply(this, arguments);\n var handler = bindFn(this.handler, this);\n this.touch = new TouchInput(this.manager, handler);\n this.mouse = new MouseInput(this.manager, handler);\n this.primaryTouch = null;\n this.lastTouches = [];\n }\n\n inherit(TouchMouseInput, Input, {\n /**\n * handle mouse and touch events\n * @param {Hammer} manager\n * @param {String} inputEvent\n * @param {Object} inputData\n */\n handler: function TMEhandler(manager, inputEvent, inputData) {\n var isTouch = inputData.pointerType == INPUT_TYPE_TOUCH,\n isMouse = inputData.pointerType == INPUT_TYPE_MOUSE;\n\n if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {\n return;\n } // when we're in a touch event, record touches to de-dupe synthetic mouse event\n\n\n if (isTouch) {\n recordTouches.call(this, inputEvent, inputData);\n } else if (isMouse && isSyntheticEvent.call(this, inputData)) {\n return;\n }\n\n this.callback(manager, inputEvent, inputData);\n },\n\n /**\n * remove the event listeners\n */\n destroy: function destroy() {\n this.touch.destroy();\n this.mouse.destroy();\n }\n });\n\n function recordTouches(eventType, eventData) {\n if (eventType & INPUT_START) {\n this.primaryTouch = eventData.changedPointers[0].identifier;\n setLastTouch.call(this, eventData);\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n setLastTouch.call(this, eventData);\n }\n }\n\n function setLastTouch(eventData) {\n var touch = eventData.changedPointers[0];\n\n if (touch.identifier === this.primaryTouch) {\n var lastTouch = {\n x: touch.clientX,\n y: touch.clientY\n };\n this.lastTouches.push(lastTouch);\n var lts = this.lastTouches;\n\n var removeLastTouch = function removeLastTouch() {\n var i = lts.indexOf(lastTouch);\n\n if (i > -1) {\n lts.splice(i, 1);\n }\n };\n\n setTimeout(removeLastTouch, DEDUP_TIMEOUT);\n }\n }\n\n function isSyntheticEvent(eventData) {\n var x = eventData.srcEvent.clientX,\n y = eventData.srcEvent.clientY;\n\n for (var i = 0; i < this.lastTouches.length; i++) {\n var t = this.lastTouches[i];\n var dx = Math.abs(x - t.x),\n dy = Math.abs(y - t.y);\n\n if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {\n return true;\n }\n }\n\n return false;\n }\n\n var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');\n var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined; // magical touchAction value\n\n var TOUCH_ACTION_COMPUTE = 'compute';\n var TOUCH_ACTION_AUTO = 'auto';\n var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented\n\n var TOUCH_ACTION_NONE = 'none';\n var TOUCH_ACTION_PAN_X = 'pan-x';\n var TOUCH_ACTION_PAN_Y = 'pan-y';\n var TOUCH_ACTION_MAP = getTouchActionProps();\n /**\n * Touch Action\n * sets the touchAction property or uses the js alternative\n * @param {Manager} manager\n * @param {String} value\n * @constructor\n */\n\n function TouchAction(manager, value) {\n this.manager = manager;\n this.set(value);\n }\n\n TouchAction.prototype = {\n /**\n * set the touchAction value on the element or enable the polyfill\n * @param {String} value\n */\n set: function set(value) {\n // find out the touch-action by the event handlers\n if (value == TOUCH_ACTION_COMPUTE) {\n value = this.compute();\n }\n\n if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {\n this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;\n }\n\n this.actions = value.toLowerCase().trim();\n },\n\n /**\n * just re-set the touchAction value\n */\n update: function update() {\n this.set(this.manager.options.touchAction);\n },\n\n /**\n * compute the value for the touchAction property based on the recognizer's settings\n * @returns {String} value\n */\n compute: function compute() {\n var actions = [];\n each(this.manager.recognizers, function (recognizer) {\n if (boolOrFn(recognizer.options.enable, [recognizer])) {\n actions = actions.concat(recognizer.getTouchAction());\n }\n });\n return cleanTouchActions(actions.join(' '));\n },\n\n /**\n * this method is called on each input cycle and provides the preventing of the browser behavior\n * @param {Object} input\n */\n preventDefaults: function preventDefaults(input) {\n var srcEvent = input.srcEvent;\n var direction = input.offsetDirection; // if the touch action did prevented once this session\n\n if (this.manager.session.prevented) {\n srcEvent.preventDefault();\n return;\n }\n\n var actions = this.actions;\n var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];\n\n if (hasNone) {\n //do not prevent defaults if this is a tap gesture\n var isTapPointer = input.pointers.length === 1;\n var isTapMovement = input.distance < 2;\n var isTapTouchTime = input.deltaTime < 250;\n\n if (isTapPointer && isTapMovement && isTapTouchTime) {\n return;\n }\n }\n\n if (hasPanX && hasPanY) {\n // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent\n return;\n }\n\n if (hasNone || hasPanY && direction & DIRECTION_HORIZONTAL || hasPanX && direction & DIRECTION_VERTICAL) {\n return this.preventSrc(srcEvent);\n }\n },\n\n /**\n * call preventDefault to prevent the browser's default behavior (scrolling in most cases)\n * @param {Object} srcEvent\n */\n preventSrc: function preventSrc(srcEvent) {\n this.manager.session.prevented = true;\n srcEvent.preventDefault();\n }\n };\n /**\n * when the touchActions are collected they are not a valid value, so we need to clean things up. *\n * @param {String} actions\n * @returns {*}\n */\n\n function cleanTouchActions(actions) {\n // none\n if (inStr(actions, TOUCH_ACTION_NONE)) {\n return TOUCH_ACTION_NONE;\n }\n\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); // if both pan-x and pan-y are set (different recognizers\n // for different directions, e.g. horizontal pan but vertical swipe?)\n // we need none (as otherwise with pan-x pan-y combined none of these\n // recognizers will work, since the browser would handle all panning\n\n if (hasPanX && hasPanY) {\n return TOUCH_ACTION_NONE;\n } // pan-x OR pan-y\n\n\n if (hasPanX || hasPanY) {\n return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;\n } // manipulation\n\n\n if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {\n return TOUCH_ACTION_MANIPULATION;\n }\n\n return TOUCH_ACTION_AUTO;\n }\n\n function getTouchActionProps() {\n if (!NATIVE_TOUCH_ACTION) {\n return false;\n }\n\n var touchMap = {};\n var cssSupports = window.CSS && window.CSS.supports;\n ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function (val) {\n // If css.supports is not supported but there is native touch-action assume it supports\n // all values. This is the case for IE 10 and 11.\n touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;\n });\n return touchMap;\n }\n /**\n * Recognizer flow explained; *\n * All recognizers have the initial state of POSSIBLE when a input session starts.\n * The definition of a input session is from the first input until the last input, with all it's movement in it. *\n * Example session for mouse-input: mousedown -> mousemove -> mouseup\n *\n * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed\n * which determines with state it should be.\n *\n * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to\n * POSSIBLE to give it another change on the next cycle.\n *\n * Possible\n * |\n * +-----+---------------+\n * | |\n * +-----+-----+ |\n * | | |\n * Failed Cancelled |\n * +-------+------+\n * | |\n * Recognized Began\n * |\n * Changed\n * |\n * Ended/Recognized\n */\n\n\n var STATE_POSSIBLE = 1;\n var STATE_BEGAN = 2;\n var STATE_CHANGED = 4;\n var STATE_ENDED = 8;\n var STATE_RECOGNIZED = STATE_ENDED;\n var STATE_CANCELLED = 16;\n var STATE_FAILED = 32;\n /**\n * Recognizer\n * Every recognizer needs to extend from this class.\n * @constructor\n * @param {Object} options\n */\n\n function Recognizer(options) {\n this.options = assign({}, this.defaults, options || {});\n this.id = uniqueId();\n this.manager = null; // default is enable true\n\n this.options.enable = ifUndefined(this.options.enable, true);\n this.state = STATE_POSSIBLE;\n this.simultaneous = {};\n this.requireFail = [];\n }\n\n Recognizer.prototype = {\n /**\n * @virtual\n * @type {Object}\n */\n defaults: {},\n\n /**\n * set options\n * @param {Object} options\n * @return {Recognizer}\n */\n set: function set(options) {\n assign(this.options, options); // also update the touchAction, in case something changed about the directions/enabled state\n\n this.manager && this.manager.touchAction.update();\n return this;\n },\n\n /**\n * recognize simultaneous with an other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n recognizeWith: function recognizeWith(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {\n return this;\n }\n\n var simultaneous = this.simultaneous;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n\n if (!simultaneous[otherRecognizer.id]) {\n simultaneous[otherRecognizer.id] = otherRecognizer;\n otherRecognizer.recognizeWith(this);\n }\n\n return this;\n },\n\n /**\n * drop the simultaneous link. it doesnt remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n dropRecognizeWith: function dropRecognizeWith(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n delete this.simultaneous[otherRecognizer.id];\n return this;\n },\n\n /**\n * recognizer can only run when an other is failing\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n requireFailure: function requireFailure(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {\n return this;\n }\n\n var requireFail = this.requireFail;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n\n if (inArray(requireFail, otherRecognizer) === -1) {\n requireFail.push(otherRecognizer);\n otherRecognizer.requireFailure(this);\n }\n\n return this;\n },\n\n /**\n * drop the requireFailure link. it does not remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n dropRequireFailure: function dropRequireFailure(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n var index = inArray(this.requireFail, otherRecognizer);\n\n if (index > -1) {\n this.requireFail.splice(index, 1);\n }\n\n return this;\n },\n\n /**\n * has require failures boolean\n * @returns {boolean}\n */\n hasRequireFailures: function hasRequireFailures() {\n return this.requireFail.length > 0;\n },\n\n /**\n * if the recognizer can recognize simultaneous with an other recognizer\n * @param {Recognizer} otherRecognizer\n * @returns {Boolean}\n */\n canRecognizeWith: function canRecognizeWith(otherRecognizer) {\n return !!this.simultaneous[otherRecognizer.id];\n },\n\n /**\n * You should use `tryEmit` instead of `emit` directly to check\n * that all the needed recognizers has failed before emitting.\n * @param {Object} input\n */\n emit: function emit(input) {\n var self = this;\n var state = this.state;\n\n function emit(event) {\n self.manager.emit(event, input);\n } // 'panstart' and 'panmove'\n\n\n if (state < STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n\n emit(self.options.event); // simple 'eventName' events\n\n if (input.additionalEvent) {\n // additional event(panleft, panright, pinchin, pinchout...)\n emit(input.additionalEvent);\n } // panend and pancancel\n\n\n if (state >= STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n },\n\n /**\n * Check that all the require failure recognizers has failed,\n * if true, it emits a gesture event,\n * otherwise, setup the state to FAILED.\n * @param {Object} input\n */\n tryEmit: function tryEmit(input) {\n if (this.canEmit()) {\n return this.emit(input);\n } // it's failing anyway\n\n\n this.state = STATE_FAILED;\n },\n\n /**\n * can we emit?\n * @returns {boolean}\n */\n canEmit: function canEmit() {\n var i = 0;\n\n while (i < this.requireFail.length) {\n if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {\n return false;\n }\n\n i++;\n }\n\n return true;\n },\n\n /**\n * update the recognizer\n * @param {Object} inputData\n */\n recognize: function recognize(inputData) {\n // make a new copy of the inputData\n // so we can change the inputData without messing up the other recognizers\n var inputDataClone = assign({}, inputData); // is is enabled and allow recognizing?\n\n if (!boolOrFn(this.options.enable, [this, inputDataClone])) {\n this.reset();\n this.state = STATE_FAILED;\n return;\n } // reset when we've reached the end\n\n\n if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {\n this.state = STATE_POSSIBLE;\n }\n\n this.state = this.process(inputDataClone); // the recognizer has recognized a gesture\n // so trigger an event\n\n if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {\n this.tryEmit(inputDataClone);\n }\n },\n\n /**\n * return the state of the recognizer\n * the actual recognizing happens in this method\n * @virtual\n * @param {Object} inputData\n * @returns {Const} STATE\n */\n process: function process(inputData) {},\n // jshint ignore:line\n\n /**\n * return the preferred touch-action\n * @virtual\n * @returns {Array}\n */\n getTouchAction: function getTouchAction() {},\n\n /**\n * called when the gesture isn't allowed to recognize\n * like when another is being recognized or it is disabled\n * @virtual\n */\n reset: function reset() {}\n };\n /**\n * get a usable string, used as event postfix\n * @param {Const} state\n * @returns {String} state\n */\n\n function stateStr(state) {\n if (state & STATE_CANCELLED) {\n return 'cancel';\n } else if (state & STATE_ENDED) {\n return 'end';\n } else if (state & STATE_CHANGED) {\n return 'move';\n } else if (state & STATE_BEGAN) {\n return 'start';\n }\n\n return '';\n }\n /**\n * direction cons to string\n * @param {Const} direction\n * @returns {String}\n */\n\n\n function directionStr(direction) {\n if (direction == DIRECTION_DOWN) {\n return 'down';\n } else if (direction == DIRECTION_UP) {\n return 'up';\n } else if (direction == DIRECTION_LEFT) {\n return 'left';\n } else if (direction == DIRECTION_RIGHT) {\n return 'right';\n }\n\n return '';\n }\n /**\n * get a recognizer by name if it is bound to a manager\n * @param {Recognizer|String} otherRecognizer\n * @param {Recognizer} recognizer\n * @returns {Recognizer}\n */\n\n\n function getRecognizerByNameIfManager(otherRecognizer, recognizer) {\n var manager = recognizer.manager;\n\n if (manager) {\n return manager.get(otherRecognizer);\n }\n\n return otherRecognizer;\n }\n /**\n * This recognizer is just used as a base for the simple attribute recognizers.\n * @constructor\n * @extends Recognizer\n */\n\n\n function AttrRecognizer() {\n Recognizer.apply(this, arguments);\n }\n\n inherit(AttrRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof AttrRecognizer\n */\n defaults: {\n /**\n * @type {Number}\n * @default 1\n */\n pointers: 1\n },\n\n /**\n * Used to check if it the recognizer receives valid input, like input.distance > 10.\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {Boolean} recognized\n */\n attrTest: function attrTest(input) {\n var optionPointers = this.options.pointers;\n return optionPointers === 0 || input.pointers.length === optionPointers;\n },\n\n /**\n * Process the input and return the state for the recognizer\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {*} State\n */\n process: function process(input) {\n var state = this.state;\n var eventType = input.eventType;\n var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);\n var isValid = this.attrTest(input); // on cancel input and we've recognized before, return STATE_CANCELLED\n\n if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {\n return state | STATE_CANCELLED;\n } else if (isRecognized || isValid) {\n if (eventType & INPUT_END) {\n return state | STATE_ENDED;\n } else if (!(state & STATE_BEGAN)) {\n return STATE_BEGAN;\n }\n\n return state | STATE_CHANGED;\n }\n\n return STATE_FAILED;\n }\n });\n /**\n * Pan\n * Recognized when the pointer is down and moved in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\n\n function PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n this.pX = null;\n this.pY = null;\n }\n\n inherit(PanRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof PanRecognizer\n */\n defaults: {\n event: 'pan',\n threshold: 10,\n pointers: 1,\n direction: DIRECTION_ALL\n },\n getTouchAction: function getTouchAction() {\n var direction = this.options.direction;\n var actions = [];\n\n if (direction & DIRECTION_HORIZONTAL) {\n actions.push(TOUCH_ACTION_PAN_Y);\n }\n\n if (direction & DIRECTION_VERTICAL) {\n actions.push(TOUCH_ACTION_PAN_X);\n }\n\n return actions;\n },\n directionTest: function directionTest(input) {\n var options = this.options;\n var hasMoved = true;\n var distance = input.distance;\n var direction = input.direction;\n var x = input.deltaX;\n var y = input.deltaY; // lock to axis?\n\n if (!(direction & options.direction)) {\n if (options.direction & DIRECTION_HORIZONTAL) {\n direction = x === 0 ? DIRECTION_NONE : x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;\n hasMoved = x != this.pX;\n distance = Math.abs(input.deltaX);\n } else {\n direction = y === 0 ? DIRECTION_NONE : y < 0 ? DIRECTION_UP : DIRECTION_DOWN;\n hasMoved = y != this.pY;\n distance = Math.abs(input.deltaY);\n }\n }\n\n input.direction = direction;\n return hasMoved && distance > options.threshold && direction & options.direction;\n },\n attrTest: function attrTest(input) {\n return AttrRecognizer.prototype.attrTest.call(this, input) && (this.state & STATE_BEGAN || !(this.state & STATE_BEGAN) && this.directionTest(input));\n },\n emit: function emit(input) {\n this.pX = input.deltaX;\n this.pY = input.deltaY;\n var direction = directionStr(input.direction);\n\n if (direction) {\n input.additionalEvent = this.options.event + direction;\n }\n\n this._super.emit.call(this, input);\n }\n });\n /**\n * Pinch\n * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * @constructor\n * @extends AttrRecognizer\n */\n\n function PinchRecognizer() {\n AttrRecognizer.apply(this, arguments);\n }\n\n inherit(PinchRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof PinchRecognizer\n */\n defaults: {\n event: 'pinch',\n threshold: 0,\n pointers: 2\n },\n getTouchAction: function getTouchAction() {\n return [TOUCH_ACTION_NONE];\n },\n attrTest: function attrTest(input) {\n return this._super.attrTest.call(this, input) && (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);\n },\n emit: function emit(input) {\n if (input.scale !== 1) {\n var inOut = input.scale < 1 ? 'in' : 'out';\n input.additionalEvent = this.options.event + inOut;\n }\n\n this._super.emit.call(this, input);\n }\n });\n /**\n * Press\n * Recognized when the pointer is down for x ms without any movement.\n * @constructor\n * @extends Recognizer\n */\n\n function PressRecognizer() {\n Recognizer.apply(this, arguments);\n this._timer = null;\n this._input = null;\n }\n\n inherit(PressRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof PressRecognizer\n */\n defaults: {\n event: 'press',\n pointers: 1,\n time: 251,\n // minimal time of the pointer to be pressed\n threshold: 9 // a minimal movement is ok, but keep it low\n\n },\n getTouchAction: function getTouchAction() {\n return [TOUCH_ACTION_AUTO];\n },\n process: function process(input) {\n var options = this.options;\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTime = input.deltaTime > options.time;\n this._input = input; // we only allow little movement\n // and we've reached an end event, so a tap is possible\n\n if (!validMovement || !validPointers || input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime) {\n this.reset();\n } else if (input.eventType & INPUT_START) {\n this.reset();\n this._timer = setTimeoutContext(function () {\n this.state = STATE_RECOGNIZED;\n this.tryEmit();\n }, options.time, this);\n } else if (input.eventType & INPUT_END) {\n return STATE_RECOGNIZED;\n }\n\n return STATE_FAILED;\n },\n reset: function reset() {\n clearTimeout(this._timer);\n },\n emit: function emit(input) {\n if (this.state !== STATE_RECOGNIZED) {\n return;\n }\n\n if (input && input.eventType & INPUT_END) {\n this.manager.emit(this.options.event + 'up', input);\n } else {\n this._input.timeStamp = now();\n this.manager.emit(this.options.event, this._input);\n }\n }\n });\n /**\n * Rotate\n * Recognized when two or more pointer are moving in a circular motion.\n * @constructor\n * @extends AttrRecognizer\n */\n\n function RotateRecognizer() {\n AttrRecognizer.apply(this, arguments);\n }\n\n inherit(RotateRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof RotateRecognizer\n */\n defaults: {\n event: 'rotate',\n threshold: 0,\n pointers: 2\n },\n getTouchAction: function getTouchAction() {\n return [TOUCH_ACTION_NONE];\n },\n attrTest: function attrTest(input) {\n return this._super.attrTest.call(this, input) && (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);\n }\n });\n /**\n * Swipe\n * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\n\n function SwipeRecognizer() {\n AttrRecognizer.apply(this, arguments);\n }\n\n inherit(SwipeRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof SwipeRecognizer\n */\n defaults: {\n event: 'swipe',\n threshold: 10,\n velocity: 0.3,\n direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,\n pointers: 1\n },\n getTouchAction: function getTouchAction() {\n return PanRecognizer.prototype.getTouchAction.call(this);\n },\n attrTest: function attrTest(input) {\n var direction = this.options.direction;\n var velocity;\n\n if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {\n velocity = input.overallVelocity;\n } else if (direction & DIRECTION_HORIZONTAL) {\n velocity = input.overallVelocityX;\n } else if (direction & DIRECTION_VERTICAL) {\n velocity = input.overallVelocityY;\n }\n\n return this._super.attrTest.call(this, input) && direction & input.offsetDirection && input.distance > this.options.threshold && input.maxPointers == this.options.pointers && abs(velocity) > this.options.velocity && input.eventType & INPUT_END;\n },\n emit: function emit(input) {\n var direction = directionStr(input.offsetDirection);\n\n if (direction) {\n this.manager.emit(this.options.event + direction, input);\n }\n\n this.manager.emit(this.options.event, input);\n }\n });\n /**\n * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur\n * between the given interval and position. The delay option can be used to recognize multi-taps without firing\n * a single tap.\n *\n * The eventData from the emitted event contains the property `tapCount`, which contains the amount of\n * multi-taps being recognized.\n * @constructor\n * @extends Recognizer\n */\n\n function TapRecognizer() {\n Recognizer.apply(this, arguments); // previous time and center,\n // used for tap counting\n\n this.pTime = false;\n this.pCenter = false;\n this._timer = null;\n this._input = null;\n this.count = 0;\n }\n\n inherit(TapRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof PinchRecognizer\n */\n defaults: {\n event: 'tap',\n pointers: 1,\n taps: 1,\n interval: 300,\n // max time between the multi-tap taps\n time: 250,\n // max time of the pointer to be down (like finger on the screen)\n threshold: 9,\n // a minimal movement is ok, but keep it low\n posThreshold: 10 // a multi-tap can be a bit off the initial position\n\n },\n getTouchAction: function getTouchAction() {\n return [TOUCH_ACTION_MANIPULATION];\n },\n process: function process(input) {\n var options = this.options;\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTouchTime = input.deltaTime < options.time;\n this.reset();\n\n if (input.eventType & INPUT_START && this.count === 0) {\n return this.failTimeout();\n } // we only allow little movement\n // and we've reached an end event, so a tap is possible\n\n\n if (validMovement && validTouchTime && validPointers) {\n if (input.eventType != INPUT_END) {\n return this.failTimeout();\n }\n\n var validInterval = this.pTime ? input.timeStamp - this.pTime < options.interval : true;\n var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;\n this.pTime = input.timeStamp;\n this.pCenter = input.center;\n\n if (!validMultiTap || !validInterval) {\n this.count = 1;\n } else {\n this.count += 1;\n }\n\n this._input = input; // if tap count matches we have recognized it,\n // else it has began recognizing...\n\n var tapCount = this.count % options.taps;\n\n if (tapCount === 0) {\n // no failing requirements, immediately trigger the tap event\n // or wait as long as the multitap interval to trigger\n if (!this.hasRequireFailures()) {\n return STATE_RECOGNIZED;\n } else {\n this._timer = setTimeoutContext(function () {\n this.state = STATE_RECOGNIZED;\n this.tryEmit();\n }, options.interval, this);\n return STATE_BEGAN;\n }\n }\n }\n\n return STATE_FAILED;\n },\n failTimeout: function failTimeout() {\n this._timer = setTimeoutContext(function () {\n this.state = STATE_FAILED;\n }, this.options.interval, this);\n return STATE_FAILED;\n },\n reset: function reset() {\n clearTimeout(this._timer);\n },\n emit: function emit() {\n if (this.state == STATE_RECOGNIZED) {\n this._input.tapCount = this.count;\n this.manager.emit(this.options.event, this._input);\n }\n }\n });\n /**\n * Simple way to create a manager with a default set of recognizers.\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\n\n function Hammer(element, options) {\n options = options || {};\n options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);\n return new Manager(element, options);\n }\n /**\n * @const {string}\n */\n\n\n Hammer.VERSION = '2.0.7';\n /**\n * default settings\n * @namespace\n */\n\n Hammer.defaults = {\n /**\n * set if DOM events are being triggered.\n * But this is slower and unused by simple implementations, so disabled by default.\n * @type {Boolean}\n * @default false\n */\n domEvents: false,\n\n /**\n * The value for the touchAction property/fallback.\n * When set to `compute` it will magically set the correct value based on the added recognizers.\n * @type {String}\n * @default compute\n */\n touchAction: TOUCH_ACTION_COMPUTE,\n\n /**\n * @type {Boolean}\n * @default true\n */\n enable: true,\n\n /**\n * EXPERIMENTAL FEATURE -- can be removed/changed\n * Change the parent input target element.\n * If Null, then it is being set the to main element.\n * @type {Null|EventTarget}\n * @default null\n */\n inputTarget: null,\n\n /**\n * force an input class\n * @type {Null|Function}\n * @default null\n */\n inputClass: null,\n\n /**\n * Default recognizer setup when calling `Hammer()`\n * When creating a new Manager these will be skipped.\n * @type {Array}\n */\n preset: [// RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]\n [RotateRecognizer, {\n enable: false\n }], [PinchRecognizer, {\n enable: false\n }, ['rotate']], [SwipeRecognizer, {\n direction: DIRECTION_HORIZONTAL\n }], [PanRecognizer, {\n direction: DIRECTION_HORIZONTAL\n }, ['swipe']], [TapRecognizer], [TapRecognizer, {\n event: 'doubletap',\n taps: 2\n }, ['tap']], [PressRecognizer]],\n\n /**\n * Some CSS properties can be used to improve the working of Hammer.\n * Add them to this method and they will be set when creating a new Manager.\n * @namespace\n */\n cssProps: {\n /**\n * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userSelect: 'none',\n\n /**\n * Disable the Windows Phone grippers when pressing an element.\n * @type {String}\n * @default 'none'\n */\n touchSelect: 'none',\n\n /**\n * Disables the default callout shown when you touch and hold a touch target.\n * On iOS, when you touch and hold a touch target such as a link, Safari displays\n * a callout containing information about the link. This property allows you to disable that callout.\n * @type {String}\n * @default 'none'\n */\n touchCallout: 'none',\n\n /**\n * Specifies whether zooming is enabled. Used by IE10>\n * @type {String}\n * @default 'none'\n */\n contentZooming: 'none',\n\n /**\n * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userDrag: 'none',\n\n /**\n * Overrides the highlight color shown when the user taps a link or a JavaScript\n * clickable element in iOS. This property obeys the alpha value, if specified.\n * @type {String}\n * @default 'rgba(0,0,0,0)'\n */\n tapHighlightColor: 'rgba(0,0,0,0)'\n }\n };\n var STOP = 1;\n var FORCED_STOP = 2;\n /**\n * Manager\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\n\n function Manager(element, options) {\n this.options = assign({}, Hammer.defaults, options || {});\n this.options.inputTarget = this.options.inputTarget || element;\n this.handlers = {};\n this.session = {};\n this.recognizers = [];\n this.oldCssProps = {};\n this.element = element;\n this.input = createInputInstance(this);\n this.touchAction = new TouchAction(this, this.options.touchAction);\n toggleCssProps(this, true);\n each(this.options.recognizers, function (item) {\n var recognizer = this.add(new item[0](item[1]));\n item[2] && recognizer.recognizeWith(item[2]);\n item[3] && recognizer.requireFailure(item[3]);\n }, this);\n }\n\n Manager.prototype = {\n /**\n * set options\n * @param {Object} options\n * @returns {Manager}\n */\n set: function set(options) {\n assign(this.options, options); // Options that need a little more setup\n\n if (options.touchAction) {\n this.touchAction.update();\n }\n\n if (options.inputTarget) {\n // Clean up existing event listeners and reinitialize\n this.input.destroy();\n this.input.target = options.inputTarget;\n this.input.init();\n }\n\n return this;\n },\n\n /**\n * stop recognizing for this session.\n * This session will be discarded, when a new [input]start event is fired.\n * When forced, the recognizer cycle is stopped immediately.\n * @param {Boolean} [force]\n */\n stop: function stop(force) {\n this.session.stopped = force ? FORCED_STOP : STOP;\n },\n\n /**\n * run the recognizers!\n * called by the inputHandler function on every movement of the pointers (touches)\n * it walks through all the recognizers and tries to detect the gesture that is being made\n * @param {Object} inputData\n */\n recognize: function recognize(inputData) {\n var session = this.session;\n\n if (session.stopped) {\n return;\n } // run the touch-action polyfill\n\n\n this.touchAction.preventDefaults(inputData);\n var recognizer;\n var recognizers = this.recognizers; // this holds the recognizer that is being recognized.\n // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED\n // if no recognizer is detecting a thing, it is set to `null`\n\n var curRecognizer = session.curRecognizer; // reset when the last recognizer is recognized\n // or when we're in a new session\n\n if (!curRecognizer || curRecognizer && curRecognizer.state & STATE_RECOGNIZED) {\n curRecognizer = session.curRecognizer = null;\n }\n\n var i = 0;\n\n while (i < recognizers.length) {\n recognizer = recognizers[i]; // find out if we are allowed try to recognize the input for this one.\n // 1. allow if the session is NOT forced stopped (see the .stop() method)\n // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one\n // that is being recognized.\n // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.\n // this can be setup with the `recognizeWith()` method on the recognizer.\n\n if (session.stopped !== FORCED_STOP && ( // 1\n !curRecognizer || recognizer == curRecognizer || // 2\n recognizer.canRecognizeWith(curRecognizer))) {\n // 3\n recognizer.recognize(inputData);\n } else {\n recognizer.reset();\n } // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the\n // current active recognizer. but only if we don't already have an active recognizer\n\n\n if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {\n curRecognizer = session.curRecognizer = recognizer;\n }\n\n i++;\n }\n },\n\n /**\n * get a recognizer by its event name.\n * @param {Recognizer|String} recognizer\n * @returns {Recognizer|Null}\n */\n get: function get(recognizer) {\n if (recognizer instanceof Recognizer) {\n return recognizer;\n }\n\n var recognizers = this.recognizers;\n\n for (var i = 0; i < recognizers.length; i++) {\n if (recognizers[i].options.event == recognizer) {\n return recognizers[i];\n }\n }\n\n return null;\n },\n\n /**\n * add a recognizer to the manager\n * existing recognizers with the same event name will be removed\n * @param {Recognizer} recognizer\n * @returns {Recognizer|Manager}\n */\n add: function add(recognizer) {\n if (invokeArrayArg(recognizer, 'add', this)) {\n return this;\n } // remove existing\n\n\n var existing = this.get(recognizer.options.event);\n\n if (existing) {\n this.remove(existing);\n }\n\n this.recognizers.push(recognizer);\n recognizer.manager = this;\n this.touchAction.update();\n return recognizer;\n },\n\n /**\n * remove a recognizer by name or instance\n * @param {Recognizer|String} recognizer\n * @returns {Manager}\n */\n remove: function remove(recognizer) {\n if (invokeArrayArg(recognizer, 'remove', this)) {\n return this;\n }\n\n recognizer = this.get(recognizer); // let's make sure this recognizer exists\n\n if (recognizer) {\n var recognizers = this.recognizers;\n var index = inArray(recognizers, recognizer);\n\n if (index !== -1) {\n recognizers.splice(index, 1);\n this.touchAction.update();\n }\n }\n\n return this;\n },\n\n /**\n * bind event\n * @param {String} events\n * @param {Function} handler\n * @returns {EventEmitter} this\n */\n on: function on(events, handler) {\n if (events === undefined) {\n return;\n }\n\n if (handler === undefined) {\n return;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function (event) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n });\n return this;\n },\n\n /**\n * unbind event, leave emit blank to remove all handlers\n * @param {String} events\n * @param {Function} [handler]\n * @returns {EventEmitter} this\n */\n off: function off(events, handler) {\n if (events === undefined) {\n return;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function (event) {\n if (!handler) {\n delete handlers[event];\n } else {\n handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);\n }\n });\n return this;\n },\n\n /**\n * emit event to the listeners\n * @param {String} event\n * @param {Object} data\n */\n emit: function emit(event, data) {\n // we also want to trigger dom events\n if (this.options.domEvents) {\n triggerDomEvent(event, data);\n } // no handlers, so skip it all\n\n\n var handlers = this.handlers[event] && this.handlers[event].slice();\n\n if (!handlers || !handlers.length) {\n return;\n }\n\n data.type = event;\n\n data.preventDefault = function () {\n data.srcEvent.preventDefault();\n };\n\n var i = 0;\n\n while (i < handlers.length) {\n handlers[i](data);\n i++;\n }\n },\n\n /**\n * destroy the manager and unbinds all events\n * it doesn't unbind dom events, that is the user own responsibility\n */\n destroy: function destroy() {\n this.element && toggleCssProps(this, false);\n this.handlers = {};\n this.session = {};\n this.input.destroy();\n this.element = null;\n }\n };\n /**\n * add/remove the css properties as defined in manager.options.cssProps\n * @param {Manager} manager\n * @param {Boolean} add\n */\n\n function toggleCssProps(manager, add) {\n var element = manager.element;\n\n if (!element.style) {\n return;\n }\n\n var prop;\n each(manager.options.cssProps, function (value, name) {\n prop = prefixed(element.style, name);\n\n if (add) {\n manager.oldCssProps[prop] = element.style[prop];\n element.style[prop] = value;\n } else {\n element.style[prop] = manager.oldCssProps[prop] || '';\n }\n });\n\n if (!add) {\n manager.oldCssProps = {};\n }\n }\n /**\n * trigger dom event\n * @param {String} event\n * @param {Object} data\n */\n\n\n function triggerDomEvent(event, data) {\n var gestureEvent = document.createEvent('Event');\n gestureEvent.initEvent(event, true, true);\n gestureEvent.gesture = data;\n data.target.dispatchEvent(gestureEvent);\n }\n\n assign(Hammer, {\n INPUT_START: INPUT_START,\n INPUT_MOVE: INPUT_MOVE,\n INPUT_END: INPUT_END,\n INPUT_CANCEL: INPUT_CANCEL,\n STATE_POSSIBLE: STATE_POSSIBLE,\n STATE_BEGAN: STATE_BEGAN,\n STATE_CHANGED: STATE_CHANGED,\n STATE_ENDED: STATE_ENDED,\n STATE_RECOGNIZED: STATE_RECOGNIZED,\n STATE_CANCELLED: STATE_CANCELLED,\n STATE_FAILED: STATE_FAILED,\n DIRECTION_NONE: DIRECTION_NONE,\n DIRECTION_LEFT: DIRECTION_LEFT,\n DIRECTION_RIGHT: DIRECTION_RIGHT,\n DIRECTION_UP: DIRECTION_UP,\n DIRECTION_DOWN: DIRECTION_DOWN,\n DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,\n DIRECTION_VERTICAL: DIRECTION_VERTICAL,\n DIRECTION_ALL: DIRECTION_ALL,\n Manager: Manager,\n Input: Input,\n TouchAction: TouchAction,\n TouchInput: TouchInput,\n MouseInput: MouseInput,\n PointerEventInput: PointerEventInput,\n TouchMouseInput: TouchMouseInput,\n SingleTouchInput: SingleTouchInput,\n Recognizer: Recognizer,\n AttrRecognizer: AttrRecognizer,\n Tap: TapRecognizer,\n Pan: PanRecognizer,\n Swipe: SwipeRecognizer,\n Pinch: PinchRecognizer,\n Rotate: RotateRecognizer,\n Press: PressRecognizer,\n on: addEventListeners,\n off: removeEventListeners,\n each: each,\n merge: merge,\n extend: extend,\n assign: assign,\n inherit: inherit,\n bindFn: bindFn,\n prefixed: prefixed\n }); // this prevents errors when Hammer is loaded in the presence of an AMD\n // style loader but by script tag, not by the loader.\n\n var freeGlobal = typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}; // jshint ignore:line\n\n freeGlobal.Hammer = Hammer;\n\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return Hammer;\n });\n } else if (typeof module != 'undefined' && module.exports) {\n module.exports = Hammer;\n } else {\n window[exportName] = Hammer;\n }\n})(window, document, 'Hammer');"],"sourceRoot":""}