Files
ionic-framework/release/js/ionic.min.js
2014-03-25 20:56:01 +00:00

17 lines
76 KiB
JavaScript

/*!
* Copyright 2014 Drifty Co.
* http://drifty.com/
*
* Ionic, v1.0.0-beta.1
* A powerful HTML5 mobile app framework.
* http://ionicframework.com/
*
* By @maxlynch, @benjsperry, @adamdbradley <3
*
* Licensed under the MIT license. Please see LICENSE for more information.
*
*/
!function(){window.ionic={controllers:{},views:{},version:"1.0.0-beta.1"},function(t){function e(t){return t*t*t}function i(t){return 3*t*t*(1-t)}function n(t){return 3*t*(1-t)*(1-t)}function r(t){return(1-t)*(1-t)*(1-t)}var o=function(t,e){return t||(t=0),e||(e=0),{x:t,y:e}};t.Animator={getQuadraticBezier:function(t,s,a,l,c){var u=new o;return u.x=s.x*e(t)+a.x*i(t)+l.x*n(t)+c.x*r(t),u.y=s.y*e(t)+a.y*i(t)+l.y*n(t)+c.y*r(t),u},getCubicBezier:function(t,e,i,n,r){epsilon=1e3/60/r/4;var o=function(e){var n=1-e;return 3*n*n*e*t+3*n*e*e*i+e*e*e},s=function(t){var i=1-t;return 3*i*i*t*e+3*i*t*t*n+t*t*t},a=function(e){var n=1-e;return 3*(2*(e-1)*e+n*n)*t+3*(-e*e*e+2*n*e)*i};return function(t){var e,i,n,r,l,c,u=t;for(n=u,c=0;8>c;c++){if(r=o(n)-u,Math.abs(r)<epsilon)return s(n);if(l=a(n),Math.abs(l)<1e-6)break;n-=r/l}if(e=0,i=1,n=u,e>n)return s(e);if(n>i)return s(i);for(;i>e;){if(r=o(n),Math.abs(r-u)<epsilon)return s(n);u>r?e=n:i=n,n=.5*(i-e)+e}return s(n)}},animate:function(t){return{leave:function(){var e=function(){t.classList.remove("leave"),t.classList.remove("leave-active"),t.removeEventListener("webkitTransitionEnd",e),t.removeEventListener("transitionEnd",e)};return t.addEventListener("webkitTransitionEnd",e),t.addEventListener("transitionEnd",e),t.classList.add("leave"),t.classList.add("leave-active"),this},enter:function(){var e=function(){t.classList.remove("enter"),t.classList.remove("enter-active"),t.removeEventListener("webkitTransitionEnd",e),t.removeEventListener("transitionEnd",e)};return t.addEventListener("webkitTransitionEnd",e),t.addEventListener("transitionEnd",e),t.classList.add("enter"),t.classList.add("enter-active"),this}}}}}(ionic),function(t,e,i){function n(){o=!0;for(var t=0;t<r.length;t++)i.requestAnimationFrame(r[t]);r=[],e.removeEventListener("DOMContentLoaded",n)}var r=[],o=!1;e.addEventListener("DOMContentLoaded",n),t._rAF=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||function(e){t.setTimeout(e,16)}}(),i.DomUtil={requestAnimationFrame:function(e){t._rAF(e)},animationFrameThrottle:function(t){var e,n,r;return function(){e=arguments,r=this,n||(n=!0,i.requestAnimationFrame(function(){t.apply(r,e),n=!1}))}},getPositionInParent:function(t){return{left:t.offsetLeft,top:t.offsetTop}},ready:function(t){o||"complete"===e.readyState?i.requestAnimationFrame(t):r.push(t)},getTextBounds:function(i){if(e.createRange){var n=e.createRange();if(n.selectNodeContents(i),n.getBoundingClientRect){var r=n.getBoundingClientRect();if(r){var o=t.scrollX,s=t.scrollY;return{top:r.top+s,left:r.left+o,right:r.left+o+r.width,bottom:r.top+s+r.height,width:r.width,height:r.height}}}}return null},getChildIndex:function(t,e){if(e)for(var i,n=t.parentNode.children,r=0,o=0,s=n.length;s>r;r++)if(i=n[r],i.nodeName&&i.nodeName.toLowerCase()==e){if(i==t)return o;o++}return Array.prototype.slice.call(t.parentNode.children).indexOf(t)},swapNodes:function(t,e){e.parentNode.insertBefore(t,e)},getParentWithClass:function(t,e,i){for(i=i||10;t.parentNode&&i--;){if(t.parentNode.classList&&t.parentNode.classList.contains(e))return t.parentNode;t=t.parentNode}return null},getParentOrSelfWithClass:function(t,e,i){for(i=i||10;t&&i--;){if(t.classList&&t.classList.contains(e))return t;t=t.parentNode}return null},rectContains:function(t,e,i,n,r,o){return i>t||t>r?!1:n>e||e>o?!1:!0}},i.requestAnimationFrame=i.DomUtil.requestAnimationFrame,i.animationFrameThrottle=i.DomUtil.animationFrameThrottle}(this,document,ionic),function(t){window.CustomEvent||!function(){var t;t=function(t,e){var i;e=e||{bubbles:!1,cancelable:!1,detail:void 0};try{i=document.createEvent("CustomEvent"),i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail)}catch(n){i=document.createEvent("Event");for(var r in e)i[r]=e[r];i.initEvent(t,e.bubbles,e.cancelable)}return i},t.prototype=window.Event.prototype,window.CustomEvent=t}(),t.EventController={VIRTUALIZED_EVENTS:["tap","swipe","swiperight","swipeleft","drag","hold","release"],trigger:function(t,e,i,n){var r=new CustomEvent(t,{detail:e,bubbles:!!i,cancelable:!!n});e&&e.target&&e.target.dispatchEvent(r)||window.dispatchEvent(r)},on:function(e,i,n){for(var r=n||window,o=0,s=this.VIRTUALIZED_EVENTS.length;s>o;o++)if(e==this.VIRTUALIZED_EVENTS[o]){var a=new t.Gesture(n);return a.on(e,i),a}r.addEventListener(e,i)},off:function(t,e,i){i.removeEventListener(t,e)},onGesture:function(e,i,n){var r=new t.Gesture(n);return r.on(e,i),r},offGesture:function(t,e,i){t.off(e,i)},handlePopState:function(){}},t.on=function(){t.EventController.on.apply(t.EventController,arguments)},t.off=function(){t.EventController.off.apply(t.EventController,arguments)},t.trigger=t.EventController.trigger,t.onGesture=function(){return t.EventController.onGesture.apply(t.EventController.onGesture,arguments)},t.offGesture=function(){return t.EventController.offGesture.apply(t.EventController.offGesture,arguments)}}(window.ionic),function(t){function e(){if(!t.Gestures.READY){t.Gestures.event.determineEventTypes();for(var e in t.Gestures.gestures)t.Gestures.gestures.hasOwnProperty(e)&&t.Gestures.detection.register(t.Gestures.gestures[e]);t.Gestures.event.onTouch(t.Gestures.DOCUMENT,t.Gestures.EVENT_MOVE,t.Gestures.detection.detect),t.Gestures.event.onTouch(t.Gestures.DOCUMENT,t.Gestures.EVENT_END,t.Gestures.detection.detect),t.Gestures.READY=!0}}t.Gesture=function(e,i){return new t.Gestures.Instance(e,i||{})},t.Gestures={},t.Gestures.defaults={stop_browser_behavior:"disable-user-behavior"},t.Gestures.HAS_POINTEREVENTS=window.navigator.pointerEnabled||window.navigator.msPointerEnabled,t.Gestures.HAS_TOUCHEVENTS="ontouchstart"in window,t.Gestures.MOBILE_REGEX=/mobile|tablet|ip(ad|hone|od)|android|silk/i,t.Gestures.NO_MOUSEEVENTS=t.Gestures.HAS_TOUCHEVENTS&&window.navigator.userAgent.match(t.Gestures.MOBILE_REGEX),t.Gestures.EVENT_TYPES={},t.Gestures.DIRECTION_DOWN="down",t.Gestures.DIRECTION_LEFT="left",t.Gestures.DIRECTION_UP="up",t.Gestures.DIRECTION_RIGHT="right",t.Gestures.POINTER_MOUSE="mouse",t.Gestures.POINTER_TOUCH="touch",t.Gestures.POINTER_PEN="pen",t.Gestures.EVENT_START="start",t.Gestures.EVENT_MOVE="move",t.Gestures.EVENT_END="end",t.Gestures.DOCUMENT=window.document,t.Gestures.plugins={},t.Gestures.READY=!1,t.Gestures.Instance=function(i,n){var r=this;if(null!==i)return e(),this.element=i,this.enabled=!0,this.options=t.Gestures.utils.extend(t.Gestures.utils.extend({},t.Gestures.defaults),n||{}),this.options.stop_browser_behavior&&t.Gestures.utils.stopDefaultBrowserBehavior(this.element,this.options.stop_browser_behavior),t.Gestures.event.onTouch(i,t.Gestures.EVENT_START,function(e){r.enabled&&t.Gestures.detection.startDetect(r,e)}),this},t.Gestures.Instance.prototype={on:function(t,e){for(var i=t.split(" "),n=0;n<i.length;n++)this.element.addEventListener(i[n],e,!1);return this},off:function(t,e){for(var i=t.split(" "),n=0;n<i.length;n++)this.element.removeEventListener(i[n],e,!1);return this},trigger:function(e,i){var n=t.Gestures.DOCUMENT.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=i;var r=this.element;return t.Gestures.utils.hasParent(i.target,r)&&(r=i.target),r.dispatchEvent(n),this},enable:function(t){return this.enabled=t,this}};var i=null,n=!1,r=!1;t.Gestures.event={bindDom:function(t,e,i){for(var n=e.split(" "),r=0;r<n.length;r++)t.addEventListener(n[r],i,!1)},onTouch:function(e,o,s){var a=this;this.bindDom(e,t.Gestures.EVENT_TYPES[o],function(l){var c=l.type.toLowerCase();if(!c.match(/mouse/)||!r){c.match(/touch/)||c.match(/pointerdown/)||c.match(/mouse/)&&1===l.which?n=!0:c.match(/mouse/)&&1!==l.which&&(n=!1),c.match(/touch|pointer/)&&(r=!0);var u=0;n&&(t.Gestures.HAS_POINTEREVENTS&&o!=t.Gestures.EVENT_END?u=t.Gestures.PointerEvent.updatePointer(o,l):c.match(/touch/)?u=l.touches.length:r||(u=c.match(/up/)?0:1),u>0&&o==t.Gestures.EVENT_END?o=t.Gestures.EVENT_MOVE:u||(o=t.Gestures.EVENT_END),(u||null===i)&&(i=l),s.call(t.Gestures.detection,a.collectEventData(e,o,a.getTouchList(i,o),l)),t.Gestures.HAS_POINTEREVENTS&&o==t.Gestures.EVENT_END&&(u=t.Gestures.PointerEvent.updatePointer(o,l))),u||(i=null,n=!1,r=!1,t.Gestures.PointerEvent.reset())}})},determineEventTypes:function(){var e;e=t.Gestures.HAS_POINTEREVENTS?t.Gestures.PointerEvent.getEvents():t.Gestures.NO_MOUSEEVENTS?["touchstart","touchmove","touchend touchcancel"]:["touchstart mousedown","touchmove mousemove","touchend touchcancel mouseup"],t.Gestures.EVENT_TYPES[t.Gestures.EVENT_START]=e[0],t.Gestures.EVENT_TYPES[t.Gestures.EVENT_MOVE]=e[1],t.Gestures.EVENT_TYPES[t.Gestures.EVENT_END]=e[2]},getTouchList:function(e){return t.Gestures.HAS_POINTEREVENTS?t.Gestures.PointerEvent.getTouchList():e.touches?e.touches:(e.indentifier=1,[e])},collectEventData:function(e,i,n,r){var o=t.Gestures.POINTER_TOUCH;return(r.type.match(/mouse/)||t.Gestures.PointerEvent.matchType(t.Gestures.POINTER_MOUSE,r))&&(o=t.Gestures.POINTER_MOUSE),{center:t.Gestures.utils.getCenter(n),timeStamp:(new Date).getTime(),target:r.target,touches:n,eventType:i,pointerType:o,srcEvent:r,preventDefault:function(){this.srcEvent.preventManipulation&&this.srcEvent.preventManipulation(),this.srcEvent.preventDefault},stopPropagation:function(){this.srcEvent.stopPropagation()},stopDetect:function(){return t.Gestures.detection.stopDetect()}}}},t.Gestures.PointerEvent={pointers:{},getTouchList:function(){var t=this,e=[];return Object.keys(t.pointers).sort().forEach(function(i){e.push(t.pointers[i])}),e},updatePointer:function(e,i){return e==t.Gestures.EVENT_END?this.pointers={}:(i.identifier=i.pointerId,this.pointers[i.pointerId]=i),Object.keys(this.pointers).length},matchType:function(e,i){if(!i.pointerType)return!1;var n={};return n[t.Gestures.POINTER_MOUSE]=i.pointerType==i.MSPOINTER_TYPE_MOUSE||i.pointerType==t.Gestures.POINTER_MOUSE,n[t.Gestures.POINTER_TOUCH]=i.pointerType==i.MSPOINTER_TYPE_TOUCH||i.pointerType==t.Gestures.POINTER_TOUCH,n[t.Gestures.POINTER_PEN]=i.pointerType==i.MSPOINTER_TYPE_PEN||i.pointerType==t.Gestures.POINTER_PEN,n[e]},getEvents:function(){return["pointerdown MSPointerDown","pointermove MSPointerMove","pointerup pointercancel MSPointerUp MSPointerCancel"]},reset:function(){this.pointers={}}},t.Gestures.utils={extend:function(t,e,i){for(var n in e)void 0!==t[n]&&i||(t[n]=e[n]);return t},hasParent:function(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1},getCenter:function(t){for(var e=[],i=[],n=0,r=t.length;r>n;n++)e.push(t[n].pageX),i.push(t[n].pageY);return{pageX:(Math.min.apply(Math,e)+Math.max.apply(Math,e))/2,pageY:(Math.min.apply(Math,i)+Math.max.apply(Math,i))/2}},getVelocity:function(t,e,i){return{x:Math.abs(e/t)||0,y:Math.abs(i/t)||0}},getAngle:function(t,e){var i=e.pageY-t.pageY,n=e.pageX-t.pageX;return 180*Math.atan2(i,n)/Math.PI},getDirection:function(e,i){var n=Math.abs(e.pageX-i.pageX),r=Math.abs(e.pageY-i.pageY);return n>=r?e.pageX-i.pageX>0?t.Gestures.DIRECTION_LEFT:t.Gestures.DIRECTION_RIGHT:e.pageY-i.pageY>0?t.Gestures.DIRECTION_UP:t.Gestures.DIRECTION_DOWN},getDistance:function(t,e){var i=e.pageX-t.pageX,n=e.pageY-t.pageY;return Math.sqrt(i*i+n*n)},getScale:function(t,e){return t.length>=2&&e.length>=2?this.getDistance(e[0],e[1])/this.getDistance(t[0],t[1]):1},getRotation:function(t,e){return t.length>=2&&e.length>=2?this.getAngle(e[1],e[0])-this.getAngle(t[1],t[0]):0},isVertical:function(e){return e==t.Gestures.DIRECTION_UP||e==t.Gestures.DIRECTION_DOWN},stopDefaultBrowserBehavior:function(t,e){t&&t.classList&&(t.classList.add(e),t.onselectstart=function(){return!1})}},t.Gestures.detection={gestures:[],current:null,previous:null,stopped:!1,startDetect:function(e,i){this.current||(this.stopped=!1,this.current={inst:e,startEvent:t.Gestures.utils.extend({},i),lastEvent:!1,name:""},this.detect(i))},detect:function(e){if(this.current&&!this.stopped){e=this.extendEventData(e);for(var i=this.current.inst.options,n=0,r=this.gestures.length;r>n;n++){var o=this.gestures[n];if(!this.stopped&&i[o.name]!==!1&&o.handler.call(o,e,this.current.inst)===!1){this.stopDetect();break}}return this.current&&(this.current.lastEvent=e),e.eventType==t.Gestures.EVENT_END&&!e.touches.length-1&&this.stopDetect(),e}},stopDetect:function(){this.previous=t.Gestures.utils.extend({},this.current),this.current=null,this.stopped=!0},extendEventData:function(e){var i=this.current.startEvent;if(i&&(e.touches.length!=i.touches.length||e.touches===i.touches)){i.touches=[];for(var n=0,r=e.touches.length;r>n;n++)i.touches.push(t.Gestures.utils.extend({},e.touches[n]))}var o=e.timeStamp-i.timeStamp,s=e.center.pageX-i.center.pageX,a=e.center.pageY-i.center.pageY,l=t.Gestures.utils.getVelocity(o,s,a);return t.Gestures.utils.extend(e,{deltaTime:o,deltaX:s,deltaY:a,velocityX:l.x,velocityY:l.y,distance:t.Gestures.utils.getDistance(i.center,e.center),angle:t.Gestures.utils.getAngle(i.center,e.center),direction:t.Gestures.utils.getDirection(i.center,e.center),scale:t.Gestures.utils.getScale(i.touches,e.touches),rotation:t.Gestures.utils.getRotation(i.touches,e.touches),startEvent:i}),e},register:function(e){var i=e.defaults||{};return void 0===i[e.name]&&(i[e.name]=!0),t.Gestures.utils.extend(t.Gestures.defaults,i,!0),e.index=e.index||1e3,this.gestures.push(e),this.gestures.sort(function(t,e){return t.index<e.index?-1:t.index>e.index?1:0}),this.gestures}},t.Gestures.gestures=t.Gestures.gestures||{},t.Gestures.gestures.Hold={name:"hold",index:10,defaults:{hold_timeout:500,hold_threshold:1},timer:null,handler:function(e,i){switch(e.eventType){case t.Gestures.EVENT_START:clearTimeout(this.timer),t.Gestures.detection.current.name=this.name,this.timer=setTimeout(function(){"hold"==t.Gestures.detection.current.name&&i.trigger("hold",e)},i.options.hold_timeout);break;case t.Gestures.EVENT_MOVE:e.distance>i.options.hold_threshold&&clearTimeout(this.timer);break;case t.Gestures.EVENT_END:clearTimeout(this.timer)}}},t.Gestures.gestures.Tap={name:"tap",index:100,defaults:{tap_max_touchtime:250,tap_max_distance:10,tap_always:!0,doubletap_distance:20,doubletap_interval:300},handler:function(e,i){if(e.eventType==t.Gestures.EVENT_END){var n=t.Gestures.detection.previous,r=!1;if(e.deltaTime>i.options.tap_max_touchtime||e.distance>i.options.tap_max_distance)return;n&&"tap"==n.name&&e.timeStamp-n.lastEvent.timeStamp<i.options.doubletap_interval&&e.distance<i.options.doubletap_distance&&(i.trigger("doubletap",e),r=!0),(!r||i.options.tap_always)&&(t.Gestures.detection.current.name="tap",i.trigger(t.Gestures.detection.current.name,e))}}},t.Gestures.gestures.Swipe={name:"swipe",index:40,defaults:{swipe_max_touches:1,swipe_velocity:.7},handler:function(e,i){if(e.eventType==t.Gestures.EVENT_END){if(i.options.swipe_max_touches>0&&e.touches.length>i.options.swipe_max_touches)return;(e.velocityX>i.options.swipe_velocity||e.velocityY>i.options.swipe_velocity)&&(i.trigger(this.name,e),i.trigger(this.name+e.direction,e))}}},t.Gestures.gestures.Drag={name:"drag",index:50,defaults:{drag_min_distance:10,correct_for_drag_min_distance:!0,drag_max_touches:1,drag_block_horizontal:!0,drag_block_vertical:!0,drag_lock_to_axis:!1,drag_lock_min_distance:25},triggered:!1,handler:function(e,i){if(t.Gestures.detection.current.name!=this.name&&this.triggered)return i.trigger(this.name+"end",e),void(this.triggered=!1);if(!(i.options.drag_max_touches>0&&e.touches.length>i.options.drag_max_touches))switch(e.eventType){case t.Gestures.EVENT_START:this.triggered=!1;break;case t.Gestures.EVENT_MOVE:if(e.distance<i.options.drag_min_distance&&t.Gestures.detection.current.name!=this.name)return;if(t.Gestures.detection.current.name!=this.name&&(t.Gestures.detection.current.name=this.name,i.options.correct_for_drag_min_distance)){var n=Math.abs(i.options.drag_min_distance/e.distance);t.Gestures.detection.current.startEvent.center.pageX+=e.deltaX*n,t.Gestures.detection.current.startEvent.center.pageY+=e.deltaY*n,e=t.Gestures.detection.extendEventData(e)}(t.Gestures.detection.current.lastEvent.drag_locked_to_axis||i.options.drag_lock_to_axis&&i.options.drag_lock_min_distance<=e.distance)&&(e.drag_locked_to_axis=!0);var r=t.Gestures.detection.current.lastEvent.direction;e.drag_locked_to_axis&&r!==e.direction&&(e.direction=t.Gestures.utils.isVertical(r)?e.deltaY<0?t.Gestures.DIRECTION_UP:t.Gestures.DIRECTION_DOWN:e.deltaX<0?t.Gestures.DIRECTION_LEFT:t.Gestures.DIRECTION_RIGHT),this.triggered||(i.trigger(this.name+"start",e),this.triggered=!0),i.trigger(this.name,e),i.trigger(this.name+e.direction,e),(i.options.drag_block_vertical&&t.Gestures.utils.isVertical(e.direction)||i.options.drag_block_horizontal&&!t.Gestures.utils.isVertical(e.direction))&&e.preventDefault();break;case t.Gestures.EVENT_END:this.triggered&&i.trigger(this.name+"end",e),this.triggered=!1}}},t.Gestures.gestures.Transform={name:"transform",index:45,defaults:{transform_min_scale:.01,transform_min_rotation:1,transform_always_block:!1},triggered:!1,handler:function(e,i){if(t.Gestures.detection.current.name!=this.name&&this.triggered)return i.trigger(this.name+"end",e),void(this.triggered=!1);if(!(e.touches.length<2))switch(i.options.transform_always_block&&e.preventDefault(),e.eventType){case t.Gestures.EVENT_START:this.triggered=!1;break;case t.Gestures.EVENT_MOVE:var n=Math.abs(1-e.scale),r=Math.abs(e.rotation);if(n<i.options.transform_min_scale&&r<i.options.transform_min_rotation)return;t.Gestures.detection.current.name=this.name,this.triggered||(i.trigger(this.name+"start",e),this.triggered=!0),i.trigger(this.name,e),r>i.options.transform_min_rotation&&i.trigger("rotate",e),n>i.options.transform_min_scale&&(i.trigger("pinch",e),i.trigger("pinch"+(e.scale<1?"in":"out"),e));break;case t.Gestures.EVENT_END:this.triggered&&i.trigger(this.name+"end",e),this.triggered=!1}}},t.Gestures.gestures.Touch={name:"touch",index:-1/0,defaults:{prevent_default:!1,prevent_mouseevents:!1},handler:function(e,i){return i.options.prevent_mouseevents&&e.pointerType==t.Gestures.POINTER_MOUSE?void e.stopDetect():(i.options.prevent_default&&e.preventDefault(),void(e.eventType==t.Gestures.EVENT_START&&i.trigger(this.name,e)))}},t.Gestures.gestures.Release={name:"release",index:1/0,handler:function(e,i){e.eventType==t.Gestures.EVENT_END&&i.trigger(this.name,e)}}}(window.ionic),function(t,e,i){function n(){i.Platform.isCordova()?e.addEventListener("deviceready",r,!1):r(),t.removeEventListener("load",n,!1)}function r(){i.Platform.isReady=!0,i.Platform.detect();for(var t=0;t<a.length;t++)a[t]();a=[],i.trigger("platformready",{target:e}),i.requestAnimationFrame(function(){e.body.classList.add("platform-ready")})}i.Platform={isReady:!1,isFullScreen:!1,platforms:null,grade:null,ua:navigator.userAgent,ready:function(t){this.isReady?t():a.push(t)},detect:function(){i.Platform._checkPlatforms(),i.requestAnimationFrame(function(){for(var t=0;t<i.Platform.platforms.length;t++)e.body.classList.add("platform-"+i.Platform.platforms[t]);e.body.classList.add("grade-"+i.Platform.grade)})},device:function(){return t.device?t.device:(this.isCordova(),{})},_checkPlatforms:function(){this.platforms=[],this.grade="a",this.isCordova()&&this.platforms.push("cordova"),this.isIPad()&&this.platforms.push("ipad");var t=this.platform();if(t){this.platforms.push(t);var e=this.version();if(e){var i=e.toString();i.indexOf(".")>0?i=i.replace(".","_"):i+="_0",this.platforms.push(t+i.split("_")[0]),this.platforms.push(t+i),this.isAndroid()&&4.4>e&&(this.grade=4>e?"c":"b")}}},isCordova:function(){return!(!t.cordova&&!t.PhoneGap&&!t.phonegap)},isIPad:function(){return this.ua.toLowerCase().indexOf("ipad")>=0},isIOS:function(){return this.is("ios")},isAndroid:function(){return this.is("android")},platform:function(){return null===o&&this.setPlatform(this.device().platform),o},setPlatform:function(t){o="undefined"!=typeof t&&null!==t&&t.length?t.toLowerCase():this.ua.indexOf("Android")>0?"android":this.ua.indexOf("iPhone")>-1||this.ua.indexOf("iPad")>-1||this.ua.indexOf("iPod")>-1?"ios":""},version:function(){return null===s&&this.setVersion(this.device().version),s},setVersion:function(t){if("undefined"!=typeof t&&null!==t&&(t=t.split("."),t=parseFloat(t[0]+"."+(t.length>1?t[1]:0)),!isNaN(t)))return void(s=t);s=0;var e=this.platform(),i={android:/Android (\d+).(\d+)?/,ios:/OS (\d+)_(\d+)?/};i[e]&&(t=this.ua.match(i[e]),t.length>2&&(s=parseFloat(t[1]+"."+t[2])))},is:function(t){if(t=t.toLowerCase(),this.platforms)for(var e=0;e<this.platforms.length;e++)if(this.platforms[e]===t)return!0;var i=this.platform();return i?i===t.toLowerCase():this.ua.toLowerCase().indexOf(t)>=0},exitApp:function(){this.ready(function(){navigator.app&&navigator.app.exitApp&&navigator.app.exitApp()})},showStatusBar:function(n){this._showStatusBar=n,this.ready(function(){i.requestAnimationFrame(function(){i.Platform._showStatusBar?(t.StatusBar&&t.StatusBar.show(),e.body.classList.remove("status-bar-hide")):(t.StatusBar&&t.StatusBar.hide(),e.body.classList.add("status-bar-hide"))})})},fullScreen:function(t,n){this.isFullScreen=t!==!1,i.DomUtil.ready(function(){i.requestAnimationFrame(function(){i.Platform.isFullScreen?e.body.classList.add("fullscreen"):e.body.classList.remove("fullscreen")}),i.Platform.showStatusBar(n===!0)})}};var o=null,s=null,a=[];t.addEventListener("load",n,!1)}(this,document,ionic),function(t,e){"use strict";e.CSS={},function(){var i,n=["webkitTransform","transform","-webkit-transform","webkit-transform","-moz-transform","moz-transform","MozTransform","mozTransform"];for(i=0;i<n.length;i++)if(void 0!==t.documentElement.style[n[i]]){e.CSS.TRANSFORM=n[i];break}for(n=["webkitTransition","mozTransition","transition"],i=0;i<n.length;i++)if(void 0!==t.documentElement.style[n[i]]){e.CSS.TRANSITION=n[i];break}}(),"classList"in t.documentElement||!Object.defineProperty||"undefined"==typeof HTMLElement||Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){function t(t){return function(){var i,n=e.className.split(/\s+/);for(i=0;i<arguments.length;i++)t(n,n.indexOf(arguments[i]),arguments[i]);e.className=n.join(" ")}}var e=this;return{add:t(function(t,e,i){~e||t.push(i)}),remove:t(function(t,e){~e&&t.splice(e,1)}),toggle:t(function(t,e,i){~e?t.splice(e,1):t.push(i)}),contains:function(t){return!!~e.className.split(/\s+/).indexOf(t)},item:function(t){return e.className.split(/\s+/)[t]||null}}}})}(document,ionic),function(t,e,i){"use strict";function n(t){if(t.gesture&&t.gesture.srcEvent){var e=t.gesture.srcEvent,n=e.target;if(o(e))return u(e);for(var r=0;5>r&&n;r++){if("INPUT"===n.tagName||"A"===n.tagName||"BUTTON"===n.tagName||"LABEL"===n.tagName||"TEXTAREA"===n.tagName)return i.tapElement(n,e);n=n.parentElement}h()}}function r(t){return t.target.control||o(t)||s(t)?u(t):void a(t)}function o(t){var e,i,n;for(e in f)if(i=f[e],n||(n=l(t)),n.x>i.x-v&&n.x<i.x+v&&n.y>i.y-v&&n.y<i.y+v)return i}function s(t){var e=l(t);return 0===e.x&&0===e.y?!1:e.x>g.x+2||e.x<g.x-2||e.y>g.y+2||e.y<g.y-2}function a(t){var e=l(t);if(e.x&&e.y){var i=Date.now();f[i]={x:e.x,y:e.y,id:i},setTimeout(function(){delete f[i]},p)}}function l(t){var e=t.gesture?t.gesture:t;if(e){var i=e.touches&&e.touches.length?e.touches:[e],n=e.changedTouches&&e.changedTouches[0]||e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]||i[0].originalEvent||i[0];if(n)return{x:n.clientX||n.pageX,y:n.clientY||n.pageY}}return{x:0,y:0}}function c(t){clearTimeout(_),_=setTimeout(function(){var e=o(t);e&&delete f[e.id],g={}},m)}function u(t){return t.stopPropagation(),t.preventDefault(),!1}function h(){var t=e.activeElement;!t||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName||setTimeout(function(){t.blur()},400)}function d(t){g=l(t)}i.tapElement=function(i,n){var r=i.control||i;if(!r.disabled&&"file"!==r.type&&"range"!==r.type){var s=l(n),c=e.createEvent("MouseEvents");return c.initMouseEvent("click",!0,!0,t,1,0,0,s.x,s.y,!1,!1,!1,!1,0,null),r.dispatchEvent(c),"INPUT"===r.tagName||"TEXTAREA"===r.tagName?(r.focus(),n.preventDefault()):h(),o(n)||a(n),i.control?u(n):void 0}};var _,f={},g={},p=1500,m=380,v=15;i.Platform.ready(function(){"c"===i.Platform.grade&&(m=800),e.addEventListener("click",r,!0),i.on("release",n,e),e.addEventListener("touchend",c,!1),e.addEventListener("mouseup",c,!1),e.addEventListener("touchstart",d,!1),e.addEventListener("mousedown",d,!1)})}(this,document,ionic),function(t,e){"use strict";function i(){for(var t in s)s[t]&&(s[t].classList.add("active"),a[t]=s[t]);s={}}function n(){for(var t in a)a[t]&&(a[t].classList.remove("active"),delete a[t])}function r(){setTimeout(o,200)}function o(){s={},e.requestAnimationFrame(n),t.body.removeEventListener("mousemove",o),t.body.removeEventListener("touchmove",o)}var s={},a={},l=0;e.activator={start:function(n){e.requestAnimationFrame(function(){for(var r,a=n.target,c=0;4>c&&a;c++){if(r&&a.classList.contains("item")){r=a;break}if(("A"==a.tagName||"BUTTON"==a.tagName||a.getAttribute("ng-click"))&&(r=a),a.classList.contains("button")){r=a;break}a=a.parentElement}r&&(s[l]=r,"touchstart"===n.type?(t.body.removeEventListener("mousedown",e.activator.start),t.body.addEventListener("touchmove",o,!1),setTimeout(i,85)):(t.body.addEventListener("mousemove",o,!1),e.requestAnimationFrame(i)),l=l>19?0:l+1)})}},window.addEventListener("load",function(){t.body.addEventListener("touchstart",e.activator.start,!1),t.body.addEventListener("mousedown",e.activator.start,!1),t.body.addEventListener("touchend",r,!1),t.body.addEventListener("mouseup",r,!1),t.body.addEventListener("touchcancel",r,!1)},!1)}(document,ionic),function(t){var e=["0","0","0"];t.Utils={arrayMove:function(t,e,i){if(i>=t.length)for(var n=i-t.length;n--+1;)t.push(void 0);return t.splice(i,0,t.splice(e,1)[0]),t},proxy:function(t,e){var i=Array.prototype.slice.call(arguments,2);return function(){return t.apply(e,i.concat(Array.prototype.slice.call(arguments)))}},debounce:function(t,e,i){var n,r,o,s,a;return function(){o=this,r=arguments,s=new Date;var l=function(){var c=new Date-s;e>c?n=setTimeout(l,e-c):(n=null,i||(a=t.apply(o,r)))},c=i&&!n;return n||(n=setTimeout(l,e)),c&&(a=t.apply(o,r)),a}},throttle:function(t,e,i){var n,r,o,s=null,a=0;i||(i={});var l=function(){a=i.leading===!1?0:Date.now(),s=null,o=t.apply(n,r)};return function(){var c=Date.now();a||i.leading!==!1||(a=c);var u=e-(c-a);return n=this,r=arguments,0>=u?(clearTimeout(s),s=null,a=c,o=t.apply(n,r)):s||i.trailing===!1||(s=setTimeout(l,u)),o}},inherit:function(e,i){var n,r=this;n=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return r.apply(this,arguments)},t.extend(n,r,i);var o=function(){this.constructor=n};return o.prototype=r.prototype,n.prototype=new o,e&&t.extend(n.prototype,e),n.__super__=r.prototype,n},extend:function(t){for(var e=Array.prototype.slice.call(arguments,1),i=0;i<e.length;i++){var n=e[i];if(n)for(var r in n)t[r]=n[r]}return t},nextUid:function(){for(var t,i=e.length;i;){if(i--,t=e[i].charCodeAt(0),57==t)return e[i]="A",e.join("");if(90!=t)return e[i]=String.fromCharCode(t+1),e.join("");e[i]="0"}return e.unshift("0"),e.join("")}},t.inherit=t.Utils.inherit,t.extend=t.Utils.extend,t.throttle=t.Utils.throttle,t.proxy=t.Utils.proxy,t.debounce=t.Utils.debounce}(window.ionic),function(t){function e(){function e(){function e(){i=r-window.innerHeight;var e=document.activeElement;e&&t.trigger("scrollChildIntoView",{target:e},!0)}n!==window.innerWidth?(n=window.innerWidth,r=window.innerHeight):r!==window.innerHeight&&window.innerHeight<r?(document.body.classList.add("footer-hide"),t.requestAnimationFrame(e)):document.body.classList.remove("footer-hide")}var i,n=window.innerWidth,r=window.innerHeight;window.addEventListener("resize",e)}t.Platform.ready(function(){t.Platform.is("android")&&e()})}(window.ionic),function(t){"use strict";t.views.View=function(){this.initialize.apply(this,arguments)},t.views.View.inherit=t.inherit,t.extend(t.views.View.prototype,{initialize:function(){}})}(window.ionic);var t=/input|textarea|select/i,e=/object|embed/i;!function(t){var e=Date.now||function(){return+new Date},i=60,n=1e3,r={},o=1;if(t.core)s.effect||(s.effect={});else var s=t.core={effect:{}};s.effect.Animate={requestAnimationFrame:function(){var e=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame,i=!!e;if(e&&!/requestAnimationFrame\(\)\s*\{\s*\[native code\]\s*\}/i.test(e.toString())&&(i=!1),i)return function(t,i){e(t,i)};var n=60,r={},o=0,s=1,a=null,l=+new Date;return function(t){var e=s++;return r[e]=t,o++,null===a&&(a=setInterval(function(){var t=+new Date,e=r;r={},o=0;for(var i in e)e.hasOwnProperty(i)&&(e[i](t),l=t);t-l>2500&&(clearInterval(a),a=null)},1e3/n)),e}}(),stop:function(t){var e=null!=r[t];return e&&(r[t]=null),e},isRunning:function(t){return null!=r[t]},start:function(t,a,l,c,u,h){var d=e(),_=d,f=0,g=0,p=o++;if(h||(h=document.body),p%20===0){var m={};for(var v in r)m[v]=!0;r=m}var T=function(o){var m=o!==!0,v=e();if(!r[p]||a&&!a(p))return r[p]=null,void(l&&l(i-g/((v-d)/n),p,!1));if(m)for(var E=Math.round((v-_)/(n/i))-1,w=0;w<Math.min(E,4);w++)T(!0),g++;c&&(f=(v-d)/c,f>1&&(f=1));var y=u?u(f):f;t(y,v,m)!==!1&&1!==f||!m?m&&(_=v,s.effect.Animate.requestAnimationFrame(T,h)):(r[p]=null,l&&l(i-g/((v-d)/n),p,1===f||null==c))};return r[p]=!0,s.effect.Animate.requestAnimationFrame(T,h),p}}}(this);!function(i){var n=function(){},r=function(t){return Math.pow(t-1,3)+1},o=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)};i.views.Scroll=i.views.View.inherit({initialize:function(t){var e=this;this.__container=t.el,this.__content=t.el.firstElementChild,setTimeout(function(){e.__container&&e.__content&&(e.__container.scrollTop=0,e.__content.scrollTop=0)}),this.options={scrollingX:!1,scrollbarX:!0,scrollingY:!0,scrollbarY:!0,startX:0,startY:0,wheelDampen:6,minScrollbarSizeX:5,minScrollbarSizeY:5,scrollbarsFade:!0,scrollbarFadeDelay:300,scrollbarResizeFadeDelay:1e3,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:n,penetrationDeceleration:.03,penetrationAcceleration:.08,scrollEventInterval:50};for(var r in t)this.options[r]=t[r];this.hintResize=i.debounce(function(){e.resize()},1e3,!0),this.triggerScrollEvent=i.throttle(function(){i.trigger("scroll",{scrollTop:e.__scrollTop,scrollLeft:e.__scrollLeft,target:e.__container})},this.options.scrollEventInterval),this.triggerScrollEndEvent=function(){i.trigger("scrollend",{scrollTop:e.__scrollTop,scrollLeft:e.__scrollLeft,target:e.__container})},this.__scrollLeft=this.options.startX,this.__scrollTop=this.options.startY,this.__callback=this.getRenderFn(),this.__initEventHandlers(),this.__createScrollbars()},run:function(){this.resize(),this.__fadeScrollbars("out",this.options.scrollbarResizeFadeDelay)},__isSingleTouch:!1,__isTracking:!1,__didDecelerationComplete:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__refreshHeight:null,__refreshActive:!1,__refreshActivate:null,__refreshDeactivate:null,__refreshStart:null,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,__transformProperty:null,__perspectiveProperty:null,__indicatorX:null,__indicatorY:null,__scrollbarFadeTimeout:null,__didWaitForSize:null,__sizerTimeout:null,__initEventHandlers:function(){function n(i){return i.target.tagName.match(t)||i.target.isContentEditable||i.target.tagName.match(e)||i.target.dataset.preventScroll}var r=this,o=this.__container;if(o.addEventListener("scrollChildIntoView",function(t){var e=window.innerHeight,n=t.target,s=t.target.offsetHeight,a=n.getBoundingClientRect().top,l=i.DomUtil.getPositionInParent(n,o).top;a+s>e&&r.scrollTo(0,l+s-.5*e,!0),t.stopPropagation()
}),"ontouchstart"in window)o.addEventListener("touchstart",function(t){t.defaultPrevented||n(t)||(r.doTouchStart(t.touches,t.timeStamp),t.preventDefault())},!1),document.addEventListener("touchmove",function(t){t.defaultPrevented||r.doTouchMove(t.touches,t.timeStamp)},!1),document.addEventListener("touchend",function(t){r.doTouchEnd(t.timeStamp)},!1);else{var s=!1;o.addEventListener("mousedown",function(t){t.defaultPrevented||n(t)||(r.doTouchStart([{pageX:t.pageX,pageY:t.pageY}],t.timeStamp),t.preventDefault(),s=!0)},!1),document.addEventListener("mousemove",function(t){s&&!t.defaultPrevented&&(r.doTouchMove([{pageX:t.pageX,pageY:t.pageY}],t.timeStamp),s=!0)},!1),document.addEventListener("mouseup",function(t){s&&(r.doTouchEnd(t.timeStamp),s=!1)},!1);var a=i.debounce(function(){r.__fadeScrollbars("in")},500,!0),l=i.debounce(function(){r.__fadeScrollbars("out")},100,!1);document.addEventListener("mousewheel",function(t){a(),r.scrollBy(t.wheelDeltaX/r.options.wheelDampen,-t.wheelDeltaY/r.options.wheelDampen),l()})}},__createScrollbar:function(t){var e=document.createElement("div"),i=document.createElement("div");return i.className="scroll-bar-indicator",e.className="h"==t?"scroll-bar scroll-bar-h":"scroll-bar scroll-bar-v",e.appendChild(i),e},__createScrollbars:function(){var t,e;this.options.scrollingX&&(t={el:this.__createScrollbar("h"),sizeRatio:1},t.indicator=t.el.children[0],this.options.scrollbarX&&this.__container.appendChild(t.el),this.__indicatorX=t),this.options.scrollingY&&(e={el:this.__createScrollbar("v"),sizeRatio:1},e.indicator=e.el.children[0],this.options.scrollbarY&&this.__container.appendChild(e.el),this.__indicatorY=e)},__resizeScrollbars:function(){var t=this;if(t.__indicatorX){var e=Math.max(Math.round(t.__clientWidth*t.__clientWidth/t.__contentWidth),20);e>t.__contentWidth&&(e=0),t.__indicatorX.size=e,t.__indicatorX.minScale=this.options.minScrollbarSizeX/e,t.__indicatorX.indicator.style.width=e+"px",t.__indicatorX.maxPos=t.__clientWidth-e,t.__indicatorX.sizeRatio=t.__maxScrollLeft?t.__indicatorX.maxPos/t.__maxScrollLeft:1}if(t.__indicatorY){var i=Math.max(Math.round(t.__clientHeight*t.__clientHeight/t.__contentHeight),20);i>t.__contentHeight&&(i=0),t.__indicatorY.size=i,t.__indicatorY.minScale=this.options.minScrollbarSizeY/i,t.__indicatorY.maxPos=t.__clientHeight-i,t.__indicatorY.indicator.style.height=i+"px",t.__indicatorY.sizeRatio=t.__maxScrollTop?t.__indicatorY.maxPos/t.__maxScrollTop:1}},__repositionScrollbars:function(){var t,e,i,n,r,o=this,s=0,a=0;o.__indicatorX&&(o.__indicatorY&&(s=10),n=Math.round(o.__indicatorX.sizeRatio*o.__scrollLeft)||0,e=o.__scrollLeft-(o.__maxScrollLeft-s),o.__scrollLeft<0?(widthScale=Math.max(o.__indicatorX.minScale,(o.__indicatorX.size-Math.abs(o.__scrollLeft))/o.__indicatorX.size),n=0,o.__indicatorX.indicator.style[o.__transformOriginProperty]="left center"):e>0?(widthScale=Math.max(o.__indicatorX.minScale,(o.__indicatorX.size-e)/o.__indicatorX.size),n=o.__indicatorX.maxPos-s,o.__indicatorX.indicator.style[o.__transformOriginProperty]="right center"):(n=Math.min(o.__maxScrollLeft,Math.max(0,n)),widthScale=1),o.__indicatorX.indicator.style[o.__transformProperty]="translate3d("+n+"px, 0, 0) scaleX("+widthScale+")"),o.__indicatorY&&(r=Math.round(o.__indicatorY.sizeRatio*o.__scrollTop)||0,o.__indicatorX&&(a=10),i=o.__scrollTop-(o.__maxScrollTop-a),o.__scrollTop<0?(t=Math.max(o.__indicatorY.minScale,(o.__indicatorY.size-Math.abs(o.__scrollTop))/o.__indicatorY.size),r=0,o.__indicatorY.indicator.style[o.__transformOriginProperty]="center top"):i>0?(t=Math.max(o.__indicatorY.minScale,(o.__indicatorY.size-i)/o.__indicatorY.size),r=o.__indicatorY.maxPos-a,o.__indicatorY.indicator.style[o.__transformOriginProperty]="center bottom"):(r=Math.min(o.__maxScrollTop,Math.max(0,r)),t=1),o.__indicatorY.indicator.style[o.__transformProperty]="translate3d(0,"+r+"px, 0) scaleY("+t+")")},__fadeScrollbars:function(t,e){var i=this;if(this.options.scrollbarsFade){var n="scroll-bar-fade-out";i.options.scrollbarsFade===!0&&(clearTimeout(i.__scrollbarFadeTimeout),"in"==t?(i.__indicatorX&&i.__indicatorX.indicator.classList.remove(n),i.__indicatorY&&i.__indicatorY.indicator.classList.remove(n)):i.__scrollbarFadeTimeout=setTimeout(function(){i.__indicatorX&&i.__indicatorX.indicator.classList.add(n),i.__indicatorY&&i.__indicatorY.indicator.classList.add(n)},e||i.options.scrollbarFadeDelay))}},__scrollingComplete:function(){var t=this;t.options.scrollingComplete(),t.__fadeScrollbars("out")},resize:function(){this.setDimensions(this.__container.clientWidth,this.__container.clientHeight,Math.max(this.__content.scrollWidth,this.__content.offsetWidth),Math.max(this.__content.scrollHeight,this.__content.offsetHeight))},getRenderFn:function(){var t,e=this,i=this.__content,n=document.documentElement.style;"MozAppearance"in n?t="gecko":"WebkitAppearance"in n?t="webkit":"string"==typeof navigator.cpuClass&&(t="trident");var r,o={trident:"ms",gecko:"Moz",webkit:"Webkit",presto:"O"}[t],s=document.createElement("div"),a=o+"Perspective",l=o+"Transform",c=o+"TransformOrigin";return e.__perspectiveProperty=l,e.__transformProperty=l,e.__transformOriginProperty=c,s.style[a]!==r?function(t,n){i.style[l]="translate3d("+-t+"px,"+-n+"px,0)",e.__repositionScrollbars(),e.triggerScrollEvent()}:s.style[l]!==r?function(t,n){i.style[l]="translate("+-t+"px,"+-n+"px)",e.__repositionScrollbars(),e.triggerScrollEvent()}:function(t,n,r){i.style.marginLeft=t?-t/r+"px":"",i.style.marginTop=n?-n/r+"px":"",i.style.zoom=r||"",e.__repositionScrollbars(),e.triggerScrollEvent()}},setDimensions:function(t,e,i,n){var r=this;t===+t&&(r.__clientWidth=t),e===+e&&(r.__clientHeight=e),i===+i&&(r.__contentWidth=i),n===+n&&(r.__contentHeight=n),r.__computeScrollMax(),r.__resizeScrollbars(),r.scrollTo(r.__scrollLeft,r.__scrollTop,!0)},setPosition:function(t,e){var i=this;i.__clientLeft=t||0,i.__clientTop=e||0},setSnapSize:function(t,e){var i=this;i.__snapWidth=t,i.__snapHeight=e},activatePullToRefresh:function(t,e,i,n){var r=this;r.__refreshHeight=t,r.__refreshActivate=e,r.__refreshDeactivate=i,r.__refreshStart=n},triggerPullToRefresh:function(){this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()},finishPullToRefresh:function(){var t=this;t.__refreshActive=!1,t.__refreshDeactivate&&t.__refreshDeactivate(),t.scrollTo(t.__scrollLeft,t.__scrollTop,!0)},getValues:function(){var t=this;return{left:t.__scrollLeft,top:t.__scrollTop,zoom:t.__zoomLevel}},getScrollMax:function(){var t=this;return{left:t.__maxScrollLeft,top:t.__maxScrollTop}},zoomTo:function(t,e,i,n){var r=this;if(!r.options.zooming)throw new Error("Zooming is not enabled!");r.__isDecelerating&&(core.effect.Animate.stop(r.__isDecelerating),r.__isDecelerating=!1);var o=r.__zoomLevel;null==i&&(i=r.__clientWidth/2),null==n&&(n=r.__clientHeight/2),t=Math.max(Math.min(t,r.options.maxZoom),r.options.minZoom),r.__computeScrollMax(t);var s=(i+r.__scrollLeft)*t/o-i,a=(n+r.__scrollTop)*t/o-n;s>r.__maxScrollLeft?s=r.__maxScrollLeft:0>s&&(s=0),a>r.__maxScrollTop?a=r.__maxScrollTop:0>a&&(a=0),r.__publish(s,a,t,e)},zoomBy:function(t,e,i,n){var r=this;r.zoomTo(r.__zoomLevel*t,e,i,n)},scrollTo:function(t,e,i,n){var r=this;if(r.__isDecelerating&&(core.effect.Animate.stop(r.__isDecelerating),r.__isDecelerating=!1),null!=n&&n!==r.__zoomLevel){if(!r.options.zooming)throw new Error("Zooming is not enabled!");t*=n,e*=n,r.__computeScrollMax(n)}else n=r.__zoomLevel;r.options.scrollingX?r.options.paging?t=Math.round(t/r.__clientWidth)*r.__clientWidth:r.options.snapping&&(t=Math.round(t/r.__snapWidth)*r.__snapWidth):t=r.__scrollLeft,r.options.scrollingY?r.options.paging?e=Math.round(e/r.__clientHeight)*r.__clientHeight:r.options.snapping&&(e=Math.round(e/r.__snapHeight)*r.__snapHeight):e=r.__scrollTop,t=Math.max(Math.min(r.__maxScrollLeft,t),0),e=Math.max(Math.min(r.__maxScrollTop,e),0),t===r.__scrollLeft&&e===r.__scrollTop&&(i=!1),r.__publish(t,e,n,i)},scrollBy:function(t,e,i){var n=this,r=n.__isAnimating?n.__scheduledLeft:n.__scrollLeft,o=n.__isAnimating?n.__scheduledTop:n.__scrollTop;n.scrollTo(r+(t||0),o+(e||0),i)},doMouseZoom:function(t,e,i,n){var r=this,o=t>0?.97:1.03;return r.zoomTo(r.__zoomLevel*o,!1,i-r.__clientLeft,n-r.__clientTop)},doTouchStart:function(t,e){if(this.hintResize(),null==t.length)throw new Error("Invalid touch list: "+t);if(e instanceof Date&&(e=e.valueOf()),"number"!=typeof e)throw new Error("Invalid timestamp value: "+e);var i=this;i.__interruptedAnimation=!0,i.__isDecelerating&&(core.effect.Animate.stop(i.__isDecelerating),i.__isDecelerating=!1,i.__interruptedAnimation=!0),i.__isAnimating&&(core.effect.Animate.stop(i.__isAnimating),i.__isAnimating=!1,i.__interruptedAnimation=!0);var n,r,o=1===t.length;o?(n=t[0].pageX,r=t[0].pageY):(n=Math.abs(t[0].pageX+t[1].pageX)/2,r=Math.abs(t[0].pageY+t[1].pageY)/2),i.__initialTouchLeft=n,i.__initialTouchTop=r,i.__zoomLevelStart=i.__zoomLevel,i.__lastTouchLeft=n,i.__lastTouchTop=r,i.__lastTouchMove=e,i.__lastScale=1,i.__enableScrollX=!o&&i.options.scrollingX,i.__enableScrollY=!o&&i.options.scrollingY,i.__isTracking=!0,i.__didDecelerationComplete=!1,i.__isDragging=!o,i.__isSingleTouch=o,i.__positions=[]},doTouchMove:function(t,e,i){if(null==t.length)throw new Error("Invalid touch list: "+t);if(e instanceof Date&&(e=e.valueOf()),"number"!=typeof e)throw new Error("Invalid timestamp value: "+e);var n=this;if(n.__isTracking){var r,o;2===t.length?(r=Math.abs(t[0].pageX+t[1].pageX)/2,o=Math.abs(t[0].pageY+t[1].pageY)/2):(r=t[0].pageX,o=t[0].pageY);var s=n.__positions;if(n.__isDragging){var a=r-n.__lastTouchLeft,l=o-n.__lastTouchTop,c=n.__scrollLeft,u=n.__scrollTop,h=n.__zoomLevel;if(null!=i&&n.options.zooming){var d=h;if(h=h/n.__lastScale*i,h=Math.max(Math.min(h,n.options.maxZoom),n.options.minZoom),d!==h){var _=r-n.__clientLeft,f=o-n.__clientTop;c=(_+c)*h/d-_,u=(f+u)*h/d-f,n.__computeScrollMax(h)}}if(n.__enableScrollX){c-=a*this.options.speedMultiplier;var g=n.__maxScrollLeft;(c>g||0>c)&&(n.options.bouncing?c+=a/2*this.options.speedMultiplier:c=c>g?g:0)}if(n.__enableScrollY){u-=l*this.options.speedMultiplier;var p=n.__maxScrollTop;(u>p||0>u)&&(n.options.bouncing||n.__refreshHeight&&0>u?(u+=l/2*this.options.speedMultiplier,n.__enableScrollX||null==n.__refreshHeight||(!n.__refreshActive&&u<=-n.__refreshHeight?(n.__refreshActive=!0,n.__refreshActivate&&n.__refreshActivate()):n.__refreshActive&&u>-n.__refreshHeight&&(n.__refreshActive=!1,n.__refreshDeactivate&&n.__refreshDeactivate()))):u=u>p?p:0)}s.length>60&&s.splice(0,30),s.push(c,u,e),n.__publish(c,u,h)}else{var m=n.options.locking?3:0,v=5,T=Math.abs(r-n.__initialTouchLeft),E=Math.abs(o-n.__initialTouchTop);n.__enableScrollX=n.options.scrollingX&&T>=m,n.__enableScrollY=n.options.scrollingY&&E>=m,s.push(n.__scrollLeft,n.__scrollTop,e),n.__isDragging=(n.__enableScrollX||n.__enableScrollY)&&(T>=v||E>=v),n.__isDragging&&(n.__interruptedAnimation=!1,n.__fadeScrollbars("in"))}n.__lastTouchLeft=r,n.__lastTouchTop=o,n.__lastTouchMove=e,n.__lastScale=i}},doTouchEnd:function(t){if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);var e=this;if(e.__isTracking){if(e.__isTracking=!1,e.__isDragging)if(e.__isDragging=!1,e.__isSingleTouch&&e.options.animating&&t-e.__lastTouchMove<=100){for(var i=e.__positions,n=i.length-1,r=n,o=n;o>0&&i[o]>e.__lastTouchMove-100;o-=3)r=o;if(r!==n){var s=i[n]-i[r],a=e.__scrollLeft-i[r-2],l=e.__scrollTop-i[r-1];e.__decelerationVelocityX=a/s*(1e3/60),e.__decelerationVelocityY=l/s*(1e3/60);var c=e.options.paging||e.options.snapping?4:1;(Math.abs(e.__decelerationVelocityX)>c||Math.abs(e.__decelerationVelocityY)>c)&&(e.__refreshActive||e.__startDeceleration(t))}else e.__scrollingComplete()}else t-e.__lastTouchMove>100&&e.__scrollingComplete();e.__isDecelerating||(e.__refreshActive&&e.__refreshStart?(e.__publish(e.__scrollLeft,-e.__refreshHeight,e.__zoomLevel,!0),e.__refreshStart&&e.__refreshStart()):((e.__interruptedAnimation||e.__isDragging)&&e.__scrollingComplete(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0,e.__zoomLevel),e.__refreshActive&&(e.__refreshActive=!1,e.__refreshDeactivate&&e.__refreshDeactivate()))),e.__positions.length=0}},__publish:function(t,e,i,n){var s=this,a=s.__isAnimating;if(a&&(core.effect.Animate.stop(a),s.__isAnimating=!1),n&&s.options.animating){s.__scheduledLeft=t,s.__scheduledTop=e,s.__scheduledZoom=i;var l=s.__scrollLeft,c=s.__scrollTop,u=s.__zoomLevel,h=t-l,d=e-c,_=i-u,f=function(t,e,i){i&&(s.__scrollLeft=l+h*t,s.__scrollTop=c+d*t,s.__zoomLevel=u+_*t,s.__callback&&s.__callback(s.__scrollLeft,s.__scrollTop,s.__zoomLevel))},g=function(t){return s.__isAnimating===t},p=function(t,e,i){e===s.__isAnimating&&(s.__isAnimating=!1),(s.__didDecelerationComplete||i)&&s.__scrollingComplete(),s.options.zooming&&s.__computeScrollMax()};s.__isAnimating=core.effect.Animate.start(f,g,p,s.options.animationDuration,a?r:o)}else s.__scheduledLeft=s.__scrollLeft=t,s.__scheduledTop=s.__scrollTop=e,s.__scheduledZoom=s.__zoomLevel=i,s.__callback&&s.__callback(t,e,i),s.options.zooming&&s.__computeScrollMax()},__computeScrollMax:function(t){var e=this;null==t&&(t=e.__zoomLevel),e.__maxScrollLeft=Math.max(e.__contentWidth*t-e.__clientWidth,0),e.__maxScrollTop=Math.max(e.__contentHeight*t-e.__clientHeight,0),e.__didWaitForSize||0!=e.__maxScrollLeft||0!=e.__maxScrollTop||(e.__didWaitForSize=!0,e.__waitForSize())},__waitForSize:function(){var t=this;clearTimeout(t.__sizerTimeout);var e=function(){t.resize(),t.options.scrollingX&&0==t.__maxScrollLeft||t.options.scrollingY&&0==t.__maxScrollTop};e(),t.__sizerTimeout=setTimeout(e,1e3)},__startDeceleration:function(){var t=this;if(t.options.paging){var e=Math.max(Math.min(t.__scrollLeft,t.__maxScrollLeft),0),i=Math.max(Math.min(t.__scrollTop,t.__maxScrollTop),0),n=t.__clientWidth,r=t.__clientHeight;t.__minDecelerationScrollLeft=Math.floor(e/n)*n,t.__minDecelerationScrollTop=Math.floor(i/r)*r,t.__maxDecelerationScrollLeft=Math.ceil(e/n)*n,t.__maxDecelerationScrollTop=Math.ceil(i/r)*r}else t.__minDecelerationScrollLeft=0,t.__minDecelerationScrollTop=0,t.__maxDecelerationScrollLeft=t.__maxScrollLeft,t.__maxDecelerationScrollTop=t.__maxScrollTop;var o=function(e,i,n){t.__stepThroughDeceleration(n)};t.__minVelocityToKeepDecelerating=t.options.snapping?4:.1;var s=function(){var e=Math.abs(t.__decelerationVelocityX)>=t.__minVelocityToKeepDecelerating||Math.abs(t.__decelerationVelocityY)>=t.__minVelocityToKeepDecelerating;return e||(t.__didDecelerationComplete=!0),e},a=function(){t.__isDecelerating=!1,t.__didDecelerationComplete&&t.__scrollingComplete(),t.options.paging&&t.scrollTo(t.__scrollLeft,t.__scrollTop,t.options.snapping)};t.__isDecelerating=core.effect.Animate.start(o,s,a)},__stepThroughDeceleration:function(t){var e=this,i=e.__scrollLeft+e.__decelerationVelocityX,n=e.__scrollTop+e.__decelerationVelocityY;if(!e.options.bouncing){var r=Math.max(Math.min(e.__maxDecelerationScrollLeft,i),e.__minDecelerationScrollLeft);r!==i&&(i=r,e.__decelerationVelocityX=0);var o=Math.max(Math.min(e.__maxDecelerationScrollTop,n),e.__minDecelerationScrollTop);o!==n&&(n=o,e.__decelerationVelocityY=0)}if(t?e.__publish(i,n,e.__zoomLevel):(e.__scrollLeft=i,e.__scrollTop=n),!e.options.paging){var s=.95;e.__decelerationVelocityX*=s,e.__decelerationVelocityY*=s}if(e.options.bouncing){var a=0,l=0,c=e.options.penetrationDeceleration,u=e.options.penetrationAcceleration;if(i<e.__minDecelerationScrollLeft?a=e.__minDecelerationScrollLeft-i:i>e.__maxDecelerationScrollLeft&&(a=e.__maxDecelerationScrollLeft-i),n<e.__minDecelerationScrollTop?l=e.__minDecelerationScrollTop-n:n>e.__maxDecelerationScrollTop&&(l=e.__maxDecelerationScrollTop-n),0!==a){var h=a*e.__decelerationVelocityX<=e.__minDecelerationScrollLeft;h&&(e.__decelerationVelocityX+=a*c);var d=Math.abs(e.__decelerationVelocityX)<=e.__minVelocityToKeepDecelerating;(!h||d)&&(e.__decelerationVelocityX=a*u)}if(0!==l){var _=l*e.__decelerationVelocityY<=e.__minDecelerationScrollTop;_&&(e.__decelerationVelocityY+=l*c);var f=Math.abs(e.__decelerationVelocityY)<=e.__minVelocityToKeepDecelerating;(!_||f)&&(e.__decelerationVelocityY=l*u)}}}})}(ionic),function(t){"use strict";t.views.ActionSheet=t.views.View.inherit({initialize:function(t){this.el=t.el},show:function(){this.el.offsetWidth,this.el.classList.add("active")},hide:function(){this.el.offsetWidth,this.el.classList.remove("active")}})}(ionic),function(t){"use strict";t.views.HeaderBar=t.views.View.inherit({initialize:function(e){this.el=e.el,t.extend(this,{alignTitle:"center"},e),this.align()},align:function(e){e||(e=this.alignTitle);var i=this.el.querySelector(".title");if(i){var n,r,o,s=this.el.childNodes,a=0,l=0,c=!1;for(n=0;n<s.length;n++)r=s[n],r.tagName&&"h1"==r.tagName.toLowerCase()?c=!0:(o=null,3==r.nodeType?o=t.DomUtil.getTextBounds(r):1==r.nodeType&&(o=r.getBoundingClientRect()),o&&(c?l+=o.width:a+=o.width));t.requestAnimationFrame(function(){var t=Math.max(a,l)+10;"center"==e?(t>10&&(i.style.left=t+"px",i.style.right=t+"px"),i.offsetWidth<i.scrollWidth&&l>0&&(i.style.right=l+5+"px")):"left"==e?(i.classList.add("title-left"),a>0&&(i.style.left=a+15+"px")):"right"==e&&(i.classList.add("title-right"),l>0&&(i.style.right=l+15+"px"))})}}})}(ionic),function(t){"use strict";var e="item",i="item-content",n="item-sliding",r="item-options",o="item-placeholder",s="item-reordering",a="item-reorder",l=function(){};l.prototype={start:function(){},drag:function(){},end:function(){},isSameItem:function(){return!1}};var c=function(t){this.dragThresholdX=t.dragThresholdX||10,this.el=t.el};c.prototype=new l,c.prototype.start=function(o){var s,a,l,c;s=o.target.classList.contains(i)?o.target:o.target.classList.contains(e)?o.target.querySelector("."+i):t.DomUtil.getParentWithClass(o.target,i),s&&(s.classList.remove(n),l=parseFloat(s.style[t.CSS.TRANSFORM].replace("translate3d(","").split(",")[0])||0,a=s.parentNode.querySelector("."+r),a&&(c=a.offsetWidth,this._currentDrag={buttonsWidth:c,content:s,startOffsetX:l}))},c.prototype.isSameItem=function(t){return t._lastDrag&&this._currentDrag?this._currentDrag.content==t._lastDrag.content:!1},c.prototype.clean=function(){var e=this._lastDrag;e&&t.requestAnimationFrame(function(){e.content.style[t.CSS.TRANSITION]="",e.content.style[t.CSS.TRANSFORM]="translate3d(0, 0, 0)"})},c.prototype.drag=t.animationFrameThrottle(function(e){var i;if(this._currentDrag&&(!this._isDragging&&(Math.abs(e.gesture.deltaX)>this.dragThresholdX||Math.abs(this._currentDrag.startOffsetX)>0)&&(this._isDragging=!0),this._isDragging)){i=this._currentDrag.buttonsWidth;var n=Math.min(0,this._currentDrag.startOffsetX+e.gesture.deltaX);-i>n&&(n=Math.min(-i,-i+.4*(e.gesture.deltaX+i))),this._currentDrag.content.style[t.CSS.TRANSFORM]="translate3d("+n+"px, 0, 0)",this._currentDrag.content.style[t.CSS.TRANSITION]="none"}}),c.prototype.end=function(e,i){var n=this;if(!this._currentDrag)return void(i&&i());var r=-this._currentDrag.buttonsWidth;e.gesture.deltaX>-(this._currentDrag.buttonsWidth/2)&&("left"==e.gesture.direction&&Math.abs(e.gesture.velocityX)<.3?r=0:"right"==e.gesture.direction&&(r=0)),t.requestAnimationFrame(function(){n._currentDrag.content.style[t.CSS.TRANSFORM]=0===r?"":"translate3d("+r+"px, 0, 0)",n._currentDrag.content.style[t.CSS.TRANSITION]="",n._lastDrag=n._currentDrag,n._currentDrag=null,i&&i()})};var u=function(t){this.dragThresholdY=t.dragThresholdY||0,this.onReorder=t.onReorder,this.el=t.el,this.scrollEl=t.scrollEl,this.scrollView=t.scrollView};u.prototype=new l,u.prototype._moveElement=function(e){var i=e.gesture.center.pageY-this._currentDrag.elementHeight/2;this.el.style[t.CSS.TRANSFORM]="translate3d(0, "+i+"px, 0)"},u.prototype.start=function(e){var i=(this.el.offsetTop,t.DomUtil.getChildIndex(this.el,this.el.nodeName.toLowerCase())),n=this.el.offsetHeight,r=this.el.cloneNode(!0),a=(this.scrollEl||this.el).parentNode;r.classList.add(o),this.el.parentNode.insertBefore(r,this.el),this.el.classList.add(s),a.parentNode.appendChild(this.el),this._currentDrag={elementHeight:n,startIndex:i,placeholder:r,scrollHeight:scroll,list:r.parentNode},this._moveElement(e)},u.prototype.drag=t.animationFrameThrottle(function(t){if(this._currentDrag){var e=0,i=t.gesture.center.pageY;if(this.scrollView){var n=this.scrollEl;e=this.scrollView.getValues().top;var r=n.offsetTop,o=r-i+this._currentDrag.elementHeight/2,s=i+this._currentDrag.elementHeight/2-r-n.offsetHeight;t.gesture.deltaY<0&&o>0&&e>0&&this.scrollView.scrollBy(null,-o),t.gesture.deltaY>0&&s>0&&e<this.scrollView.getScrollMax().top&&this.scrollView.scrollBy(null,s)}!this._isDragging&&Math.abs(t.gesture.deltaY)>this.dragThresholdY&&(this._isDragging=!0),this._isDragging&&(this._moveElement(t),this._currentDrag.currentY=e+i-this._currentDrag.placeholder.parentNode.offsetTop,this._reorderItems())}}),u.prototype._reorderItems=function(){var e=(this._currentDrag.placeholder,Array.prototype.slice.call(this._currentDrag.placeholder.parentNode.children)),i=e.indexOf(this._currentDrag.placeholder),n=e[Math.max(0,i-1)],r=e[Math.min(e.length,i+1)],o=this._currentDrag.currentY;return n&&o<n.offsetTop+n.offsetHeight/2?(t.DomUtil.swapNodes(this._currentDrag.placeholder,n),i-1):r&&o>r.offsetTop+r.offsetHeight/2?(t.DomUtil.swapNodes(r,this._currentDrag.placeholder),i+1):void 0},u.prototype.end=function(e,i){if(!this._currentDrag)return void(i&&i());var n=this._currentDrag.placeholder,r=t.DomUtil.getChildIndex(n,n.nodeName.toLowerCase());this.el.classList.remove(s),this.el.style[t.CSS.TRANSFORM]="",n.parentNode.insertBefore(this.el,n),n.parentNode.removeChild(n),this.onReorder&&this.onReorder(this.el,this._currentDrag.startIndex,r),this._currentDrag=null,i&&i()},t.views.ListView=t.views.View.inherit({initialize:function(e){var i=this;e=t.extend({onReorder:function(){},virtualRemoveThreshold:-200,virtualAddThreshold:200,canSwipe:!1},e),t.extend(this,e),!this.itemHeight&&this.listEl&&(this.itemHeight=this.listEl.children[0]&&parseInt(this.listEl.children[0].style.height,10)),this.onRefresh=e.onRefresh||function(){},this.onRefreshOpening=e.onRefreshOpening||function(){},this.onRefreshHolding=e.onRefreshHolding||function(){},window.ionic.onGesture("release",function(t){i._handleEndDrag(t)},this.el),window.ionic.onGesture("drag",function(t){i._handleDrag(t)},this.el),this._initDrag()},stopRefreshing:function(){var t=this.el.querySelector(".list-refresher");t.style.height="0px"},didScroll:function(t){if(this.isVirtual){var e=this.itemHeight,i=(this.listEl.children.length,t.target.scrollHeight),n=this.el.parentNode.offsetHeight,r=(t.scrollTop,Math.max(0,t.scrollTop+this.virtualRemoveThreshold)),o=Math.min(i,Math.abs(t.scrollTop)+n+this.virtualAddThreshold),s=Math.floor((o-r)/e),a=parseInt(Math.abs(r/e),10),l=parseInt(Math.abs(o/e),10);this._virtualItemsToRemove=Array.prototype.slice.call(this.listEl.children,0,a);{Array.prototype.slice.call(this.listEl.children,a,a+s)}this.renderViewport&&this.renderViewport(r,o,a,l)}},didStopScrolling:function(){if(this.isVirtual)for(var t=0;t<this._virtualItemsToRemove.length;t++){{this._virtualItemsToRemove[t]}this.didHideItem&&this.didHideItem(t)}},clearDragEffects:function(){this._lastDragOp&&(this._lastDragOp.clean&&this._lastDragOp.clean(),this._lastDragOp=null)},_initDrag:function(){this._lastDragOp=this._dragOp,this._dragOp=null},_getItem:function(t){for(;t;){if(t.classList.contains(e))return t;t=t.parentNode}return null},_startDrag:function(e){var i=this;this._isDragging=!1;var n=this._lastDragOp;if(!t.DomUtil.getParentOrSelfWithClass(e.target,a)||"up"!=e.gesture.direction&&"down"!=e.gesture.direction){if(!this._didDragUpOrDown&&("left"==e.gesture.direction||"right"==e.gesture.direction)&&Math.abs(e.gesture.deltaX)>5){var r=this._getItem(e.target);r&&r.querySelector(".item-options")&&(this._dragOp=new c({el:this.el}),this._dragOp.start(e),e.preventDefault())}}else{var r=this._getItem(e.target);r&&(this._dragOp=new u({el:r,scrollEl:this.scrollEl,scrollView:this.scrollView,onReorder:function(t,e,n){i.onReorder&&i.onReorder(t,e,n)}}),this._dragOp.start(e),e.preventDefault())}n&&this._dragOp&&!this._dragOp.isSameItem(n)&&e.defaultPrevented&&n.clean&&n.clean()},_handleEndDrag:function(t){var e=this;this._didDragUpOrDown=!1,this._dragOp&&this._dragOp.end(t,function(){e._initDrag()})},_handleDrag:function(t){this.canSwipe&&(Math.abs(t.gesture.deltaY)>5&&(this._didDragUpOrDown=!0),this.isDragging||this._dragOp||this._startDrag(t),this._dragOp&&(t.gesture.srcEvent.preventDefault(),this._dragOp.drag(t)))}})}(ionic),function(t){"use strict";t.views.Loading=t.views.View.inherit({initialize:function(t){this.el=t.el,this.maxWidth=t.maxWidth||200,this.showDelay=t.showDelay||0,this._loadingBox=this.el.querySelector(".loading")||this.el},show:function(){var t=this;if(this._loadingBox){var e=t._loadingBox,i=Math.min(t.maxWidth,Math.max(window.outerWidth-40,e.offsetWidth));e.style.width=i+"px",e.style.marginLeft=-e.offsetWidth/2+"px",e.style.marginTop=-e.offsetHeight/2+"px",this._showDelayTimeout=window.setTimeout(function(){t.el.classList.add("active")},t.showDelay)}},hide:function(){this.el.offsetWidth,window.clearTimeout(this._showDelayTimeout),this.el.classList.remove("active")},setContent:function(t){this._loadingBox&&(this._loadingBox.innerHTML=t||"")}})}(ionic),function(t){"use strict";t.views.Modal=t.views.View.inherit({initialize:function(e){e=t.extend({focusFirstInput:!1,unfocusOnHide:!0,focusFirstDelay:600},e),t.extend(this,e),this.el=e.el},show:function(){var t=this;t.focusFirstInput&&window.setTimeout(function(){var e=t.el.querySelector("input, textarea");e&&e.focus&&e.focus()},t.focusFirstDelay)},hide:function(){if(this.unfocusOnHide){var t=this.el.querySelectorAll("input, textarea");window.setTimeout(function(){for(var e=0;e<t.length;e++)t[e].blur&&t[e].blur()})}}})}(ionic),function(t){"use strict";t.views.NavBar=t.views.View.inherit({initialize:function(t){this.el=t.el,this._titleEl=this.el.querySelector(".title"),t.hidden&&this.hide()},hide:function(){this.el.classList.add("hidden")},show:function(){this.el.classList.remove("hidden")},shouldGoBack:function(){},setTitle:function(t){this._titleEl&&(this._titleEl.innerHTML=t)},showBackButton:function(t){var e=this;if(!this._currentBackButton){var i=document.createElement("a");i.className="button back",i.innerHTML="Back",this._currentBackButton=i,this._currentBackButton.onclick=function(){e.shouldGoBack&&e.shouldGoBack()}}t&&!this._currentBackButton.parentNode?this.el.insertBefore(this._currentBackButton,this.el.firstChild):!t&&this._currentBackButton.parentNode&&this._currentBackButton.parentNode.removeChild(this._currentBackButton)}})}(ionic),function(t){"use strict";t.views.SideMenu=t.views.View.inherit({initialize:function(t){this.el=t.el,this.isEnabled="undefined"==typeof t.isEnabled?!0:t.isEnabled,this.setWidth(t.width)},getFullWidth:function(){return this.width},setWidth:function(t){this.width=t,this.el.style.width=t+"px"},setIsEnabled:function(t){this.isEnabled=t},bringUp:function(){"0"!==this.el.style.zIndex&&(this.el.style.zIndex="0")},pushDown:function(){"-1"!==this.el.style.zIndex&&(this.el.style.zIndex="-1")}}),t.views.SideMenuContent=t.views.View.inherit({initialize:function(e){t.extend(this,{animationClass:"menu-animated",onDrag:function(){},onEndDrag:function(){}},e),t.onGesture("drag",t.proxy(this._onDrag,this),this.el),t.onGesture("release",t.proxy(this._onEndDrag,this),this.el)},_onDrag:function(t){this.onDrag&&this.onDrag(t)},_onEndDrag:function(t){this.onEndDrag&&this.onEndDrag(t)},disableAnimation:function(){this.el.classList.remove(this.animationClass)},enableAnimation:function(){this.el.classList.add(this.animationClass)},getTranslateX:function(){return parseFloat(this.el.style[t.CSS.TRANSFORM].replace("translate3d(","").split(",")[0])},setTranslateX:t.animationFrameThrottle(function(e){this.el.style[t.CSS.TRANSFORM]="translate3d("+e+"px, 0, 0)"})})}(ionic),function(t){"use strict";t.views.Slider=t.views.View.inherit({initialize:function(t){function e(){g=T.children,v=g.length,g.length<2&&(t.continuous=!1),_.transitions&&t.continuous&&g.length<3&&(T.appendChild(g[0].cloneNode(!0)),T.appendChild(T.children[1].cloneNode(!0)),g=T.children),p=new Array(g.length),m=f.getBoundingClientRect().width||f.offsetWidth,T.style.width=g.length*m+"px";for(var e=g.length;e--;){var i=g[e];i.style.width=m+"px",i.setAttribute("data-index",e),_.transitions&&(i.style.left=e*-m+"px",s(e,E>e?-m:e>E?m:0,0))}t.continuous&&_.transitions&&(s(r(E-1),-m,0),s(r(E+1),m,0)),_.transitions||(T.style.left=E*-m+"px"),f.style.visibility="visible",t.slidesChanged&&t.slidesChanged()}function i(){t.continuous?o(E-1):E&&o(E-1)}function n(){t.continuous?o(E+1):E<g.length-1&&o(E+1)}function r(t){return(g.length+t%g.length)%g.length}function o(e,i){if(E!=e){if(_.transitions){var n=Math.abs(E-e)/(E-e);if(t.continuous){var o=n;n=-p[r(e)]/m,n!==o&&(e=-n*g.length+e)}for(var a=Math.abs(E-e)-1;a--;)s(r((e>E?e:E)-a-1),m*n,0);e=r(e),s(E,m*n,i||w),s(e,0,i||w),t.continuous&&s(r(e-n),-(m*n),0)}else e=r(e),l(E*-m,e*-m,i||w);E=e,d(t.callback&&t.callback(E,g[E]))}}function s(t,e,i){a(t,e,i),p[t]=e}function a(t,e,i){var n=g[t],r=n&&n.style;r&&(r.webkitTransitionDuration=r.MozTransitionDuration=r.msTransitionDuration=r.OTransitionDuration=r.transitionDuration=i+"ms",r.webkitTransform="translate("+e+"px,0)translateZ(0)",r.msTransform=r.MozTransform=r.OTransform="translateX("+e+"px)")}function l(e,i,n){if(!n)return void(T.style.left=i+"px");var r=+new Date,o=setInterval(function(){var s=+new Date-r;return s>n?(T.style.left=i+"px",S&&c(),t.transitionEnd&&t.transitionEnd.call(event,E,g[E]),void clearInterval(o)):void(T.style.left=(i-e)*(Math.floor(s/n*100)/100)+e+"px")},4)}function c(){y=setTimeout(n,S)}function u(){S=t.auto||0,clearTimeout(y)}var h=function(){},d=function(t){setTimeout(t||h,0)},_={addEventListener:!!window.addEventListener,touch:"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,transitions:function(t){var e=["transitionProperty","WebkitTransition","MozTransition","OTransition","msTransition"];for(var i in e)if(void 0!==t.style[e[i]])return!0;return!1}(document.createElement("swipe"))},f=t.el;if(f){var g,p,m,v,T=f.children[0];t=t||{};var E=parseInt(t.startSlide,10)||0,w=t.speed||300;t.continuous=void 0!==t.continuous?t.continuous:!0;var y,b,S=t.auto||0,D={},x={},L={handleEvent:function(i){switch(("mousedown"==i.type||"mouseup"==i.type||"mousemove"==i.type)&&(i.touches=[{pageX:i.pageX,pageY:i.pageY}]),i.type){case"mousedown":this.start(i);break;case"touchstart":this.start(i);break;case"touchmove":this.move(i);break;case"mousemove":this.move(i);break;case"touchend":d(this.end(i));break;case"mouseup":d(this.end(i));break;case"webkitTransitionEnd":case"msTransitionEnd":case"oTransitionEnd":case"otransitionend":case"transitionend":d(this.transitionEnd(i));break;case"resize":d(e)}t.stopPropagation&&i.stopPropagation()},start:function(t){var e=t.touches[0];D={x:e.pageX,y:e.pageY,time:+new Date},b=void 0,x={},_.touch?(T.addEventListener("touchmove",this,!1),T.addEventListener("touchend",this,!1)):(T.addEventListener("mousemove",this,!1),T.addEventListener("mouseup",this,!1),document.addEventListener("mouseup",this,!1))},move:function(e){if(!(e.touches.length>1||e.scale&&1!==e.scale)){t.disableScroll&&e.preventDefault();var i=e.touches[0];x={x:i.pageX-D.x,y:i.pageY-D.y},"undefined"==typeof b&&(b=!!(b||Math.abs(x.x)<Math.abs(x.y))),b||(e.preventDefault(),u(),t.continuous?(a(r(E-1),x.x+p[r(E-1)],0),a(E,x.x+p[E],0),a(r(E+1),x.x+p[r(E+1)],0)):(x.x=x.x/(!E&&x.x>0||E==g.length-1&&x.x<0?Math.abs(x.x)/m+1:1),a(E-1,x.x+p[E-1],0),a(E,x.x+p[E],0),a(E+1,x.x+p[E+1],0)))}},end:function(){var e=+new Date-D.time,i=Number(e)<250&&Math.abs(x.x)>20||Math.abs(x.x)>m/2,n=!E&&x.x>0||E==g.length-1&&x.x<0;t.continuous&&(n=!1);var o=x.x<0;b||(i&&!n?(o?(t.continuous?(s(r(E-1),-m,0),s(r(E+2),m,0)):s(E-1,-m,0),s(E,p[E]-m,w),s(r(E+1),p[r(E+1)]-m,w),E=r(E+1)):(t.continuous?(s(r(E+1),m,0),s(r(E-2),-m,0)):s(E+1,m,0),s(E,p[E]+m,w),s(r(E-1),p[r(E-1)]+m,w),E=r(E-1)),t.callback&&t.callback(E,g[E])):t.continuous?(s(r(E-1),-m,w),s(E,0,w),s(r(E+1),m,w)):(s(E-1,-m,w),s(E,0,w),s(E+1,m,w))),_.touch?(T.removeEventListener("touchmove",L,!1),T.removeEventListener("touchend",L,!1)):(T.removeEventListener("mousemove",L,!1),T.removeEventListener("mouseup",L,!1),document.removeEventListener("mouseup",L,!1))
},transitionEnd:function(e){parseInt(e.target.getAttribute("data-index"),10)==E&&(S&&c(),t.transitionEnd&&t.transitionEnd.call(e,E,g[E]))}};this.update=function(){setTimeout(e)},this.setup=function(){e()},this.slide=function(t,e){u(),o(t,e)},this.prev=this.previous=function(){u(),i()},this.next=function(){u(),n()},this.stop=function(){u()},this.currentIndex=function(){return E},this.slidesCount=function(){return v},this.kill=function(){u(),T.style.width="",T.style.left="";for(var t=g.length;t--;){var e=g[t];e.style.width="",e.style.left="",_.transitions&&a(t,0,0)}_.addEventListener?(T.removeEventListener("touchstart",L,!1),T.removeEventListener("webkitTransitionEnd",L,!1),T.removeEventListener("msTransitionEnd",L,!1),T.removeEventListener("oTransitionEnd",L,!1),T.removeEventListener("otransitionend",L,!1),T.removeEventListener("transitionend",L,!1),window.removeEventListener("resize",L,!1)):window.onresize=null},this.load=function(){e(),S&&c(),_.addEventListener?(_.touch?T.addEventListener("touchstart",L,!1):T.addEventListener("mousedown",L,!1),_.transitions&&(T.addEventListener("webkitTransitionEnd",L,!1),T.addEventListener("msTransitionEnd",L,!1),T.addEventListener("oTransitionEnd",L,!1),T.addEventListener("otransitionend",L,!1),T.addEventListener("transitionend",L,!1)),window.addEventListener("resize",L,!1)):window.onresize=function(){e()}}}}})}(ionic),function(t){"use strict";t.views.TabBarItem=t.views.View.inherit({initialize:function(t){this.el=t,this._buildItem()},create:function(e){var i=document.createElement("a");if(i.className="tab-item",e.icon){var n=document.createElement("i");n.className=e.icon,i.appendChild(n)}if(e.badge){var r=document.createElement("i");r.className="badge",r.innerHTML=e.badge,i.appendChild(r),i.className="tab-item has-badge"}return i.appendChild(document.createTextNode(e.title)),new t.views.TabBarItem(i)},_buildItem:function(){for(var e,i=this,n=Array.prototype.slice.call(this.el.children),r=0,o=n.length;o>r;r++)e=n[r],"i"==e.tagName.toLowerCase()&&/icon/.test(e.className)&&(this.icon=e.className),"i"==e.tagName.toLowerCase()&&/badge/.test(e.className)&&(this.badge=e.textContent.trim());for(this.title="",r=0,o=this.el.childNodes.length;o>r;r++)e=this.el.childNodes[r],"#text"===e.nodeName&&(this.title+=e.nodeValue.trim());this._tapHandler=function(t){i.onTap&&i.onTap(t)},t.on("tap",this._tapHandler,this.el)},onTap:function(){},destroy:function(){t.off("tap",this._tapHandler,this.el)},getIcon:function(){return this.icon},getTitle:function(){return this.title},getBadge:function(){return this.badge},setSelected:function(t){this.isSelected=t,t?this.el.classList.add("active"):this.el.classList.remove("active")}}),t.views.TabBar=t.views.View.inherit({initialize:function(t){this.el=t.el,this.items=[],this._buildItems()},getItems:function(){return this.items},addItem:function(e){var i=t.views.TabBarItem.prototype.create(e);this.appendItemElement(i),this.items.push(i),this._bindEventsOnItem(i)},appendItemElement:function(t){this.el&&this.el.appendChild(t.el)},removeItem:function(t){var e=this.items[t];e&&(e.onTap=void 0,e.destroy())},_bindEventsOnItem:function(t){var e=this;this._itemTapHandler||(this._itemTapHandler=function(){e.trySelectItem(this)}),t.onTap=this._itemTapHandler},getSelectedItem:function(){return this.selectedItem},setSelectedItem:function(t){this.selectedItem=this.items[t];for(var e=0,i=this.items.length;i>e;e+=1)this.items[e].setSelected(!1);this.selectedItem&&this.selectedItem.setSelected(!0)},selectItem:function(t){for(var e=0,i=this.items.length;i>e;e+=1)if(this.items[e]==t)return void this.setSelectedItem(e)},trySelectItem:function(t){for(var e=0,i=this.items.length;i>e;e+=1)if(this.items[e]==t)return void(this.tryTabSelect&&this.tryTabSelect(e))},_buildItems:function(){for(var e,i=Array.prototype.slice.call(this.el.children),n=0,r=i.length;r>n;n+=1)e=new t.views.TabBarItem(i[n]),this.items[n]=e,this._bindEventsOnItem(e);this.items.length>0&&(this.selectedItem=this.items[0])},destroy:function(){for(var t=0,e=this.items.length;e>t;t+=1)this.items[t].destroy();this.items.length=0}})}(window.ionic),function(t){"use strict";t.views.Toggle=t.views.View.inherit({initialize:function(e){var i=this;this.el=e.el,this.checkbox=e.checkbox,this.track=e.track,this.handle=e.handle,this.openPercent=-1,this.onChange=e.onChange||function(){},this.triggerThreshold=e.triggerThreshold||20,this.dragStartHandler=function(t){i.dragStart(t)},this.dragHandler=function(t){i.drag(t)},this.holdHandler=function(t){i.hold(t)},this.releaseHandler=function(t){i.release(t)},this.dragStartGesture=t.onGesture("dragstart",this.dragStartHandler,this.el),this.dragGesture=t.onGesture("drag",this.dragHandler,this.el),this.dragHoldGesture=t.onGesture("hold",this.holdHandler,this.el),this.dragReleaseGesture=t.onGesture("release",this.releaseHandler,this.el)},destroy:function(){t.offGesture(this.dragStartGesture,"dragstart",this.dragStartGesture),t.offGesture(this.dragGesture,"drag",this.dragGesture),t.offGesture(this.dragHoldGesture,"hold",this.holdHandler),t.offGesture(this.dragReleaseGesture,"release",this.releaseHandler)},tap:function(){"disabled"!==this.el.getAttribute("disabled")&&this.val(!this.checkbox.checked)},dragStart:function(t){this.checkbox.disabled||(this._dragInfo={width:this.el.offsetWidth,left:this.el.offsetLeft,right:this.el.offsetLeft+this.el.offsetWidth,triggerX:this.el.offsetWidth/2,initialState:this.checkbox.checked},t.gesture.srcEvent.preventDefault(),this.hold(t))},drag:function(e){var i=this;this._dragInfo&&(e.gesture.srcEvent.preventDefault(),t.requestAnimationFrame(function(){var t=(i.track.offsetLeft+i.handle.offsetWidth/2,i.track.offsetLeft+i.track.offsetWidth-i.handle.offsetWidth/2,e.gesture.deltaX,e.gesture.touches[0].pageX-i._dragInfo.left),n=i._dragInfo.width-i.triggerThreshold;i._dragInfo.initialState?t<i.triggerThreshold?i.setOpenPercent(0):t>i._dragInfo.triggerX&&i.setOpenPercent(100):t<i._dragInfo.triggerX?i.setOpenPercent(0):t>n&&i.setOpenPercent(100)}))},endDrag:function(){this._dragInfo=null},hold:function(){this.el.classList.add("dragging")},release:function(t){this.el.classList.remove("dragging"),this.endDrag(t)},setOpenPercent:function(e){if(this.openPercent<0||e<this.openPercent-3||e>this.openPercent+3)if(this.openPercent=e,0===e)this.val(!1);else if(100===e)this.val(!0);else{var i=Math.round(e/100*this.track.offsetWidth-this.handle.offsetWidth);i=1>i?0:i,this.handle.style[t.CSS.TRANSFORM]="translate3d("+i+"px,0,0)"}},val:function(e){return(e===!0||e===!1)&&(""!==this.handle.style[t.CSS.TRANSFORM]&&(this.handle.style[t.CSS.TRANSFORM]=""),this.checkbox.checked=e,this.openPercent=e?100:0,this.onChange&&this.onChange()),this.checkbox.checked}})}(ionic),function(t){"use strict";t.controllers.ViewController=function(){this.initialize.apply(this,arguments)},t.controllers.ViewController.inherit=t.inherit,t.extend(t.controllers.ViewController.prototype,{initialize:function(){},destroy:function(){}})}(window.ionic),function(t){"use strict";t.controllers.NavController=t.controllers.ViewController.inherit({initialize:function(t){var e=this;this.navBar=t.navBar,this.content=t.content,this.controllers=t.controllers||[],this._updateNavBar(),this.navBar.shouldGoBack=function(){e.pop()}},getControllers:function(){return this.controllers},getTopController:function(){return this.controllers[this.controllers.length-1]},push:function(t){var e=this.controllers[this.controllers.length-1];this.controllers.push(t);var i=this.switchingController&&this.switchingController(t)||!0;if(i!==!1){e&&(e.isVisible=!1,e.visibilityChanged&&e.visibilityChanged("push"));var n=this.controllers[this.controllers.length-1];return n.isVisible=!0,n.visibilityChanged&&n.visibilityChanged(e?"push":"first"),this._updateNavBar(),t}},pop:function(){var t,e;if(!(this.controllers.length<2))return e=this.controllers.pop(),e&&(e.isVisible=!1,e.visibilityChanged&&e.visibilityChanged("pop")),t=this.controllers[this.controllers.length-1],t.isVisible=!0,t.visibilityChanged&&t.visibilityChanged("pop"),this._updateNavBar(),e},showNavBar:function(){this.navBar&&this.navBar.show()},hideNavBar:function(){this.navBar&&this.navBar.hide()},_updateNavBar:function(){this.getTopController()&&this.navBar&&(this.navBar.setTitle(this.getTopController().title),this.navBar.showBackButton(this.controllers.length>1?!0:!1))}})}(window.ionic),function(t){"use strict";t.controllers.SideMenuController=t.controllers.ViewController.inherit({initialize:function(t){var e=this;this.left=t.left,this.right=t.right,this.content=t.content,this.dragThresholdX=t.dragThresholdX||10,this._rightShowing=!1,this._leftShowing=!1,this._isDragging=!1,this.content&&(this.content.onDrag=function(t){e._handleDrag(t)},this.content.onEndDrag=function(t){e._endDrag(t)})},setContent:function(t){var e=this;this.content=t,this.content.onDrag=function(t){e._handleDrag(t)},this.content.endDrag=function(t){e._endDrag(t)}},isOpenLeft:function(){return this.getOpenAmount()>0},isOpenRight:function(){return this.getOpenAmount()<0},toggleLeft:function(t){var e=this.getOpenAmount();0===arguments.length&&(t=0>=e),this.content.enableAnimation(),this.openPercentage(t?100:0)},toggleRight:function(t){var e=this.getOpenAmount();0===arguments.length&&(t=e>=0),this.content.enableAnimation(),this.openPercentage(t?-100:0)},close:function(){this.openPercentage(0)},getOpenAmount:function(){return this.content&&this.content.getTranslateX()||0},getOpenRatio:function(){var t=this.getOpenAmount();return t>=0?t/this.left.width:t/this.right.width},isOpen:function(){return 1==this.getOpenRatio()},getOpenPercentage:function(){return 100*this.getOpenRatio()},openPercentage:function(t){var e=t/100;if(this.left&&t>=0)this.openAmount(this.left.width*e);else if(this.right&&0>t){{this.right.width}this.openAmount(this.right.width*e)}},openAmount:function(t){var e=this.left&&this.left.width||0,i=this.right&&this.right.width||0;return(this.left&&this.left.isEnabled||!(t>0))&&(this.right&&this.right.isEnabled||!(0>t))?this._leftShowing&&t>e?void this.content.setTranslateX(e):this._rightShowing&&-i>t?void this.content.setTranslateX(-i):(this.content.setTranslateX(t),void(t>=0?(this._leftShowing=!0,this._rightShowing=!1,t>0&&(this.right&&this.right.pushDown&&this.right.pushDown(),this.left&&this.left.bringUp&&this.left.bringUp())):(this._rightShowing=!0,this._leftShowing=!1,this.right&&this.right.bringUp&&this.right.bringUp(),this.left&&this.left.pushDown&&this.left.pushDown()))):void this.content.setTranslateX(0)},snapToRest:function(t){this.content.enableAnimation(),this._isDragging=!1;var e=this.getOpenRatio();if(0===e)return void this.openPercentage(0);var i=.3,n=t.gesture.velocityX,r=t.gesture.direction;this.openPercentage(e>0&&.5>e&&"right"==r&&i>n?0:e>.5&&"left"==r&&i>n?100:0>e&&e>-.5&&"left"==r&&i>n?0:.5>e&&"right"==r&&i>n?-100:"right"==r&&e>=0&&(e>=.5||n>i)?100:"left"==r&&0>=e&&(-.5>=e||n>i)?-100:0)},_endDrag:function(t){this._isDragging&&this.snapToRest(t),this._startX=null,this._lastX=null,this._offsetX=null},_handleDrag:function(t){this._startX?this._lastX=t.gesture.touches[0].pageX:(this._startX=t.gesture.touches[0].pageX,this._lastX=this._startX),!this._isDragging&&Math.abs(this._lastX-this._startX)>this.dragThresholdX&&(this._startX=this._lastX,this._isDragging=!0,this.content.disableAnimation(),this._offsetX=this.getOpenAmount()),this._isDragging&&this.openAmount(this._offsetX+(this._lastX-this._startX))}})}(ionic),function(t){"use strict";t.controllers.TabBarController=t.controllers.ViewController.inherit({initialize:function(t){this.tabBar=t.tabBar,this._bindEvents(),this.controllers=[];for(var e=t.controllers||[],i=0;i<e.length;i++)this.addController(e[i]);this.controllerWillChange=t.controllerWillChange||function(){},this.controllerChanged=t.controllerChanged||function(){},this.setSelectedController(0)},_bindEvents:function(){var t=this;this.tabBar.tryTabSelect=function(e){t.setSelectedController(e)}},selectController:function(t){var e=!0;this.controllerWillChange&&this.controllerWillChange(this.controllers[t],t)===!1&&(e=!1),e&&this.setSelectedController(t)},setSelectedController:function(t){if(!(t>=this.controllers.length)){var e=this.selectedController,i=this.selectedIndex;this.selectedController=this.controllers[t],this.selectedIndex=t,this._showController(t),this.tabBar.setSelectedItem(t),this.controllerChanged&&this.controllerChanged(e,i,this.selectedController,this.selectedIndex)}},_showController:function(t){for(var e,i=0,n=this.controllers.length;n>i;i++)e=this.controllers[i],e.isVisible=!1,e.visibilityChanged&&e.visibilityChanged();e=this.controllers[t],e.isVisible=!0,e.visibilityChanged&&e.visibilityChanged()},_clearSelected:function(){this.selectedController=null,this.selectedIndex=-1},getController:function(t){return this.controllers[t]},getControllers:function(){return this.controllers},getSelectedController:function(){return this.selectedController},getSelectedControllerIndex:function(){return this.selectedIndex},addController:function(t){this.controllers.push(t),this.tabBar.addItem({title:t.title,icon:t.icon,badge:t.badge}),this.selectedController||this.setSelectedController(0)},setControllers:function(t){this.controllers=t,this._clearSelected(),this.selectController(0)}})}(window.ionic)}();