/*! * Copyright 2014 Drifty Co. * http://drifty.com/ * * Ionic, v1.0.0-beta.3 * 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(){function e(e){var t,n=typeof e;return"object"==n&&null!==e?"function"==typeof(t=e.$$hashKey)?t=e.$$hashKey():void 0===t&&(t=e.$$hashKey=ionic.Utils.nextUid()):t=e,n+":"+t}function t(e){if(e.$root!==e){var t=e.$parent;e.$$disconnected=!0,t.$$childHead===e&&(t.$$childHead=e.$$nextSibling),t.$$childTail===e&&(t.$$childTail=e.$$prevSibling),e.$$prevSibling&&(e.$$prevSibling.$$nextSibling=e.$$nextSibling),e.$$nextSibling&&(e.$$nextSibling.$$prevSibling=e.$$prevSibling),e.$$nextSibling=e.$$prevSibling=null}}function n(e){if(e.$root!==e&&e.$$disconnected){var t=e.$parent;e.$$disconnected=!1,e.$$prevSibling=t.$$childTail,t.$$childHead?(t.$$childTail.$$nextSibling=e,t.$$childTail=e):t.$$childHead=t.$$childTail=e}}function i(e){return["$log",function(t){function n(e){this.handle=e}var i=this,r=this._instances=[];this._registerInstance=function(e,t){return e.$$delegateHandle=t,r.push(e),function(){var t=r.indexOf(e);-1!==t&&r.splice(t,1)}},this.$getByHandle=function(e){return e?new n(e):i},e.forEach(function(e){n.prototype[e]=function(){var n,i,o=this.handle,a=arguments,s=0;return r.forEach(function(t){t.$$delegateHandle===o&&(s++,i=t[e].apply(t,a),1===s&&(n=i))}),s?n:t.warn('Delegate for handle "'+this.handle+'" could not find a corresponding element with delegate-handle="'+this.handle+'"! '+e+"() was not called!\nPossible cause: If you are calling "+e+'() immediately, and your element with delegate-handle="'+this.handle+'" is a child of your controller, then your element may not be compiled yet. Put a $timeout around your call to '+e+"() and try again.")},i[e]=function(){var t,n,i=arguments;return r.forEach(function(r,o){n=r[e].apply(r,i),0===o&&(t=n)}),t}})}]}function r(){return["$ionicScrollDelegate",function(e){return{restrict:"E",link:function(t,n){function i(t){for(var i=3,r=t.target;i--&&r;){if(r.classList.contains("button")||r.tagName.match(/input|textarea|select/i)||r.isContentEditable)return;r=r.parentNode}var o=t.gesture&&t.gesture.touches[0]||t.detail.touches[0],a=n[0].getBoundingClientRect();ionic.DomUtil.rectContains(o.pageX,o.pageY,a.left,a.top-20,a.left+a.width,a.top+a.height)&&e.scrollTop(!0)}ionic.on("tap",i,n[0]),t.$on("$destroy",function(){ionic.off("tap",i,n[0])})}}}]}function o(e){return[function(){return{restrict:"E",compile:function(t){function n(t,n,i){var r=(new ionic.views.HeaderBar({el:n[0],alignTitle:i.alignTitle||"center"}),n[0]);e?(t.$watch(function(){return r.className},function(e){var n=-1!==e.indexOf("bar-subheader");t.$hasHeader=!n,t.$hasSubheader=n}),t.$on("$destroy",function(){delete t.$hasHeader,delete t.$hasSubheader})):(t.$watch(function(){return r.className},function(e){var n=-1!==e.indexOf("bar-subfooter");t.$hasFooter=!n,t.$hasSubfooter=n}),t.$on("$destroy",function(){delete t.$hasFooter,delete t.$hasSubfooter}),t.$watch("$hasTabs",function(e){n.toggleClass("has-tabs",!!e)}))}return t.addClass(e?"bar bar-header":"bar bar-footer"),{pre:n}}}}]}function a(e){e.stopPropagation()}var s={method:function(e,t,n){var i=!1;return function(){return i||(i=!0,t(e)),n.apply(this,arguments)}},field:function(e,t,n,i,r){var o=!1,a=function(){return o||(o=!0,t(e)),r},s=function(n){return o||(o=!0,t(e)),r=n,n};Object.defineProperty(n,i,{get:a,set:s,enumerable:!0})}},c=angular.module("ionic",["ngAnimate","ngSanitize","ui.router"]);c.factory("$ionicActionSheet",["$rootScope","$document","$compile","$animate","$timeout","$ionicTemplateLoader","$ionicPlatform",function(e,t,n,i,r,o,a){return{show:function(o){var s=e.$new(!0);angular.extend(s,{cancel:angular.noop,buttonClicked:angular.noop,destructiveButtonClicked:angular.noop},o);var c=n('')(s),l=angular.element(c[0].querySelector(".action-sheet-wrapper")),u=function(e){l.removeClass("action-sheet-up"),e&&r(function(){o.cancel()},200),i.removeClass(c,"active",function(){s.$destroy()}),t[0].body.classList.remove("action-sheet-open"),s.$deregisterBackButton&&s.$deregisterBackButton()};s.$deregisterBackButton=a.registerBackButtonAction(function(){u()},p),s.cancel=function(){u(!0)},s.buttonClicked=function(e){(o.buttonClicked&&o.buttonClicked(e))===!0&&u(!1)},s.destructiveButtonClicked=function(){(o.destructiveButtonClicked&&o.destructiveButtonClicked())===!0&&u(!1)},t[0].body.appendChild(c[0]),t[0].body.classList.add("action-sheet-open");var d=new ionic.views.ActionSheet({el:c[0]});return s.sheet=d,i.addClass(c,"active"),r(function(){l.addClass("action-sheet-up")},20),d}}}]),angular.element.prototype.addClass=function(e){var t,n,i,r,o,a;if(e&&"ng-scope"!=e&&"ng-isolate-scope"!=e)for(t=0;t'),r=0;return e[0].body.appendChild(i[0]),{retain:t,release:n,_element:i}}]),c.factory("$ionicBind",["$parse","$interpolate",function(e,t){var n=/^\s*([@=&])(\??)\s*(\w*)\s*$/;return function(i,r,o){angular.forEach(o||{},function(o,a){var s,c,l=o.match(n)||[],u=l[3]||a,d=l[1];switch(d){case"@":if(!r[u])return;r.$observe(u,function(e){i[a]=e}),r[u]&&(i[a]=t(r[u])(i));break;case"=":if(!r[u])return;c=i.$watch(r[u],function(e){i[a]=e}),i.$on("$destroy",c);break;case"&":if(r[u]&&r[u].match(RegExp(a+"(.*?)")))throw new Error('& expression binding "'+a+'" looks like it will recursively call "'+r[u]+'" and cause a stack overflow! Please choose a different scopeName.');s=e(r[u]),i[a]=function(e){return s(i,e)}}})}}]),c.factory("$collectionDataSource",["$cacheFactory","$parse",function(i,r){function o(t){var n=this;if(this.scope=t.scope,this.transcludeFn=t.transcludeFn,this.transcludeParent=t.transcludeParent,this.keyExpr=t.keyExpr,this.listExpr=t.listExpr,this.trackByExpr=t.trackByExpr,this.heightGetter=t.heightGetter,this.widthGetter=t.widthGetter,this.dimensions=[],this.data=[],this.trackByExpr){var o=r(this.trackByExpr),s={$id:e};this.itemHashGetter=function(e,t){return s[n.keyExpr]=t,s.$index=e,o(n.scope,s)}}else this.itemHashGetter=function(t,n){return e(n)};var c={};this.itemCache=i(a++,{size:500});var l=this.itemCache.put;this.itemCache.put=function(e,t){return c[e]=!0,l(e,t)};var u=this.itemCache.remove;this.itemCache.remove=function(e){return delete c[e],u(e)},this.itemCache.keys=function(){return Object.keys(c)}}var a=0;return o.prototype={destroy:function(){this.dimensions.length=0,this.itemCache.keys().forEach(function(e){var t=this.itemCache.get(e);t.element.remove(),t.scope.$destroy()},this),this.itemCache.removeAll()},calculateDataDimensions:function(){var e={};this.dimensions=this.data.map(function(t,n){return e[this.keyExpr]=t,e.$index=n,{width:this.widthGetter(this.scope,e),height:this.heightGetter(this.scope,e)}},this)},compileItem:function(e,t){var n=this.itemHashGetter(e,t),i=this.itemCache.get(n);if(i)return i;var r={};return r.scope=this.scope.$new(),r.scope[this.keyExpr]=t,this.transcludeFn(r.scope,function(e){r.element=e,r.element[0].style.position="absolute"}),this.itemCache.put(n,r)},getItem:function(e){var t=this.data[e],n=this.compileItem(e,t);return n.scope.$index!==e&&(n.scope.$index=e,n.scope.$first=0===e,n.scope.$last=e===this.getLength()-1,n.scope.$middle=!(n.scope.$first||n.scope.$last),n.scope.$odd=!(n.scope.$even=0===(1&e))),n},detachItem:function(e){var n,i,r;for(n=0;ni&&(n=0,t+=e.primarySize)),o.primaryPos=t,o.secondaryPos=n,e=o,o},this)},resize:function(){this.dimensions=this.calculateDimensions();var e=this.dimensions[this.dimensions.length-1];this.viewportSize=e?e.primaryPos+e.primarySize:0,this.setCurrentIndex(0),this.render(!0)},setCurrentIndex:function(e){this.currentIndex=e,this.hasPrevIndex=e>0,this.hasPrevIndex&&(this.previousPos=this.dimensions[e-1].primaryPos),this.hasNextIndex=e+1=this.nextPos||this.hasPrevIndex&&e100)&&this.render(),e-this.lastRenderScrollValue},getIndexForScrollValue:function(e,t){var n;if(t<=this.dimensions[e].primaryPos)for(;(n=this.dimensions[e-1])&&n.primaryPos>t;)e--;else for(;(n=this.dimensions[e+1])&&n.primaryPos=this.dataSource.getLength()||e){for(t in this.renderedItems)this.removeItem(t);if(this.currentIndex>=this.dataSource.getLength())return null}for(var n,i=this.scrollValue(),r=(i-this.lastRenderScrollValue,this.scrollSize()),o=r+i,a=this.getIndexForScrollValue(this.currentIndex,i),s=Math.max(a-1,0);s>0&&(n=this.dimensions[s])&&n.primaryPos===this.dimensions[a-1].primaryPos;)s--;var c=this.dimensions[s].primaryPos;for(t=s;(n=this.dimensions[t])&&n.primaryPos-n.primarySizet||t>l)&&this.removeItem(t);this.setCurrentIndex(a),this.lastRenderScrollValue=c},renderItem:function(e,t,n){var i=this.dataSource.getItem(e);i?(this.dataSource.attachItem(i),i.element[0].style[ionic.CSS.TRANSFORM]=this.transformString(t,n,n),this.renderedItems[e]=i,i.scope&&!i.scope.$$phase&&i.scope.$digest()):delete this.renderedItems[e]},removeItem:function(e){var t=this.renderedItems[e];t&&(this.dataSource.detachItem(t),delete this.renderedItems[e])}},e}]),c.factory("$ionicGesture",[function(){return{on:function(e,t,n){return window.ionic.onGesture(e,t,n[0])},off:function(e,t,n){return window.ionic.offGesture(e,t,n)}}}]);var l='
',u="$ionicLoading instance.hide() has been deprecated. Use $ionicLoading.hide().",d="$ionicLoading instance.show() has been deprecated. Use $ionicLoading.show().",h="$ionicLoading instance.setContent() has been deprecated. Use $ionicLoading.show({ template: 'my content' }).";c.factory("$ionicLoading",["$document","$ionicTemplateLoader","$ionicBackdrop","$timeout","$q","$log","$compile",function(e,t,n,i,r,o,a){function c(){return v||(v=t.compile({template:l,appendTo:e[0].body}).then(function(e){var o=e;return e.show=function(e){var s=e.templateUrl?t.load(e.templateUrl):r.when(e.template||e.content||"");this.isShown||(this.hasBackdrop=!e.noBackdrop&&e.showBackdrop!==!1,this.hasBackdrop&&n.retain()),e.duration&&(i.cancel(this.durationTimeout),this.durationTimeout=i(angular.bind(this,this.hide),+e.duration)),s.then(function(e){e&&(o.element.html(e),a(o.element.contents())(o.scope)),o.isShown&&(o.element.addClass("visible"),ionic.DomUtil.centerElementByMarginTwice(o.element[0]),ionic.requestAnimationFrame(function(){o.isShown&&o.element.addClass("active")}))}),this.isShown=!0},e.hide=function(){this.isShown&&(this.hasBackdrop&&n.release(),o.element.removeClass("active"),setTimeout(function(){!o.isShown&&o.element.removeClass("visible")},200)),i.cancel(this.durationTimeout),this.isShown=!1},e})),r.when(v)}function f(e){e||(e={});var t=e.delay||e.showDelay||0;return i.cancel(g),g=i(angular.noop,t),g.then(c).then(function(t){return t.show(e)}),{hide:s.method(u,o.error,p),show:s.method(d,o.error,function(){f(e)}),setContent:s.method(h,o.error,function(e){c().then(function(t){t.show({template:e})})})}}function p(){i.cancel(g),c().then(function(e){e.hide()})}var v,g=r.when();return{show:f,hide:p,_getLoader:c}}]),c.factory("$ionicModal",["$rootScope","$document","$compile","$timeout","$ionicPlatform","$ionicTemplateLoader","$q",function(e,t,n,i,r,o,a){var s=ionic.views.Modal.inherit({initialize:function(e){ionic.views.Modal.prototype.initialize.call(this,e),this.animation=e.animation||"slide-in-up"},show:function(){var e=this,n=angular.element(e.modalEl);return e.el.classList.remove("hide"),t[0].body.classList.add("modal-open"),e.el.parentElement||(n.addClass(e.animation),t[0].body.appendChild(e.el)),n.addClass("ng-enter active").removeClass("ng-leave ng-leave-active"),e._isShown=!0,e._deregisterBackButton=r.registerBackButtonAction(function(){e.hide()},200),e._isOpenPromise=a.defer(),ionic.views.Modal.prototype.show.call(e),i(function(){n.addClass("ng-enter-active"),e.scope.$parent&&e.scope.$parent.$broadcast("modal.shown",e),e.el.classList.add("active")},20),i(angular.noop,400)},hide:function(){var e=this,n=angular.element(e.modalEl);return e.el.classList.remove("active"),n.addClass("ng-leave"),i(function(){n.addClass("ng-leave-active").removeClass("ng-enter ng-enter-active active")},20),e._isShown=!1,e.scope.$parent&&e.scope.$parent.$broadcast("modal.hidden",e),e._deregisterBackButton&&e._deregisterBackButton(),ionic.views.Modal.prototype.hide.call(e),i(function(){t[0].body.classList.remove("modal-open"),e.el.classList.add("hide")},500)},remove:function(){var e=this;return e.scope.$parent&&e.scope.$parent.$broadcast("modal.removed",e),e.hide().then(function(){e.scope.$destroy(),angular.element(e.el).remove()})},isShown:function(){return!!this._isShown}}),c=function(t,i){var r=i.scope&&i.scope.$new()||e.$new(!0);angular.extend(r,{$hasHeader:!1,$hasSubheader:!1,$hasFooter:!1,$hasSubfooter:!1,$hasTabs:!1,$hasTabsTop:!1});var o=n(""+t+"")(r);i.el=o[0],i.modalEl=i.el.querySelector(".modal");var a=new s(i);return a.scope=r,i.scope||(r.modal=a),a};return{fromTemplate:function(e,t){var n=c(e,t||{});return n},fromTemplateUrl:function(e,t,n){var i;return angular.isFunction(t)&&(i=t,t=n),o.load(e).then(function(e){var n=c(e,t||{});return i&&i(n),n})}}}]),c.service("$ionicNavBarDelegate",i(["back","align","showBackButton","showBar","setTitle","changeTitle","getTitle","getPreviousTitle"]));var f=100,p=300,v=500;c.provider("$ionicPlatform",function(){return{$get:["$q","$rootScope",function(e){var t={onHardwareBackButton:function(e){ionic.Platform.ready(function(){document.addEventListener("backbutton",e,!1)})},offHardwareBackButton:function(e){ionic.Platform.ready(function(){document.removeEventListener("backbutton",e)})},$backButtonActions:{},registerBackButtonAction:function(e,n,i){t._hasBackButtonHandler||(t.$backButtonActions={},t.onHardwareBackButton(t.hardwareBackButtonClick),t._hasBackButtonHandler=!0);var r={id:i?i:ionic.Utils.nextUid(),priority:n?n:0,fn:e};return t.$backButtonActions[r.id]=r,function(){delete t.$backButtonActions[r.id]}},hardwareBackButtonClick:function(e){var n,i;for(i in t.$backButtonActions)(!n||t.$backButtonActions[i].priority>=n.priority)&&(n=t.$backButtonActions[i]);return n?(n.fn(e),n):void 0},is:function(e){return ionic.Platform.is(e)},ready:function(t){var n=e.defer();return ionic.Platform.ready(function(){n.resolve(),t&&t()}),n.promise}};return t}]}});var g='';c.factory("$ionicPopup",["$ionicTemplateLoader","$ionicBackdrop","$q","$timeout","$rootScope","$document","$compile","$ionicPlatform",function(e,t,n,i,r,o,a,s){function c(t){t=angular.extend({scope:null,title:"",buttons:[]},t||{});var r=e.compile({template:g,scope:t.scope&&t.scope.$new(),appendTo:o[0].body}),s=t.templateUrl?e.load(t.templateUrl):n.when(t.template||t.content||"");return n.all([r,s]).then(function(e){var r=e[0],o=e[1],s=n.defer();r.responseDeferred=s;var c=angular.element(r.element[0].querySelector(".popup-body"));return o?(c.html(o),a(c.contents())(r.scope)):c.remove(),angular.extend(r.scope,{title:t.title,buttons:t.buttons,subTitle:t.subTitle,$buttonTapped:function(e,t){var n=(e.onTap||angular.noop)(t);t=t.originalEvent||t,t.defaultPrevented||s.resolve(n)}}),r.show=function(){r.isShown||(r.isShown=!0,ionic.requestAnimationFrame(function(){r.isShown&&(r.element.removeClass("popup-hidden"),r.element.addClass("popup-showing active"),ionic.DomUtil.centerElementByMarginTwice(r.element[0]),d(r.element))}))},r.hide=function(e){return e=e||angular.noop,r.isShown?(r.isShown=!1,r.element.removeClass("active"),r.element.addClass("popup-hidden"),void i(e,250)):e()},r.remove=function(){r.removed||(r.hide(function(){r.element.remove(),r.scope.$destroy()}),r.removed=!0)},r})}function l(){$[0]&&$[0].responseDeferred.resolve()}function u(e){function n(e){r.then(function(t){t.removed||t.responseDeferred.resolve(e)})}var r=w._createPopup(e),o=$[0];o&&o.hide();var a=i(angular.noop,o?m.stackPushDelay:0).then(function(){return r}).then(function(e){return o||(document.body.classList.add("popup-open"),t.retain(),w._backButtonActionDone=s.registerBackButtonAction(l,v)),$.unshift(e),e.show(),e.responseDeferred.notify({close:a.close}),e.responseDeferred.promise.then(function(n){var i=$.indexOf(e);-1!==i&&$.splice(i,1),e.remove();var r=$[0];return r?r.show():(document.body.classList.remove("popup-open"),t.release(),(w._backButtonActionDone||angular.noop)()),n})});return a.close=n,a}function d(e){var t=e[0].querySelectorAll("input");t.length||(t=e[0].querySelectorAll("button"));var n=t[t.length-1];n&&n.focus()}function h(e){return u(angular.extend({buttons:[{text:e.okText||"OK",type:e.okType||"button-positive",onTap:function(){return!0}}]},e||{}))}function f(e){return u(angular.extend({buttons:[{text:e.cancelText||"Cancel",type:e.cancelType||"button-default",onTap:function(){return!1}},{text:e.okText||"OK",type:e.okType||"button-positive",onTap:function(){return!0}}]},e||{}))}function p(e){var t=r.$new(!0);return t.data={},u(angular.extend({template:'',scope:t,buttons:[{text:e.cancelText||"Cancel",type:e.cancelType||"button-default",onTap:function(){}},{text:e.okText||"OK",type:e.okType||"button-positive",onTap:function(){return t.data.response||""}}]},e||{}))}var m={stackPushDelay:50},$=[],w={show:u,alert:h,confirm:f,prompt:p,_createPopup:c,_popupStack:$};return w}]),c.service("$ionicScrollDelegate",i(["resize","scrollTop","scrollBottom","scrollTo","scrollBy","getScrollPosition","anchorScroll","getScrollView","rememberScrollPosition","forgetScrollPosition","scrollToRememberedPosition"])),c.service("$ionicSideMenuDelegate",i(["toggleLeft","toggleRight","getOpenRatio","isOpen","isOpenLeft","isOpenRight","canDragContent"])),c.service("$ionicSlideBoxDelegate",i(["update","slide","enableSlide","previous","next","stop","currentIndex","slidesCount"])),c.service("$ionicTabsDelegate",i(["select","selectedIndex"])),c.factory("$ionicTemplateLoader",["$compile","$controller","$http","$q","$rootScope","$templateCache",function(e,t,n,i,r,o){function a(e){return n.get(e,{cache:o}).then(function(e){return e.data&&e.data.trim()})}function s(n){n=angular.extend({template:"",templateUrl:"",scope:null,controller:null,locals:{},appendTo:null},n||{});var o=n.templateUrl?this.load(n.templateUrl):i.when(n.template);return o.then(function(i){var o,a=n.scope||r.$new(),s=angular.element("
").html(i).contents();return n.controller&&(o=t(n.controller,angular.extend(n.locals,{$scope:a})),s.children().data("$ngControllerController",o)),n.appendTo&&angular.element(n.appendTo).append(s),e(s)(a),{element:s,scope:a}})}return{load:a,compile:s}}]),c.run(["$rootScope","$state","$location","$document","$animate","$ionicPlatform","$ionicViewService",function(e,t,n,i,r,o,a){function s(t){return e.$viewHistory.backView?e.$viewHistory.backView.go():ionic.Platform.exitApp(),t.preventDefault(),!1}e.$viewHistory={histories:{root:{historyId:"root",parentHistoryId:null,stack:[],cursor:-1}},views:{},backView:null,forwardView:null,currentView:null,disabledRegistrableTagNames:[]},a.disableRegisterByTagName&&(a.disableRegisterByTagName("ion-tabs"),a.disableRegisterByTagName("ion-side-menus")),e.$on("viewState.changeHistory",function(i,r){if(r){var o=r.historyId?e.$viewHistory.histories[r.historyId]:null;if(o&&o.cursor>-1&&o.cursor-1&&s.stack.length>0&&s.cursor=u.index;v--)p.stack[v].destroy(),p.stack.splice(v)}}else h.navAction="initialView";r.views[h.viewId]=this.createView({viewId:h.viewId,index:s.stack.length,historyId:s.historyId,backViewId:c&&c.viewId?c.viewId:null,forwardViewId:null,stateId:o,stateName:this.getCurrentStateName(),stateParams:this.getCurrentStateParams(),url:n.url()}),"moveBack"==h.navAction&&e.$emit("$viewHistory.viewBack",c.viewId,h.viewId),s.stack.push(r.views[h.viewId])}return d&&(d.disableAnimate&&(h.navDirection=null),d.disableBack&&(r.views[h.viewId].backViewId=null),this.nextViewOptions(null)),this.setNavViews(h.viewId),s.cursor=r.currentView.index,h},setNavViews:function(t){var n=e.$viewHistory;n.currentView=this._getViewById(t),n.backView=this._getBackView(n.currentView),n.forwardView=this._getForwardView(n.currentView),e.$broadcast("$viewHistory.historyChange",{showBack:n.backView&&n.backView.historyId===n.currentView.historyId})},registerHistory:function(e){e.$historyId=ionic.Utils.nextUid()},createView:function(e){var t=new s;return t.initialize(e)},getCurrentView:function(){return e.$viewHistory.currentView},getBackView:function(){return e.$viewHistory.backView},getForwardView:function(){return e.$viewHistory.forwardView},getNavDirection:function(){return e.$viewHistory.navDirection},getCurrentStateName:function(){return t&&t.current?t.current.name:null},isCurrentStateNavView:function(e){return t&&t.current&&t.current.views&&t.current.views[e]?!0:!1},getCurrentStateParams:function(){var e;if(t&&t.params)for(var n in t.params)t.params.hasOwnProperty(n)&&(e=e||{},e[n]=t.params[n]);return e},getCurrentStateId:function(){var e;if(t&&t.current&&t.current.name){if(e=t.current.name,t.params)for(var n in t.params)t.params.hasOwnProperty(n)&&t.params[n]&&(e+="_"+n+"="+t.params[n]);return e}return ionic.Utils.nextUid()},goToHistoryRoot:function(t){if(t){var n=e.$viewHistory.histories[t];if(n&&n.stack.length){if(e.$viewHistory.currentView&&e.$viewHistory.currentView.viewId===n.stack[0].viewId)return;e.$viewHistory.forcedNav={viewId:n.stack[0].viewId,navAction:"moveBack",navDirection:"back"},n.stack[0].go()}}},_getViewById:function(t){return t?e.$viewHistory.views[t]:null},_getBackView:function(e){return e?this._getViewById(e.backViewId):null},_getForwardView:function(e){return e?this._getViewById(e.forwardViewId):null},_getHistoryById:function(t){return t?e.$viewHistory.histories[t]:null},_getHistory:function(t){var n=this._getParentHistoryObj(t);return e.$viewHistory.histories[n.historyId]||(e.$viewHistory.histories[n.historyId]={historyId:n.historyId,parentHistoryId:this._getParentHistoryObj(n.scope.$parent).historyId,stack:[],cursor:-1}),e.$viewHistory.histories[n.historyId]},_getParentHistoryObj:function(t){for(var n=t;n;){if(n.hasOwnProperty("$historyId"))return{historyId:n.$historyId,scope:n};n=n.$parent}return{historyId:"root",scope:e}},nextViewOptions:function(e){return arguments.length?void(this._nextOpts=e):this._nextOpts},getRenderer:function(e,t,n){function i(e){for(var t="";!t&&e;)t=e.getAttribute("animation"),e=e.parentElement;return t}function r(){l&&e[0].classList.add(l),"back"===a.navDirection?e[0].classList.add("reverse"):e[0].classList.remove("reverse")}var a,s,c=this,l=i(e[0]);return function(t){return{enter:function(n){return s&&t?(r(),n.addClass("ng-enter"),document.body.classList.add("disable-pointer-events"),void o.enter(n,e,null,function(){document.body.classList.remove("disable-pointer-events"),l&&e[0].classList.remove(l)})):void e.append(n)},leave:function(){var n=e.contents();return s&&t?(r(),void o.leave(n,function(){n.remove()})):void n.remove()},register:function(e){return a=c.register(n,e),s=null!==l&&null!==a.navDirection,a}}}},disableRegisterByTagName:function(t){e.$viewHistory.disabledRegistrableTagNames.push(t.toUpperCase())},isTagNameRegistrable:function(t){var n,i,r=e.$viewHistory.disabledRegistrableTagNames;for(n=0;n')(e),angular.element(a[0]).replaceWith(n)),i=o('

')(e),ionic.requestAnimationFrame(function(){n&&r.leave(angular.element(n)); var o=n&&angular.element(n)||null;r.enter(i,t,o,function(){c._headerBarView.align()}),angular.forEach(a,function(e){e&&e.parentNode&&angular.element(e).remove()}),e.$digest(),ionic.requestAnimationFrame(function(){i[0].classList.remove("invisible")})})}}]),c.factory("$$scrollValueCache",function(){return{}}).controller("$ionicScroll",["$scope","scrollViewOptions","$timeout","$window","$$scrollValueCache","$location","$rootScope","$document","$ionicScrollDelegate",function(e,t,n,i,r,o,a,s,c){var l=this;this._scrollViewOptions=t;var u=this.element=t.el,d=this.$element=angular.element(u),h=this.scrollView=new ionic.views.Scroll(t);(d.parent().length?d.parent():d).data("$$ionicScrollController",this);var f=c._registerInstance(this,t.delegateHandle);angular.isDefined(t.bouncing)||ionic.Platform.ready(function(){h.options.bouncing=!ionic.Platform.isAndroid()});var p=angular.bind(h,h.resize);ionic.on("resize",p,i);var v=angular.noop;e.$on("$destroy",function(){f(),ionic.off("resize",p,i),i.removeEventListener("resize",p),v(),l._rememberScrollId&&(r[l._rememberScrollId]=h.getValues())}),d.on("scroll",function(t){var n=(t.originalEvent||t).detail||{};e.$onScroll&&e.$onScroll({event:t,scrollTop:n.scrollTop||0,scrollLeft:n.scrollLeft||0})}),e.$on("$viewContentLoaded",function(e,t){if(!e.defaultPrevented){e.preventDefault();var n=t&&t.viewId;n&&(l.rememberScrollPosition(n),l.scrollToRememberedPosition(),v=a.$on("$viewHistory.viewBack",function(e,t){n===t&&l.forgetScrollPosition()}))}}),n(function(){h.run()}),this._rememberScrollId=null,this.getScrollView=function(){return this.scrollView},this.getScrollPosition=function(){return this.scrollView.getValues()},this.resize=function(){return n(p)},this.scrollTop=function(e){this.resize().then(function(){h.scrollTo(0,0,!!e)})},this.scrollBottom=function(e){this.resize().then(function(){var t=h.getScrollMax();h.scrollTo(t.left,t.top,!!e)})},this.scrollTo=function(e,t,n){this.resize().then(function(){h.scrollTo(e,t,!!n)})},this.scrollBy=function(e,t,n){this.resize().then(function(){h.scrollBy(e,t,!!n)})},this.anchorScroll=function(e){this.resize().then(function(){var t=o.hash(),n=t&&s[0].getElementById(t);if(t&&n){var i=ionic.DomUtil.getPositionInParent(n,l.$element);h.scrollTo(i.left,i.top,!!e)}else h.scrollTo(0,0,!!e)})},this.rememberScrollPosition=function(e){if(!e)throw new Error("Must supply an id to remember the scroll by!");this._rememberScrollId=e},this.forgetScrollPosition=function(){delete r[this._rememberScrollId],this._rememberScrollId=null},this.scrollToRememberedPosition=function(e){var t=r[this._rememberScrollId];t&&this.resize().then(function(){h.scrollTo(+t.left,+t.top,e)})},this._setRefresher=function(e,t){var n=this.refresher=t,i=l.refresher.clientHeight||0;h.activatePullToRefresh(i,function(){n.classList.add("active"),e.$onPulling()},function(){n.classList.remove("refreshing"),n.classList.remove("active")},function(){n.classList.add("refreshing"),e.$onRefresh()})}}]),c.controller("$ionicSideMenus",["$scope","$attrs","$ionicSideMenuDelegate",function(e,t,n){angular.extend(this,ionic.controllers.SideMenuController.prototype),ionic.controllers.SideMenuController.call(this,{left:{width:275},right:{width:275}}),this.canDragContent=function(t){return arguments.length&&(e.dragContent=!!t),e.dragContent},this.isDraggableTarget=function(t){return e.dragContent&&!t.gesture.srcEvent.defaultPrevented&&!t.target.tagName.match(/input|textarea|select|object|embed/i)&&!t.target.isContentEditable&&!(t.target.dataset?t.target.dataset.preventScroll:"true"==t.target.getAttribute("data-prevent-default"))},e.sideMenuContentTranslateX=0;var i=n._registerInstance(this,t.delegateHandle);e.$on("$destroy",i)}]),c.controller("$ionicTab",["$scope","$ionicViewService","$attrs","$location","$state",function(e,t,n,i,r){this.$scope=e,this.hrefMatchesState=function(){return n.href&&0===i.path().indexOf(n.href.replace(/^#/,"").replace(/\/$/,""))},this.srefMatchesState=function(){return n.uiSref&&r.includes(n.uiSref.split("(")[0])},this.navNameMatchesState=function(){return this.navViewName&&t.isCurrentStateNavView(this.navViewName)},this.tabMatchesState=function(){return this.hrefMatchesState()||this.srefMatchesState()||this.navNameMatchesState()}}]),c.controller("$ionicTabs",["$scope","$ionicViewService","$element",function(e,t){var n=null,i=this;i.tabs=[],i.selectedIndex=function(){return i.tabs.indexOf(n)},i.selectedTab=function(){return n},i.add=function(e){t.registerHistory(e),i.tabs.push(e),1===i.tabs.length&&i.select(e)},i.remove=function(e){var t=i.tabs.indexOf(e);if(-1!==t){if(e.$tabSelected)if(i.deselect(e),1===i.tabs.length);else{var n=t===i.tabs.length-1?t-1:t+1;i.select(i.tabs[n])}i.tabs.splice(t,1)}},i.deselect=function(e){e.$tabSelected&&(n=null,e.$tabSelected=!1,(e.onDeselect||angular.noop)())},i.select=function(r,o){var a;if(angular.isNumber(r)?(a=r,r=i.tabs[a]):a=i.tabs.indexOf(r),!r||-1==a)throw new Error('Cannot select tab "'+a+'"!');if(n&&n.$historyId==r.$historyId)o&&t.goToHistoryRoot(r.$historyId);else if(angular.forEach(i.tabs,function(e){i.deselect(e)}),n=r,r.$tabSelected=!0,(r.onSelect||angular.noop)(),o){var s={type:"tab",tabIndex:a,historyId:r.$historyId,navViewName:r.navViewName,hasNavView:!!r.navViewName,title:r.title,url:r.href,uiSref:r.uiSref};e.$emit("viewState.changeHistory",s)}}}]),c.directive("ionActionSheet",["$document",function(e){return{restrict:"E",scope:!0,replace:!0,link:function(t,n){var i=function(e){27==e.which&&(t.cancel(),t.$apply())},r=function(e){e.target==n[0]&&(t.cancel(),t.$apply())};t.$on("$destroy",function(){n.remove(),e.unbind("keyup",i)}),e.bind("keyup",i),n.bind("click",r)},template:'
'}}]),c.directive("ionCheckbox",function(){return{restrict:"E",replace:!0,require:"?ngModel",scope:{ngModel:"=?",ngValue:"=?",ngChecked:"=?",ngDisabled:"=?",ngChange:"&"},transclude:!0,template:'',compile:function(e,t){var n=e.find("input");t.name&&n.attr("name",t.name),t.ngChecked&&n.attr("ng-checked",t.ngChecked),t.ngDisabled&&n.attr("ng-disabled",t.ngDisabled),t.ngTrueValue&&n.attr("ng-true-value",t.ngTrueValue),t.ngFalseValue&&n.attr("ng-false-value",t.ngFalseValue)}}}),c.directive("collectionRepeat",["$collectionRepeatManager","$collectionDataSource","$parse",function(e,t,n){return{priority:1e3,transclude:"element",terminal:!0,$$tlb:!0,require:"^$ionicScroll",link:function(i,r,o,a,s){function c(e){l.resize(),g.setData(e),m.resize()}var l=a.scrollView;if(l.options.scrollingX&&l.options.scrollingY)throw new Error("Cannot create a collection-repeat within a scrollView that is scrollable on both x and y axis. Choose either x direction or y direction.");var u=!!l.options.scrollingY;if(u&&!o.collectionItemHeight)throw new Error("collection-repeat expected attribute collection-item-height to be a an expression that returns a number.");if(!u&&!o.collectionItemWidth)throw new Error("collection-repeat expected attribute collection-item-width to be a an expression that returns a number.");o.collectionItemHeight=o.collectionItemHeight||'"100%"',o.collectionItemWidth=o.collectionItemWidth||'"100%"';var d=o.collectionItemHeight?n(o.collectionItemHeight):function(){return l.__clientHeight},h=o.collectionItemWidth?n(o.collectionItemWidth):function(){return l.__clientWidth},f=function(e,t){var n=d(e,t);return angular.isString(n)&&n.indexOf("%")>-1?Math.floor(parseInt(n,10)/100*l.__clientHeight):n},p=function(e,t){var n=h(e,t);return angular.isString(n)&&n.indexOf("%")>-1?Math.floor(parseInt(n,10)/100*l.__clientWidth):n},v=o.collectionRepeat.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!v)throw new Error("collection-repeat expected expression in form of '_item_ in _collection_[ track by _id_]' but got '"+o.collectionRepeat+"'.");var g=new t({scope:i,transcludeFn:s,transcludeParent:r.parent(),keyExpr:v[1],listExpr:v[2],trackByExpr:v[3],heightGetter:f,widthGetter:p}),m=new e({dataSource:g,element:a.$element,scrollView:a.scrollView});i.$watchCollection(g.listExpr,function(e){if(e&&!angular.isArray(e))throw new Error("collection-repeat expects an array to repeat over, but instead got '"+typeof e+"'.");c(e)});var $=angular.bind(m,m.resize);ionic.on("resize",function(){c(i.$eval(g.listExpr))},window),i.$on("$destroy",function(){m.destroy(),g.destroy(),ionic.off("resize",$,window)})}}}]),c.directive("ionContent",["$timeout","$controller","$ionicBind",function(e,t,n){return{restrict:"E",require:"^?ionNavView",scope:!0,priority:800,compile:function(e,i){function r(e,r,a){var s=e.$parent;e.$watch(function(){return(s.$hasHeader?" has-header":"")+(s.$hasSubheader?" has-subheader":"")+(s.$hasFooter?" has-footer":"")+(s.$hasSubfooter?" has-subfooter":"")+(s.$hasTabs?" has-tabs":"")+(s.$hasTabsTop?" has-tabs-top":"")},function(e,t){r.removeClass(t),r.addClass(e)}),e.$hasHeader=e.$hasSubheader=e.$hasFooter=e.$hasSubfooter=e.$hasTabs=e.$hasTabsTop=!1,n(e,a,{$onScroll:"&onScroll",$onScrollComplete:"&onScrollComplete",hasBouncing:"@",scroll:"@",padding:"@",hasScrollX:"@",hasScrollY:"@",scrollbarX:"@",scrollbarY:"@",startX:"@",startY:"@",scrollEventInterval:"@"}),angular.isDefined(a.padding)&&e.$watch(a.padding,function(e){(o||r).toggleClass("padding",!!e)}),"false"===e.scroll||("true"===i.overflowScroll?r.addClass("overflow-scroll"):t("$ionicScroll",{$scope:e,scrollViewOptions:{el:r[0],delegateHandle:i.delegateHandle,bouncing:e.$eval(e.hasBouncing),startX:e.$eval(e.startX)||0,startY:e.$eval(e.startY)||0,scrollbarX:e.$eval(e.scrollbarX)!==!1,scrollbarY:e.$eval(e.scrollbarY)!==!1,scrollingX:e.$eval(e.hasScrollX)===!0,scrollingY:e.$eval(e.hasScrollY)!==!1,scrollEventInterval:parseInt(e.scrollEventInterval,10)||10,scrollingComplete:function(){e.$onScrollComplete({scrollTop:this.__scrollTop,scrollLeft:this.__scrollLeft})}}}))}var o;return e.addClass("scroll-content"),"false"!=i.scroll&&(o=angular.element('
'),o.append(e.contents()),e.append(o)),{pre:r}}}}]),c.directive("ionNavBar",r()).directive("ionHeaderBar",r()).directive("ionHeaderBar",o(!0)).directive("ionFooterBar",o(!1)),c.directive("ionInfiniteScroll",["$timeout",function(e){function t(e,t,n){return n?t*(1-parseInt(e,10)/100):t-parseInt(e,10)}return{restrict:"E",require:["^$ionicScroll","ionInfiniteScroll"],template:'
',scope:!0,controller:["$scope","$attrs",function(e,n){this.isLoading=!1,this.scrollView=null,this.getMaxScroll=function(){var e=(n.distance||"1%").trim(),i=-1!==e.indexOf("%"),r=this.scrollView.getScrollMax();return{left:this.scrollView.options.scrollingX?t(e,r.left,i):-1,top:this.scrollView.options.scrollingY?t(e,r.top,i):-1}}}],link:function(t,n,i,r){function o(){if(!s.isLoading){var e=c.getValues(),t=s.getMaxScroll();(-1!==t.left&&e.left>=t.left||-1!==t.top&&e.top>=t.top)&&l()}}var a=r[0],s=r[1],c=s.scrollView=a.scrollView;t.icon=function(){return angular.isDefined(i.icon)?i.icon:"ion-loading-d"};var l=function(){n[0].classList.add("active"),s.isLoading=!0,t.$parent&&t.$parent.$apply(i.onInfinite||"")},u=function(){n[0].classList.remove("active"),e(function(){c.resize()},0,!1),s.isLoading=!1};t.$on("scroll.infiniteScrollComplete",function(){u()}),t.$on("$destroy",function(){a.$element.off("scroll",d)});var d=ionic.animationFrameThrottle(o);setTimeout(d),a.$element.on("scroll",d)}}}]);var m='',$='
';c.directive("ionItem",["$animate","$compile",function(){return{restrict:"E",controller:["$scope","$element",function(e,t){this.$scope=e,this.$element=t}],priorty:Number.MAX_VALUE,require:["ionItem","^ionList"],scope:!0,compile:function(e,t){var n=angular.isDefined(t.href)||angular.isDefined(t.ngHref),i=n||/ion-(delete|option|reorder)-button/i.test(e.html());if(i){var r=angular.element(n?m:$);r.append(e.contents()),e.append(r),e.addClass("item item-complex")}else e.addClass("item");return function(e,t,n){e.$href=function(){return n.href||n.ngHref}}}}}]);var w='
';c.directive("ionDeleteButton",["$animate",function(e){return{restrict:"E",require:["^ionItem","^ionList"],priority:Number.MAX_VALUE,compile:function(t,n){return n.$set("class",(n["class"]||"")+" button icon button-icon",!0),function(t,n,i,r){var o=r[0],a=r[1],s=angular.element(w);s.append(n),o.$element.append(s).addClass("item-left-editable"),a.showDelete()&&e.removeClass(s,"ng-hide")}}}}]);var b='';c.directive("ionOptionButton",["$compile",function(){return{restrict:"E",require:"^ionItem",priority:Number.MAX_VALUE,compile:function(e,t){return t.$set("class",(t["class"]||"")+" button",!0),function(e,t,n,i){i.optionsContainer||(i.optionsContainer=angular.element(b),i.$element.append(i.optionsContainer)),i.optionsContainer.append(t),t.on("click",a)}}}}]);var y='
';c.directive("ionReorderButton",["$animate",function(e){return{restrict:"E",require:["^ionItem","^ionList"],priority:Number.MAX_VALUE,compile:function(t,n){return n.$set("class",(n["class"]||"")+" button icon button-icon",!0),t[0].setAttribute("data-prevent-scroll",!0),function(t,n,i,r){var o=r[0],a=r[1];t.$onReorder=function(e,n){t.$eval(i.onReorder,{$fromIndex:e,$toIndex:n})};var s=angular.element(y);s.append(n),o.$element.append(s).addClass("item-right-editable"),a.showReorder()&&e.removeClass(s,"ng-hide")}}}}]),c.directive("ionList",["$animate","$timeout",function(e,t){return{restrict:"E",require:["ionList","^?$ionicScroll"],controller:"$ionicList",compile:function(n,i){var r=angular.element('
').append(n.contents());return n.append(r),function(n,r,o,a){function s(){function t(t,n){angular.forEach(r[0].querySelectorAll(t),function(t){n?e.removeClass(angular.element(t),"ng-hide"):e.addClass(angular.element(t),"ng-hide")})}function o(e,t){var n=angular.element(r[0].querySelectorAll(e));t?n.attr("data-tap-disabled","true"):n.removeAttr("data-tap-disabled")}c.listView=new ionic.views.ListView({el:r[0],listEl:r.children()[0],scrollEl:l&&l.element,scrollView:l&&l.scrollView,onReorder:function(e,t,n){var i=angular.element(e).scope();i&&i.$onReorder&&i.$onReorder(t,n)},canSwipe:function(){return c.canSwipeItems()}});angular.isDefined(i.canSwipe)&&n.$watch("!!("+i.canSwipe+")",function(e){c.canSwipeItems(e)}),angular.isDefined(i.showDelete)&&n.$watch("!!("+i.showDelete+")",function(e){c.showDelete(e)}),angular.isDefined(i.showReorder)&&n.$watch("!!("+i.showReorder+")",function(e){c.showReorder(e)}),n.$watch(function(){return c.showDelete()},function(e,n){(e||n)&&(e&&c.closeOptionButtons(),c.canSwipeItems(!e),r.children().toggleClass("list-left-editing",e),t(".item-delete.item-left-edit",e),o(".item-content",e))}),n.$watch(function(){return c.showReorder()},function(e,n){(e||n)&&(e&&c.closeOptionButtons(),c.canSwipeItems(!e),r.children().toggleClass("list-right-editing",e),t(".item-reorder.item-right-edit",e),o(".item-content",e))})}var c=a[0],l=a[1];t(s)}}}}]),c.directive("menuClose",["$ionicViewService",function(){return{restrict:"AC",require:"^ionSideMenus",link:function(e,t,n,i){t.bind("click",function(){i.close()})}}}]),c.directive("menuToggle",["$ionicViewService",function(){return{restrict:"AC",require:"^ionSideMenus",link:function(e,t,n,i){var r=n.menuToggle||"left";t.bind("click",function(){"left"===r?i.toggleLeft():"right"===r&&i.toggleRight()})}}}]),c.directive("ionModal",[function(){return{restrict:"E",transclude:!0,replace:!0,template:''}}]),c.directive("ionNavBackButton",["$animate",function(e){return{restrict:"E",require:"^ionNavBar",compile:function(t){return t.addClass("button back-button ng-hide"),function(t,n,i,r){i.ngClick||(t.$navBack=r.back,n.on("click",function(e){t.$apply(function(){t.$navBack(e)})}));var o=t.$parent.$on("$viewHistory.historyChange",function(e,n){t.hasBackButton=!!n.showBack});t.$on("$destroy",o),t.$watch("!!(backButtonShown && hasBackButton)",ionic.animationFrameThrottle(function(t){t?e.removeClass(n,"ng-hide"):e.addClass(n,"ng-hide")}))}}}}]),c.directive("ionNavBar",["$ionicViewService","$rootScope","$animate","$compile",function(){return{restrict:"E",controller:"$ionicNavBar",scope:!0,compile:function(e){function t(e,t,n,i){i._headerBarView=new ionic.views.HeaderBar({el:t[0],alignTitle:n.alignTitle||"center"}),e.backButtonShown=!1,e.shouldAnimate=!0,e.isReverse=!1,e.isInvisible=!0,e.$on("$destroy",function(){e.$parent.$hasHeader=!1}),e.$watch(function(){return(e.isReverse?" reverse":"")+(e.isInvisible?" invisible":"")+(e.shouldAnimate?"":" no-animation")},function(e,n){t.removeClass(n),t.addClass(e)})}return e.addClass("bar bar-header nav-bar").append('

'),{pre:t}}}}]),c.directive("ionNavButtons",["$compile","$animate",function(e,t){return{require:"^ionNavBar",restrict:"E",compile:function(n){var i=n.contents().remove();return function(n,r,o,a){var s="right"===o.side?a.rightButtonsElement:a.leftButtonsElement,c=angular.element("").append(i);r.append(c),e(c)(n),ionic.requestAnimationFrame(function(){t.enter(c,s)}),n.$on("$destroy",function(){t.leave(c)}),r.css("display","none")}}}}]),c.directive("navClear",["$ionicViewService","$state","$location","$window","$rootScope",function(e,t,n,i,r){return r.$on("$stateChangeError",function(){e.nextViewOptions(null)}),{priority:100,restrict:"AC",compile:function(){function t(t,n){function r(){o=t.$on("$stateChangeStart",function(){e.nextViewOptions({disableAnimate:!0,disableBack:!0}),o()}),i.setTimeout(o,300)}var o;n.on("click",r)}return{pre:t}}}}]),c.directive("ionNavView",["$ionicViewService","$state","$compile","$controller","$animate",function(e,t,n,i,r){var o=!1,a={restrict:"E",terminal:!0,priority:2e3,transclude:!0,controller:function(){},compile:function(s,c,l){return function(s,c,u){function d(o){r.enabled()===!1&&(o=!1);var a=t.$current&&t.$current.locals[p];if(a!==f){var l=e.getRenderer(c,u,s);if(h&&(h.$destroy(),h=null),!a)return f=null,$.state=null,c.append(g);var d=angular.element("
").html(a.$template).contents(),m=l().register(d);l(o).leave(),f=a,$.state=a.$$state,l(o).enter(d);var w=n(d);if(h=s.$new(),h.$navDirection=m.navDirection,a.$$controller){a.$scope=h;var b=i(a.$$controller,a);c.children().data("$ngControllerController",b)}w(h);var y=e._getViewById(m.viewId)||{};h.$broadcast("$viewContentLoaded",y),v&&h.$eval(v),d=null}}var h,f,p=u[a.name]||u.name||"",v=u.onload||"",g=l(s);c.append(g);var m=c.parent().inheritedData("$uiView");p.indexOf("@")<0&&(p=p+"@"+(m?m.state.name:""));var $={name:p,state:null};c.data("$uiView",$);var w=function(){if(!o){o=!0;try{d(!0)}catch(e){throw o=!1,e}o=!1}};s.$on("$stateChangeSuccess",w),d(!1)}}};return a}]),c.config(["$provide",function(e){e.decorator("ngClickDirective",["$delegate",function(e){return e.shift(),e}])}]).factory("$ionicNgClick",["$parse",function(e){return function(t,n,i){var r=e(i);n.on("click",function(e){t.$apply(function(){r(t,{$event:e})})}),n.onclick=function(){}}}]).directive("ngClick",["$ionicNgClick",function(e){return function(t,n,i){e(t,n,i.ngClick)}}]).directive("ionStopEvent",function(){return{restrict:"A",link:function(e,t,n){t.bind(n.ionStopEvent,a)}}}),c.directive("ionPane",function(){return{restrict:"E",link:function(e,t){t.addClass("pane")}}}),c.directive("ionRadio",function(){return{restrict:"E",replace:!0,require:"?ngModel",scope:{ngModel:"=?",ngValue:"=?",ngChange:"&",icon:"@",name:"@"},transclude:!0,template:'',compile:function(e,t){t.name&&e.children().eq(0).attr("name",t.name),t.icon&&e.children().eq(2).removeClass("ion-checkmark").addClass(t.icon)}}}),c.directive("ionRefresher",["$ionicBind",function(e){return{restrict:"E",replace:!0,require:"^$ionicScroll",template:'
',compile:function(t,n){return angular.isUndefined(n.pullingIcon)&&n.$set("pullingIcon","ion-arrow-down-c"),angular.isUndefined(n.refreshingIcon)&&n.$set("refreshingIcon","ion-loading-d"),function(t,n,i,r){e(t,i,{pullingIcon:"@",pullingText:"@",refreshingIcon:"@",refreshingText:"@",$onRefresh:"&onRefresh",$onPulling:"&onPulling"}),r._setRefresher(t,n[0]),t.$on("scroll.refreshComplete",function(){n[0].classList.remove("active"),r.scrollView.finishPullToRefresh()})}}}}]),c.directive("ionScroll",["$timeout","$controller","$ionicBind",function(e,t,n){return{restrict:"E",scope:!0,controller:function(){},compile:function(e){function i(e,i,o){var a,s;n(e,o,{direction:"@",paging:"@",$onScroll:"&onScroll",scroll:"@",scrollbarX:"@",scrollbarY:"@",zooming:"@",minZoom:"@",maxZoom:"@"}),angular.isDefined(o.padding)&&e.$watch(o.padding,function(e){r.toggleClass("padding",!!e)}),e.$eval(e.paging)===!0&&r.addClass("scroll-paging"),e.direction||(e.direction="y");var c=e.$eval(e.paging)===!0,l={el:i[0],delegateHandle:o.delegateHandle,paging:c,scrollbarX:e.$eval(e.scrollbarX)!==!1,scrollbarY:e.$eval(e.scrollbarY)!==!1,scrollingX:e.direction.indexOf("x")>=0,scrollingY:e.direction.indexOf("y")>=0,zooming:e.$eval(e.zooming)===!0,maxZoom:e.$eval(e.maxZoom)||3,minZoom:e.$eval(e.minZoom)||.5};c&&(l.speedMultiplier=.8,l.bouncing=!1),s=t("$ionicScroll",{$scope:e,scrollViewOptions:l}),a=e.$parent.scrollView=s.scrollView}e.addClass("scroll-view");var r=angular.element('
');return r.append(e.contents()),e.append(r),{pre:i}}}}]),c.directive("ionSideMenu",function(){return{restrict:"E",require:"^ionSideMenus",scope:!0,compile:function(e,t){return angular.isUndefined(t.isEnabled)&&t.$set("isEnabled","true"),angular.isUndefined(t.width)&&t.$set("width","275"),e.addClass("menu menu-"+t.side),function(e,t,n,i){e.side=n.side||"left";var r=i[e.side]=new ionic.views.SideMenu({width:275,el:t[0],isEnabled:!0});e.$watch(n.width,function(e){var t=+e;t&&t==e&&r.setWidth(+e)}),e.$watch(n.isEnabled,function(e){r.setIsEnabled(!!e)})}}}}),c.directive("ionSideMenuContent",["$timeout","$ionicGesture",function(e,t){return{restrict:"EA",require:"^ionSideMenus",scope:!0,compile:function(n,i){function r(n,r,o,a){function s(e){0!==a.getOpenAmount()&&(a.close(),e.gesture.srcEvent.preventDefault())}r.addClass("menu-content pane"),angular.isDefined(i.dragContent)?n.$watch(i.dragContent,function(e){a.canDragContent(e)}):a.canDragContent(!0);var c=!1,l=!1;ionic.on("tap",s,r[0]);var u=function(e){!c&&a.isDraggableTarget(e)&&(l=!0,a._handleDrag(e),e.gesture.srcEvent.preventDefault())},d=function(e){l&&e.gesture.srcEvent.preventDefault()},h=t.on("dragright",u,r),f=t.on("dragleft",u,r),p=t.on("dragup",d,r),v=t.on("dragdown",d,r),g=function(e){l=!1,c||a._endDrag(e),c=!1},m=t.on("release",g,r);a.setContent({onDrag:function(){},endDrag:function(){},getTranslateX:function(){return n.sideMenuContentTranslateX||0},setTranslateX:ionic.animationFrameThrottle(function(t){r[0].style[ionic.CSS.TRANSFORM]="translate3d("+t+"px, 0, 0)",e(function(){n.sideMenuContentTranslateX=t})}),enableAnimation:function(){n.animationEnabled=!0,r[0].classList.add("menu-animated")},disableAnimation:function(){n.animationEnabled=!1,r[0].classList.remove("menu-animated")}}),n.$on("$destroy",function(){t.off(f,"dragleft",u),t.off(h,"dragright",u),t.off(p,"dragup",u),t.off(v,"dragdown",u),t.off(m,"release",g),ionic.off("tap",s,r[0])})}return{pre:r}}}}]),c.directive("ionSideMenus",[function(){return{restrict:"ECA",replace:!0,transclude:!0,controller:"$ionicSideMenus",template:'
'}}]),c.directive("ionSlideBox",["$timeout","$compile","$ionicSlideBoxDelegate",function(e,t,n){return{restrict:"E",replace:!0,transclude:!0,scope:{doesContinue:"@",slideInterval:"@",showPager:"@",pagerClick:"&",disableScroll:"@",onSlideChanged:"&",activeSlide:"=?"},controller:["$scope","$element","$attrs",function(t,i,r){var o=t.$eval(t.doesContinue)===!0,a=o?t.$eval(t.slideInterval)||4e3:0,s=new ionic.views.Slider({el:i[0],auto:a,disableScroll:t.$eval(t.disableScroll)===!0||!1,continuous:o,startSlide:t.activeSlide,slidesChanged:function(){t.currentSlide=s.currentIndex(),e(function(){})},callback:function(n){t.currentSlide=n,t.onSlideChanged({index:t.currentSlide}),t.$parent.$broadcast("slideBox.slideChanged",n),t.activeSlide=n,e(function(){})}});t.$watch("activeSlide",function(e){angular.isDefined(e)&&s.slide(e)}),t.$on("slideBox.nextSlide",function(){s.next()}),t.$on("slideBox.prevSlide",function(){s.prev()}),t.$on("slideBox.setSlide",function(e,t){s.slide(t)}),this.__slider=s;var c=n._registerInstance(s,r.delegateHandle);t.$on("$destroy",c),this.slidesCount=function(){return s.slidesCount()},this.onPagerClick=function(e){t.pagerClick({index:e})},e(function(){s.load()})}],template:'
',link:function(e,n){if(e.$eval(e.showPager)!==!1){var i=e.$new(),r=angular.element("");n.append(r),t(r)(i)}}}}]).directive("ionSlide",function(){return{restrict:"E",require:"^ionSlideBox",compile:function(e){return e.addClass("slider-slide"),function(){}}}}).directive("ionPager",function(){return{restrict:"E",replace:!0,require:"^ionSlideBox",template:'
',link:function(e,t,n,i){var r=function(e){for(var n=t[0].children,i=n.length,r=0;i>r;r++)r==e?n[r].classList.add("active"):n[r].classList.remove("active")};e.pagerClick=function(e){i.onPagerClick(e)},e.numSlides=function(){return new Array(i.slidesCount())},e.$watch("currentSlide",function(e){r(e)})}}}),c.directive("ionTab",["$rootScope","$animate","$ionicBind","$compile",function(e,t,n,i){function r(e,t){return angular.isDefined(t)?" "+e+'="'+t+'"':""}return{restrict:"E",require:["^ionTabs","ionTab"],replace:!0,controller:"$ionicTab",scope:!0,compile:function(e,o){var a="",s=angular.element('
').append(e.contents().remove());return function(e,r,o,c){function l(){f.tabMatchesState()&&h.select(e)}var u,d,h=c[0],f=c[1],p=s[0].querySelector("ion-nav-view")||s[0].querySelector("data-ion-nav-view"),v=p&&p.getAttribute("name");n(e,o,{animate:"=",onSelect:"&",onDeselect:"&",title:"@",uiSref:"@",href:"@"}),h.add(e),e.$on("$destroy",function(){h.remove(e),g.isolateScope().$destroy(),g.remove()}),r[0].removeAttribute("title"),v&&(f.navViewName=v),e.$on("$stateChangeSuccess",l),l();var g=angular.element(a);g.data("$ionTabsController",h),g.data("$ionTabController",f),h.$tabsElement.append(i(g)(e)),e.$watch("$tabSelected",function(n){u&&u.$destroy(),u=null,d&&t.leave(d),d=null,n&&(u=e.$new(),d=s.clone(),t.enter(d,h.$element),i(d)(u))})}}}}]),c.directive("ionTabNav",[function(){return{restrict:"E",replace:!0,require:["^ionTabs","^ionTab"],template:'{{badge}}',scope:{title:"@",icon:"@",iconOn:"@",iconOff:"@",badge:"=",badgeStyle:"@"},compile:function(){return function(e,t,n,i){var r=i[0],o=i[1];t[0].removeAttribute("title"),e.selectTab=function(e){e.preventDefault(),r.select(o.$scope,!0)},n.ngClick||t.on("click",function(t){e.$apply(function(){e.selectTab(t)})}),e.getIconOn=function(){return e.iconOn||e.icon},e.getIconOff=function(){return e.iconOff||e.icon},e.isTabActive=function(){return r.selectedTab()===o.$scope}}}}}]),c.directive("ionTabs",["$ionicViewService","$ionicTabsDelegate",function(e,t){return{restrict:"E",scope:!0,controller:"$ionicTabs",compile:function(e){function n(e,n,i,r){var o=t._registerInstance(r,i.delegateHandle);e.$on("$destroy",o),r.$scope=e,r.$element=n,r.$tabsElement=angular.element(n[0].querySelector(".tabs"));var a=n[0];e.$watch(function(){return a.className},function(t){var n=-1!==t.indexOf("tabs-top"),i=-1!==t.indexOf("tabs-item-hide");e.$hasTabs=!n&&!i,e.$hasTabsTop=n&&!i}),e.$on("$destroy",function(){delete e.$hasTabs,delete e.$hasTabsTop})}e.addClass("view");var i=angular.element('
');return i.append(e.contents()),e.append(i),{pre:n}}}}]),c.directive("ionToggle",["$ionicGesture","$timeout",function(){return{restrict:"E",replace:!0,require:"?ngModel",scope:{ngModel:"=?",ngValue:"=?",ngChecked:"=?",ngChange:"&",ngDisabled:"=?"},transclude:!0,template:'
',compile:function(e,t){var n=e.find("input");return t.name&&n.attr("name",t.name),t.ngChecked&&n.attr("ng-checked","ngChecked"),t.ngTrueValue&&n.attr("ng-true-value",t.ngTrueValue),t.ngFalseValue&&n.attr("ng-false-value",t.ngFalseValue),function(e,t){var n,i,r,o;n=t[0].getElementsByTagName("label")[0],i=n.children[0],r=n.children[1],o=r.children[0];var a=angular.element(i).controller("ngModel");e.toggle=new ionic.views.Toggle({el:n,track:r,checkbox:i,handle:o,onChange:function(){a.$setViewValue(i.checked?!0:!1),e.$apply()}}),e.$on("$destroy",function(){e.toggle.destroy()})}}}}]),c.directive("ionView",["$ionicViewService","$rootScope","$animate",function(){return{restrict:"EA",priority:1e3,require:"^?ionNavBar",compile:function(e){return e.addClass("pane"),e[0].removeAttribute("title"),function(e,t,n,i){if(i){if(angular.isDefined(n.title)){var r=n.title;i.changeTitle(r,e.$navDirection),n.$observe("title",function(e){e!==r&&i.setTitle(e)})}var o=angular.isDefined(n.hideBackButton)?n.hideBackButton:"false";e.$watch(o,function(e){i.showBackButton(!e)});var a=angular.isDefined(n.hideNavBar)?n.hideNavBar:"false";e.$watch(a,function(e){i.showBar(!e)})}}}}}])}();