/*!
* Copyright 2014 Drifty Co.
* http://drifty.com/
*
* Ionic, v1.0.0-rc.0
* 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,t,n,i,o,r){function a(a,c,s,l,u){function d(){return S||(S=new e({afterItemsNode:L[0],containerNode:w,heightData:B,widthData:I,forceRefreshImages:!(!f(s.forceRefreshImages)||"false"===s.forceRefreshImages),keyExpression:k,renderBuffer:V,scope:a,scrollView:l.scrollView,transclude:u}))}function h(){var e=m.__clientHeight,t=m.__clientWidth;t&&e&&(h.height!==e||h.width!==t)&&(h.height=e,h.width=t,p())}function p(){if((B.computed||I.computed)&&g(),B.computed){if(B.value=x.height,!B.value)throw new Error('collection-repeat tried to compute the height of repeated elements "'+b+'", but was unable to. Please provide the "item-height" attribute. http://ionicframework.com/docs/api/directive/collectionRepeat/')}else!B.dynamic&&B.getValue&&(B.value=B.getValue());if(I.computed){if(I.value=x.width,!I.value)throw new Error('collection-repeat tried to compute the width of repeated elements "'+b+'", but was unable to. Please provide the "item-width" attribute. http://ionicframework.com/docs/api/directive/collectionRepeat/')}else!I.dynamic&&I.getValue&&(I.value=I.getValue());d().refreshLayout()}function v(e,n){if(e){var i;try{i=t(e)}catch(o){e.trim().match(/\d+(px|%)$/)&&(e='"'+e+'"'),i=t(e)}var r=e.replace(/(\'|\"|px|%)/g,"").trim(),a=r.length&&!/([a-zA-Z]|\$|:|\?)/.test(r);if(n.attrValue=e,a){var c=parseInt(i());if(e.indexOf("%")>-1){var s=c/100;n.getValue=n===B?function(){return Math.floor(s*m.__clientHeight)}:function(){return Math.floor(s*m.__clientWidth)}}else n.value=c}else n.dynamic=!0,n.getValue=n===B?function(e,t){var n=i(e,t);return n.charAt&&"%"===n.charAt(n.length-1)?Math.floor(parseInt(n)/100*m.__clientHeight):parseInt(n)}:function(e,t){var n=i(e,t);return n.charAt&&"%"===n.charAt(n.length-1)?Math.floor(parseInt(n)/100*m.__clientWidth):parseInt(n)}}}function g(){R||u(H=a.$new(),function(e){e[0].removeAttribute("collection-repeat"),R=e[0]}),H[k]=(T(a)||[])[0],o.$$phase||H.$digest(),w.appendChild(R);var e=n.getComputedStyle(R);x.width=parseInt(e.width),x.height=parseInt(e.height),w.removeChild(R)}var m=l.scrollView,$=c[0],w=angular.element('
')[0];if($.parentNode.replaceChild(w,$),m.options.scrollingX&&m.options.scrollingY)throw new Error("collection-repeat expected a parent x or y scrollView, not an xy scrollView.");var b=s.collectionRepeat,y=b.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!y)throw new Error("collection-repeat expected expression in form of '_item_ in _collection_[ track by _id_]' but got '"+s.collectionRepeat+"'.");var S,k=y[1],C=y[2],T=t(C),B={},I={},x={},A=s.itemRenderBuffer||s.collectionBufferSize,V=angular.isDefined(A)?parseInt(A):E,P=s.itemHeight||s.collectionItemHeight,D=s.itemWidth||s.collectionItemWidth;P||D?(P?v(P,B):B.computed=!0,D||(D='"100%"'),v(D,I)):B.computed=I.computed=!0;var L=angular.element(m.__content.querySelector(".collection-repeat-after-container"));if(!L.length){var M=!1,N=[].filter.call(m.__content.childNodes,function(e){return ionic.DomUtil.contains(e,w)?(M=!0,!1):M});L=angular.element(''),m.options.scrollingX&&L.addClass("horizontal"),L.append(N),m.__content.appendChild(L[0])}i(p),l.$element.one("scroll.init",p);var _=ionic.animationFrameThrottle(h);angular.element(n).on("resize",_),a.$on("$destroy",function(){angular.element(n).off("resize",_),l.$element&&l.$element.off("scroll.init",p),R&&R.parentNode&&R.parentNode.removeChild(R),H&&H.$destroy(),H=R=null,S&&S.destroy(),S=null}),a.$watchCollection(T,function(e){if(e||(e=[]),!angular.isArray(e))throw new Error("collection-repeat expected an array for '"+C+"', but got a "+typeof value);r(function(){d().refreshData(e),e.length&&p()},0,!1)});var R,H}return{restrict:"A",priority:1e3,transclude:"element",$$tlb:!0,require:"^$ionicScroll",link:a}}function t(e,t,n){var o={primaryPos:0,secondaryPos:0,primarySize:0,secondarySize:0};return function(t){function r(){return a(!0)}function a(t){if(!a.destroyed){var n,i,r,l,u=Q.getScrollValue(),d=u+Q.scrollPrimarySize;Q.updateRenderRange(u,d),F=Math.max(0,F-k),W=Math.min(I.length-1,W+k);for(n in K)(F>n||n>W)&&(i=K[n],delete K[n],j.push(i),i.isShown=!1,i.scope.$broadcast("$collectionRepeatChange"));for(n=F;W>=n;n++)n>=I.length||K[n]&&!t||(i=K[n]||(K[n]=j.length?j.pop():G.length?G.shift():new s),Z.push(i),i.isShown=!0,l=i.scope,l.$index=n,l[S]=I[n],l.$first=0===n,l.$last=n===I.length-1,l.$middle=!(l.$first||l.$last),l.$odd=!(l.$even=0===(1&n)),l.$$disconnected&&ionic.Utils.reconnectScope(i.scope),r=Q.getDimensions(n),(i.secondaryPos!==r.secondaryPos||i.primaryPos!==r.primaryPos)&&(i.node.style[ionic.CSS.TRANSFORM]=z.replace(R,i.primaryPos=r.primaryPos).replace(H,i.secondaryPos=r.secondaryPos)),(i.secondarySize!==r.secondarySize||i.primarySize!==r.primarySize)&&(i.node.style.cssText=i.node.style.cssText.replace(A,O.replace(R,(i.primarySize=r.primarySize)+1).replace(H,i.secondarySize=r.secondarySize))));for(W===I.length-1&&(r=Q.getDimensions(I.length-1)||o,m.style[ionic.CSS.TRANSFORM]=z.replace(R,r.primaryPos+r.primarySize).replace(H,0));j.length;)i=j.pop(),ionic.Utils.disconnectScope(i.scope),G.push(i),i.node.style[ionic.CSS.TRANSFORM]="translate3d(-9999px,-9999px,0)",i.primaryPos=i.secondaryPos=null;if(w)for(n=0,ii=Z.length;nh&&(f=i.images[h]);h++){var v=f.src;f.src=x,f.src=v}if(t)for(var g=e.$$phase;Z.length;)i=Z.pop(),g||i.scope.$digest();else c()}}function c(){var t,i;c.running||(c.running=!0,n(function o(){if(i=Z.length){for(var r=e.$$phase,a=Math.floor(i/1.25)||1;a&&Z.length;)t=Z.pop(),t.isShown&&(a--,r||t.scope.$digest());n(o)}else c.running=!1}))}function s(){var e=this;this.scope=C.$new(),this.id="item"+J++,B(this.scope,function(t){e.element=t,e.element.data("$$collectionRepeatItem",e),e.node=t[0],e.node.style[ionic.CSS.TRANSFORM]="translate3d(-9999px,-9999px,0)",e.node.style.cssText+=" height: 0px; width: 0px;",ionic.Utils.disconnectScope(e.scope),$.appendChild(e.node),e.images=t[0].getElementsByTagName("img")})}function l(){this.getItemPrimarySize=P,this.getItemSecondarySize=L,this.getScrollValue=function(){return Math.max(0,Math.min(T.__scrollTop-U,T.__maxScrollTop-U-q))},this.refreshDirection=function(){this.scrollPrimarySize=T.__clientHeight,this.scrollSecondarySize=T.__clientWidth,this.estimatedPrimarySize=v,this.estimatedSecondarySize=g,this.estimatedItemsAcross=N&&Math.floor(T.__clientWidth/g)||1}}function u(){this.getItemPrimarySize=L,this.getItemSecondarySize=P,this.getScrollValue=function(){return Math.max(0,Math.min(T.__scrollLeft-U,T.__maxScrollLeft-U-q))},this.refreshDirection=function(){this.scrollPrimarySize=T.__clientWidth,this.scrollSecondarySize=T.__clientHeight,this.estimatedPrimarySize=g,this.estimatedSecondarySize=v,this.estimatedItemsAcross=N&&Math.floor(T.__clientHeight/v)||1}}function d(){this.getEstimatedSecondaryPos=function(e){return e%this.estimatedItemsAcross*this.estimatedSecondarySize},this.getEstimatedPrimaryPos=function(e){return Math.floor(e/this.estimatedItemsAcross)*this.estimatedPrimarySize},this.getEstimatedIndex=function(e){return Math.floor(e/this.estimatedPrimarySize)*this.estimatedItemsAcross}}function f(){this.getEstimatedSecondaryPos=function(){return 0},this.getEstimatedPrimaryPos=function(e){return e*this.estimatedPrimarySize},this.getEstimatedIndex=function(e){return Math.floor(e/this.estimatedPrimarySize)}}function h(){this.getContentSize=function(){return this.getEstimatedPrimaryPos(I.length-1)+this.estimatedPrimarySize+U+q};var e={};this.getDimensions=function(t){return e.primaryPos=this.getEstimatedPrimaryPos(t),e.secondaryPos=this.getEstimatedSecondaryPos(t),e.primarySize=this.estimatedPrimarySize,e.secondarySize=this.estimatedSecondarySize,e},this.updateRenderRange=function(e,t){F=Math.max(0,this.getEstimatedIndex(e)),W=Math.min(I.length-1,this.getEstimatedIndex(t)+this.estimatedItemsAcross-1),Y=Math.max(0,this.getEstimatedPrimaryPos(F)),X=this.getEstimatedPrimaryPos(W)+this.estimatedPrimarySize}}function p(){function e(e){var t,i,a;for(t=Math.max(0,n);e>=t&&(a=l[t]);t++)i=l[t-1]||o,a.primarySize=r.getItemPrimarySize(t,I[t]),a.secondarySize=r.scrollSecondarySize,a.primaryPos=i.primaryPos+i.primarySize,a.secondaryPos=0}function t(e){var t,i,a;for(t=Math.max(n,0);e>=t&&(a=l[t]);t++)i=l[t-1]||o,a.secondarySize=Math.min(r.getItemSecondarySize(t,I[t]),r.scrollSecondarySize),a.secondaryPos=i.secondaryPos+i.secondarySize,0===t||a.secondaryPos+a.secondarySize>r.scrollSecondarySize?(a.rowStartIndex=t,a.secondaryPos=0,a.primarySize=r.getItemPrimarySize(t,I[t]),a.primaryPos=i.primaryPos+i.primarySize):(a.rowStartIndex=i.rowStartIndex,a.primarySize=i.primarySize,a.primaryPos=i.primaryPos)}var n,r=this,a=M?function(){T.setDimensions(null,null,null,r.getContentSize(),!0)}:function(){T.setDimensions(null,null,r.getContentSize(),null,!0)},c=ionic.debounce(a,25,!0),s=N?t:e,l=[];this.getContentSize=function(){var e=l[n]||o;return(e.primaryPos+e.primarySize||0)+this.getEstimatedPrimaryPos(I.length-n-1)+U+q},this.onDestroy=function(){l.length=0},this.onRefreshData=function(){for(i=l.length,len=I.length;in&&(e>.9*I.length?(s(I.length-1),n=I.length-1,a()):(s(e),n=e,c())),l[e]};var u=-1,d=-1;this.updateRenderRange=function(e,t){var n,i,o;if(this.getDimensions(2*this.getEstimatedIndex(t)),-1===u||0===e)n=0;else if(e>=d)for(n=u,i=I.length;i>n&&!((o=this.getDimensions(n))&&o.primaryPos+o.primarySize>=e);n++);else for(n=u;n>=0;n--)if((o=this.getDimensions(n))&&o.primaryPos<=e){n=N?o.rowStartIndex:n;break}F=Math.min(Math.max(0,n),I.length-1),Y=-1!==F?this.getDimensions(F).primaryPos:-1;var r;for(n=F+1,i=I.length;i>n;n++)if((o=this.getDimensions(n))&&o.primaryPos+o.primarySize>t){if(N)for(r=o;i-1>n&&(o=this.getDimensions(n+1)).primaryPos===r.primaryPos;)n++;break}W=Math.min(n,I.length-1),X=-1!==W?(o=this.getDimensions(W)).primaryPos+o.primarySize:-1,d=e,u=F}}var v,g,m=t.afterItemsNode,$=t.containerNode,w=t.forceRefreshImages,b=t.heightData,y=t.widthData,S=t.keyExpression,k=t.renderBuffer,C=t.scope,T=t.scrollView,B=t.transclude,I=[],E={},V=b.getValue||function(){return b.value},P=function(e,t){return E[S]=t,E.$index=e,V(C,E)},D=y.getValue||function(){return y.value},L=function(e,t){return E[S]=t,E.$index=e,D(C,E)},M=!!T.options.scrollingY,N=M?y.dynamic||y.value!==T.__clientWidth:b.dynamic||b.value!==T.__clientHeight,_=!b.dynamic&&!y.dynamic,R="PRIMARY",H="SECONDARY",z=M?"translate3d(SECONDARYpx,PRIMARYpx,0)":"translate3d(PRIMARYpx,SECONDARYpx,0)",O=M?"height: PRIMARYpx; width: SECONDARYpx;":"height: SECONDARYpx; width: PRIMARYpx;",U=0,q=0,F=-1,W=-1,X=-1,Y=-1,G=[],j=[],Z=[],K={},J=0,Q=M?new l:new u;(N?d:f).call(Q),(_?h:p).call(Q);var et=M?"getContentHeight":"getContentWidth",tt=T.options[et];T.options[et]=angular.bind(Q,Q.getContentSize),T.__$callback=T.__callback,T.__callback=function(e,t,n,i){var o=Q.getScrollValue();(-1===F||o+Q.scrollPrimarySize>X||Y>o)&&a(),T.__$callback(e,t,n,i)};var nt=!1,it=!1;this.refreshLayout=function(){v=P(0,I[0]),g=L(0,I[0]);var e=getComputedStyle(m)||{},t=m.firstElementChild&&getComputedStyle(m.firstElementChild)||{},n=m.lastElementChild&&getComputedStyle(m.lastElementChild)||{};q=(parseInt(e[M?"height":"width"])||0)+(t&&parseInt(t[M?"marginTop":"marginLeft"])||0)+(n&&parseInt(n[M?"marginBottom":"marginRight"])||0),U=0;var i=$;do U+=i[M?"offsetTop":"offsetLeft"];while(ionic.DomUtil.contains(T.__content,i=i.offsetParent));if((Q.onRefreshLayout||angular.noop)(),Q.refreshDirection(),!nt)for(var o=Math.max(20,3*k),a=0;o>a;a++)G.push(new s);nt=!0,nt&&it&&r()},this.refreshData=function(e){I=e,(Q.onRefreshData||angular.noop)(),it=!0,nt&&it&&(T.resize(),r())},this.destroy=function(){a.destroyed=!0,G.forEach(function(e){e.scope.$destroy(),e.scope=e.element=e.node=e.images=null}),G.length=Z.length=j.length=0,K={},T.options[et]=tt,T.__callback=T.__$callback,T.resize(),(Q.onDestroy||angular.noop)()}}}function n(e){return["$ionicGesture","$parse",function(t,n){var i=e.substr(2).toLowerCase();return function(o,r,a){var c=n(a[e]),s=function(e){o.$apply(function(){c(o,{$event:e})})},l=t.on(i,s,r);o.$on("$destroy",function(){t.off(l,i,s)})}}]}function o(){return["$ionicScrollDelegate",function(e){return{restrict:"E",link:function(t,n,i){function o(t){for(var i=3,o=t.target;i--&&o;){if(o.classList.contains("button")||o.tagName.match(/input|textarea|select/i)||o.isContentEditable)return;o=o.parentNode}var r=t.gesture&&t.gesture.touches[0]||t.detail.touches[0],a=n[0].getBoundingClientRect();ionic.DomUtil.rectContains(r.pageX,r.pageY,a.left,a.top-20,a.left+a.width,a.top+a.height)&&e.scrollTop(!0)}"true"!=i.noTapScroll&&(ionic.on("tap",o,n[0]),t.$on("$destroy",function(){ionic.off("tap",o,n[0])}))}}}]}function r(e){return["$document","$timeout",function(t,n){return{restrict:"E",controller:"$ionicHeaderBar",compile:function(i){function o(t,n,i,o){e?(t.$watch(function(){return n[0].className},function(e){var n=-1===e.indexOf("ng-hide"),i=-1!==e.indexOf("bar-subheader");t.$hasHeader=n&&!i,t.$hasSubheader=n&&i}),t.$on("$destroy",function(){delete t.$hasHeader,delete t.$hasSubheader}),o.align(),t.$on("$ionicHeader.align",function(){ionic.requestAnimationFrame(function(){o.align()})})):(t.$watch(function(){return n[0].className},function(e){var n=-1===e.indexOf("ng-hide"),i=-1!==e.indexOf("bar-subfooter");t.$hasFooter=n&&!i,t.$hasSubfooter=n&&i}),t.$on("$destroy",function(){delete t.$hasFooter,delete t.$hasSubfooter}),t.$watch("$hasTabs",function(e){n.toggleClass("has-tabs",!!e)}))}return i.addClass(e?"bar bar-header":"bar bar-footer"),n(function(){e&&t[0].getElementsByClassName("tabs-top").length&&i.addClass("has-tabs-top")}),{pre:o}}}}]}function a(e){return e.clientHeight}function c(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,o){var r=!1,a=function(){return r||(r=!0,t(e)),o},c=function(n){return r||(r=!0,t(e)),o=n,n};Object.defineProperty(n,i,{get:a,set:c,enumerable:!0})}},l=angular.module("ionic",["ngAnimate","ngSanitize","ui.router"]),u=angular.extend,d=angular.forEach,f=angular.isDefined,h=angular.isNumber,p=angular.isString,v=angular.element,g=angular.noop;l.factory("$ionicActionSheet",["$rootScope","$compile","$animate","$timeout","$ionicTemplateLoader","$ionicPlatform","$ionicBody",function(e,t,n,i,o,r,a){function c(o){function c(e){e&&/icon/.test(e)&&(s.$actionSheetHasIcon=!0)}var s=e.$new(!0);u(s,{cancel:g,destructiveButtonClicked:g,buttonClicked:g,$deregisterBackButton:g,buttons:[],cancelOnStateChange:!0},o||{});for(var l=0;l')(s),f=v(d[0].querySelector(".action-sheet-wrapper")),h=s.cancelOnStateChange?e.$on("$stateChangeSuccess",function(){s.cancel()}):g;return s.removeSheet=function(e){s.removed||(s.removed=!0,f.removeClass("action-sheet-up"),i(function(){a.removeClass("action-sheet-open")},400),s.$deregisterBackButton(),h(),n.removeClass(d,"active").then(function(){s.$destroy(),d.remove(),s.cancel.$scope=f=null,(e||g)()}))},s.showSheet=function(e){s.removed||(a.append(d).addClass("action-sheet-open"),n.addClass(d,"active").then(function(){s.removed||(e||g)()}),i(function(){s.removed||f.addClass("action-sheet-up")},20,!1))},s.$deregisterBackButton=r.registerBackButtonAction(function(){i(s.cancel)},C),s.cancel=function(){s.removeSheet(o.cancel)},s.buttonClicked=function(e){o.buttonClicked(e,o.buttons[e])===!0&&s.removeSheet()},s.destructiveButtonClicked=function(){o.destructiveButtonClicked()===!0&&s.removeSheet()},s.showSheet(),s.cancel.$scope=s,s.cancel}return{show:c}}]),v.prototype.addClass=function(e){var t,n,i,o,r,a;if(e&&"ng-scope"!=e&&"ng-isolate-scope"!=e)for(t=0;t'),a=0;return e[0].body.appendChild(r[0]),{retain:n,release:i,getElement:o,_element:r}}]),l.factory("$ionicBind",["$parse","$interpolate",function(e,t){var n=/^\s*([@=&])(\??)\s*(\w*)\s*$/;return function(i,o,r){d(r||{},function(r,a){var c,s,l=r.match(n)||[],u=l[3]||a,d=l[1];switch(d){case"@":if(!o[u])return;o.$observe(u,function(e){i[a]=e}),o[u]&&(i[a]=t(o[u])(i));break;case"=":if(!o[u])return;s=i.$watch(o[u],function(e){i[a]=e}),i.$on("$destroy",s);break;case"&":if(o[u]&&o[u].match(RegExp(a+"(.*?)")))throw new Error('& expression binding "'+a+'" looks like it will recursively call "'+o[u]+'" and cause a stack overflow! Please choose a different scopeName.');c=e(o[u]),i[a]=function(e){return c(i,e)}}})}}]),l.factory("$ionicBody",["$document",function(e){return{addClass:function(){for(var t=0;t-1&&m.stack.length>0&&m.cursor=N.index;a--){var q=i.stack[a];q&&q.destroy&&q.destroy(),i.stack.splice(a)}z=N.historyId}m.historyId===L.historyId?H=I:L.historyId!==m.historyId&&(H=x,i=d(L.historyId),i&&i.parentHistoryId===m.parentHistoryId?H=E:(i=d(i.parentHistoryId),i&&i.historyId===m.historyId&&(H=A)))}else R=S;2>P&&(H=V),D.views[_]=this.createView({viewId:_,index:m.stack.length,historyId:m.historyId,backViewId:L&&L.viewId?L.viewId:null,forwardViewId:null,stateId:u,stateName:this.currentStateName(),stateParams:g(),url:O}),m.stack.push(D.views[_])}if(o.cancel(b),w){if(w.disableAnimate&&(H=V),w.disableBack&&(D.views[_].backViewId=null),w.historyRoot){for(a=0;a0&&(m.stack[a-1].forwardViewId=null),D.forwardView=null,D.currentView.index=D.backView.index,D.currentView.backViewId=D.backView.backViewId,D.backView=s(D.backView),m.stack.splice(a,1);break}return m.cursor=D.currentView.index,{viewId:_,action:R,direction:H,historyId:z,enableBack:this.enabledBack(D.currentView),isHistoryRoot:0===D.currentView.index,ele:l}},registerHistory:function(e){e.$historyId=ionic.Utils.nextUid()},createView:function(e){var t=new L;return t.initialize(e)},getViewById:c,viewHistory:function(){return D},currentView:function(e){return arguments.length&&(D.currentView=e),D.currentView},currentHistoryId:function(){return D.currentView?D.currentView.historyId:null},currentTitle:function(e){return D.currentView?(arguments.length&&(D.currentView.title=e),D.currentView.title):void 0},backView:function(e){return arguments.length&&(D.backView=e),D.backView},backTitle:function(e){var t=e&&c(e.backViewId)||D.backView;return t&&t.title},forwardView:function(e){return arguments.length&&(D.forwardView=e),D.forwardView},currentStateName:function(){return t&&t.current?t.current.name:null},isCurrentStateNavView:function(e){return!!(t&&t.current&&t.current.views&&t.current.views[e])},goToHistoryRoot:function(e){if(e){var t=d(e);if(t&&t.stack.length){if(D.currentView&&D.currentView.viewId===t.stack[0].viewId)return;y={viewId:t.stack[0].viewId,action:C,direction:B},t.stack[0].go()}}},goBack:function(){D.backView&&D.backView.go()},enabledBack:function(e){var t=s(e);return!(!t||t.historyId!==e.historyId)},clearHistory:function(){var e=D.histories,t=D.currentView;if(e)for(var n in e)e[n].stack&&(e[n].stack=[],e[n].cursor=-1),t&&t.historyId===n?(t.backViewId=t.forwardViewId=null,e[n].stack.push(t)):e[n].destroy&&e[n].destroy();for(var i in D.views)i!==t.viewId&&delete D.views[i];t&&p(t.viewId)},clearCache:function(){a._instances.forEach(function(e){e.clearCache()})},nextViewOptions:function(e){return arguments.length&&(o.cancel(b),null===e?w=e:(w=w||{},u(w,e),w.expire&&(b=o(function(){w=null},w.expire)))),w},isAbstractEle:function(e,t){return t&&t.$$state&&t.$$state.self["abstract"]?!0:!(!e||!m(e)&&!m(e.children()))},isActiveScope:function(e){if(!e)return!1;for(var t,n=e,i=this.currentHistoryId();n;){if(n.$$disconnected)return!1;if(!t&&n.hasOwnProperty("$historyId")&&(t=!0),i){if(n.hasOwnProperty("$historyId")&&i==n.$historyId)return!0;if(n.hasOwnProperty("$activeHistoryId")&&i==n.$activeHistoryId){if(n.hasOwnProperty("$historyId"))return!0;if(!t)return!0}}t&&n.hasOwnProperty("$activeHistoryId")&&(t=!1),n=n.$parent}return i?"root"==i:!0}}}]).run(["$rootScope","$state","$location","$document","$ionicPlatform","$ionicHistory",function(e,t,n,i,o,r){function a(e){var t=r.backView();return t?t.go():ionic.Platform.exitApp(),e.preventDefault(),!1}e.$on("$ionicView.beforeEnter",function(){ionic.keyboard&&ionic.keyboard.hide&&ionic.keyboard.hide()}),e.$on("$ionicHistory.change",function(e,i){if(i){var o=r.viewHistory(),a=i.historyId?o.histories[i.historyId]:null;if(a&&a.cursor>-1&&a.cursor-1&&(o.boxShadow="0 0 10px rgba(0,0,0,"+(r.shouldAnimate?.45*i:.3)+")"),o[ionic.CSS.TRANSFORM]="translate3d("+n+"%,0,0)",ionic.DomUtil.cachedStyles(e,o)}var r={run:function(i){"forward"==n?(o(e,1,99*(1-i),1-i),o(t,1-.1*i,-33*i,-1)):"back"==n?(o(e,1-.1*(1-i),-33*(1-i),-1),o(t,1,100*i,1-i)):(o(e,1,0,-1),o(t,0,0,-1))},shouldAnimate:i&&("forward"==n||"back"==n)};return r},o.transitions.navBar.ios=function(e,t,n,i){function o(e,t,n,i){var o={};o[ionic.CSS.TRANSITION_DURATION]=c.shouldAnimate?"":0,o.opacity=1===t?"":t,e.setCss("buttons-left",o),e.setCss("buttons-right",o),e.setCss("back-button",o),o[ionic.CSS.TRANSFORM]="translate3d("+i+"px,0,0)",e.setCss("back-text",o),o[ionic.CSS.TRANSFORM]="translate3d("+n+"px,0,0)",e.setCss("title",o)}function r(e,t,n){if(e&&t){var i=(e.titleTextX()+e.titleWidth())*(1-n),r=t&&(t.titleTextX()-e.backButtonTextLeft())*(1-n)||0;o(e,n,i,r)}}function a(e,t,n){if(e&&t){var i=(-(e.titleTextX()-t.backButtonTextLeft())-e.titleLeftRight())*n;o(e,1-n,i,0)}}var c={run:function(n){var i=e.controller(),o=t&&t.controller();"back"==c.direction?(a(i,o,1-n),r(o,i,1-n)):(r(i,o,n),a(o,i,n))},direction:n,shouldAnimate:i&&("forward"==n||"back"==n)};return c},o.transitions.views.android=function(e,t,n,i){function o(e,t){var n={};n[ionic.CSS.TRANSITION_DURATION]=r.shouldAnimate?"":0,n[ionic.CSS.TRANSFORM]="translate3d("+t+"%,0,0)",ionic.DomUtil.cachedStyles(e,n)}i=i&&("forward"==n||"back"==n);var r={run:function(i){"forward"==n?(o(e,99*(1-i)),o(t,-100*i)):"back"==n?(o(e,-100*(1-i)),o(t,100*i)):(o(e,0),o(t,0))},shouldAnimate:i};return r},o.transitions.navBar.android=function(e,t,n,i){function o(e,t){if(e){var n={};n.opacity=1===t?"":t,e.setCss("buttons-left",n),e.setCss("buttons-right",n),e.setCss("back-button",n),e.setCss("back-text",n),e.setCss("title",n)}}return{run:function(n){o(e.controller(),n),o(t&&t.controller(),1-n)},shouldAnimate:i&&("forward"==n||"back"==n)}},o.transitions.views.none=function(e,t){return{run:function(n){o.transitions.views.android(e,t,!1,!1).run(n)},shouldAnimate:!1}},o.transitions.navBar.none=function(e,t){return{run:function(n){o.transitions.navBar.ios(e,t,!1,!1).run(n),o.transitions.navBar.android(e,t,!1,!1).run(n)},shouldAnimate:!1}},o.setPlatformConfig=e,o.$get=function(){return o}});var m='
',$="$ionicLoading instance.hide() has been deprecated. Use $ionicLoading.hide().",w="$ionicLoading instance.show() has been deprecated. Use $ionicLoading.show().",b="$ionicLoading instance.setContent() has been deprecated. Use $ionicLoading.show({ template: 'my content' }).";l.constant("$ionicLoadingConfig",{template:""}).factory("$ionicLoading",["$ionicLoadingConfig","$ionicBody","$ionicTemplateLoader","$ionicBackdrop","$timeout","$q","$log","$compile","$ionicPlatform","$rootScope",function(e,t,n,i,o,r,a,c,l,d){function f(){return v||(v=n.compile({template:m,appendTo:t.get()}).then(function(e){return e.show=function(a){var s=a.templateUrl?n.load(a.templateUrl):r.when(a.template||a.content||"");e.scope=a.scope||e.scope,e.isShown||(e.hasBackdrop=!a.noBackdrop&&a.showBackdrop!==!1,e.hasBackdrop&&(i.retain(),i.getElement().addClass("backdrop-loading"))),a.duration&&(o.cancel(e.durationTimeout),e.durationTimeout=o(angular.bind(e,e.hide),+a.duration)),y(),y=l.registerBackButtonAction(g,B),s.then(function(n){if(n){var i=e.element.children();i.html(n),c(i.contents())(e.scope)}e.isShown&&(e.element.addClass("visible"),ionic.requestAnimationFrame(function(){e.isShown&&(e.element.addClass("active"),t.addClass("loading-active"))}))}),e.isShown=!0},e.hide=function(){y(),e.isShown&&(e.hasBackdrop&&(i.release(),i.getElement().removeClass("backdrop-loading")),e.element.removeClass("active"),t.removeClass("loading-active"),setTimeout(function(){!e.isShown&&e.element.removeClass("visible")
},200)),o.cancel(e.durationTimeout),e.isShown=!1},e})),v}function h(t){t=u({},e||{},t||{});var n=t.delay||t.showDelay||0;return S(),k(),t.hideOnStateChange&&(S=d.$on("$stateChangeSuccess",p),k=d.$on("$stateChangeError",p)),o.cancel(C),C=o(g,n),C.then(f).then(function(e){return e.show(t)}),{hide:s.method($,a.error,p),show:s.method(w,a.error,function(){h(t)}),setContent:s.method(b,a.error,function(e){f().then(function(t){t.show({template:e})})})}}function p(){S(),k(),o.cancel(C),f().then(function(e){e.hide()})}var v,y=g,S=g,k=g,C=r.when();return{show:h,hide:p,_getLoader:f}}]),l.factory("$ionicModal",["$rootScope","$ionicBody","$compile","$timeout","$ionicPlatform","$ionicTemplateLoader","$q","$log",function(e,t,n,i,o,r,a,c){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(e){var n=this;if(n.scope.$$destroyed)return void c.error("Cannot call "+n.viewType+".show() after remove(). Please create a new "+n.viewType+" instance.");var r=v(n.modalEl);return n.el.classList.remove("hide"),i(function(){t.addClass(n.viewType+"-open")},400),n.el.parentElement||(r.addClass(n.animation),t.append(n.el)),e&&n.positionView&&(n.positionView(e,r),ionic.on("resize",function(){ionic.off("resize",null,window),n.positionView(e,r)},window)),r.addClass("ng-enter active").removeClass("ng-leave ng-leave-active"),n._isShown=!0,n._deregisterBackButton=o.registerBackButtonAction(n.hardwareBackButtonClose?angular.bind(n,n.hide):g,k),ionic.views.Modal.prototype.show.call(n),i(function(){r.addClass("ng-enter-active"),ionic.trigger("resize"),n.scope.$parent&&n.scope.$parent.$broadcast(n.viewType+".shown",n),n.el.classList.add("active"),n.scope.$broadcast("$ionicHeader.align")},20),i(function(){n.$el.on("click",function(e){n.backdropClickToClose&&e.target===n.el&&n.hide()})},400)},hide:function(){var e=this,n=v(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(e.viewType+".hidden",e),e._deregisterBackButton&&e._deregisterBackButton(),ionic.views.Modal.prototype.hide.call(e),e.positionView&&ionic.off("resize",null,window),i(function(){t.removeClass(e.viewType+"-open"),e.el.classList.add("hide")},e.hideDelay||320)},remove:function(){var e=this;return e.scope.$parent&&e.scope.$parent.$broadcast(e.viewType+".removed",e),e.hide().then(function(){e.scope.$destroy(),e.$el.remove()})},isShown:function(){return!!this._isShown}}),l=function(t,i){var o=i.scope&&i.scope.$new()||e.$new(!0);i.viewType=i.viewType||"modal",u(o,{$hasHeader:!1,$hasSubheader:!1,$hasFooter:!1,$hasSubfooter:!1,$hasTabs:!1,$hasTabsTop:!1});var r=n(""+t+"")(o);i.$el=r,i.el=r[0],i.modalEl=i.el.querySelector("."+i.viewType);var a=new s(i);return a.scope=o,i.scope||(o[i.viewType]=a),a};return{fromTemplate:function(e,t){var n=l(e,t||{});return n},fromTemplateUrl:function(e,t,n){var i;return angular.isFunction(t)&&(i=t,t=n),r.load(e).then(function(e){var n=l(e,t||{});return i&&i(n),n})}}}]),l.service("$ionicNavBarDelegate",ionic.DelegateService(["align","showBackButton","showBar","title","changeTitle","setTitle","getTitle","back","getPreviousTitle"])),l.service("$ionicNavViewDelegate",ionic.DelegateService(["clearCache"]));var y=100,S=150,k=200,C=300,T=400,B=500;l.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 o={id:i?i:ionic.Utils.nextUid(),priority:n?n:0,fn:e};return t.$backButtonActions[o.id]=o,function(){delete t.$backButtonActions[o.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)},on:function(e,t){return ionic.Platform.ready(function(){document.addEventListener(e,t,!1)}),function(){ionic.Platform.ready(function(){document.removeEventListener(e,t)})}},ready:function(t){var n=e.defer();return ionic.Platform.ready(function(){n.resolve(),t&&t()}),n.promise}};return t}]}}),l.factory("$ionicPopover",["$ionicModal","$ionicPosition","$document","$window",function(e,t,n,i){function o(e,o){var a=v(e.target||e),c=t.offset(a),s=o.prop("offsetWidth"),l=o.prop("offsetHeight"),u=n[0].body.clientWidth,d=i.innerHeight,f={left:c.left+c.width/2-s/2},h=v(o[0].querySelector(".popover-arrow"));f.leftu&&(f.left=u-s-r),c.top+c.height+l>d&&c.top-l>0?(f.top=c.top-l,o.addClass("popover-bottom")):(f.top=c.top+c.height,o.removeClass("popover-bottom")),h.css({left:c.left+c.width/2-h.prop("offsetWidth")/2-f.left+"px"}),o.css({top:f.top+"px",left:f.left+"px",marginLeft:"0",opacity:"1"})}var r=6,a={viewType:"popover",hideDelay:1,animation:"none",positionView:o};return{fromTemplate:function(t,n){return e.fromTemplate(t,ionic.Utils.extend(a,n||{}))},fromTemplateUrl:function(t,n){return e.fromTemplateUrl(t,ionic.Utils.extend(a,n||{}))}}}]);var I='