forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathionic-angular.min.js
17 lines (16 loc) · 63.4 KB
/
ionic-angular.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*!
* Copyright 2014 Drifty Co.
* http://drifty.com/
*
* Ionic, v1.0.0-beta.4
* 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('<ion-action-sheet buttons="buttons"></ion-action-sheet>')(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()},v),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<this.length;t++)if(r=this[t],r.setAttribute)if(e.indexOf(" ")<0)r.classList.add(e);else{for(a=(" "+(r.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),o=e.split(" "),n=0;n<o.length;n++)i=o[n].trim(),-1===a.indexOf(" "+i+" ")&&(a+=i+" ");r.setAttribute("class",a.trim())}return this},angular.element.prototype.removeClass=function(e){var t,n,i,r,o;if(e)for(t=0;t<this.length;t++)if(o=this[t],o.getAttribute)if(e.indexOf(" ")<0)o.classList.remove(e);else for(i=e.split(" "),n=0;n<i.length;n++)r=i[n],o.setAttribute("class",(" "+(o.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+r.trim()+" "," ").trim());return this},c.provider("$ionicAnimation",function(){var e=!1;this.setSlowAnimations=function(t){e=t},this.$get=[function(){return function(t){return t.useSlowAnimations=e,ionic.Animation.create(t)}}]}),c.factory("$ionicBackdrop",["$document",function(e){function t(){1===++r&&(i.addClass("visible"),ionic.requestAnimationFrame(function(){r&&i.addClass("active")}))}function n(){0===--r&&(i.removeClass("active"),setTimeout(function(){!r&&i.removeClass("visible")},100))}var i=angular.element('<div class="backdrop">'),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;n<e.element.length;n++)i=e.element[n],r=i.parentNode,r&&r.removeChild(i);t(e.scope)},attachItem:function(e){e.element[0].parentNode||this.transcludeParent[0].appendChild(e.element[0]),n(e.scope),!e.scope.$$phase&&e.scope.$digest()},getLength:function(){return this.data&&this.data.length||0},setData:function(e){this.data=e||[],this.calculateDataDimensions()}},o}]),c.factory("$collectionRepeatManager",["$rootScope","$timeout",function(){function e(e){function t(){return n.viewportSize}var n=this;this.dataSource=e.dataSource,this.element=e.element,this.scrollView=e.scrollView,this.isVertical=!!this.scrollView.options.scrollingY,this.renderedItems={},this.lastRenderScrollValue=this.bufferTransformOffset=this.hasBufferStartIndex=this.hasBufferEndIndex=this.bufferItemsLength=0,this.setCurrentIndex(0),this.scrollView.__$callback=this.scrollView.__callback,this.scrollView.__callback=angular.bind(this,this.renderScroll),this.isVertical?(this.scrollView.options.getContentHeight=t,this.scrollValue=function(){return this.scrollView.__scrollTop},this.scrollMaxValue=function(){return this.scrollView.__maxScrollTop},this.scrollSize=function(){return this.scrollView.__clientHeight},this.secondaryScrollSize=function(){return this.scrollView.__clientWidth},this.transformString=function(e,t){return"translate3d("+t+"px,"+e+"px,0)"},this.primaryDimension=function(e){return e.height},this.secondaryDimension=function(e){return e.width}):(this.scrollView.options.getContentWidth=t,this.scrollValue=function(){return this.scrollView.__scrollLeft},this.scrollMaxValue=function(){return this.scrollView.__maxScrollLeft},this.scrollSize=function(){return this.scrollView.__clientWidth},this.secondaryScrollSize=function(){return this.scrollView.__clientHeight},this.transformString=function(e,t){return"translate3d("+e+"px,"+t+"px,0)"},this.primaryDimension=function(e){return e.width},this.secondaryDimension=function(e){return e.height})}return e.prototype={destroy:function(){for(var e in this.renderedItems)this.removeItem(e)},calculateDimensions:function(){var e,t=0,n=0,i=(this.dataSource.dimensions.length,this.secondaryScrollSize());return this.dataSource.dimensions.map(function(r){var o={primarySize:this.primaryDimension(r),secondarySize:Math.min(this.secondaryDimension(r),i)};return e&&(n+=e.secondarySize,e.primaryPos===t&&n+o.secondarySize>i&&(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.dataSource.getLength(),this.hasNextIndex&&(this.nextPos=this.dimensions[e+1].primaryPos)},renderScroll:ionic.animationFrameThrottle(function(e,t,n,i){return this.isVertical?t=this.getTransformPosition(t):e=this.getTransformPosition(e),this.scrollView.__$callback(e,t,n,i)}),getTransformPosition:function(e){return(this.hasNextIndex&&e>=this.nextPos||this.hasPrevIndex&&e<this.previousPos||Math.abs(e-this.lastRenderScrollValue)>100)&&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<t;)e++;return e},render:function(e){var t;if(this.currentIndex>=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.primarySize<o;)this.renderItem(t,n.primaryPos-c,n.secondaryPos),t++;var l=t-1;for(t in this.renderedItems)(s>t||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):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='<div class="loading"></div>',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","$ionicPlatform",function(e,t,n,i,r,o,a,c){function f(){return g||(g=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})),g}function p(e){e||(e={});var t=e.delay||e.showDelay||0;return w&&i.cancel(w),w=i(angular.noop,t),w.then(f).then(function(t){return $(),$=c.registerBackButtonAction(angular.noop,m),t.show(e)}),{hide:s.method(u,o.error,v),show:s.method(d,o.error,function(){p(e)}),setContent:s.method(h,o.error,function(e){f().then(function(t){t.show({template:e})})})}}function v(){$(),i.cancel(w),f().then(function(e){e.hide()})}var g,$=angular.noop,w=r.when();return{show:p,hide:v,_getLoader:f}}]),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"),i(function(){t[0].body.classList.add("modal-open")},400),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(function(){e.$el.on("click",function(t){t.target===e.el&&e.hide()})},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.$el.off("click"),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(),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("<ion-modal>"+t+"</ion-modal>")(r);i.$el=o,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=150,v=300,g=400,m=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 $='<div class="popup"><div class="popup-head"><h3 class="popup-title" ng-bind-html="title"></h3><h5 class="popup-sub-title" ng-bind-html="subTitle" ng-if="subTitle"></h5></div><div class="popup-body"></div><div class="popup-buttons row"><button ng-repeat="button in buttons" ng-click="$buttonTapped(button, $event)" class="button col" ng-class="button.type || \'button-default\'" ng-bind-html="button.text"></button></div></div>';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:$,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(){m[0]&&m[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=m[0];o&&o.hide();var a=i(angular.noop,o?v.stackPushDelay:0).then(function(){return r}).then(function(e){return o||(document.body.classList.add("popup-open"),t.retain(),w._backButtonActionDone=s.registerBackButtonAction(l,g)),m.unshift(e),e.show(),e.responseDeferred.notify({close:a.close}),e.responseDeferred.promise.then(function(n){var i=m.indexOf(e);-1!==i&&m.splice(i,1),e.remove();var r=m[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:'<input ng-model="data.response" type="'+(e.inputType||"text")+'" placeholder="'+(e.inputPlaceholder||"")+'">',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 v={stackPushDelay:50},m=[],w={show:u,alert:h,confirm:f,prompt:p,_createPopup:c,_popupStack:m};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("<div>").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<o.stack.length){var a=o.stack[o.cursor];return a.go(r)}!r.url&&r.uiSref&&(r.url=t.href(r.uiSref)),r.url&&(0===r.url.indexOf("#")&&(r.url=r.url.replace("#","")),r.url!==n.url()&&n.url(r.url))}}),e.$on("viewState.viewEnter",function(e,t){t&&t.title&&(i[0].title=t.title)}),o.registerBackButtonAction(s,f)}]).factory("$ionicViewService",["$rootScope","$state","$location","$window","$injector","$animate",function(e,t,n,i,r,o){function a(){return ionic.Utils.nextUid()}var s=function(){};return s.prototype.initialize=function(e){if(e){for(var t in e)this[t]=e[t];return this}return null},s.prototype.go=function(){return this.stateName?t.go(this.stateName,this.stateParams):this.url&&this.url!==n.url()?e.$viewHistory.backView===this?i.history.go(-1):e.$viewHistory.forwardView===this?i.history.go(1):void n.url(this.url):null},s.prototype.destroy=function(){this.scope&&(this.scope.$destroy&&this.scope.$destroy(),this.scope=null)},{register:function(t,i){var r=e.$viewHistory,o=this.getCurrentStateId(),s=this._getHistory(t),c=r.currentView,l=r.backView,u=r.forwardView,d=this.nextViewOptions(),h={viewId:null,navAction:null,navDirection:null,historyId:s.historyId};if(i&&!this.isTagNameRegistrable(i))return h.navAction="disabledByTagName",h;if(c&&c.stateId===o&&c.historyId===s.historyId)return h.navAction="noChange",h;if(r.forcedNav)ionic.Utils.extend(h,r.forcedNav),e.$viewHistory.forcedNav=null;else if(l&&l.stateId===o)h.viewId=l.viewId,h.navAction="moveBack",h.viewId=l.viewId,l.historyId===c.historyId&&(h.navDirection="back");else if(u&&u.stateId===o){h.viewId=u.viewId,h.navAction="moveForward",u.historyId===c.historyId&&(h.navDirection="forward");var f=this._getParentHistoryObj(t);u.historyId&&f.scope&&(f.scope.$historyId=u.historyId,h.historyId=u.historyId)}else if(c&&c.historyId!==s.historyId&&s.cursor>-1&&s.stack.length>0&&s.cursor<s.stack.length&&s.stack[s.cursor].stateId===o)h.viewId=s.stack[s.cursor].viewId,h.navAction="moveBack";else{if(h.viewId=a(o),c){if(c.forwardViewId=h.viewId,s.historyId===c.historyId&&(h.navDirection="forward"),h.navAction="newView",u&&c.stateId!==u.stateId){var p=this._getHistoryById(u.historyId);if(p)for(var v=p.stack.length-1;v>=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<t.length;n++)if(1===t[n].nodeType)for(i=0;i<r.length;i++)if(t[n].tagName===r[i])return!1;return!0},clearHistory:function(){var t=e.$viewHistory.histories,n=e.$viewHistory.currentView;for(var i in t)t[i].stack&&(t[i].stack=[],t[i].cursor=-1),n.historyId===i?(n.backViewId=null,n.forwardViewId=null,t[i].stack.push(n)):t[i].destroy&&t[i].destroy();for(var r in e.$viewHistory.views)r!==n.viewId&&delete e.$viewHistory.views[r];this.setNavViews(n.viewId)}}}]),c.config(["$provide",function(e){function t(e,t){return e.__hash=e.hash,e.hash=function(n){return angular.isDefined(n)&&t(function(){var e=document.querySelector(".scroll-content");e&&(e.scrollTop=0)},0,!1),e.__hash(n)},e}e.decorator("$location",["$delegate","$timeout",t])}]),c.service("$ionicListDelegate",i(["showReorder","showDelete","canSwipeItems","closeOptionButtons"])).controller("$ionicList",["$scope","$attrs","$parse","$ionicListDelegate",function(e,t,n,i){var r=!0,o=!1,a=!1,s=i._registerInstance(this,t.delegateHandle);e.$on("$destroy",s),this.showReorder=function(e){return arguments.length&&(o=!!e),o},this.showDelete=function(e){return arguments.length&&(a=!!e),a},this.canSwipeItems=function(e){return arguments.length&&(r=!!e),r},this.closeOptionButtons=function(){this.listView&&this.listView.clearDragEffects()}}]),c.controller("$ionicNavBar",["$scope","$element","$attrs","$ionicViewService","$animate","$compile","$ionicNavBarDelegate",function(e,t,n,i,r,o,a){t.parent().data("$ionNavBarController",this);var s=a._registerInstance(this,n.delegateHandle);e.$on("$destroy",s);var c=this;this.leftButtonsElement=angular.element(t[0].querySelector(".buttons.left-buttons")),this.rightButtonsElement=angular.element(t[0].querySelector(".buttons.right-buttons")),this.back=function(e){var t=i.getBackView();return t&&t.go(),e&&(e.alreadyHandled=!0),!1},this.align=function(e){this._headerBarView.align(e)},this.showBackButton=function(t){return arguments.length&&(e.backButtonShown=!!t),!(!e.hasBackButton||!e.backButtonShown)},this.showBar=function(t){return arguments.length&&(e.isInvisible=!t,e.$parent.$hasHeader=!!t),!e.isInvisible},this.setTitle=function(t){e.oldTitle=e.title,e.title=t||""},this.changeTitle=function(t,n){return e.title===t?!1:(this.setTitle(t),e.isReverse="back"==n,e.shouldAnimate=!!n,e.shouldAnimate?this._animateTitles():this._headerBarView.align(),!0)},this.getTitle=function(){return e.title||""
},this.getPreviousTitle=function(){return e.oldTitle||""},this._animateTitles=function(){var n,i,a;a=t[0].querySelectorAll(".title"),a.length&&(n=o('<h1 class="title" ng-bind-html="oldTitle"></h1>')(e),angular.element(a[0]).replaceWith(n)),i=o('<h1 class="title invisible" ng-bind-html="title"></h1>')(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 i=t&&t.viewId;i&&n(function(){l.rememberScrollPosition(i),l.scrollToRememberedPosition(),v=a.$on("$viewHistory.viewBack",function(e,t){i===t&&l.forgetScrollPosition()})},1,!1)}}),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","$ionicPlatform",function(e,t,n,i){var r=this;angular.extend(this,ionic.controllers.SideMenuController.prototype),this.$scope=e,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 o=angular.noop,a=angular.bind(this,this.close);e.$watch(function(){return 0!==r.getOpenAmount()},function(e){o(),e&&(o=i.registerBackButtonAction(a,p))});var s=n._registerInstance(this,t.delegateHandle);e.$on("$destroy",function(){s(),o()})}]),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:'<div class="action-sheet-backdrop"><div class="action-sheet-wrapper"><div class="action-sheet"><div class="action-sheet-group"><div class="action-sheet-title" ng-if="titleText" ng-bind-html="titleText"></div><button class="button" ng-click="buttonClicked($index)" ng-repeat="button in buttons" ng-bind-html="button.text"></button></div><div class="action-sheet-group" ng-if="destructiveText"><button class="button destructive" ng-click="destructiveButtonClicked()" ng-bind-html="destructiveText"></button></div><div class="action-sheet-group" ng-if="cancelText"><button class="button" ng-click="cancel()" ng-bind-html="cancelText"></button></div></div></div></div>'}}]),c.directive("ionCheckbox",function(){return{restrict:"E",replace:!0,require:"?ngModel",scope:{ngModel:"=?",ngValue:"=?",ngChecked:"=?",ngDisabled:"=?",ngChange:"&"},transclude:!0,template:'<label class="item item-checkbox"><div class="checkbox checkbox-input-hidden disable-pointer-events"><input type="checkbox" ng-model="ngModel" ng-value="ngValue" ng-change="ngChange()"><i class="checkbox-icon"></i></div><div class="item-content disable-pointer-events" ng-transclude></div></label>',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)}}});var w="Cannot create a collection-repeat within a scrollView that is scrollable on both x and y axis. Choose either x direction or y direction.",b="collection-repeat expected attribute collection-item-height to be a an expression that returns a number (in pixels) or percentage.",y="collection-repeat expected attribute collection-item-width to be a an expression that returns a number (in pixels) or percentage.",S="collection-repeat expected expression in form of '_item_ in _collection_[ track by _id_]' but got '%'";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){u.resize(),I.setData(e),C.resize()}function l(){c(i.$eval($))}var u=a.scrollView;if(u.options.scrollingX&&u.options.scrollingY)throw new Error(w);var d=!!u.options.scrollingY;if(d&&!o.collectionItemHeight)throw new Error(b);if(!d&&!o.collectionItemWidth)throw new Error(y);o.collectionItemHeight=o.collectionItemHeight||'"100%"',o.collectionItemWidth=o.collectionItemWidth||'"100%"';var h=o.collectionItemHeight?n(o.collectionItemHeight):function(){return u.__clientHeight},f=o.collectionItemWidth?n(o.collectionItemWidth):function(){return u.__clientWidth},p=function(e,t){var n=h(e,t);return angular.isString(n)&&n.indexOf("%")>-1?Math.floor(parseInt(n,10)/100*u.__clientHeight):n},v=function(e,t){var n=f(e,t);return angular.isString(n)&&n.indexOf("%")>-1?Math.floor(parseInt(n,10)/100*u.__clientWidth):n},g=o.collectionRepeat.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!g)throw new Error(S.replace("%",o.collectionRepeat));var m=g[1],$=g[2],k=g[3],I=new t({scope:i,transcludeFn:s,transcludeParent:r.parent(),keyExpr:m,listExpr:$,trackByExpr:k,heightGetter:p,widthGetter:v}),C=new e({dataSource:I,element:a.$element,scrollView:a.scrollView});i.$watchCollection($,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)}),ionic.on("resize",l,window),i.$on("$destroy",function(){C.destroy(),I.destroy(),ionic.off("resize",l,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('<div class="scroll"></div>'),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:'<div class="scroll-infinite"><div class="scroll-infinite-content"><i class="icon {{icon()}} icon-refreshing"></i></div></div>',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 k='<a class="item-content" ng-href="{{$href()}}"></a>',I='<div class="item-content"></div>';c.directive("ionItem",["$animate","$compile",function(){return{restrict:"E",controller:["$scope","$element",function(e,t){this.$scope=e,this.$element=t}],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?k:I);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 C='<div class="item-left-edit item-delete ng-hide"></div>';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(C);s.append(n),o.$element.append(s).addClass("item-left-editable"),a.showDelete()&&e.removeClass(s,"ng-hide")}}}}]);var x='<div class="item-options invisible"></div>';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(x),i.$element.append(i.optionsContainer)),i.optionsContainer.append(t),t.on("click",a)}}}}]);var T='<div data-prevent-scroll="true" class="item-right-edit item-reorder ng-hide"></div>';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(T);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('<div class="list">').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:'<div class="modal-backdrop"><div class="modal-wrapper" ng-transclude></div></div>'}}]),c.directive("ionNavBackButton",["$animate","$rootScope",function(e,t){var n=!1;return t.$on("$viewHistory.historyChange",function(e,t){n=!!t.showBack}),{restrict:"E",require:"^ionNavBar",compile:function(t){return t.addClass("button back-button ng-hide"),function(t,i,r,o){r.ngClick||(t.$navBack=o.back,i.on("click",function(e){t.$apply(function(){t.$navBack(e)})})),t.$watch(function(){return!(!n||!t.backButtonShown)},ionic.animationFrameThrottle(function(t){t?e.removeClass(i,"ng-hide"):e.addClass(i,"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('<div class="buttons left-buttons"> </div><h1 ng-bind-html="title" class="title"></h1><div class="buttons right-buttons"> </div>'),{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("<span>").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("<div></div>").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:'<label class="item item-radio"><input type="radio" name="radio-group" ng-model="ngModel" ng-value="ngValue" ng-change="ngChange()"><div class="item-content disable-pointer-events" ng-transclude></div><i class="radio-icon disable-pointer-events icon ion-checkmark"></i></label>',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:'<div class="scroll-refresher"><div class="ionic-refresher-content" ng-class="{\'ionic-refresher-with-text\': pullingText || refreshingText}"><i class="icon {{pullingIcon}} icon-pulling"></i><div class="text-pulling" ng-bind-html="pullingText"></div><i class="icon {{refreshingIcon}} icon-refreshing"></i><div class="text-refreshing" ng-bind-html="refreshingText"></div></div></div>',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('<div class="scroll"></div>');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:'<div class="view" ng-transclude></div>'}}]),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,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(){})}});s.enableSlide(t.$eval(r.disableScroll)!==!0),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:'<div class="slider"> <div class="slider-slides" ng-transclude> </div> </div>',link:function(e,n){if(e.$eval(e.showPager)!==!1){var i=e.$new(),r=angular.element("<ion-pager></ion-pager>");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:'<div class="slider-pager"><span class="slider-pager-page" ng-repeat="slide in numSlides() track by $index" ng-class="{active: $index == currentSlide}" ng-click="pagerClick($index)"><i class="icon ion-record"></i></span></div>',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="<ion-tab-nav"+r("ng-click",o.ngClick)+r("title",o.title)+r("icon",o.icon)+r("icon-on",o.iconOn)+r("icon-off",o.iconOff)+r("badge",o.badge)+r("badge-style",o.badgeStyle)+"></ion-tab-nav>",s=angular.element('<div class="pane">').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:'<a ng-class="{\'tab-item-active\': isTabActive(), \'has-badge\':badge}" class="tab-item"><span class="badge {{badgeStyle}}" ng-if="badge">{{badge}}</span><i class="icon {{getIconOn()}}" ng-if="getIconOn() && isTabActive()"></i><i class="icon {{getIconOff()}}" ng-if="getIconOff() && !isTabActive()"></i><span class="tab-title" ng-bind-html="title"></span></a>',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('<div class="tabs"></div>');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:'<div class="item item-toggle"><div ng-transclude></div><label class="toggle"><input type="checkbox" ng-model="ngModel" ng-value="ngValue" ng-change="ngChange()" ng-disabled="ngDisabled"><div class="track"><div class="handle"></div></div></label></div>',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),t.toggleClass&&e[0].getElementsByTagName("label")[0].classList.add(t.toggleClass),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)})}}}}}])}();