{"version":3,"file":"polymer.js","sources":["../../polymer-gestures/src/scope.js","../../polymer-gestures/src/targetfind.js","../../polymer-gestures/src/touch-action.js","../../polymer-gestures/src/eventFactory.js","../../polymer-gestures/src/pointermap.js","../../polymer-gestures/src/dispatcher.js","../../polymer-gestures/src/mouse.js","../../polymer-gestures/src/touch.js","../../polymer-gestures/src/ms.js","../../polymer-gestures/src/pointer.js","../../polymer-gestures/src/platform-events.js","../../polymer-gestures/src/track.js","../../polymer-gestures/src/hold.js","../../polymer-gestures/src/tap.js","../../polymer-expressions/third_party/esprima/esprima.js","../../polymer-expressions/src/polymer-expressions.js","polymer-versioned.js","../src/boot.js","../src/lib/lang.js","../src/lib/job.js","../src/lib/dom.js","../src/lib/super.js","../src/lib/deserialize.js","../src/api.js","../src/instance/utils.js","../src/instance/events.js","../src/instance/attributes.js","../src/instance/properties.js","../src/instance/mdv.js","../src/instance/base.js","../src/instance/styles.js","../src/declaration/polymer.js","../src/declaration/path.js","../src/declaration/styles.js","../src/declaration/events.js","../src/declaration/properties.js","../src/declaration/attributes.js","../src/declaration/mdv.js","../src/declaration/prototype.js","../src/declaration/queue.js","../src/declaration/import.js","../src/declaration/polymer-element.js","../src/lib/auto-binding.js"],"names":["window","PolymerGestures","scope","HAS_FULL_PATH","pathTest","document","createElement","createShadowRoot","sr","s","appendChild","addEventListener","ev","path","stopPropagation","CustomEvent","bubbles","head","dispatchEvent","parentNode","removeChild","target","shadow","inEl","shadowRoot","webkitShadowRoot","canTarget","Boolean","elementFromPoint","targetingShadow","this","olderShadow","os","olderShadowRoot","se","querySelector","allShadows","element","shadows","push","searchRoot","inRoot","x","y","t","owner","nodeType","Node","DOCUMENT_NODE","DOCUMENT_FRAGMENT_NODE","findTarget","inEvent","clientX","clientY","findTouchAction","n","i","length","ELEMENT_NODE","hasAttribute","getAttribute","host","LCA","a","b","contains","adepth","depth","bdepth","d","walk","u","deepContains","common","insideNode","node","rect","getBoundingClientRect","left","right","top","bottom","targetFinding","bind","shadowSelector","v","selector","rule","attrib2css","selectors","styles","hasTouchAction","style","touchAction","hasShadowRoot","ShadowDOMPolyfill","forEach","r","String","map","el","textContent","MOUSE_PROPS","MOUSE_DEFAULTS","NOP_FACTORY","eventFactory","preventTap","makeBaseEvent","inType","inDict","e","createEvent","initEvent","cancelable","makeGestureEvent","Object","create","k","keys","makePointerEvent","p","buttons","pressure","pointerId","width","height","tiltX","tiltY","pointerType","hwTimestamp","isPrimary","_source","PointerMap","USE_MAP","m","Map","pointers","POINTERS_FN","values","prototype","size","set","inId","indexOf","has","delete","splice","get","clear","callback","thisArg","call","CLONE_PROPS","CLONE_DEFAULTS","HAS_SVG_INSTANCE","SVGElementInstance","dispatcher","pointermap","eventMap","eventSources","eventSourceList","gestures","dependencyMap","down","listeners","index","up","gestureQueue","registerSource","name","source","newEvents","events","registerGesture","obj","g","exposes","toLowerCase","register","initial","es","l","unregister","fireEvent","move","type","fillGestureQueue","cancel","tapPrevented","eventHandler","_handledByPG","fn","listen","addEvent","unlisten","removeEvent","eventName","boundHandler","removeEventListener","makeEvent","preventDefault","_target","cloneEvent","eventCopy","correspondingUseElement","clone","gestureTrigger","j","enabled","requestAnimationFrame","boundGestureTrigger","activateGesture","gesture","dep","recognizer","_pgListeners","actionNode","defaultActions","setAttribute","handler","capture","deactivateGesture","DEDUP_DIST","WHICH_TO_BUTTONS","HAS_BUTTONS","MouseEvent","mouseEvents","POINTER_ID","POINTER_TYPE","lastTouches","isEventSimulatedFromTouch","lts","dx","Math","abs","dy","prepareEvent","which","mousedown","mouseup","mousemove","cleanupMouse","relatedTarget","DEDUP_TIMEOUT","Array","CLICK_COUNT_TIMEOUT","HYSTERESIS","HAS_TOUCH_ACTION","touchEvents","scrollTypes","EMITTER","XSCROLLER","YSCROLLER","touchActionToScrollType","st","firstTouch","isPrimaryTouch","inTouch","identifier","setPrimaryTouch","firstXY","X","Y","scrolling","cancelResetClickCount","removePrimaryPointer","inPointer","resetClickCount","clickCount","resetId","setTimeout","clearTimeout","typeToButtons","ret","touch","id","currentTouchEvent","fastPath","touchToPointer","cte","detail","webkitRadiusX","radiusX","webkitRadiusY","radiusY","webkitForce","force","self","processTouches","inFunction","tl","changedTouches","_cancel","cleanUpPointer","shouldScroll","scrollAxis","oa","da","doa","findTouch","inTL","vacuumTouches","touches","value","key","touchstart","dedupSynthMouse","touchmove","dd","sqrt","touchcancel","touchend","lt","HAS_BITMAP_TYPE","MSPointerEvent","MSPOINTER_TYPE_MOUSE","msEvents","POINTER_TYPES","cleanup","MSPointerDown","MSPointerMove","MSPointerUp","MSPointerCancel","pointerEvents","pointerdown","pointermove","pointerup","pointercancel","nav","navigator","PointerEvent","msPointerEnabled","undefined","ontouchstart","isSafari","userAgent","match","body","track","trackx","tracky","WIGGLE_THRESHOLD","clampDir","inDelta","calcPositionDelta","inA","inB","pageX","pageY","fireTrack","inTrackingData","downEvent","lastMoveEvent","xDirection","yDirection","gestureProto","trackInfo","ddx","screenX","ddy","screenY","downTarget","tracking","hold","HOLD_DELAY","heldPointer","holdJob","pulse","Date","now","timeStamp","held","fireHold","clearInterval","setInterval","inHoldTime","holdTime","tap","shouldTap","downState","start","altKey","ctrlKey","metaKey","shiftKey","global","assert","condition","message","Error","isDecimalDigit","ch","isWhiteSpace","fromCharCode","isLineTerminator","isIdentifierStart","isIdentifierPart","isKeyword","skipWhitespace","charCodeAt","getIdentifier","slice","scanIdentifier","Token","Identifier","Keyword","NullLiteral","BooleanLiteral","range","scanPunctuator","code2","ch2","code","ch1","Punctuator","throwError","Messages","UnexpectedToken","scanNumericLiteral","number","NumericLiteral","parseFloat","scanStringLiteral","quote","str","octal","StringLiteral","isIdentifierName","token","advance","EOF","lex","lookahead","peek","pos","messageFormat","error","args","arguments","msg","replace","whole","description","throwUnexpected","expect","matchKeyword","keyword","parseArrayInitialiser","elements","parseExpression","delegate","createArrayExpression","parseObjectPropertyKey","createLiteral","createIdentifier","parseObjectProperty","createProperty","parseObjectInitialiser","properties","createObjectExpression","parseGroupExpression","expr","parsePrimaryExpression","createThisExpression","parseArguments","parseNonComputedProperty","parseNonComputedMember","parseComputedMember","parseLeftHandSideExpression","property","createMemberExpression","createCallExpression","parseUnaryExpression","parsePostfixExpression","createUnaryExpression","binaryPrecedence","prec","parseBinaryExpression","stack","operator","pop","createBinaryExpression","parseConditionalExpression","consequent","alternate","createConditionalExpression","parseFilter","createFilter","parseFilters","parseTopLevel","Syntax","parseInExpression","parseAsExpression","createTopLevel","createAsExpression","indexName","createInExpression","parse","inDelegate","state","labelSet","TokenName","ArrayExpression","BinaryExpression","CallExpression","ConditionalExpression","EmptyStatement","ExpressionStatement","Literal","LabeledStatement","LogicalExpression","MemberExpression","ObjectExpression","Program","Property","ThisExpression","UnaryExpression","UnknownLabel","Redeclaration","esprima","prepareBinding","expressionText","filterRegistry","expression","getExpression","scopeIdent","tagName","ex","console","model","oneTime","binding","getBinding","polymerExpressionScopeIdent_","indexIdent","polymerExpressionIndexIdent_","expressionParseCache","ASTDelegate","Expression","valueFn_","IdentPath","Path","object","accessor","computed","dynamicDeps","simplePath","getFn","Filter","notImplemented","arg","valueFn","filters","deps","currentPath","ConstantObservable","value_","convertStylePropertyName","c","findScope","prop","parentScopeName","hasOwnProperty","isLiteralExpression","pathString","isNaN","Number","PolymerExpressions","observer","addPath","getValueFrom","setValue","newValue","setValueFrom",{"end":{"file":"../../polymer-expressions/src/polymer-expressions.js","comments_before":[],"nlb":false,"endpos":3539,"pos":3531,"col":8,"line":117,"value":"fullPath","type":"name"},"start":{"file":"../../polymer-expressions/src/polymer-expressions.js","comments_before":[],"nlb":false,"endpos":3539,"pos":3531,"col":8,"line":117,"value":"fullPath","type":"name"},"name":"fullPath"},"fullPath","fullPath_","parts","context","propName","transform","toModelDirection","initialArgs","toModel","toDOM","apply","unaryOperators","+","-","!","binaryOperators","*","/","%","<",">","<=",">=","==","!=","===","!==","&&","||","op","argument","test","ident","filter","arr","kind","open","discardChanges","deliver","close","firstTime","firstValue","startReset","getValue","finishReset","setValueFn","CompoundObserver","ObserverTransform","count","random","toString","styleObject","join","tokenList","tokens","prepareInstancePositionChanged","template","templateInstance","valid","PathObserver","prepareInstanceModel","scopeName","parentScope","createScopeObject","__proto__","defineProperty","configurable","writable","Polymer","version","extend","api","getOwnPropertyNames","pd","getOwnPropertyDescriptor","nom","job","wait","stop","Job","go","inContext","boundComplete","complete","h","handle","cancelAnimationFrame","registry","HTMLElement","tag","getPrototypeForTag","getPrototypeOf","originalStopPropagation","Event","cancelBubble","$super","arrayOfArgs","caller","_super","nameInThis","warn","memoizeSuper","n$","method","proto","nextSuper","super","noopHandler","deserializeValue","currentValue","inferredType","typeHandlers","string","date","boolean","parseInt","JSON","function","declaration","instance","publish","apis","utils","async","timeout","Platform","flush","cancelAsync","fire","onNode","event","asyncFire","classFollows","anew","old","className","classList","remove","add","injectBoundHTML","html","innerHTML","fragment","instanceTemplate","nop","nob","asyncMethod","log","logFlags","EVENT_PREFIX","addHostListeners","eventDelegates","localName","methodName","getEventHandler","dispatchMethod","group","groupEnd","attributes","copyInstanceAttributes","a$","_instanceAttributes","takeAttributes","_publishLC","attributeToProperty","propertyForAttribute","search","bindPattern","stringValue","serializeValue","reflectPropertyToAttribute","serializedValue","removeAttribute","areSameValue","numberIsNaN","resolveBindingValue","oldValue","updateRecord","createPropertyObserver","_observeNames","o","_propertyObserver","registerObserver","observeArrayValue","openPropertyObserver","notifyPropertyChanges","newValues","oldValues","paths","called","observe","ov","nv","invokeMethod","deliverChanges","propertyChanged_","reflect","callbackName","isArray","closeNamedObserver","ArrayObserver","registerNamedObserver","emitPropertyChangeRecord","Observer","hasObjectObserve","notifier","notifier_","getNotifier","notify","bindToAccessor","observable","resolveFn","privateName","privateObservable","resolvedValue","createComputedProperties","_computedNames","syntax","bindProperty","_observers","closeObservers","observers","o$","_namedObservers","closeNamedObservers","mdv","bindingDelegate","dom","createInstance","bindings_","enableBindingsReflection","path_","_recordBinding","mixinSuper","bindFinished","makeElementReady","asyncUnbindAll","_unbound","unbind","_unbindAllJob","unbindAll","cancelUnbindAll","mustachePattern","isBase","PolymerBase","base","created","ready","createdCallback","prepareElement","ownerDocument","isStagingDocument","_elementPrepared","shadowRoots","_readied","parseDeclarations","attachedCallback","attached","enteredView","hasBeenAttached","domReady","detachedCallback","preventDispose","detached","leftView","enteredViewCallback","leftViewCallback","enteredDocumentCallback","leftDocumentCallback","parseDeclaration","elementElement","fetchTemplate","root","shadowFromTemplate","shadowRootReady","lightFromTemplate","refNode","eventController","insertBefore","marshalNodeReferences","$","querySelectorAll","attributeChangedCallback","attributeChanged","onMutation","listener","MutationObserver","mutations","disconnect","childList","subtree","constructor","Base","shimCssText","cssText","is","ShadowCSS","makeScopeSelector","hasShadowDOMPolyfill","STYLE_SCOPE_ATTRIBUTE","STYLE_CONTROLLER_SCOPE","installControllerStyles","findStyleScope","scopeHasNamedStyle","cssTextForScope","installScopeCssText","installScopeStyle","cssTextToScopeStyle","applyStyleToScope","styleCacheForScope","cache","polyfillScopeStyleCache","_scopeStyles","script","_currentScript","getRegisteredPrototype","registerPrototype","notifyPrototype","waitingForPrototype","client","waitPrototype","registerWhenReady","prototypesByName","declarations","deliverDeclarations","resolveElementPaths","urlResolver","resolveDom","addResolvePathApi","assetPath","URL","baseURI","resolvePath","urlPath","href","importRuleForSheet","sheet","baseUrl","createStyleElement","attr","firstElementChild","s$","nextElementSibling","cssTextFromSheet","__resource","matchesSelector","inSelector","matches","STYLE_SELECTOR","STYLE_LOADABLE_MATCH","SHEET_SELECTOR","STYLE_GLOBAL_SCOPE","SCOPE_ATTR","loadStyles","content","templateContent","convertSheetsToStyles","findLoadableStyles","templateUrl","styleResolver","copySheetAttributes","replaceChild","link","loadables","installSheets","cacheSheets","cacheStyles","installLocalSheets","installGlobalStyles","sheets","findNodes","firstChild","matcher","nodes","array","templateNodes","concat","styleForScope","scopeDescriptor","webkitMatchesSelector","mozMatchesSelector","mixedCaseEventTypes","parseHostEvents","delegates","addAttributeDelegates","hasEventPrefix","removeEventPrefix","trim","prefixLength","findController","controller","currentTarget","prepareEventBinding","eventType","bindingValue","inferObservers","explodeObservers","exploded","ni","names","split","optimizePropertyMaps","_publishNames","publishProperties","requireProperties","lowerCaseMap","propertyInfos","createPropertyAccessor","createPropertyAccessors","ATTRIBUTES_ATTRIBUTE","ATTRIBUTES_REGEX","inheritAttributesObjects","inheritObject","publishAttributes","accumulateInstanceAttributes","clonable","isInstanceAttribute","blackList","extends","noscript","assetpath","cache-csstext","installBindingDelegate","ensurePrototypeTraversal","ancestor","extendeeName","buildPrototype","publishConstructor","extension","generateBasePrototype","desugarBeforeChaining","chainPrototypes","desugarAfterChaining","inheritMetaData","chained","chainObject","extendee","shimStyling","registerCallback","symbol","ctor","extnds","findBasePrototype","ensureBaseApi","memoizedBases","extended","mixinMethod","info","typeExtension","findTypeExtension","registerElement","inherited","queueForElement","mainQueue","importQueue","nextQueued","whenPolymerReady","queue","waitToReady","CustomElements","HTMLImports","whenImportsReady","addReadyCallback","check","__queue","enqueue","shouldAdd","useNative","readied","flushable","addToFlushQueue","shift","nextElement","canReady","isEmpty","flushQueue","flushing","upgradeDocumentTree","flushReadyCallbacks","readyCallbacks","whenReady","importElements","elementOrFragment","importUrls","urls","url","frag","createDocumentFragment","rel","import","isRegistered","isCustomTag","init","loadResources","registered","waitingForQueue","waitingForResources","_register","handleNoScript","_needsResources","makeSyntax"],"mappings":";;;;;;;;;;AASAA,OAAOC,mBCAP,SAAUC,GACR,GAAIC,IAAgB,EAGhBC,EAAWC,SAASC,cAAc,OACtC,IAAIF,EAASG,iBAAkB,CAC7B,GAAIC,GAAKJ,EAASG,mBACdE,EAAIJ,SAASC,cAAc,OAC/BE,GAAGE,YAAYD,GACfL,EAASO,iBAAiB,WAAY,SAASC,GACzCA,EAAGC,OAELV,EAAgBS,EAAGC,KAAK,KAAOJ,GAEjCG,EAAGE,mBAEL,IAAIF,GAAK,GAAIG,aAAY,YAAaC,SAAS,GAE/CX,UAASY,KAAKP,YAAYN,GAC1BK,EAAES,cAAcN,GA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IACX8I,GAAOwxB,eAAiB,WAAa,MAAOrqB,GAAKkP,MAEjD,IAAIuQ,GAAS,GAAIjO,oBACb/C,EAAiBgR,EAAOhR,cAK5B,OAJAgR,GAAOhR,eAAiB,SAAS4C,EAAY3Y,EAAM9F,GACjD,MAAOiG,GAAO2xB,oBAAoBnZ,EAAY3Y,EAAM9F,IAC7C6b,EAAejX,KAAKioB,EAAQpO,EAAY3Y,EAAM9F,IAEhD6sB","sourcesContent":["/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\nwindow.PolymerGestures = {};\n","/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n var HAS_FULL_PATH = false;\n\n // test for full event path support\n var pathTest = document.createElement('meta');\n if (pathTest.createShadowRoot) {\n var sr = pathTest.createShadowRoot();\n var s = document.createElement('span');\n sr.appendChild(s);\n pathTest.addEventListener('testpath', function(ev) {\n if (ev.path) {\n // if the span is in the event path, then path[0] is the real source for all events\n HAS_FULL_PATH = ev.path[0] === s;\n }\n ev.stopPropagation();\n });\n var ev = new CustomEvent('testpath', {bubbles: true});\n // must add node to DOM to trigger event listener\n document.head.appendChild(pathTest);\n s.dispatchEvent(ev);\n pathTest.parentNode.removeChild(pathTest);\n sr = s = null;\n }\n pathTest = null;\n\n var target = {\n shadow: function(inEl) {\n if (inEl) {\n return inEl.shadowRoot || inEl.webkitShadowRoot;\n }\n },\n canTarget: function(shadow) {\n return shadow && Boolean(shadow.elementFromPoint);\n },\n targetingShadow: function(inEl) {\n var s = this.shadow(inEl);\n if (this.canTarget(s)) {\n return s;\n }\n },\n olderShadow: function(shadow) {\n var os = shadow.olderShadowRoot;\n if (!os) {\n var se = shadow.querySelector('shadow');\n if (se) {\n os = se.olderShadowRoot;\n }\n }\n return os;\n },\n allShadows: function(element) {\n var shadows = [], s = this.shadow(element);\n while(s) {\n shadows.push(s);\n s = this.olderShadow(s);\n }\n return shadows;\n },\n searchRoot: function(inRoot, x, y) {\n var t, st, sr, os;\n if (inRoot) {\n t = inRoot.elementFromPoint(x, y);\n if (t) {\n // found element, check if it has a ShadowRoot\n sr = this.targetingShadow(t);\n } else if (inRoot !== document) {\n // check for sibling roots\n sr = this.olderShadow(inRoot);\n }\n // search other roots, fall back to light dom element\n return this.searchRoot(sr, x, y) || t;\n }\n },\n owner: function(element) {\n if (!element) {\n return document;\n }\n var s = element;\n // walk up until you hit the shadow root or document\n while (s.parentNode) {\n s = s.parentNode;\n }\n // the owner element is expected to be a Document or ShadowRoot\n if (s.nodeType != Node.DOCUMENT_NODE && s.nodeType != Node.DOCUMENT_FRAGMENT_NODE) {\n s = document;\n }\n return s;\n },\n findTarget: function(inEvent) {\n if (HAS_FULL_PATH && inEvent.path) {\n return inEvent.path[0];\n }\n var x = inEvent.clientX, y = inEvent.clientY;\n // if the listener is in the shadow root, it is much faster to start there\n var s = this.owner(inEvent.target);\n // if x, y is not in this root, fall back to document search\n if (!s.elementFromPoint(x, y)) {\n s = document;\n }\n return this.searchRoot(s, x, y);\n },\n findTouchAction: function(inEvent) {\n var n;\n if (HAS_FULL_PATH && inEvent.path) {\n var path = inEvent.path;\n for (var i = 0; i < path.length; i++) {\n n = path[i];\n if (n.nodeType === Node.ELEMENT_NODE && n.hasAttribute('touch-action')) {\n return n.getAttribute('touch-action');\n }\n }\n } else {\n n = inEvent.target;\n while(n) {\n if (n.hasAttribute('touch-action')) {\n return n.getAttribute('touch-action');\n }\n n = n.parentNode || n.host;\n }\n }\n // auto is default\n return \"auto\";\n },\n LCA: function(a, b) {\n if (a === b) {\n return a;\n }\n if (a && !b) {\n return a;\n }\n if (b && !a) {\n return b;\n }\n if (!b && !a) {\n return document;\n }\n // fast case, a is a direct descendant of b or vice versa\n if (a.contains && a.contains(b)) {\n return a;\n }\n if (b.contains && b.contains(a)) {\n return b;\n }\n var adepth = this.depth(a);\n var bdepth = this.depth(b);\n var d = adepth - bdepth;\n if (d >= 0) {\n a = this.walk(a, d);\n } else {\n b = this.walk(b, -d);\n }\n while (a && b && a !== b) {\n a = a.parentNode || a.host;\n b = b.parentNode || b.host;\n }\n return a;\n },\n walk: function(n, u) {\n for (var i = 0; n && (i < u); i++) {\n n = n.parentNode || n.host;\n }\n return n;\n },\n depth: function(n) {\n var d = 0;\n while(n) {\n d++;\n n = n.parentNode || n.host;\n }\n return d;\n },\n deepContains: function(a, b) {\n var common = this.LCA(a, b);\n // if a is the common ancestor, it must \"deeply\" contain b\n return common === a;\n },\n insideNode: function(node, x, y) {\n var rect = node.getBoundingClientRect();\n return (rect.left <= x) && (x <= rect.right) && (rect.top <= y) && (y <= rect.bottom);\n }\n };\n scope.targetFinding = target;\n /**\n * Given an event, finds the \"deepest\" node that could have been the original target before ShadowDOM retargetting\n *\n * @param {Event} Event An event object with clientX and clientY properties\n * @return {Element} The probable event origninator\n */\n scope.findTarget = target.findTarget.bind(target);\n /**\n * Determines if the \"container\" node deeply contains the \"containee\" node, including situations where the \"containee\" is contained by one or more ShadowDOM\n * roots.\n *\n * @param {Node} container\n * @param {Node} containee\n * @return {Boolean}\n */\n scope.deepContains = target.deepContains.bind(target);\n\n /**\n * Determines if the x/y position is inside the given node.\n *\n * Example:\n *\n * function upHandler(event) {\n * var innode = PolymerGestures.insideNode(event.target, event.clientX, event.clientY);\n * if (innode) {\n * // wait for tap?\n * } else {\n * // tap will never happen\n * }\n * }\n *\n * @param {Node} node\n * @param {Number} x Screen X position\n * @param {Number} y screen Y position\n * @return {Boolean}\n */\n scope.insideNode = target.insideNode;\n\n})(window.PolymerGestures);\n","/*\n *\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n(function() {\n function shadowSelector(v) {\n return 'html /deep/ ' + selector(v);\n }\n function selector(v) {\n return '[touch-action=\"' + v + '\"]';\n }\n function rule(v) {\n return '{ -ms-touch-action: ' + v + '; touch-action: ' + v + ';}';\n }\n var attrib2css = [\n 'none',\n 'auto',\n 'pan-x',\n 'pan-y',\n {\n rule: 'pan-x pan-y',\n selectors: [\n 'pan-x pan-y',\n 'pan-y pan-x'\n ]\n },\n 'manipulation'\n ];\n var styles = '';\n // only install stylesheet if the browser has touch action support\n var hasTouchAction = typeof document.head.style.touchAction === 'string';\n // only add shadow selectors if shadowdom is supported\n var hasShadowRoot = !window.ShadowDOMPolyfill && document.head.createShadowRoot;\n\n if (hasTouchAction) {\n attrib2css.forEach(function(r) {\n if (String(r) === r) {\n styles += selector(r) + rule(r) + '\\n';\n if (hasShadowRoot) {\n styles += shadowSelector(r) + rule(r) + '\\n';\n }\n } else {\n styles += r.selectors.map(selector) + rule(r.rule) + '\\n';\n if (hasShadowRoot) {\n styles += r.selectors.map(shadowSelector) + rule(r.rule) + '\\n';\n }\n }\n });\n\n var el = document.createElement('style');\n el.textContent = styles;\n document.head.appendChild(el);\n }\n})();\n","/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This is the constructor for new PointerEvents.\n *\n * New Pointer Events must be given a type, and an optional dictionary of\n * initialization properties.\n *\n * Due to certain platform requirements, events returned from the constructor\n * identify as MouseEvents.\n *\n * @constructor\n * @param {String} inType The type of the event to create.\n * @param {Object} [inDict] An optional dictionary of initial event properties.\n * @return {Event} A new PointerEvent of type `inType` and initialized with properties from `inDict`.\n */\n(function(scope) {\n\n var MOUSE_PROPS = [\n 'bubbles',\n 'cancelable',\n 'view',\n 'detail',\n 'screenX',\n 'screenY',\n 'clientX',\n 'clientY',\n 'ctrlKey',\n 'altKey',\n 'shiftKey',\n 'metaKey',\n 'button',\n 'relatedTarget',\n 'pageX',\n 'pageY'\n ];\n\n var MOUSE_DEFAULTS = [\n false,\n false,\n null,\n null,\n 0,\n 0,\n 0,\n 0,\n false,\n false,\n false,\n false,\n 0,\n null,\n 0,\n 0\n ];\n\n var NOP_FACTORY = function(){ return function(){}; };\n\n var eventFactory = {\n // TODO(dfreedm): this is overridden by tap recognizer, needs review\n preventTap: NOP_FACTORY,\n makeBaseEvent: function(inType, inDict) {\n var e = document.createEvent('Event');\n e.initEvent(inType, inDict.bubbles || false, inDict.cancelable || false);\n e.preventTap = eventFactory.preventTap(e);\n return e;\n },\n makeGestureEvent: function(inType, inDict) {\n inDict = inDict || Object.create(null);\n\n var e = this.makeBaseEvent(inType, inDict);\n for (var i = 0, keys = Object.keys(inDict), k; i < keys.length; i++) {\n k = keys[i];\n e[k] = inDict[k];\n }\n return e;\n },\n makePointerEvent: function(inType, inDict) {\n inDict = inDict || Object.create(null);\n\n var e = this.makeBaseEvent(inType, inDict);\n // define inherited MouseEvent properties\n for(var i = 0, p; i < MOUSE_PROPS.length; i++) {\n p = MOUSE_PROPS[i];\n e[p] = inDict[p] || MOUSE_DEFAULTS[i];\n }\n e.buttons = inDict.buttons || 0;\n\n // Spec requires that pointers without pressure specified use 0.5 for down\n // state and 0 for up state.\n var pressure = 0;\n if (inDict.pressure) {\n pressure = inDict.pressure;\n } else {\n pressure = e.buttons ? 0.5 : 0;\n }\n\n // add x/y properties aliased to clientX/Y\n e.x = e.clientX;\n e.y = e.clientY;\n\n // define the properties of the PointerEvent interface\n e.pointerId = inDict.pointerId || 0;\n e.width = inDict.width || 0;\n e.height = inDict.height || 0;\n e.pressure = pressure;\n e.tiltX = inDict.tiltX || 0;\n e.tiltY = inDict.tiltY || 0;\n e.pointerType = inDict.pointerType || '';\n e.hwTimestamp = inDict.hwTimestamp || 0;\n e.isPrimary = inDict.isPrimary || false;\n e._source = inDict._source || '';\n return e;\n }\n };\n\n scope.eventFactory = eventFactory;\n})(window.PolymerGestures);\n","/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This module implements an map of pointer states\n */\n(function(scope) {\n var USE_MAP = window.Map && window.Map.prototype.forEach;\n var POINTERS_FN = function(){ return this.size; };\n function PointerMap() {\n if (USE_MAP) {\n var m = new Map();\n m.pointers = POINTERS_FN;\n return m;\n } else {\n this.keys = [];\n this.values = [];\n }\n }\n\n PointerMap.prototype = {\n set: function(inId, inEvent) {\n var i = this.keys.indexOf(inId);\n if (i > -1) {\n this.values[i] = inEvent;\n } else {\n this.keys.push(inId);\n this.values.push(inEvent);\n }\n },\n has: function(inId) {\n return this.keys.indexOf(inId) > -1;\n },\n 'delete': function(inId) {\n var i = this.keys.indexOf(inId);\n if (i > -1) {\n this.keys.splice(i, 1);\n this.values.splice(i, 1);\n }\n },\n get: function(inId) {\n var i = this.keys.indexOf(inId);\n return this.values[i];\n },\n clear: function() {\n this.keys.length = 0;\n this.values.length = 0;\n },\n // return value, key, map\n forEach: function(callback, thisArg) {\n this.values.forEach(function(v, i) {\n callback.call(thisArg, v, this.keys[i], this);\n }, this);\n },\n pointers: function() {\n return this.keys.length;\n }\n };\n\n scope.PointerMap = PointerMap;\n})(window.PolymerGestures);\n","/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n var CLONE_PROPS = [\n // MouseEvent\n 'bubbles',\n 'cancelable',\n 'view',\n 'detail',\n 'screenX',\n 'screenY',\n 'clientX',\n 'clientY',\n 'ctrlKey',\n 'altKey',\n 'shiftKey',\n 'metaKey',\n 'button',\n 'relatedTarget',\n // DOM Level 3\n 'buttons',\n // PointerEvent\n 'pointerId',\n 'width',\n 'height',\n 'pressure',\n 'tiltX',\n 'tiltY',\n 'pointerType',\n 'hwTimestamp',\n 'isPrimary',\n // event instance\n 'type',\n 'target',\n 'currentTarget',\n 'which',\n 'pageX',\n 'pageY',\n 'timeStamp',\n // gesture addons\n 'preventTap',\n 'tapPrevented',\n '_source'\n ];\n\n var CLONE_DEFAULTS = [\n // MouseEvent\n false,\n false,\n null,\n null,\n 0,\n 0,\n 0,\n 0,\n false,\n false,\n false,\n false,\n 0,\n null,\n // DOM Level 3\n 0,\n // PointerEvent\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n '',\n 0,\n false,\n // event instance\n '',\n null,\n null,\n 0,\n 0,\n 0,\n 0,\n function(){},\n false\n ];\n\n var HAS_SVG_INSTANCE = (typeof SVGElementInstance !== 'undefined');\n\n var eventFactory = scope.eventFactory;\n\n /**\n * This module is for normalizing events. Mouse and Touch events will be\n * collected here, and fire PointerEvents that have the same semantics, no\n * matter the source.\n * Events fired:\n * - pointerdown: a pointing is added\n * - pointerup: a pointer is removed\n * - pointermove: a pointer is moved\n * - pointerover: a pointer crosses into an element\n * - pointerout: a pointer leaves an element\n * - pointercancel: a pointer will no longer generate events\n */\n var dispatcher = {\n pointermap: new scope.PointerMap(),\n eventMap: Object.create(null),\n // Scope objects for native events.\n // This exists for ease of testing.\n eventSources: Object.create(null),\n eventSourceList: [],\n gestures: [],\n // map gesture event -> {listeners: int, index: gestures[int]}\n dependencyMap: {\n // make sure down and up are in the map to trigger \"register\"\n down: {listeners: 0, index: -1},\n up: {listeners: 0, index: -1}\n },\n gestureQueue: [],\n /**\n * Add a new event source that will generate pointer events.\n *\n * `inSource` must contain an array of event names named `events`, and\n * functions with the names specified in the `events` array.\n * @param {string} name A name for the event source\n * @param {Object} source A new source of platform events.\n */\n registerSource: function(name, source) {\n var s = source;\n var newEvents = s.events;\n if (newEvents) {\n newEvents.forEach(function(e) {\n if (s[e]) {\n this.eventMap[e] = s[e].bind(s);\n }\n }, this);\n this.eventSources[name] = s;\n this.eventSourceList.push(s);\n }\n },\n registerGesture: function(name, source) {\n var obj = Object.create(null);\n obj.listeners = 0;\n obj.index = this.gestures.length;\n for (var i = 0, g; i < source.exposes.length; i++) {\n g = source.exposes[i].toLowerCase();\n this.dependencyMap[g] = obj;\n }\n this.gestures.push(source);\n },\n register: function(element, initial) {\n var l = this.eventSourceList.length;\n for (var i = 0, es; (i < l) && (es = this.eventSourceList[i]); i++) {\n // call eventsource register\n es.register.call(es, element, initial);\n }\n },\n unregister: function(element) {\n var l = this.eventSourceList.length;\n for (var i = 0, es; (i < l) && (es = this.eventSourceList[i]); i++) {\n // call eventsource register\n es.unregister.call(es, element);\n }\n },\n // EVENTS\n down: function(inEvent) {\n this.fireEvent('down', inEvent);\n },\n move: function(inEvent) {\n // pipe move events into gesture queue directly\n inEvent.type = 'move';\n this.fillGestureQueue(inEvent);\n },\n up: function(inEvent) {\n this.fireEvent('up', inEvent);\n },\n cancel: function(inEvent) {\n inEvent.tapPrevented = true;\n this.fireEvent('up', inEvent);\n },\n // LISTENER LOGIC\n eventHandler: function(inEvent) {\n // This is used to prevent multiple dispatch of events from\n // platform events. This can happen when two elements in different scopes\n // are set up to create pointer events, which is relevant to Shadow DOM.\n\n // TODO(dfreedm): make this check more granular, allow for minimal event generation\n // e.g inEvent._handledByPG['tap'] and inEvent._handledByPG['track'], etc\n if (inEvent._handledByPG) {\n return;\n }\n var type = inEvent.type;\n var fn = this.eventMap && this.eventMap[type];\n if (fn) {\n fn(inEvent);\n }\n inEvent._handledByPG = true;\n },\n // set up event listeners\n listen: function(target, events) {\n for (var i = 0, l = events.length, e; (i < l) && (e = events[i]); i++) {\n this.addEvent(target, e);\n }\n },\n // remove event listeners\n unlisten: function(target, events) {\n for (var i = 0, l = events.length, e; (i < l) && (e = events[i]); i++) {\n this.removeEvent(target, e);\n }\n },\n addEvent: function(target, eventName) {\n target.addEventListener(eventName, this.boundHandler);\n },\n removeEvent: function(target, eventName) {\n target.removeEventListener(eventName, this.boundHandler);\n },\n // EVENT CREATION AND TRACKING\n /**\n * Creates a new Event of type `inType`, based on the information in\n * `inEvent`.\n *\n * @param {string} inType A string representing the type of event to create\n * @param {Event} inEvent A platform event with a target\n * @return {Event} A PointerEvent of type `inType`\n */\n makeEvent: function(inType, inEvent) {\n var e = eventFactory.makePointerEvent(inType, inEvent);\n e.preventDefault = inEvent.preventDefault;\n e.tapPrevented = inEvent.tapPrevented;\n e._target = e._target || inEvent.target;\n return e;\n },\n // make and dispatch an event in one call\n fireEvent: function(inType, inEvent) {\n var e = this.makeEvent(inType, inEvent);\n return this.dispatchEvent(e);\n },\n /**\n * Returns a snapshot of inEvent, with writable properties.\n *\n * @param {Event} inEvent An event that contains properties to copy.\n * @return {Object} An object containing shallow copies of `inEvent`'s\n * properties.\n */\n cloneEvent: function(inEvent) {\n var eventCopy = Object.create(null), p;\n for (var i = 0; i < CLONE_PROPS.length; i++) {\n p = CLONE_PROPS[i];\n eventCopy[p] = inEvent[p] || CLONE_DEFAULTS[i];\n // Work around SVGInstanceElement shadow tree\n // Return the element that is represented by the instance for Safari, Chrome, IE.\n // This is the behavior implemented by Firefox.\n if (p === 'target' || p === 'relatedTarget') {\n if (HAS_SVG_INSTANCE && eventCopy[p] instanceof SVGElementInstance) {\n eventCopy[p] = eventCopy[p].correspondingUseElement;\n }\n }\n }\n // keep the semantics of preventDefault\n eventCopy.preventDefault = function() {\n inEvent.preventDefault();\n };\n return eventCopy;\n },\n /**\n * Dispatches the event to its target.\n *\n * @param {Event} inEvent The event to be dispatched.\n * @return {Boolean} True if an event handler returns true, false otherwise.\n */\n dispatchEvent: function(inEvent) {\n var t = inEvent._target;\n if (t) {\n t.dispatchEvent(inEvent);\n // clone the event for the gesture system to process\n // clone after dispatch to pick up gesture prevention code\n var clone = this.cloneEvent(inEvent);\n clone.target = t;\n this.fillGestureQueue(clone);\n }\n },\n gestureTrigger: function() {\n // process the gesture queue\n for (var i = 0, e; i < this.gestureQueue.length; i++) {\n e = this.gestureQueue[i];\n for (var j = 0, g, fn; j < this.gestures.length; j++) {\n g = this.gestures[j];\n fn = g[e.type];\n if (g.enabled && fn) {\n fn.call(g, e);\n }\n }\n }\n this.gestureQueue.length = 0;\n },\n fillGestureQueue: function(ev) {\n // only trigger the gesture queue once\n if (!this.gestureQueue.length) {\n requestAnimationFrame(this.boundGestureTrigger);\n }\n this.gestureQueue.push(ev);\n }\n };\n dispatcher.boundHandler = dispatcher.eventHandler.bind(dispatcher);\n dispatcher.boundGestureTrigger = dispatcher.gestureTrigger.bind(dispatcher);\n scope.dispatcher = dispatcher;\n\n /**\n * Listen for `gesture` on `node` with the `handler` function\n *\n * If `handler` is the first listener for `gesture`, the underlying gesture recognizer is then enabled.\n *\n * @param {Element} node\n * @param {string} gesture\n * @return Boolean `gesture` is a valid gesture\n */\n scope.activateGesture = function(node, gesture) {\n var g = gesture.toLowerCase();\n var dep = dispatcher.dependencyMap[g];\n if (dep) {\n var recognizer = dispatcher.gestures[dep.index];\n if (dep.listeners === 0) {\n if (recognizer) {\n recognizer.enabled = true;\n }\n }\n dep.listeners++;\n if (!node._pgListeners) {\n dispatcher.register(node);\n node._pgListeners = 0;\n }\n // TODO(dfreedm): re-evaluate bookkeeping to avoid using attributes\n if (recognizer) {\n var touchAction = recognizer.defaultActions && recognizer.defaultActions[g];\n var actionNode;\n switch(node.nodeType) {\n case Node.ELEMENT_NODE:\n actionNode = node;\n break;\n case Node.DOCUMENT_FRAGMENT_NODE:\n actionNode = node.host;\n break;\n default:\n actionNode = null;\n break;\n }\n if (touchAction && actionNode && !actionNode.hasAttribute('touch-action')) {\n actionNode.setAttribute('touch-action', touchAction);\n }\n }\n node._pgListeners++;\n }\n return Boolean(dep);\n };\n\n /**\n *\n * Listen for `gesture` from `node` with `handler` function.\n *\n * @param {Element} node\n * @param {string} gesture\n * @param {Function} handler\n * @param {Boolean} capture\n */\n scope.addEventListener = function(node, gesture, handler, capture) {\n if (handler) {\n scope.activateGesture(node, gesture);\n node.addEventListener(gesture, handler, capture);\n }\n };\n\n /**\n * Tears down the gesture configuration for `node`\n *\n * If `handler` is the last listener for `gesture`, the underlying gesture recognizer is disabled.\n *\n * @param {Element} node\n * @param {string} gesture\n * @return Boolean `gesture` is a valid gesture\n */\n scope.deactivateGesture = function(node, gesture) {\n var g = gesture.toLowerCase();\n var dep = dispatcher.dependencyMap[g];\n if (dep) {\n if (dep.listeners > 0) {\n dep.listeners--;\n }\n if (dep.listeners === 0) {\n var recognizer = dispatcher.gestures[dep.index];\n if (recognizer) {\n recognizer.enabled = false;\n }\n }\n if (node._pgListeners > 0) {\n node._pgListeners--;\n }\n if (node._pgListeners === 0) {\n dispatcher.unregister(node);\n }\n }\n return Boolean(dep);\n };\n\n /**\n * Stop listening for `gesture` from `node` with `handler` function.\n *\n * @param {Element} node\n * @param {string} gesture\n * @param {Function} handler\n * @param {Boolean} capture\n */\n scope.removeEventListener = function(node, gesture, handler, capture) {\n if (handler) {\n scope.deactivateGesture(node, gesture);\n node.removeEventListener(gesture, handler, capture);\n }\n };\n})(window.PolymerGestures);\n","/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n(function (scope) {\n var dispatcher = scope.dispatcher;\n var pointermap = dispatcher.pointermap;\n // radius around touchend that swallows mouse events\n var DEDUP_DIST = 25;\n\n var WHICH_TO_BUTTONS = [0, 1, 4, 2];\n\n var HAS_BUTTONS = false;\n try {\n HAS_BUTTONS = new MouseEvent('test', {buttons: 1}).buttons === 1;\n } catch (e) {}\n\n // handler block for native mouse events\n var mouseEvents = {\n POINTER_ID: 1,\n POINTER_TYPE: 'mouse',\n events: [\n 'mousedown',\n 'mousemove',\n 'mouseup'\n ],\n exposes: [\n 'down',\n 'up',\n 'move'\n ],\n register: function(target) {\n dispatcher.listen(target, this.events);\n },\n unregister: function(target) {\n dispatcher.unlisten(target, this.events);\n },\n lastTouches: [],\n // collide with the global mouse listener\n isEventSimulatedFromTouch: function(inEvent) {\n var lts = this.lastTouches;\n var x = inEvent.clientX, y = inEvent.clientY;\n for (var i = 0, l = lts.length, t; i < l && (t = lts[i]); i++) {\n // simulated mouse events will be swallowed near a primary touchend\n var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);\n if (dx <= DEDUP_DIST && dy <= DEDUP_DIST) {\n return true;\n }\n }\n },\n prepareEvent: function(inEvent) {\n var e = dispatcher.cloneEvent(inEvent);\n e.pointerId = this.POINTER_ID;\n e.isPrimary = true;\n e.pointerType = this.POINTER_TYPE;\n e._source = 'mouse';\n if (!HAS_BUTTONS) {\n e.buttons = WHICH_TO_BUTTONS[e.which] || 0;\n }\n return e;\n },\n mousedown: function(inEvent) {\n if (!this.isEventSimulatedFromTouch(inEvent)) {\n var p = pointermap.has(this.POINTER_ID);\n // TODO(dfreedman) workaround for some elements not sending mouseup\n // http://crbug/149091\n if (p) {\n this.mouseup(inEvent);\n }\n var e = this.prepareEvent(inEvent);\n e.target = scope.findTarget(inEvent);\n pointermap.set(this.POINTER_ID, e.target);\n dispatcher.down(e);\n }\n },\n mousemove: function(inEvent) {\n if (!this.isEventSimulatedFromTouch(inEvent)) {\n var target = pointermap.get(this.POINTER_ID);\n if (target) {\n var e = this.prepareEvent(inEvent);\n e.target = target;\n // handle case where we missed a mouseup\n if (e.buttons === 0) {\n dispatcher.cancel(e);\n this.cleanupMouse();\n } else {\n dispatcher.move(e);\n }\n }\n }\n },\n mouseup: function(inEvent) {\n if (!this.isEventSimulatedFromTouch(inEvent)) {\n var e = this.prepareEvent(inEvent);\n e.relatedTarget = scope.findTarget(inEvent);\n e.target = pointermap.get(this.POINTER_ID);\n dispatcher.up(e);\n this.cleanupMouse();\n }\n },\n cleanupMouse: function() {\n pointermap['delete'](this.POINTER_ID);\n }\n };\n\n scope.mouseEvents = mouseEvents;\n})(window.PolymerGestures);\n","/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n var dispatcher = scope.dispatcher;\n var allShadows = scope.targetFinding.allShadows.bind(scope.targetFinding);\n var pointermap = dispatcher.pointermap;\n var touchMap = Array.prototype.map.call.bind(Array.prototype.map);\n // This should be long enough to ignore compat mouse events made by touch\n var DEDUP_TIMEOUT = 2500;\n var CLICK_COUNT_TIMEOUT = 200;\n var HYSTERESIS = 20;\n var ATTRIB = 'touch-action';\n // TODO(dfreedm): disable until http://crbug.com/399765 is resolved\n // var HAS_TOUCH_ACTION = ATTRIB in document.head.style;\n var HAS_TOUCH_ACTION = false;\n\n // handler block for native touch events\n var touchEvents = {\n events: [\n 'touchstart',\n 'touchmove',\n 'touchend',\n 'touchcancel'\n ],\n exposes: [\n 'down',\n 'up',\n 'move'\n ],\n register: function(target, initial) {\n if (initial) {\n return;\n }\n dispatcher.listen(target, this.events);\n },\n unregister: function(target) {\n dispatcher.unlisten(target, this.events);\n },\n scrollTypes: {\n EMITTER: 'none',\n XSCROLLER: 'pan-x',\n YSCROLLER: 'pan-y',\n },\n touchActionToScrollType: function(touchAction) {\n var t = touchAction;\n var st = this.scrollTypes;\n if (t === st.EMITTER) {\n return 'none';\n } else if (t === st.XSCROLLER) {\n return 'X';\n } else if (t === st.YSCROLLER) {\n return 'Y';\n } else {\n return 'XY';\n }\n },\n POINTER_TYPE: 'touch',\n firstTouch: null,\n isPrimaryTouch: function(inTouch) {\n return this.firstTouch === inTouch.identifier;\n },\n setPrimaryTouch: function(inTouch) {\n // set primary touch if there no pointers, or the only pointer is the mouse\n if (pointermap.pointers() === 0 || (pointermap.pointers() === 1 && pointermap.has(1))) {\n this.firstTouch = inTouch.identifier;\n this.firstXY = {X: inTouch.clientX, Y: inTouch.clientY};\n this.scrolling = null;\n this.cancelResetClickCount();\n }\n },\n removePrimaryPointer: function(inPointer) {\n if (inPointer.isPrimary) {\n this.firstTouch = null;\n this.firstXY = null;\n this.resetClickCount();\n }\n },\n clickCount: 0,\n resetId: null,\n resetClickCount: function() {\n var fn = function() {\n this.clickCount = 0;\n this.resetId = null;\n }.bind(this);\n this.resetId = setTimeout(fn, CLICK_COUNT_TIMEOUT);\n },\n cancelResetClickCount: function() {\n if (this.resetId) {\n clearTimeout(this.resetId);\n }\n },\n typeToButtons: function(type) {\n var ret = 0;\n if (type === 'touchstart' || type === 'touchmove') {\n ret = 1;\n }\n return ret;\n },\n findTarget: function(touch, id) {\n if (this.currentTouchEvent.type === 'touchstart') {\n if (this.isPrimaryTouch(touch)) {\n var fastPath = {\n clientX: touch.clientX,\n clientY: touch.clientY,\n path: this.currentTouchEvent.path,\n target: this.currentTouchEvent.target\n };\n return scope.findTarget(fastPath);\n } else {\n return scope.findTarget(touch);\n }\n }\n // reuse target we found in touchstart\n return pointermap.get(id);\n },\n touchToPointer: function(inTouch) {\n var cte = this.currentTouchEvent;\n var e = dispatcher.cloneEvent(inTouch);\n // Spec specifies that pointerId 1 is reserved for Mouse.\n // Touch identifiers can start at 0.\n // Add 2 to the touch identifier for compatibility.\n var id = e.pointerId = inTouch.identifier + 2;\n e.target = this.findTarget(inTouch, id);\n e.bubbles = true;\n e.cancelable = true;\n e.detail = this.clickCount;\n e.buttons = this.typeToButtons(cte.type);\n e.width = inTouch.webkitRadiusX || inTouch.radiusX || 0;\n e.height = inTouch.webkitRadiusY || inTouch.radiusY || 0;\n e.pressure = inTouch.webkitForce || inTouch.force || 0.5;\n e.isPrimary = this.isPrimaryTouch(inTouch);\n e.pointerType = this.POINTER_TYPE;\n e._source = 'touch';\n // forward touch preventDefaults\n var self = this;\n e.preventDefault = function() {\n self.scrolling = false;\n self.firstXY = null;\n cte.preventDefault();\n };\n return e;\n },\n processTouches: function(inEvent, inFunction) {\n var tl = inEvent.changedTouches;\n this.currentTouchEvent = inEvent;\n for (var i = 0, t, p; i < tl.length; i++) {\n t = tl[i];\n p = this.touchToPointer(t);\n if (inEvent.type === 'touchstart') {\n pointermap.set(p.pointerId, p.target);\n }\n if (pointermap.has(p.pointerId)) {\n inFunction.call(this, p);\n }\n if (inEvent.type === 'touchend' || inEvent._cancel) {\n this.cleanUpPointer(p);\n }\n }\n },\n // For single axis scrollers, determines whether the element should emit\n // pointer events or behave as a scroller\n shouldScroll: function(inEvent) {\n if (this.firstXY) {\n var ret;\n var touchAction = scope.targetFinding.findTouchAction(inEvent);\n var scrollAxis = this.touchActionToScrollType(touchAction);\n if (scrollAxis === 'none') {\n // this element is a touch-action: none, should never scroll\n ret = false;\n } else if (scrollAxis === 'XY') {\n // this element should always scroll\n ret = true;\n } else {\n var t = inEvent.changedTouches[0];\n // check the intended scroll axis, and other axis\n var a = scrollAxis;\n var oa = scrollAxis === 'Y' ? 'X' : 'Y';\n var da = Math.abs(t['client' + a] - this.firstXY[a]);\n var doa = Math.abs(t['client' + oa] - this.firstXY[oa]);\n // if delta in the scroll axis > delta other axis, scroll instead of\n // making events\n ret = da >= doa;\n }\n return ret;\n }\n },\n findTouch: function(inTL, inId) {\n for (var i = 0, l = inTL.length, t; i < l && (t = inTL[i]); i++) {\n if (t.identifier === inId) {\n return true;\n }\n }\n },\n // In some instances, a touchstart can happen without a touchend. This\n // leaves the pointermap in a broken state.\n // Therefore, on every touchstart, we remove the touches that did not fire a\n // touchend event.\n // To keep state globally consistent, we fire a\n // pointercancel for this \"abandoned\" touch\n vacuumTouches: function(inEvent) {\n var tl = inEvent.touches;\n // pointermap.pointers() should be < tl.length here, as the touchstart has not\n // been processed yet.\n if (pointermap.pointers() >= tl.length) {\n var d = [];\n pointermap.forEach(function(value, key) {\n // Never remove pointerId == 1, which is mouse.\n // Touch identifiers are 2 smaller than their pointerId, which is the\n // index in pointermap.\n if (key !== 1 && !this.findTouch(tl, key - 2)) {\n var p = value;\n d.push(p);\n }\n }, this);\n d.forEach(function(p) {\n this.cancel(p);\n pointermap.delete(p.pointerId);\n });\n }\n },\n touchstart: function(inEvent) {\n this.vacuumTouches(inEvent);\n this.setPrimaryTouch(inEvent.changedTouches[0]);\n this.dedupSynthMouse(inEvent);\n if (!this.scrolling) {\n this.clickCount++;\n this.processTouches(inEvent, this.down);\n }\n },\n down: function(inPointer) {\n dispatcher.down(inPointer);\n },\n touchmove: function(inEvent) {\n if (HAS_TOUCH_ACTION) {\n // touchevent.cancelable == false is sent when the page is scrolling under native Touch Action in Chrome 36\n // https://groups.google.com/a/chromium.org/d/msg/input-dev/wHnyukcYBcA/b9kmtwM1jJQJ\n if (inEvent.cancelable) {\n this.processTouches(inEvent, this.move);\n }\n } else {\n if (!this.scrolling) {\n if (this.scrolling === null && this.shouldScroll(inEvent)) {\n this.scrolling = true;\n } else {\n this.scrolling = false;\n inEvent.preventDefault();\n this.processTouches(inEvent, this.move);\n }\n } else if (this.firstXY) {\n var t = inEvent.changedTouches[0];\n var dx = t.clientX - this.firstXY.X;\n var dy = t.clientY - this.firstXY.Y;\n var dd = Math.sqrt(dx * dx + dy * dy);\n if (dd >= HYSTERESIS) {\n this.touchcancel(inEvent);\n this.scrolling = true;\n this.firstXY = null;\n }\n }\n }\n },\n move: function(inPointer) {\n dispatcher.move(inPointer);\n },\n touchend: function(inEvent) {\n this.dedupSynthMouse(inEvent);\n this.processTouches(inEvent, this.up);\n },\n up: function(inPointer) {\n inPointer.relatedTarget = scope.findTarget(inPointer);\n dispatcher.up(inPointer);\n },\n cancel: function(inPointer) {\n dispatcher.cancel(inPointer);\n },\n touchcancel: function(inEvent) {\n inEvent._cancel = true;\n this.processTouches(inEvent, this.cancel);\n },\n cleanUpPointer: function(inPointer) {\n pointermap['delete'](inPointer.pointerId);\n this.removePrimaryPointer(inPointer);\n },\n // prevent synth mouse events from creating pointer events\n dedupSynthMouse: function(inEvent) {\n var lts = scope.mouseEvents.lastTouches;\n var t = inEvent.changedTouches[0];\n // only the primary finger will synth mouse events\n if (this.isPrimaryTouch(t)) {\n // remember x/y of last touch\n var lt = {x: t.clientX, y: t.clientY};\n lts.push(lt);\n var fn = (function(lts, lt){\n var i = lts.indexOf(lt);\n if (i > -1) {\n lts.splice(i, 1);\n }\n }).bind(null, lts, lt);\n setTimeout(fn, DEDUP_TIMEOUT);\n }\n }\n };\n\n scope.touchEvents = touchEvents;\n})(window.PolymerGestures);\n","/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n var dispatcher = scope.dispatcher;\n var pointermap = dispatcher.pointermap;\n var HAS_BITMAP_TYPE = window.MSPointerEvent && typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE === 'number';\n var msEvents = {\n events: [\n 'MSPointerDown',\n 'MSPointerMove',\n 'MSPointerUp',\n 'MSPointerCancel',\n ],\n register: function(target) {\n if (target !== document) {\n return;\n }\n dispatcher.listen(target, this.events);\n },\n unregister: function(target) {\n dispatcher.unlisten(target, this.events);\n },\n POINTER_TYPES: [\n '',\n 'unavailable',\n 'touch',\n 'pen',\n 'mouse'\n ],\n prepareEvent: function(inEvent) {\n var e = inEvent;\n e = dispatcher.cloneEvent(inEvent);\n if (HAS_BITMAP_TYPE) {\n e.pointerType = this.POINTER_TYPES[inEvent.pointerType];\n }\n e._source = 'ms';\n return e;\n },\n cleanup: function(id) {\n pointermap['delete'](id);\n },\n MSPointerDown: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n e.target = scope.findTarget(inEvent);\n pointermap.set(inEvent.pointerId, e.target);\n dispatcher.down(e);\n },\n MSPointerMove: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n e.target = pointermap.get(e.pointerId);\n dispatcher.move(e);\n },\n MSPointerUp: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n e.relatedTarget = scope.findTarget(inEvent);\n e.target = pointermap.get(e.pointerId);\n dispatcher.up(e);\n this.cleanup(inEvent.pointerId);\n },\n MSPointerCancel: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n e.relatedTarget = scope.findTarget(inEvent);\n e.target = pointermap.get(e.pointerId);\n dispatcher.cancel(e);\n this.cleanup(inEvent.pointerId);\n }\n };\n\n scope.msEvents = msEvents;\n})(window.PolymerGestures);\n","/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n var dispatcher = scope.dispatcher;\n var pointermap = dispatcher.pointermap;\n var pointerEvents = {\n events: [\n 'pointerdown',\n 'pointermove',\n 'pointerup',\n 'pointercancel'\n ],\n prepareEvent: function(inEvent) {\n var e = dispatcher.cloneEvent(inEvent);\n e._source = 'pointer';\n return e;\n },\n register: function(target) {\n if (target !== document) {\n return;\n }\n dispatcher.listen(target, this.events);\n },\n unregister: function(target) {\n dispatcher.unlisten(target, this.events);\n },\n cleanup: function(id) {\n pointermap['delete'](id);\n },\n pointerdown: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n e.target = scope.findTarget(inEvent);\n pointermap.set(e.pointerId, e.target);\n dispatcher.down(e);\n },\n pointermove: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n e.target = pointermap.get(e.pointerId);\n dispatcher.move(e);\n },\n pointerup: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n e.relatedTarget = scope.findTarget(inEvent);\n e.target = pointermap.get(e.pointerId);\n dispatcher.up(e);\n this.cleanup(inEvent.pointerId);\n },\n pointercancel: function(inEvent) {\n var e = this.prepareEvent(inEvent);\n e.relatedTarget = scope.findTarget(inEvent);\n e.target = pointermap.get(e.pointerId);\n dispatcher.cancel(e);\n this.cleanup(inEvent.pointerId);\n }\n };\n\n scope.pointerEvents = pointerEvents;\n})(window.PolymerGestures);\n","/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This module contains the handlers for native platform events.\n * From here, the dispatcher is called to create unified pointer events.\n * Included are touch events (v1), mouse events, and MSPointerEvents.\n */\n(function(scope) {\n var dispatcher = scope.dispatcher;\n var nav = window.navigator;\n\n if (window.PointerEvent) {\n dispatcher.registerSource('pointer', scope.pointerEvents);\n } else if (nav.msPointerEnabled) {\n dispatcher.registerSource('ms', scope.msEvents);\n } else {\n dispatcher.registerSource('mouse', scope.mouseEvents);\n if (window.ontouchstart !== undefined) {\n dispatcher.registerSource('touch', scope.touchEvents);\n /*\n * NOTE: an empty touch listener on body will reactivate nodes imported from templates with touch listeners\n * Removing it will re-break the nodes\n *\n * Work around for https://bugs.webkit.org/show_bug.cgi?id=135628\n */\n var isSafari = nav.userAgent.match('Safari') && !nav.userAgent.match('Chrome');\n if (isSafari) {\n document.body.addEventListener('touchstart', function(){});\n }\n }\n }\n dispatcher.register(document, true);\n})(window.PolymerGestures);\n","/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This event denotes the beginning of a series of tracking events.\n *\n * @module PointerGestures\n * @submodule Events\n * @class trackstart\n */\n/**\n * Pixels moved in the x direction since trackstart.\n * @type Number\n * @property dx\n */\n/**\n * Pixes moved in the y direction since trackstart.\n * @type Number\n * @property dy\n */\n/**\n * Pixels moved in the x direction since the last track.\n * @type Number\n * @property ddx\n */\n/**\n * Pixles moved in the y direction since the last track.\n * @type Number\n * @property ddy\n */\n/**\n * The clientX position of the track gesture.\n * @type Number\n * @property clientX\n */\n/**\n * The clientY position of the track gesture.\n * @type Number\n * @property clientY\n */\n/**\n * The pageX position of the track gesture.\n * @type Number\n * @property pageX\n */\n/**\n * The pageY position of the track gesture.\n * @type Number\n * @property pageY\n */\n/**\n * The screenX position of the track gesture.\n * @type Number\n * @property screenX\n */\n/**\n * The screenY position of the track gesture.\n * @type Number\n * @property screenY\n */\n/**\n * The last x axis direction of the pointer.\n * @type Number\n * @property xDirection\n */\n/**\n * The last y axis direction of the pointer.\n * @type Number\n * @property yDirection\n */\n/**\n * A shared object between all tracking events.\n * @type Object\n * @property trackInfo\n */\n/**\n * The element currently under the pointer.\n * @type Element\n * @property relatedTarget\n */\n/**\n * The type of pointer that make the track gesture.\n * @type String\n * @property pointerType\n */\n/**\n *\n * This event fires for all pointer movement being tracked.\n *\n * @class track\n * @extends trackstart\n */\n/**\n * This event fires when the pointer is no longer being tracked.\n *\n * @class trackend\n * @extends trackstart\n */\n\n (function(scope) {\n var dispatcher = scope.dispatcher;\n var eventFactory = scope.eventFactory;\n var pointermap = new scope.PointerMap();\n var track = {\n events: [\n 'down',\n 'move',\n 'up',\n ],\n exposes: [\n 'trackstart',\n 'track',\n 'trackx',\n 'tracky',\n 'trackend'\n ],\n defaultActions: {\n 'track': 'none',\n 'trackx': 'pan-y',\n 'tracky': 'pan-x'\n },\n WIGGLE_THRESHOLD: 4,\n clampDir: function(inDelta) {\n return inDelta > 0 ? 1 : -1;\n },\n calcPositionDelta: function(inA, inB) {\n var x = 0, y = 0;\n if (inA && inB) {\n x = inB.pageX - inA.pageX;\n y = inB.pageY - inA.pageY;\n }\n return {x: x, y: y};\n },\n fireTrack: function(inType, inEvent, inTrackingData) {\n var t = inTrackingData;\n var d = this.calcPositionDelta(t.downEvent, inEvent);\n var dd = this.calcPositionDelta(t.lastMoveEvent, inEvent);\n if (dd.x) {\n t.xDirection = this.clampDir(dd.x);\n } else if (inType === 'trackx') {\n return;\n }\n if (dd.y) {\n t.yDirection = this.clampDir(dd.y);\n } else if (inType === 'tracky') {\n return;\n }\n var gestureProto = {\n bubbles: true,\n cancelable: true,\n trackInfo: t.trackInfo,\n relatedTarget: inEvent.relatedTarget,\n pointerType: inEvent.pointerType,\n pointerId: inEvent.pointerId,\n _source: 'track'\n };\n if (inType !== 'tracky') {\n gestureProto.x = inEvent.x;\n gestureProto.dx = d.x;\n gestureProto.ddx = dd.x;\n gestureProto.clientX = inEvent.clientX;\n gestureProto.pageX = inEvent.pageX;\n gestureProto.screenX = inEvent.screenX;\n gestureProto.xDirection = t.xDirection;\n }\n if (inType !== 'trackx') {\n gestureProto.dy = d.y;\n gestureProto.ddy = dd.y;\n gestureProto.y = inEvent.y;\n gestureProto.clientY = inEvent.clientY;\n gestureProto.pageY = inEvent.pageY;\n gestureProto.screenY = inEvent.screenY;\n gestureProto.yDirection = t.yDirection;\n }\n var e = eventFactory.makeGestureEvent(inType, gestureProto);\n t.downTarget.dispatchEvent(e);\n },\n down: function(inEvent) {\n if (inEvent.isPrimary && (inEvent.pointerType === 'mouse' ? inEvent.buttons === 1 : true)) {\n var p = {\n downEvent: inEvent,\n downTarget: inEvent.target,\n trackInfo: {},\n lastMoveEvent: null,\n xDirection: 0,\n yDirection: 0,\n tracking: false\n };\n pointermap.set(inEvent.pointerId, p);\n }\n },\n move: function(inEvent) {\n var p = pointermap.get(inEvent.pointerId);\n if (p) {\n if (!p.tracking) {\n var d = this.calcPositionDelta(p.downEvent, inEvent);\n var move = d.x * d.x + d.y * d.y;\n // start tracking only if finger moves more than WIGGLE_THRESHOLD\n if (move > this.WIGGLE_THRESHOLD) {\n p.tracking = true;\n p.lastMoveEvent = p.downEvent;\n this.fireTrack('trackstart', inEvent, p);\n }\n }\n if (p.tracking) {\n this.fireTrack('track', inEvent, p);\n this.fireTrack('trackx', inEvent, p);\n this.fireTrack('tracky', inEvent, p);\n }\n p.lastMoveEvent = inEvent;\n }\n },\n up: function(inEvent) {\n var p = pointermap.get(inEvent.pointerId);\n if (p) {\n if (p.tracking) {\n this.fireTrack('trackend', inEvent, p);\n }\n pointermap.delete(inEvent.pointerId);\n }\n }\n };\n dispatcher.registerGesture('track', track);\n })(window.PolymerGestures);\n","/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This event is fired when a pointer is held down for 200ms.\n *\n * @module PointerGestures\n * @submodule Events\n * @class hold\n */\n/**\n * Type of pointer that made the holding event.\n * @type String\n * @property pointerType\n */\n/**\n * Screen X axis position of the held pointer\n * @type Number\n * @property clientX\n */\n/**\n * Screen Y axis position of the held pointer\n * @type Number\n * @property clientY\n */\n/**\n * Type of pointer that made the holding event.\n * @type String\n * @property pointerType\n */\n/**\n * This event is fired every 200ms while a pointer is held down.\n *\n * @class holdpulse\n * @extends hold\n */\n/**\n * Milliseconds pointer has been held down.\n * @type Number\n * @property holdTime\n */\n/**\n * This event is fired when a held pointer is released or moved.\n *\n * @class release\n */\n\n(function(scope) {\n var dispatcher = scope.dispatcher;\n var eventFactory = scope.eventFactory;\n var hold = {\n // wait at least HOLD_DELAY ms between hold and pulse events\n HOLD_DELAY: 200,\n // pointer can move WIGGLE_THRESHOLD pixels before not counting as a hold\n WIGGLE_THRESHOLD: 16,\n events: [\n 'down',\n 'move',\n 'up',\n ],\n exposes: [\n 'hold',\n 'holdpulse',\n 'release'\n ],\n heldPointer: null,\n holdJob: null,\n pulse: function() {\n var hold = Date.now() - this.heldPointer.timeStamp;\n var type = this.held ? 'holdpulse' : 'hold';\n this.fireHold(type, hold);\n this.held = true;\n },\n cancel: function() {\n clearInterval(this.holdJob);\n if (this.held) {\n this.fireHold('release');\n }\n this.held = false;\n this.heldPointer = null;\n this.target = null;\n this.holdJob = null;\n },\n down: function(inEvent) {\n if (inEvent.isPrimary && !this.heldPointer) {\n this.heldPointer = inEvent;\n this.target = inEvent.target;\n this.holdJob = setInterval(this.pulse.bind(this), this.HOLD_DELAY);\n }\n },\n up: function(inEvent) {\n if (this.heldPointer && this.heldPointer.pointerId === inEvent.pointerId) {\n this.cancel();\n }\n },\n move: function(inEvent) {\n if (this.heldPointer && this.heldPointer.pointerId === inEvent.pointerId) {\n var x = inEvent.clientX - this.heldPointer.clientX;\n var y = inEvent.clientY - this.heldPointer.clientY;\n if ((x * x + y * y) > this.WIGGLE_THRESHOLD) {\n this.cancel();\n }\n }\n },\n fireHold: function(inType, inHoldTime) {\n var p = {\n bubbles: true,\n cancelable: true,\n pointerType: this.heldPointer.pointerType,\n pointerId: this.heldPointer.pointerId,\n x: this.heldPointer.clientX,\n y: this.heldPointer.clientY,\n _source: 'hold'\n };\n if (inHoldTime) {\n p.holdTime = inHoldTime;\n }\n var e = eventFactory.makeGestureEvent(inType, p);\n this.target.dispatchEvent(e);\n }\n };\n dispatcher.registerGesture('hold', hold);\n})(window.PolymerGestures);\n","/*\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This event is fired when a pointer quickly goes down and up, and is used to\n * denote activation.\n *\n * Any gesture event can prevent the tap event from being created by calling\n * `event.preventTap`.\n *\n * Any pointer event can prevent the tap by setting the `tapPrevented` property\n * on itself.\n *\n * @module PointerGestures\n * @submodule Events\n * @class tap\n */\n/**\n * X axis position of the tap.\n * @property x\n * @type Number\n */\n/**\n * Y axis position of the tap.\n * @property y\n * @type Number\n */\n/**\n * Type of the pointer that made the tap.\n * @property pointerType\n * @type String\n */\n(function(scope) {\n var dispatcher = scope.dispatcher;\n var eventFactory = scope.eventFactory;\n var pointermap = new scope.PointerMap();\n var tap = {\n events: [\n 'down',\n 'up'\n ],\n exposes: [\n 'tap'\n ],\n down: function(inEvent) {\n if (inEvent.isPrimary && !inEvent.tapPrevented) {\n pointermap.set(inEvent.pointerId, {\n target: inEvent.target,\n buttons: inEvent.buttons,\n x: inEvent.clientX,\n y: inEvent.clientY\n });\n }\n },\n shouldTap: function(e, downState) {\n if (e.pointerType === 'mouse') {\n // only allow left click to tap for mouse\n return downState.buttons === 1;\n }\n return !e.tapPrevented;\n },\n up: function(inEvent) {\n var start = pointermap.get(inEvent.pointerId);\n if (start && this.shouldTap(inEvent, start)) {\n // up.relatedTarget is target currently under finger\n var t = scope.targetFinding.LCA(start.target, inEvent.relatedTarget);\n if (t) {\n var e = eventFactory.makeGestureEvent('tap', {\n bubbles: true,\n cancelable: true,\n x: inEvent.clientX,\n y: inEvent.clientY,\n detail: inEvent.detail,\n pointerType: inEvent.pointerType,\n pointerId: inEvent.pointerId,\n altKey: inEvent.altKey,\n ctrlKey: inEvent.ctrlKey,\n metaKey: inEvent.metaKey,\n shiftKey: inEvent.shiftKey,\n _source: 'tap'\n });\n t.dispatchEvent(e);\n }\n }\n pointermap.delete(inEvent.pointerId);\n }\n };\n // patch eventFactory to remove id from tap's pointermap for preventTap calls\n eventFactory.preventTap = function(e) {\n return function() {\n e.tapPrevented = true;\n pointermap.delete(e.pointerId);\n };\n };\n dispatcher.registerGesture('tap', tap);\n})(window.PolymerGestures);\n","/*\n Copyright (C) 2013 Ariya Hidayat \n Copyright (C) 2013 Thaddee Tyl \n Copyright (C) 2012 Ariya Hidayat \n Copyright (C) 2012 Mathias Bynens \n Copyright (C) 2012 Joost-Wim Boekesteijn \n Copyright (C) 2012 Kris Kowal \n Copyright (C) 2012 Yusuke Suzuki \n Copyright (C) 2012 Arpad Borsos \n Copyright (C) 2011 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n(function (global) {\n 'use strict';\n\n var Token,\n TokenName,\n Syntax,\n Messages,\n source,\n index,\n length,\n delegate,\n lookahead,\n state;\n\n Token = {\n BooleanLiteral: 1,\n EOF: 2,\n Identifier: 3,\n Keyword: 4,\n NullLiteral: 5,\n NumericLiteral: 6,\n Punctuator: 7,\n StringLiteral: 8\n };\n\n TokenName = {};\n TokenName[Token.BooleanLiteral] = 'Boolean';\n TokenName[Token.EOF] = '';\n TokenName[Token.Identifier] = 'Identifier';\n TokenName[Token.Keyword] = 'Keyword';\n TokenName[Token.NullLiteral] = 'Null';\n TokenName[Token.NumericLiteral] = 'Numeric';\n TokenName[Token.Punctuator] = 'Punctuator';\n TokenName[Token.StringLiteral] = 'String';\n\n Syntax = {\n ArrayExpression: 'ArrayExpression',\n BinaryExpression: 'BinaryExpression',\n CallExpression: 'CallExpression',\n ConditionalExpression: 'ConditionalExpression',\n EmptyStatement: 'EmptyStatement',\n ExpressionStatement: 'ExpressionStatement',\n Identifier: 'Identifier',\n Literal: 'Literal',\n LabeledStatement: 'LabeledStatement',\n LogicalExpression: 'LogicalExpression',\n MemberExpression: 'MemberExpression',\n ObjectExpression: 'ObjectExpression',\n Program: 'Program',\n Property: 'Property',\n ThisExpression: 'ThisExpression',\n UnaryExpression: 'UnaryExpression'\n };\n\n // Error messages should be identical to V8.\n Messages = {\n UnexpectedToken: 'Unexpected token %0',\n UnknownLabel: 'Undefined label \\'%0\\'',\n Redeclaration: '%0 \\'%1\\' has already been declared'\n };\n\n // Ensure the condition is true, otherwise throw an error.\n // This is only to have a better contract semantic, i.e. another safety net\n // to catch a logic error. The condition shall be fulfilled in normal case.\n // Do NOT use this to enforce a certain condition on any user input.\n\n function assert(condition, message) {\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }\n\n function isDecimalDigit(ch) {\n return (ch >= 48 && ch <= 57); // 0..9\n }\n\n\n // 7.2 White Space\n\n function isWhiteSpace(ch) {\n return (ch === 32) || // space\n (ch === 9) || // tab\n (ch === 0xB) ||\n (ch === 0xC) ||\n (ch === 0xA0) ||\n (ch >= 0x1680 && '\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\uFEFF'.indexOf(String.fromCharCode(ch)) > 0);\n }\n\n // 7.3 Line Terminators\n\n function isLineTerminator(ch) {\n return (ch === 10) || (ch === 13) || (ch === 0x2028) || (ch === 0x2029);\n }\n\n // 7.6 Identifier Names and Identifiers\n\n function isIdentifierStart(ch) {\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122); // a..z\n }\n\n function isIdentifierPart(ch) {\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n (ch >= 48 && ch <= 57); // 0..9\n }\n\n // 7.6.1.1 Keywords\n\n function isKeyword(id) {\n return (id === 'this')\n }\n\n // 7.4 Comments\n\n function skipWhitespace() {\n while (index < length && isWhiteSpace(source.charCodeAt(index))) {\n ++index;\n }\n }\n\n function getIdentifier() {\n var start, ch;\n\n start = index++;\n while (index < length) {\n ch = source.charCodeAt(index);\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n }\n\n function scanIdentifier() {\n var start, id, type;\n\n start = index;\n\n id = getIdentifier();\n\n // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n if (id.length === 1) {\n type = Token.Identifier;\n } else if (isKeyword(id)) {\n type = Token.Keyword;\n } else if (id === 'null') {\n type = Token.NullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = Token.BooleanLiteral;\n } else {\n type = Token.Identifier;\n }\n\n return {\n type: type,\n value: id,\n range: [start, index]\n };\n }\n\n\n // 7.7 Punctuators\n\n function scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2;\n\n switch (code) {\n\n // Check for most common single-character punctuators.\n case 46: // . dot\n case 40: // ( open bracket\n case 41: // ) close bracket\n case 59: // ; semicolon\n case 44: // , comma\n case 123: // { open curly brace\n case 125: // } close curly brace\n case 91: // [\n case 93: // ]\n case 58: // :\n case 63: // ?\n ++index;\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code),\n range: [start, index]\n };\n\n default:\n code2 = source.charCodeAt(index + 1);\n\n // '=' (char #61) marks an assignment or comparison operator.\n if (code2 === 61) {\n switch (code) {\n case 37: // %\n case 38: // &\n case 42: // *:\n case 43: // +\n case 45: // -\n case 47: // /\n case 60: // <\n case 62: // >\n case 124: // |\n index += 2;\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n range: [start, index]\n };\n\n case 33: // !\n case 61: // =\n index += 2;\n\n // !== and ===\n if (source.charCodeAt(index) === 61) {\n ++index;\n }\n return {\n type: Token.Punctuator,\n value: source.slice(start, index),\n range: [start, index]\n };\n default:\n break;\n }\n }\n break;\n }\n\n // Peek more characters.\n\n ch2 = source[index + 1];\n\n // Other 2-character punctuators: && ||\n\n if (ch1 === ch2 && ('&|'.indexOf(ch1) >= 0)) {\n index += 2;\n return {\n type: Token.Punctuator,\n value: ch1 + ch2,\n range: [start, index]\n };\n }\n\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: Token.Punctuator,\n value: ch1,\n range: [start, index]\n };\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n // 7.8.3 Numeric Literals\n function scanNumericLiteral() {\n var number, start, ch;\n\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),\n 'Numeric literal must start with a decimal digit or a decimal point');\n\n start = index;\n number = '';\n if (ch !== '.') {\n number = source[index++];\n ch = source[index];\n\n // Hex number starts with '0x'.\n // Octal number starts with '0'.\n if (number === '0') {\n // decimal number starts with '0' such as '09' is illegal.\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n\n ch = source[index];\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseFloat(number),\n range: [start, index]\n };\n }\n\n // 7.8.4 String Literals\n\n function scanStringLiteral() {\n var str = '', quote, start, ch, octal = false;\n\n quote = source[index];\n assert((quote === '\\'' || quote === '\"'),\n 'String literal must starts with a quote');\n\n start = index;\n ++index;\n\n while (index < length) {\n ch = source[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'n':\n str += '\\n';\n break;\n case 'r':\n str += '\\r';\n break;\n case 't':\n str += '\\t';\n break;\n case 'b':\n str += '\\b';\n break;\n case 'f':\n str += '\\f';\n break;\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n str += ch;\n break;\n }\n } else {\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.StringLiteral,\n value: str,\n octal: octal,\n range: [start, index]\n };\n }\n\n function isIdentifierName(token) {\n return token.type === Token.Identifier ||\n token.type === Token.Keyword ||\n token.type === Token.BooleanLiteral ||\n token.type === Token.NullLiteral;\n }\n\n function advance() {\n var ch;\n\n skipWhitespace();\n\n if (index >= length) {\n return {\n type: Token.EOF,\n range: [index, index]\n };\n }\n\n ch = source.charCodeAt(index);\n\n // Very common: ( and ) and ;\n if (ch === 40 || ch === 41 || ch === 58) {\n return scanPunctuator();\n }\n\n // String literal starts with single quote (#39) or double quote (#34).\n if (ch === 39 || ch === 34) {\n return scanStringLiteral();\n }\n\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n }\n\n // Dot (.) char #46 can also start a floating-point number, hence the need\n // to check the next character.\n if (ch === 46) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n }\n\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n return scanPunctuator();\n }\n\n function lex() {\n var token;\n\n token = lookahead;\n index = token.range[1];\n\n lookahead = advance();\n\n index = token.range[1];\n\n return token;\n }\n\n function peek() {\n var pos;\n\n pos = index;\n lookahead = advance();\n index = pos;\n }\n\n // Throw an exception\n\n function throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(\n /%(\\d)/g,\n function (whole, index) {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n }\n );\n\n error = new Error(msg);\n error.index = index;\n error.description = msg;\n throw error;\n }\n\n // Throw an exception because of the token.\n\n function throwUnexpected(token) {\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // Expect the next token to match the specified punctuator.\n // If not, an exception will be thrown.\n\n function expect(value) {\n var token = lex();\n if (token.type !== Token.Punctuator || token.value !== value) {\n throwUnexpected(token);\n }\n }\n\n // Return true if the next token matches the specified punctuator.\n\n function match(value) {\n return lookahead.type === Token.Punctuator && lookahead.value === value;\n }\n\n // Return true if the next token matches the specified keyword\n\n function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }\n\n function consumeSemicolon() {\n // Catch the very common case first: immediately a semicolon (char #59).\n if (source.charCodeAt(index) === 59) {\n lex();\n return;\n }\n\n skipWhitespace();\n\n if (match(';')) {\n lex();\n return;\n }\n\n if (lookahead.type !== Token.EOF && !match('}')) {\n throwUnexpected(lookahead);\n }\n }\n\n // 11.1.4 Array Initialiser\n\n function parseArrayInitialiser() {\n var elements = [];\n\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n expect(']');\n\n return delegate.createArrayExpression(elements);\n }\n\n // 11.1.5 Object Initialiser\n\n function parseObjectPropertyKey() {\n var token;\n\n skipWhitespace();\n token = lex();\n\n // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {\n return delegate.createLiteral(token);\n }\n\n return delegate.createIdentifier(token.value);\n }\n\n function parseObjectProperty() {\n var token, key;\n\n token = lookahead;\n skipWhitespace();\n\n if (token.type === Token.EOF || token.type === Token.Punctuator) {\n throwUnexpected(token);\n }\n\n key = parseObjectPropertyKey();\n expect(':');\n return delegate.createProperty('init', key, parseExpression());\n }\n\n function parseObjectInitialiser() {\n var properties = [];\n\n expect('{');\n\n while (!match('}')) {\n properties.push(parseObjectProperty());\n\n if (!match('}')) {\n expect(',');\n }\n }\n\n expect('}');\n\n return delegate.createObjectExpression(properties);\n }\n\n // 11.1.6 The Grouping Operator\n\n function parseGroupExpression() {\n var expr;\n\n expect('(');\n\n expr = parseExpression();\n\n expect(')');\n\n return expr;\n }\n\n\n // 11.1 Primary Expressions\n\n function parsePrimaryExpression() {\n var type, token, expr;\n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n type = lookahead.type;\n\n if (type === Token.Identifier) {\n expr = delegate.createIdentifier(lex().value);\n } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n expr = delegate.createLiteral(lex());\n } else if (type === Token.Keyword) {\n if (matchKeyword('this')) {\n lex();\n expr = delegate.createThisExpression();\n }\n } else if (type === Token.BooleanLiteral) {\n token = lex();\n token.value = (token.value === 'true');\n expr = delegate.createLiteral(token);\n } else if (type === Token.NullLiteral) {\n token = lex();\n token.value = null;\n expr = delegate.createLiteral(token);\n } else if (match('[')) {\n expr = parseArrayInitialiser();\n } else if (match('{')) {\n expr = parseObjectInitialiser();\n }\n\n if (expr) {\n return expr;\n }\n\n throwUnexpected(lex());\n }\n\n // 11.2 Left-Hand-Side Expressions\n\n function parseArguments() {\n var args = [];\n\n expect('(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseExpression());\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return args;\n }\n\n function parseNonComputedProperty() {\n var token;\n\n token = lex();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n\n return delegate.createIdentifier(token.value);\n }\n\n function parseNonComputedMember() {\n expect('.');\n\n return parseNonComputedProperty();\n }\n\n function parseComputedMember() {\n var expr;\n\n expect('[');\n\n expr = parseExpression();\n\n expect(']');\n\n return expr;\n }\n\n function parseLeftHandSideExpression() {\n var expr, args, property;\n\n expr = parsePrimaryExpression();\n\n while (true) {\n if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else if (match('.')) {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = delegate.createCallExpression(expr, args);\n } else {\n break;\n }\n }\n\n return expr;\n }\n\n // 11.3 Postfix Expressions\n\n var parsePostfixExpression = parseLeftHandSideExpression;\n\n // 11.4 Unary Operators\n\n function parseUnaryExpression() {\n var token, expr;\n\n if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {\n expr = parsePostfixExpression();\n } else if (match('+') || match('-') || match('!')) {\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n throwError({}, Messages.UnexpectedToken);\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n }\n\n function binaryPrecedence(token) {\n var prec = 0;\n\n if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n case '&&':\n prec = 2;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n prec = 7;\n break;\n\n case 'in':\n prec = 7;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n\n default:\n break;\n }\n\n return prec;\n }\n\n // 11.5 Multiplicative Operators\n // 11.6 Additive Operators\n // 11.7 Bitwise Shift Operators\n // 11.8 Relational Operators\n // 11.9 Equality Operators\n // 11.10 Binary Bitwise Operators\n // 11.11 Binary Logical Operators\n\n function parseBinaryExpression() {\n var expr, token, prec, stack, right, operator, left, i;\n\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }\n\n\n // 11.12 Conditional Operator\n\n function parseConditionalExpression() {\n var expr, consequent, alternate;\n\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n consequent = parseConditionalExpression();\n expect(':');\n alternate = parseConditionalExpression();\n\n expr = delegate.createConditionalExpression(expr, consequent, alternate);\n }\n\n return expr;\n }\n\n // Simplification since we do not support AssignmentExpression.\n var parseExpression = parseConditionalExpression;\n\n // Polymer Syntax extensions\n\n // Filter ::\n // Identifier\n // Identifier \"(\" \")\"\n // Identifier \"(\" FilterArguments \")\"\n\n function parseFilter() {\n var identifier, args;\n\n identifier = lex();\n\n if (identifier.type !== Token.Identifier) {\n throwUnexpected(identifier);\n }\n\n args = match('(') ? parseArguments() : [];\n\n return delegate.createFilter(identifier.value, args);\n }\n\n // Filters ::\n // \"|\" Filter\n // Filters \"|\" Filter\n\n function parseFilters() {\n while (match('|')) {\n lex();\n parseFilter();\n }\n }\n\n // TopLevel ::\n // LabelledExpressions\n // AsExpression\n // InExpression\n // FilterExpression\n\n // AsExpression ::\n // FilterExpression as Identifier\n\n // InExpression ::\n // Identifier, Identifier in FilterExpression\n // Identifier in FilterExpression\n\n // FilterExpression ::\n // Expression\n // Expression Filters\n\n function parseTopLevel() {\n skipWhitespace();\n peek();\n\n var expr = parseExpression();\n if (expr) {\n if (lookahead.value === ',' || lookahead.value == 'in' &&\n expr.type === Syntax.Identifier) {\n parseInExpression(expr);\n } else {\n parseFilters();\n if (lookahead.value === 'as') {\n parseAsExpression(expr);\n } else {\n delegate.createTopLevel(expr);\n }\n }\n }\n\n if (lookahead.type !== Token.EOF) {\n throwUnexpected(lookahead);\n }\n }\n\n function parseAsExpression(expr) {\n lex(); // as\n var identifier = lex().value;\n delegate.createAsExpression(expr, identifier);\n }\n\n function parseInExpression(identifier) {\n var indexName;\n if (lookahead.value === ',') {\n lex();\n if (lookahead.type !== Token.Identifier)\n throwUnexpected(lookahead);\n indexName = lex().value;\n }\n\n lex(); // in\n var expr = parseExpression();\n parseFilters();\n delegate.createInExpression(identifier.name, indexName, expr);\n }\n\n function parse(code, inDelegate) {\n delegate = inDelegate;\n source = code;\n index = 0;\n length = source.length;\n lookahead = null;\n state = {\n labelSet: {}\n };\n\n return parseTopLevel();\n }\n\n global.esprima = {\n parse: parse\n };\n})(this);\n","// Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n// This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n// The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n// The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n// Code distributed by Google as part of the polymer project is also\n// subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n\n(function (global) {\n 'use strict';\n\n function prepareBinding(expressionText, name, node, filterRegistry) {\n var expression;\n try {\n expression = getExpression(expressionText);\n if (expression.scopeIdent &&\n (node.nodeType !== Node.ELEMENT_NODE ||\n node.tagName !== 'TEMPLATE' ||\n (name !== 'bind' && name !== 'repeat'))) {\n throw Error('as and in can only be used within