mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
18 lines
110 KiB
JavaScript
18 lines
110 KiB
JavaScript
/*!
|
|
* 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('<div class="collection-repeat-container">')[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('<span class="collection-repeat-after-container">'),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;n<ii&&(i=Z[n]);n++)if(i.images)for(var f,h=0,p=i.images.length;p>h&&(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;i<len;i++)l.push({});n=-1},this.onRefreshLayout=function(){n=-1},this.getDimensions=function(e){return e=Math.min(e,I.length-1),e>n&&(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.buttons.length;l++)c(s.buttons[l].text);c(s.cancelText),c(s.destructiveText);var d=s.element=t('<ion-action-sheet ng-class="cssClass" buttons="buttons"></ion-action-sheet>')(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<this.length;t++)if(o=this[t],o.setAttribute)if(e.indexOf(" ")<0&&o.classList.add)o.classList.add(e);else{for(a=(" "+(o.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),r=e.split(" "),n=0;n<r.length;n++)i=r[n].trim(),-1===a.indexOf(" "+i+" ")&&(a+=i+" ");o.setAttribute("class",a.trim())}return this},v.prototype.removeClass=function(e){var t,n,i,o,r;if(e)for(t=0;t<this.length;t++)if(r=this[t],r.getAttribute)if(e.indexOf(" ")<0&&r.classList.remove)r.classList.remove(e);else for(i=e.split(" "),n=0;n<i.length;n++)o=i[n],r.setAttribute("class",(" "+(r.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+o.trim()+" "," ").trim());return this},l.factory("$ionicBackdrop",["$document","$timeout",function(e,t){function n(){1===++a&&(r.addClass("visible"),ionic.requestAnimationFrame(function(){a&&r.addClass("active")}))}function i(){0===--a&&(r.removeClass("active"),t(function(){!a&&r.removeClass("visible")},400,!1))}function o(){return r}var r=v('<div class="backdrop">'),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<arguments.length;t++)e[0].body.classList.add(arguments[t]);return this},removeClass:function(){for(var t=0;t<arguments.length;t++)e[0].body.classList.remove(arguments[t]);return this},enableClass:function(e){var t=Array.prototype.slice.call(arguments).slice(1);return e?this.addClass.apply(this,t):this.removeClass.apply(this,t),this},append:function(t){return e[0].body.appendChild(t.length?t[0]:t),this},get:function(){return e[0].body}}}]),l.factory("$ionicClickBlock",["$document","$ionicBody","$timeout",function(e,t,n){function i(e){e.preventDefault(),e.stopPropagation()}function o(){s&&(a?a.classList.remove(l):(a=e[0].createElement("div"),a.className="click-block",t.append(a),a.addEventListener("touchstart",i),a.addEventListener("mousedown",i)),s=!1)}function r(){a&&a.classList.add(l)}var a,c,s,l="click-block-hide";return{show:function(e){s=!0,n.cancel(c),c=n(this.hide,e||310),o()},hide:function(){s=!1,n.cancel(c),r()}}}]),l.factory("$ionicGesture",[function(){return{on:function(e,t,n,i){return window.ionic.onGesture(e,t,n[0],i)},off:function(e,t,n){return window.ionic.offGesture(e,t,n)}}}]),l.factory("$ionicHistory",["$rootScope","$state","$location","$window","$timeout","$ionicViewSwitcher","$ionicNavViewDelegate",function(e,t,n,i,o,r,a){function c(e){return e?D.views[e]:null}function s(e){return e?c(e.backViewId):null}function l(e){return e?c(e.forwardViewId):null}function d(e){return e?D.histories[e]:null}function f(e){var t=h(e);return D.histories[t.historyId]||(D.histories[t.historyId]={historyId:t.historyId,parentHistoryId:h(t.scope.$parent).historyId,stack:[],cursor:-1}),d(t.historyId)}function h(t){for(var n=t;n;){if(n.hasOwnProperty("$historyId"))return{historyId:n.$historyId,scope:n};n=n.$parent}return{historyId:"root",scope:e}}function p(e){D.currentView=c(e),D.backView=s(D.currentView),D.forwardView=l(D.currentView)}function v(){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()}function g(){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}function m(e){return e&&e.length&&/ion-side-menus|ion-tabs/i.test(e[0].tagName)}var $,w,b,y,S="initialView",k="newView",C="moveBack",T="moveForward",B="back",I="forward",x="enter",A="exit",E="swap",V="none",P=0,D={histories:{root:{historyId:"root",parentHistoryId:null,stack:[],cursor:-1}},views:{},backView:null,forwardView:null,currentView:null},L=function(){};return L.prototype.initialize=function(e){if(e){for(var t in e)this[t]=e[t];return this}return null},L.prototype.go=function(){return this.stateName?t.go(this.stateName,this.stateParams):this.url&&this.url!==n.url()?D.backView===this?i.history.go(-1):D.forwardView===this?i.history.go(1):void n.url(this.url):null},L.prototype.destroy=function(){this.scope&&(this.scope.$destroy&&this.scope.$destroy(),this.scope=null)},{register:function(e,t){var i,a,l,u=v(),m=f(e),L=D.currentView,M=D.backView,N=D.forwardView,_=null,R=null,H=V,z=m.historyId,O=n.url();if($!==u&&($=u,P++),y)_=y.viewId,R=y.action,H=y.direction,y=null;else if(M&&M.stateId===u)_=M.viewId,z=M.historyId,R=C,M.historyId===L.historyId?H=B:L&&(H=A,i=d(M.historyId),i&&i.parentHistoryId===L.historyId?H=x:(i=d(L.historyId),i&&i.parentHistoryId===m.parentHistoryId&&(H=E)));else if(N&&N.stateId===u)_=N.viewId,z=N.historyId,R=T,N.historyId===L.historyId?H=I:L&&(H=A,L.historyId===m.parentHistoryId?H=x:(i=d(L.historyId),i&&i.parentHistoryId===m.parentHistoryId&&(H=E))),i=h(e),N.historyId&&i.scope&&(i.scope.$historyId=N.historyId,z=N.historyId);else if(L&&L.historyId!==z&&m.cursor>-1&&m.stack.length>0&&m.cursor<m.stack.length&&m.stack[m.cursor].stateId===u){var U=m.stack[m.cursor];_=U.viewId,z=U.historyId,R=C,H=E,i=d(L.historyId),i&&i.parentHistoryId===z?H=A:(i=d(z),i&&i.parentHistoryId===L.historyId&&(H=x)),i=c(U.backViewId),i&&U.historyId!==i.historyId&&(m.stack[m.cursor].backViewId=L.viewId)}else{if(l=r.createViewEle(t),this.isAbstractEle(l,t))return{action:"abstractView",direction:V,ele:l};if(_=ionic.Utils.nextUid(),L){if(L.forwardViewId=_,R=k,N&&L.stateId!==N.stateId&&L.historyId===N.historyId&&(i=d(N.historyId))){for(a=i.stack.length-1;a>=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;a<m.stack.length;a++)m.stack[a].viewId===_?(m.stack[a].index=0,m.stack[a].backViewId=m.stack[a].forwardViewId=null):delete D.views[m.stack[a].viewId];m.stack=[D.views[_]]}w=null}if(p(_),D.backView&&z==D.backView.historyId&&u==D.backView.stateId&&O==D.backView.url)for(a=0;a<m.stack.length;a++)if(m.stack[a].viewId==_){R="dupNav",H=V,a>0&&(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<a.stack.length){var c=a.stack[a.cursor];return c.go(i)}!i.url&&i.uiSref&&(i.url=t.href(i.uiSref)),i.url&&(0===i.url.indexOf("#")&&(i.url=i.url.replace("#","")),i.url!==n.url()&&n.url(i.url))}}),e.$ionicGoBack=function(){r.goBack()},e.$on("$ionicView.afterEnter",function(e,t){t&&t.title&&(i[0].title=t.title)}),o.registerBackButtonAction(a,y)}]),l.provider("$ionicConfig",function(){function e(e,i){a.platform[e]=i,o.platform[e]={},t(a,a.platform[e]),n(a.platform[e],o.platform[e],"")}function t(e,n){for(var i in e)i!=r&&e.hasOwnProperty(i)&&(angular.isObject(e[i])?(f(n[i])||(n[i]={}),t(e[i],n[i])):f(n[i])||(n[i]=null))}function n(e,t,o){d(e,function(c,s){angular.isObject(e[s])?(t[s]={},n(e[s],t[s],o+"."+s)):t[s]=function(n){if(arguments.length)return e[s]=n,t;if(e[s]==r){var c=i(a.platform,ionic.Platform.platform()+o+"."+s);return c||c===!1?c:i(a.platform,"default"+o+"."+s)}return e[s]}})}function i(e,t){t=t.split(".");for(var n=0;n<t.length;n++){if(!e||!f(e[t[n]]))return null;e=e[t[n]]}return e}var o=this;o.platform={};var r="platform",a={views:{maxCache:r,forwardCache:r,transition:r,swipeBackEnabled:r,swipeBackHitWidth:r},navBar:{alignTitle:r,positionPrimaryButtons:r,positionSecondaryButtons:r,transition:r},backButton:{icon:r,text:r,previousTitleText:r},form:{checkbox:r,toggle:r},scrolling:{jsScrolling:r},tabs:{style:r,position:r},templates:{maxPrefetch:r},platform:{}};n(a,o,""),e("default",{views:{maxCache:10,forwardCache:!1,transition:"ios",swipeBackEnabled:!0,swipeBackHitWidth:45},navBar:{alignTitle:"center",positionPrimaryButtons:"left",positionSecondaryButtons:"right",transition:"view"},backButton:{icon:"ion-ios-arrow-back",text:"Back",previousTitleText:!0},form:{checkbox:"circle",toggle:"large"},scrolling:{jsScrolling:!0},tabs:{style:"standard",position:"bottom"},templates:{maxPrefetch:30}}),e("ios",{}),e("android",{views:{transition:"android",swipeBackEnabled:!1},navBar:{alignTitle:"left",positionPrimaryButtons:"right",positionSecondaryButtons:"right"},backButton:{icon:"ion-android-arrow-back",text:!1,previousTitleText:!1},form:{checkbox:"square",toggle:"small"},tabs:{style:"striped",position:"top"}}),o.transitions={views:{},navBar:{}},o.transitions.views.ios=function(e,t,n,i){function o(e,t,n,i){var o={};o[ionic.CSS.TRANSITION_DURATION]=r.shouldAnimate?"":0,o.opacity=t,i>-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='<div class="loading-container"><div class="loading"></div></div>',$="$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:"<ion-spinner></ion-spinner>"}).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("<ion-"+i.viewType+">"+t+"</ion-"+i.viewType+">")(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.left<r?f.left=r:f.left+s+r>u&&(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='<div class="popup-container" ng-class="cssClass"><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" ng-show="buttons.length"><button ng-repeat="button in buttons" ng-click="$buttonTapped(button, $event)" class="button" ng-class="button.type || \'button-default\'" ng-bind-html="button.text"></button></div></div></div>';l.factory("$ionicPopup",["$ionicTemplateLoader","$ionicBackdrop","$q","$timeout","$rootScope","$ionicBody","$compile","$ionicPlatform",function(e,t,n,i,o,r,a,c){function s(t){t=u({scope:null,title:"",buttons:[]},t||{});var o=e.compile({template:I,scope:t.scope&&t.scope.$new(),appendTo:r.get()}),c=t.templateUrl?e.load(t.templateUrl):n.when(t.template||t.content||"");return n.all([o,c]).then(function(e){var o=e[0],r=e[1],c=n.defer();o.responseDeferred=c;var s=v(o.element[0].querySelector(".popup-body"));return r?(s.html(r),a(s.contents())(o.scope)):s.remove(),u(o.scope,{title:t.title,buttons:t.buttons,subTitle:t.subTitle,cssClass:t.cssClass,$buttonTapped:function(e,t){var n=(e.onTap||g)(t);t=t.originalEvent||t,t.defaultPrevented||c.resolve(n)}}),o.show=function(){o.isShown||(o.isShown=!0,ionic.requestAnimationFrame(function(){o.isShown&&(o.element.removeClass("popup-hidden"),o.element.addClass("popup-showing active"),f(o.element))}))},o.hide=function(e){return e=e||g,o.isShown?(o.isShown=!1,o.element.removeClass("active"),o.element.addClass("popup-hidden"),void i(e,250)):e()},o.remove=function(){o.removed||(o.hide(function(){o.element.remove(),o.scope.$destroy()}),o.removed=!0)},o})}function l(){w[0]&&w[0].responseDeferred.resolve()}function d(e){function n(e){o.then(function(t){t.removed||t.responseDeferred.resolve(e)})}var o=b._createPopup(e),a=w[0];a&&a.hide();var s=i(g,a?$.stackPushDelay:0).then(function(){return o}).then(function(e){return a||(r.addClass("popup-open"),t.retain(),b._backButtonActionDone=c.registerBackButtonAction(l,T)),w.unshift(e),e.show(),e.responseDeferred.notify({close:s.close}),e.responseDeferred.promise.then(function(n){var o=w.indexOf(e);-1!==o&&w.splice(o,1),e.remove();var a=w[0];return a?a.show():(i(function(){r.removeClass("popup-open")},400),i(function(){t.release()},$.stackPushDelay||0),(b._backButtonActionDone||g)()),n})});return s.close=n,s}function f(e){var t=e[0].querySelector("[autofocus]");t&&t.focus()}function h(e){return d(u({buttons:[{text:e.okText||"OK",type:e.okType||"button-positive",onTap:function(){return!0}}]},e||{}))}function p(e){return d(u({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 m(e){var t=o.$new(!0);t.data={};var n="";return e.template&&/<[a-z][\s\S]*>/i.test(e.template)===!1&&(n="<span>"+e.template+"</span>",delete e.template),d(u({template:n+'<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 $={stackPushDelay:75},w=[],b={show:d,alert:h,confirm:p,prompt:m,_createPopup:s,_popupStack:w};return b}]),l.factory("$ionicPosition",["$document","$window",function(e,t){function n(e,n){return e.currentStyle?e.currentStyle[n]:t.getComputedStyle?t.getComputedStyle(e)[n]:e.style[n]}function i(e){return"static"===(n(e,"position")||"static")}var o=function(t){for(var n=e[0],o=t.offsetParent||n;o&&o!==n&&i(o);)o=o.offsetParent;return o||n};return{position:function(t){var n=this.offset(t),i={top:0,left:0},r=o(t[0]);r!=e[0]&&(i=this.offset(v(r)),i.top+=r.clientTop-r.scrollTop,i.left+=r.clientLeft-r.scrollLeft);var a=t[0].getBoundingClientRect();return{width:a.width||t.prop("offsetWidth"),height:a.height||t.prop("offsetHeight"),top:n.top-i.top,left:n.left-i.left}},offset:function(n){var i=n[0].getBoundingClientRect();return{width:i.width||n.prop("offsetWidth"),height:i.height||n.prop("offsetHeight"),top:i.top+(t.pageYOffset||e[0].documentElement.scrollTop),left:i.left+(t.pageXOffset||e[0].documentElement.scrollLeft)}}}}]),l.service("$ionicScrollDelegate",ionic.DelegateService(["resize","scrollTop","scrollBottom","scrollTo","scrollBy","zoomTo","zoomBy","getScrollPosition","anchorScroll","freezeScroll","freezeAllScrolls","getScrollView"])),l.service("$ionicSideMenuDelegate",ionic.DelegateService(["toggleLeft","toggleRight","getOpenRatio","isOpen","isOpenLeft","isOpenRight","canDragContent","edgeDragThreshold"])),l.service("$ionicSlideBoxDelegate",ionic.DelegateService(["update","slide","select","enableSlide","previous","next","stop","autoPlay","start","currentIndex","selected","slidesCount","count","loop"])),l.service("$ionicTabsDelegate",ionic.DelegateService(["select","selectedIndex"])),function(){var e=[];l.factory("$ionicTemplateCache",["$http","$templateCache","$timeout",function(t,n,i){function o(e){return"undefined"==typeof e?r():(p(e)&&(e=[e]),d(e,function(e){c.push(e)}),void(a&&r()))}function r(){if(o._runCount++,a=!0,0!==c.length){for(var e=0;4>e&&(template=c.pop());)p(template)&&t.get(template,{cache:n}),e++;c.length&&i(r,1e3)}}var a,c=e;return o._runCount=0,o}]).config(["$stateProvider","$ionicConfigProvider",function(t,n){var i=t.state;t.state=function(o,r){if("object"==typeof r){var a=r.prefetchTemplate!==!1&&e.length<n.templates.maxPrefetch();if(a&&p(r.templateUrl)&&e.push(r.templateUrl),angular.isObject(r.views))for(var c in r.views)a=r.views[c].prefetchTemplate!==!1&&e.length<n.templates.maxPrefetch(),a&&p(r.views[c].templateUrl)&&e.push(r.views[c].templateUrl)}return i.call(t,o,r)}}]).run(["$ionicTemplateCache",function(e){e()}])}(),l.factory("$ionicTemplateLoader",["$compile","$controller","$http","$q","$rootScope","$templateCache",function(e,t,n,i,o,r){function a(e){return n.get(e,{cache:r}).then(function(e){return e.data&&e.data.trim()})}function c(n){n=u({template:"",templateUrl:"",scope:null,controller:null,locals:{},appendTo:null},n||{});var r=n.templateUrl?this.load(n.templateUrl):i.when(n.template);return r.then(function(i){var r,a=n.scope||o.$new(),c=v("<div>").html(i).contents();return n.controller&&(r=t(n.controller,u(n.locals,{$scope:a})),c.children().data("$ngControllerController",r)),n.appendTo&&v(n.appendTo).append(c),e(c)(a),{element:c,scope:a}})}return{load:a,compile:c}}]),l.factory("$ionicViewService",["$ionicHistory","$log",function(e,t){function n(e,n){t.warn("$ionicViewService"+e+" is deprecated, please use $ionicHistory"+n+" instead: http://ionicframework.com/docs/nightly/api/service/$ionicHistory/")}n("","");var i={getCurrentView:"currentView",getBackView:"backView",getForwardView:"forwardView",getCurrentStateName:"currentStateName",nextViewOptions:"nextViewOptions",clearHistory:"clearHistory"};return d(i,function(t,o){i[o]=function(){return n("."+o,"."+t),e[t].apply(this,arguments)}}),i}]),l.factory("$ionicViewSwitcher",["$timeout","$document","$q","$ionicClickBlock","$ionicConfig","$ionicNavBarDelegate",function(e,t,n,i,o,r){function a(e,t){return c(e)["abstract"]?c(e).name:t?t.stateId||t.viewId:ionic.Utils.nextUid()}function c(e){return e&&e.$$state&&e.$$state.self||{}}function s(e,t,n,i){var r=c(e),a=g||V(t,"view-transition")||r.viewTransition||o.views.transition()||"ios",s=o.navBar.transition();return n=m||V(t,"view-direction")||r.viewDirection||n||"none",u(l(i),{transition:a,navBarTransition:"view"===s?a:s,direction:n,shouldAnimate:"none"!==a&&"none"!==n})}function l(e){return e=e||{},{viewId:e.viewId,historyId:e.historyId,stateId:e.stateId,stateName:e.stateName,stateParams:e.stateParams}}function h(e,t){return arguments.length>1?void V(e,T,t):V(e,T)}function p(e){if(e&&e.length){var t=e.scope();t&&(t.$emit("$ionicView.unloaded",e.data(C)),t.$destroy()),e.remove()}}var g,m,$="webkitTransitionEnd transitionend",w="$noCache",b="$destroyEle",y="$eleId",S="$accessed",k="$fallbackTimer",C="$viewData",T="nav-view",B="active",I="cached",x="stage",A=0;ionic.transition=ionic.transition||{},ionic.transition.isActive=!1;var E,V=ionic.DomUtil.cachedAttr,P=[],D=1100,L={create:function(t,d,v,T,E,M){var N,_,R,H=++A,z={init:function(e,t){L.isTransitioning(!0),z.loadViewElements(e),z.render(e,function(){t&&t()})},loadViewElements:function(e){var n,i,o,r=t.getViewElements(),c=a(d,v),s=t.activeEleId();for(n=0,i=r.length;i>n&&(o=r.eq(n),o.data(y)===c?o.data(w)?(o.data(y,c+ionic.Utils.nextUid()),o.data(b,!0)):N=o:f(s)&&o.data(y)===s&&(_=o),!N||!_);n++);R=!!N,R||(N=e.ele||L.createViewEle(d),N.data(y,c)),M&&t.activeEleId(c),e.ele=null},render:function(e,n){if(R)ionic.Utils.reconnectScope(N.scope());else{h(N,x);var i=s(d,N,e.direction,v),r=o.transitions.views[i.transition]||o.transitions.views.none;r(N,null,i.direction,!0).run(0),N.data(C,{viewId:i.viewId,historyId:i.historyId,stateName:i.stateName,stateParams:i.stateParams}),(c(d).cache===!1||"false"===c(d).cache||"false"==N.attr("cache-view")||0===o.views.maxCache())&&N.data(w,!0);var a=t.appendViewElement(N,d);delete i.direction,delete i.transition,a.$emit("$ionicView.loaded",i)}N.data(S,Date.now()),n&&n()},transition:function(a,c,f){function p(){h(N,F.shouldAnimate?"entering":B),h(_,F.shouldAnimate?"leaving":I),F.run(1),r._instances.forEach(function(e){e.triggerTransitionStart(H)}),F.shouldAnimate||b()}function w(e){e.target===this&&b()}function b(){b.x||(b.x=!0,N.off($,w),e.cancel(N.data(k)),_&&e.cancel(_.data(k)),z.emit("after",O,U),C&&C.resolve(t),H===A&&(n.all(P).then(L.transitionEnd),z.cleanup(O)),r._instances.forEach(function(e){e.triggerTransitionEnd()}),g=m=v=T=N=_=null)}function y(e){e.target===this&&S()}function S(){h(N,I),h(_,B),N.off($,y),e.cancel(N.data(k)),L.transitionEnd([t])}var C,O=s(d,N,a,v),U=u(u({},O),l(T));O.transitionId=U.transitionId=H,O.fromCache=!!R,O.enableBack=!!c,O.renderStart=E,O.renderEnd=M,V(N.parent(),"nav-view-transition",O.transition),V(N.parent(),"nav-view-direction",O.direction),e.cancel(N.data(k));var q=o.transitions.views[O.transition]||o.transitions.views.none,F=q(N,_,O.direction,O.shouldAnimate&&f&&M);if(F.shouldAnimate&&(N.on($,w),N.data(k,e(b,D)),i.show(D)),E&&(z.emit("before",O,U),h(N,x),F.run(0)),M&&(C=n.defer(),P.push(C.promise)),E&&M)e(p,16);else{if(!M)return h(N,"entering"),h(_,"leaving"),{run:F.run,cancel:function(t){t?(N.on($,y),N.data(k,e(S,D)),i.show(D)):S(),F.shouldAnimate=t,F.run(0),F=null}};M&&p()}},emit:function(e,t,n){var i=N.scope();i&&(i.$emit("$ionicView."+e+"Enter",t),"after"==e&&i.$emit("$ionicView.enter",t)),_?(i=_.scope(),i&&(i.$emit("$ionicView."+e+"Leave",n),"after"==e&&i.$emit("$ionicView.leave",n))):i&&n&&n.viewId&&(i.$emit("$ionicNavView."+e+"Leave",n),"after"==e&&i.$emit("$ionicNavView.leave",n))},cleanup:function(e){_&&"back"==e.direction&&!o.views.forwardCache()&&p(_);var n,i,r,a=t.getViewElements(),c=a.length,s=c-1>o.views.maxCache(),l=Date.now();for(n=0;c>n;n++)i=a.eq(n),s&&i.data(S)<l?(l=i.data(S),r=a.eq(n)):i.data(b)&&h(i)!=B&&p(i);p(r),N.data(w)&&N.data(b,!0)},enteringEle:function(){return N},leavingEle:function(){return _}};return z},transitionEnd:function(e){d(e,function(e){e.transitionEnd()}),L.isTransitioning(!1),i.hide(),P=[]},nextTransition:function(e){g=e},nextDirection:function(e){m=e},isTransitioning:function(t){return arguments.length&&(ionic.transition.isActive=!!t,e.cancel(E),t&&(E=e(function(){L.isTransitioning(!1)},999))),ionic.transition.isActive},createViewEle:function(e){var n=t[0].createElement("div");return e&&e.$template&&(n.innerHTML=e.$template,1===n.children.length)?(n.children[0].classList.add("pane"),v(n.children[0])):(n.className="pane",v(n))},viewEleIsActive:function(e,t){h(e,t?B:I)},getTransitionData:s,navViewAttr:h,destroyViewEle:p};return L}]),l.config(["$provide",function(e){e.decorator("$compile",["$delegate",function(e){return e.$$addScopeInfo=function(e,t,n,i){var o=n?i?"$isolateScopeNoTemplate":"$isolateScope":"$scope";e.data(o,t)},e}])}]),l.config(["$provide",function(e){function t(e,t){return e.__hash=e.hash,e.hash=function(n){return f(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])}]),l.controller("$ionicHeaderBar",["$scope","$element","$attrs","$q","$ionicConfig","$ionicHistory",function(e,t,n,i,o,r){function a(e){return C[e]||(C[e]=t[0].querySelector("."+e)),C[e]}var c="title",s="back-text",l="back-button",u="default-title",d="previous-title",f="hide",h=this,p="",v="",g=0,m=0,$="",w=!1,b=!0,y=!0,S=!1,k=0;h.beforeEnter=function(t){e.$broadcast("$ionicView.beforeEnter",t)},h.title=function(e){return arguments.length&&e!==p&&(a(c).innerHTML=e,p=e,k=0),p},h.enableBack=function(e,t){return arguments.length&&(w=e,t||h.updateBackButton()),w},h.showBack=function(e,t){return arguments.length&&(b=e,t||h.updateBackButton()),b},h.showNavBack=function(e){y=e,h.updateBackButton()},h.updateBackButton=function(){if((b&&y&&w)!==S){S=b&&y&&w;var e=a(l);e&&e.classList[S?"remove":"add"](f)}},h.titleTextWidth=function(){if(!k){var e=ionic.DomUtil.getTextBounds(a(c));k=Math.min(e&&e.width||30)}return k},h.titleWidth=function(){var e=h.titleTextWidth(),t=a(c).offsetWidth;return e>t&&(e=t+(g-m-5)),e},h.titleTextX=function(){return t[0].offsetWidth/2-h.titleWidth()/2},h.titleLeftRight=function(){return g-m},h.backButtonTextLeft=function(){for(var e=0,t=a(s);t;)e+=t.offsetLeft,t=t.parentElement;return e},h.resetBackButton=function(e){if(o.backButton.previousTitleText()){var t=a(d);if(t){t.classList.remove(f);var n=e&&r.getViewById(e.viewId),i=r.backTitle(n);i!==v&&(v=t.innerHTML=i)}var c=a(u);c&&c.classList.remove(f)}},h.align=function(e){var i=a(c);e=e||n.alignTitle||o.navBar.alignTitle();var r=h.calcWidths(e,!1);if(b&&v&&o.backButton.previousTitleText()){var s=h.calcWidths(e,!0),l=t[0].offsetWidth-s.titleLeft-s.titleRight;h.titleTextWidth()<=l&&(r=s)}return h.updatePositions(i,r.titleLeft,r.titleRight,r.buttonsLeft,r.buttonsRight,r.css,r.showPrevTitle)},h.calcWidths=function(e,n){var i,o,r,h,p,v,g,m,$,w=a(c),y=a(l),S=t[0].childNodes,k=0,C=0,T=0,B=0,I="",x=0;for(i=0;i<S.length;i++){if(p=S[i],g=0,1==p.nodeType){if(p===w){$=!0;continue}if(p.classList.contains(f))continue;if(b&&p===y){for(o=0;o<p.childNodes.length;o++)if(h=p.childNodes[o],1==h.nodeType)if(h.classList.contains(s))for(r=0;r<h.children.length;r++)if(v=h.children[r],n){if(v.classList.contains(u))continue;x+=v.offsetWidth}else{if(v.classList.contains(d))continue;x+=v.offsetWidth}else x+=h.offsetWidth;else 3==h.nodeType&&h.nodeValue.trim()&&(m=ionic.DomUtil.getTextBounds(h),x+=m&&m.width||0);g=x||p.offsetWidth}else g=p.offsetWidth}else 3==p.nodeType&&p.nodeValue.trim()&&(m=ionic.DomUtil.getTextBounds(p),g=m&&m.width||0);$?C+=g:k+=g}if("left"==e)I="title-left",k&&(T=k+15),C&&(B=C+15);else if("right"==e)I="title-right",k&&(T=k+15),C&&(B=C+15);else{var A=Math.max(k,C)+10;A>10&&(T=B=A)}return{backButtonWidth:x,buttonsLeft:k,buttonsRight:C,titleLeft:T,titleRight:B,showPrevTitle:n,css:I}},h.updatePositions=function(e,n,r,c,s,l,p){var v=i.defer();if(e&&(n!==g&&(e.style.left=n?n+"px":"",g=n),r!==m&&(e.style.right=r?r+"px":"",m=r),l!==$&&(l&&e.classList.add(l),$&&e.classList.remove($),$=l)),o.backButton.previousTitleText()){var w=a(d),b=a(u);w&&w.classList[p?"remove":"add"](f),b&&b.classList[p?"add":"remove"](f)}return ionic.requestAnimationFrame(function(){if(e&&e.offsetWidth+10<e.scrollWidth){var n=s+5,i=t[0].offsetWidth-g-h.titleTextWidth()-20;r=n>i?n:i,r!==m&&(e.style.right=r+"px",m=r)}v.resolve()}),v.promise},h.setCss=function(e,t){ionic.DomUtil.cachedStyles(a(e),t)};var C={};e.$on("$destroy",function(){for(var e in C)C[e]=null})}]),l.controller("$ionInfiniteScroll",["$scope","$attrs","$element","$timeout",function(e,t,n,i){function o(){ionic.requestAnimationFrame(function(){n[0].classList.add("active")}),s.isLoading=!0,e.$parent&&e.$parent.$apply(t.onInfinite||"")}function r(){ionic.requestAnimationFrame(function(){n[0].classList.remove("active")}),i(function(){s.jsScrolling&&s.scrollView.resize(),s.checkBounds()},30,!1),s.isLoading=!1}function a(){if(!s.isLoading){var e={};if(s.jsScrolling){e=s.getJSMaxScroll();var t=s.scrollView.getValues();(-1!==e.left&&t.left>=e.left||-1!==e.top&&t.top>=e.top)&&o()}else e=s.getNativeMaxScroll(),(-1!==e.left&&s.scrollEl.scrollLeft>=e.left-s.scrollEl.clientWidth||-1!==e.top&&s.scrollEl.scrollTop>=e.top-s.scrollEl.clientHeight)&&o()}}function c(e){return distance=(t.distance||"2.5%").trim(),isPercent=-1!==distance.indexOf("%"),isPercent?e*(1-parseFloat(distance)/100):e-parseFloat(distance)}var s=this;s.isLoading=!1,e.icon=function(){return f(t.icon)?t.icon:"ion-load-d"},e.spinner=function(){return f(t.spinner)?t.spinner:""},e.$on("scroll.infiniteScrollComplete",function(){r()}),e.$on("$destroy",function(){s.scrollCtrl&&s.scrollCtrl.$element&&s.scrollCtrl.$element.off("scroll",s.checkBounds),s.scrollEl&&s.scrollEl.removeEventListener&&s.scrollEl.removeEventListener("scroll",s.checkBounds)}),s.checkBounds=ionic.Utils.throttle(a,300),s.getJSMaxScroll=function(){var e=s.scrollView.getScrollMax();return{left:s.scrollView.options.scrollingX?c(e.left):-1,top:s.scrollView.options.scrollingY?c(e.top):-1}},s.getNativeMaxScroll=function(){var e={left:s.scrollEl.scrollWidth,top:s.scrollEl.scrollHeight},t=window.getComputedStyle(s.scrollEl)||{};return{left:"scroll"===t.overflowX||"auto"===t.overflowX||"scroll"===s.scrollEl.style["overflow-x"]?c(e.left):-1,top:"scroll"===t.overflowY||"auto"===t.overflowY||"scroll"===s.scrollEl.style["overflow-y"]?c(e.top):-1}}}]),l.service("$ionicListDelegate",ionic.DelegateService(["showReorder","showDelete","canSwipeItems","closeOptionButtons"])).controller("$ionicList",["$scope","$attrs","$ionicListDelegate","$ionicHistory",function(e,t,n,i){var o=this,r=!0,a=!1,c=!1,s=n._registerInstance(o,t.delegateHandle,function(){return i.isActiveScope(e)});e.$on("$destroy",s),o.showReorder=function(e){return arguments.length&&(a=!!e),a},o.showDelete=function(e){return arguments.length&&(c=!!e),c},o.canSwipeItems=function(e){return arguments.length&&(r=!!e),r},o.closeOptionButtons=function(){o.listView&&o.listView.clearDragEffects()}}]),l.controller("$ionicNavBar",["$scope","$element","$attrs","$compile","$timeout","$ionicNavBarDelegate","$ionicConfig","$ionicHistory",function(e,t,n,i,o,r,a,c){function s(e,t){var n=console.warn||console.log;n&&n.call(console,"navBarController."+e+" is deprecated, please use "+t+" instead")}function l(e){return x[e]?v(x[e]):void 0}function u(){for(var e=0;e<I.length;e++)if(I[e].isActive)return I[e]}function h(){for(var e=0;e<I.length;e++)if(!I[e].isActive)return I[e]}function p(e,t){e&&ionic.DomUtil.cachedAttr(e.containerEle(),"nav-bar",t)}function g(e){ionic.DomUtil.cachedAttr(t,"nav-swipe",e)}var m,$,w,b="hide",y="$ionNavBarController",S="primaryButtons",k="secondaryButtons",C="backButton",T="primaryButtons secondaryButtons leftButtons rightButtons title".split(" "),B=this,I=[],x={},A=!0;t.parent().data(y,B);var E=n.delegateHandle||"navBar"+ionic.Utils.nextUid(),V=r._registerInstance(B,E);B.init=function(){t.addClass("nav-bar-container"),ionic.DomUtil.cachedAttr(t,"nav-bar-transition",a.views.transition()),B.createHeaderBar(!1),B.createHeaderBar(!0),e.$emit("ionNavBar.init",E)},B.createHeaderBar=function(o){function r(e,t){e&&("title"===t?g.append(e):"rightButtons"==t||t==k&&"left"!=a.navBar.positionSecondaryButtons()||t==S&&"right"==a.navBar.positionPrimaryButtons()?(p||(p=v('<div class="buttons buttons-right">'),u.append(p)),t==k?p.append(e):p.prepend(e)):(h||(h=v('<div class="buttons buttons-left">'),m[C]?m[C].after(h):u.prepend(h)),t==k?h.append(e):h.prepend(e)))}var c=v('<div class="nav-bar-block">');ionic.DomUtil.cachedAttr(c,"nav-bar",o?"active":"cached");var s=n.alignTitle||a.navBar.alignTitle(),u=v("<ion-header-bar>").addClass(n["class"]).attr("align-title",s);f(n.noTapScroll)&&u.attr("no-tap-scroll",n.noTapScroll);var h,p,g=v('<div class="title title-'+s+'">'),m={},$={};m[C]=l(C),m[C]&&u.append(m[C]),u.append(g),d(T,function(e){m[e]=l(e),r(m[e],e)});for(var w=0;w<u[0].children.length;w++)u[0].children[w].classList.add("header-item");c.append(u),t.append(i(c)(e.$new()));var y=u.data("$ionHeaderBarController"),B={isActive:o,title:function(e){y.title(e)},setItem:function(e,t){B.removeItem(t),e?("title"===t&&B.title(""),r(e,t),m[t]&&m[t].addClass(b),$[t]=e):m[t]&&m[t].removeClass(b)},removeItem:function(e){$[e]&&($[e].scope().$destroy(),$[e].remove(),$[e]=null)},containerEle:function(){return c},headerBarEle:function(){return u},afterLeave:function(){d(T,function(e){B.removeItem(e)}),y.resetBackButton()},controller:function(){return y},destroy:function(){d(T,function(e){B.removeItem(e)}),c.scope().$destroy();for(var e in m)m[e]&&(m[e].removeData(),m[e]=null);h&&h.removeData(),p&&p.removeData(),g.removeData(),u.removeData(),c.remove(),c=u=g=h=p=null}};return I.push(B),B},B.navElement=function(e,t){return f(t)&&(x[e]=t),x[e]},B.update=function(e){var t=!e.hasHeaderBar&&e.showNavBar;e.transition=a.views.transition(),t||(e.direction="none"),B.enable(t);var n=B.isInitialized?h():u(),i=B.isInitialized?u():null,o=n.controller();o.enableBack(e.enableBack,!0),o.showBack(e.showBack,!0),o.updateBackButton(),B.title(e.title,n),B.showBar(t),e.navBarItems&&d(T,function(t){n.setItem(e.navBarItems[t],t)}),B.transition(n,i,e),B.isInitialized=!0,g("")},B.transition=function(e,n,i){function r(){for(var t=0;t<I.length;t++)I[t].isActive=!1;e.isActive=!0,p(e,"active"),p(n,"cached"),B.activeTransition=u=$=null}var c=e.controller(),s=a.transitions.navBar[i.navBarTransition]||a.transitions.navBar.none,l=i.transitionId;c.beforeEnter(i);var u=s(e,n,i.direction,i.shouldAnimate&&B.isInitialized);ionic.DomUtil.cachedAttr(t,"nav-bar-transition",i.navBarTransition),ionic.DomUtil.cachedAttr(t,"nav-bar-direction",i.direction),u.shouldAnimate&&i.renderEnd?p(e,"stage"):(p(e,"entering"),p(n,"leaving")),c.resetBackButton(i),u.run(0),B.activeTransition={run:function(e){u.shouldAnimate=!1,u.direction="back",u.run(e)},cancel:function(t,i){g(i),p(n,"active"),p(e,"cached"),u.shouldAnimate=t,u.run(0),B.activeTransition=u=null},complete:function(e,t){g(t),u.shouldAnimate=e,u.run(1),$=r}},o(c.align,16),(m=function(){w===l&&(p(e,"entering"),p(n,"leaving"),u.run(1),$=function(){w!=l&&u.shouldAnimate||r()},m=null)})()},B.triggerTransitionStart=function(e){w=e,m&&m()},B.triggerTransitionEnd=function(){$&&$()},B.showBar=function(t){return arguments.length&&(B.visibleBar(t),e.$parent.$hasHeader=!!t),!!e.$parent.$hasHeader},B.visibleBar=function(e){e&&!A?t.removeClass(b):!e&&A&&t.addClass(b),A=e},B.enable=function(e){B.visibleBar(e);for(var t=0;t<r._instances.length;t++)r._instances[t]!==B&&r._instances[t].visibleBar(!1)},B.showBackButton=function(t){for(var n=0;n<I.length;n++)I[n].controller().showNavBack(!!t);return e.$isBackButtonShown=!!t,e.$isBackButtonShown},B.showActiveBackButton=function(e){var t=u();t&&t.controller().showBack(e)},B.title=function(t,n){return f(t)&&(t=t||"",n=n||u(),n&&n.title(t),e.$title=t,c.currentTitle(t)),e.$title},B.align=function(e,t){t=t||u(),t&&t.controller().align(e)},B.hasTabsTop=function(e){t[e?"addClass":"removeClass"]("nav-bar-tabs-top")},B.changeTitle=function(e){s("changeTitle(val)","title(val)"),B.title(e)},B.setTitle=function(e){s("setTitle(val)","title(val)"),B.title(e)},B.getTitle=function(){return s("getTitle()","title()"),B.title()},B.back=function(){s("back()","$ionicHistory.goBack()"),c.goBack()},B.getPreviousTitle=function(){s("getPreviousTitle()","$ionicHistory.backTitle()"),c.goBack()},e.$on("$destroy",function(){e.$parent.$hasHeader=!1,t.parent().removeData(y);for(var n=0;n<I.length;n++)I[n].destroy();t.remove(),t=I=null,V()})}]),l.controller("$ionicNavView",["$scope","$element","$attrs","$compile","$controller","$ionicNavBarDelegate","$ionicNavViewDelegate","$ionicHistory","$ionicViewSwitcher","$ionicConfig","$ionicScrollDelegate",function(e,t,n,i,o,r,a,c,s,l,d){function f(e){ionic.DomUtil.cachedAttr(t,"nav-swipe",e)}function h(e,t){var n=p();n&&n.hasTabsTop(t)}function p(){if(g)for(var e=0;e<r._instances.length;e++)if(r._instances[e].$$delegateHandle==g)return r._instances[e];return t.inheritedData("$ionNavBarController")}var v,g,m,$,w,b="$eleId",y="$destroyEle",S="$noCache",k="active",C="cached",T=this,B=!1,I=s.navViewAttr;T.scope=e,T.element=t,T.init=function(){var i=n.name||"",o=t.parent().inheritedData("$uiView"),r=o&&o.state?o.state.name:"";i.indexOf("@")<0&&(i=i+"@"+r);var c={name:i,state:null};t.data("$uiView",c);var s=a._registerInstance(T,n.delegateHandle);return e.$on("$destroy",function(){s(),T.isSwipeFreeze&&d.freezeAllScrolls(!1)}),e.$on("$ionicHistory.deselect",T.cacheCleanup),e.$on("$ionicTabs.top",h),ionic.Platform.ready(function(){ionic.Platform.isWebView()&&l.views.swipeBackEnabled()&&T.initSwipeBack()}),c},T.register=function(t){var n=u({},c.currentView()),i=c.register(e,t);T.update(i);var o=c.getViewById(i.viewId)||{},r=$!==i.viewId;T.render(i,t,o,n,r,!0)},T.update=function(e){B=!0,v=e.direction;var n=t.parent().inheritedData("$ionNavViewController");n&&(n.isPrimary(!1),("enter"===v||"exit"===v)&&(n.direction(v),"enter"===v&&(v="none")))},T.render=function(e,t,n,i,o,r){var a=s.create(T,t,n,i,o,r);a.init(e,function(){a.transition(T.direction(),e.enableBack,!w),$=w=null})},T.beforeEnter=function(e){if(B){g=e.navBarDelegate;var t=p();t&&t.update(e),f("")}},T.activeEleId=function(e){return arguments.length&&(m=e),m},T.transitionEnd=function(){var e,n,i,o=t.children();for(e=0,n=o.length;n>e;e++)i=o.eq(e),i.data(b)===m?I(i,k):("leaving"===I(i)||I(i)===k||I(i)===C)&&(i.data(y)||i.data(S)?s.destroyViewEle(i):(I(i,C),ionic.Utils.disconnectScope(i.scope())));f(""),T.isSwipeFreeze&&d.freezeAllScrolls(!1)},T.cacheCleanup=function(){for(var e=t.children(),n=0,i=e.length;i>n;n++)e.eq(n).data(y)&&s.destroyViewEle(e.eq(n))},T.clearCache=function(){for(var e,n,i=t.children(),o=0,r=i.length;r>o;o++)e=i.eq(o),I(e)==C?s.destroyViewEle(e):I(e)==k&&(n=e.scope(),n&&n.$broadcast("$ionicView.clearCache"))},T.getViewElements=function(){return t.children()},T.appendViewElement=function(n,r){var a=i(n);t.append(n);var c=e.$new();if(r&&r.$$controller){r.$scope=c;var s=o(r.$$controller,r);t.children().data("$ngControllerController",s)}return a(c),c},T.title=function(e){var t=p();t&&t.title(e)},T.enableBackButton=function(e){var t=p();
|
|
t&&t.enableBackButton(e)},T.showBackButton=function(e){var t=p();t&&t.showActiveBackButton(e)},T.showBar=function(e){var t=p();t&&t.showBar(e)},T.isPrimary=function(e){return arguments.length&&(B=e),B},T.direction=function(e){return arguments.length&&(v=e),v},T.initSwipeBack=function(){function n(e){if(B&&(S=r(e),!(S>C)&&(v=c.backView(),v&&v.historyId===c.currentView().historyId))){y||(y=window.innerWidth),T.isSwipeFreeze=d.freezeAllScrolls(!0);var n={direction:"back"};k=[];var a=s.create(T,n,v,c.currentView(),!0,!1);a.loadViewElements(n),a.render(n),u=a.transition("back",c.enabledBack(v),!0),h=p(),m=ionic.onGesture("drag",i,t[0]),b=ionic.onGesture("release",o,t[0])}}function i(e){if(B&&u){var t=r(e);if(k.push({t:Date.now(),x:t}),t>=y-15)o(e);else{var n=Math.min(Math.max(a(t),0),1);u.run(n),h&&h.activeTransition&&h.activeTransition.run(n)}}}function o(e){if(B&&u&&k&&k.length>1){for(var t=Date.now(),n=r(e),c=k[k.length-1],s=k.length-2;s>=0&&!(t-c.t>200);s--)c=k[s];var l=n>=k[k.length-2].x,p=a(n),g=Math.abs(c.x-n)/(t-c.t);if($=v.viewId,w=.03>p||p>.97,l&&(p>.5||g>.1)){var S=g>.5||.05>g||n>y-45?"fast":"slow";f(w?"":S),v.go(),h&&h.activeTransition&&h.activeTransition.complete(!w,S)}else f(w?"":"fast"),$=null,u.cancel(!w),h&&h.activeTransition&&h.activeTransition.cancel(!w,"fast"),w=null}ionic.offGesture(m,"drag",i),ionic.offGesture(b,"release",o),y=u=k=null,T.isSwipeFreeze=d.freezeAllScrolls(!1)}function r(e){return ionic.tap.pointerCoord(e.gesture.srcEvent).x}function a(e){return(e-S)/y}var u,h,v,g,m,b,y,S,k,C=l.views.swipeBackHitWidth();g=ionic.onGesture("dragstart",n,t[0]),e.$on("$destroy",function(){ionic.offGesture(g,"dragstart",n),ionic.offGesture(m,"drag",i),ionic.offGesture(b,"release",o),T.element=u=h=null})}}]),l.controller("$ionicRefresher",["$scope","$attrs","$element","$ionicBind","$timeout",function(e,t,n,i,o){function r(){return P||k?(E=null,k?(k=!1,T=0,B>I?(g(),d(I,A)):(d(0,A,v),C=!1),!0):(T=0,C=!1,u(!1),!0)):void 0}function a(e){if(P&&!(e.touches.length>1)){if(null===E&&(E=parseInt(e.touches[0].screenY,10)),V=parseInt(e.touches[0].screenY,10)-E,0>=V-T||0!==b.scrollTop)return C&&(C=!1,u(!1)),k&&l(b,-1*parseInt(V-T,10)),0!==B&&s(0),!0;V>0&&0===b.scrollTop&&!C&&(T=V),e.preventDefault(),C||(C=!0,u(!0)),k=!0,s(parseInt((V-T)/3,10)),!x&&B>I?(x=!0,ionic.requestAnimationFrame(p)):x&&I>B&&(x=!1,ionic.requestAnimationFrame(v))}}function c(e){P=0===e.target.scrollTop||k}function s(e){y.style[ionic.CSS.TRANSFORM]="translateY("+e+"px)",B=e}function l(e,t){e.scrollTop=t;var n=document.createEvent("UIEvents");n.initUIEvent("scroll",!0,!0,window,1),e.dispatchEvent(n)}function u(e){ionic.requestAnimationFrame(e?function(){y.classList.add("overscroll"),m()}:function(){y.classList.remove("overscroll"),$(),v()})}function d(e,t,n){function i(e){return--e*e*e+1}function o(){var c=Date.now(),l=Math.min(1,(c-r)/t),d=i(l);s(parseInt(d*(e-a)+a,10)),1>l?ionic.requestAnimationFrame(o):(5>e&&e>-5&&(C=!1,u(!1)),n&&n())}var r=Date.now(),a=B;return a===e?void n():void ionic.requestAnimationFrame(o)}function h(){ionic.off("touchmove",a,y),ionic.off("touchend",r,y),ionic.off("scroll",c,b),b=null,y=null}function p(){n[0].classList.add("active"),e.$onPulling()}function v(){o(function(){n.removeClass("active refreshing refreshing-tail"),x&&(x=!1)},150)}function g(){n[0].classList.add("refreshing"),e.$onRefresh()}function m(){n[0].classList.remove("invisible")}function $(){n[0].classList.add("invisible")}function w(){n[0].classList.add("refreshing-tail")}var b,y,S=this,k=!1,C=!1,T=0,B=0,I=60,x=!1,A=500,E=null,V=null,P=!0;f(t.pullingIcon)||t.$set("pullingIcon","ion-android-arrow-down"),e.showSpinner=!f(t.refreshingIcon)&&"none"!=t.spinner,e.showIcon=f(t.refreshingIcon),i(e,t,{pullingIcon:"@",pullingText:"@",refreshingIcon:"@",refreshingText:"@",spinner:"@",disablePullingRotation:"@",$onRefresh:"&onRefresh",$onPulling:"&onPulling"}),e.$on("scroll.refreshComplete",function(){o(function(){ionic.requestAnimationFrame(w),d(0,A,v),o(function(){C&&(C=!1,u(!1))},A)},A)}),S.init=function(){if(b=n.parent().parent()[0],y=n.parent()[0],!b.classList.contains("ionic-scroll")||!y.classList.contains("scroll"))throw new Error("Refresher must be immediate child of ion-content or ion-scroll");ionic.on("touchmove",a,y),ionic.on("touchend",r,y),ionic.on("scroll",c,b),e.$on("$destroy",h)},S.getRefresherDomMethods=function(){return{activate:p,deactivate:v,start:g,show:m,hide:$,tail:w}},S.__handleTouchmove=a,S.__getScrollChild=function(){return y},S.__getScrollParent=function(){return b}}]),l.controller("$ionicScroll",["$scope","scrollViewOptions","$timeout","$window","$location","$document","$ionicScrollDelegate","$ionicHistory",function(e,t,n,i,o,r,a,c){var s=this;s.__timeout=n,s._scrollViewOptions=t;var l=s.element=t.el,u=s.$element=v(l),d=s.scrollView=new ionic.views.Scroll(t);(u.parent().length?u.parent():u).data("$$ionicScrollController",s);var h=a._registerInstance(s,t.delegateHandle,function(){return c.isActiveScope(e)});f(t.bouncing)||ionic.Platform.ready(function(){d.options&&(d.options.bouncing=!0,ionic.Platform.isAndroid()&&(d.options.bouncing=!1,d.options.deceleration=.95))});var p=angular.bind(d,d.resize);ionic.on("resize",p,i);var g=function(t){var n=(t.originalEvent||t).detail||{};e.$onScroll&&e.$onScroll({event:t,scrollTop:n.scrollTop||0,scrollLeft:n.scrollLeft||0})};u.on("scroll",g),e.$on("$destroy",function(){h(),d&&d.__cleanup&&d.__cleanup(),ionic.off("resize",p,i),i.removeEventListener("resize",p),u.off("scroll",g),d=s.scrollView=t=s._scrollViewOptions=t.el=s._scrollViewOptions.el=u=s.$element=l=null}),n(function(){d&&d.run&&d.run(),u.triggerHandler("scroll.init")}),s.getScrollView=function(){return d},s.getScrollPosition=function(){return d.getValues()},s.resize=function(){return n(p).then(function(){u&&u.triggerHandler("scroll.resize")})},s.scrollTop=function(e){s.resize().then(function(){d.scrollTo(0,0,!!e)})},s.scrollBottom=function(e){s.resize().then(function(){var t=d.getScrollMax();d.scrollTo(t.left,t.top,!!e)})},s.scrollTo=function(e,t,n){s.resize().then(function(){d.scrollTo(e,t,!!n)})},s.zoomTo=function(e,t,n,i){s.resize().then(function(){d.zoomTo(e,!!t,n,i)})},s.zoomBy=function(e,t,n,i){s.resize().then(function(){d.zoomBy(e,!!t,n,i)})},s.scrollBy=function(e,t,n){s.resize().then(function(){d.scrollBy(e,t,!!n)})},s.anchorScroll=function(e){s.resize().then(function(){var t=o.hash(),n=t&&r[0].getElementById(t);if(!t||!n)return void d.scrollTo(0,0,!!e);var i=n,a=0,c=0,l=0;do null!==i&&(a+=i.offsetLeft),null!==i&&(c+=i.offsetTop),i=i.offsetParent,l++;while(i.attributes!=s.element.attributes&&i.offsetParent);d.scrollTo(a,c,!!e)})},s.freezeScroll=d.freeze,s.freezeAllScrolls=function(e){for(var t=0;t<a._instances.length;t++)a._instances[t].freezeScroll(e)},s._setRefresher=function(e,t,n){s.refresher=t;var i=s.refresher.clientHeight||60;d.activatePullToRefresh(i,n)}}]),l.controller("$ionicSideMenus",["$scope","$attrs","$ionicSideMenuDelegate","$ionicPlatform","$ionicBody","$ionicHistory","$ionicScrollDelegate",function(e,t,n,i,o,r,a){function c(e){e&&!m.isScrollFreeze?a.freezeAllScrolls(e):!e&&m.isScrollFreeze&&a.freezeAllScrolls(!1),m.isScrollFreeze=e}var s,l,u,d,f,p,v,m=this,$=!0;m.$scope=e,m.initialize=function(e){m.left=e.left,m.right=e.right,m.setContent(e.content),m.dragThresholdX=e.dragThresholdX||10,r.registerHistory(m.$scope)},m.setContent=function(e){e&&(m.content=e,m.content.onDrag=function(e){m._handleDrag(e)},m.content.endDrag=function(e){m._endDrag(e)})},m.isOpenLeft=function(){return m.getOpenAmount()>0},m.isOpenRight=function(){return m.getOpenAmount()<0},m.toggleLeft=function(e){if(!v&&m.left.isEnabled){var t=m.getOpenAmount();0===arguments.length&&(e=0>=t),m.content.enableAnimation(),m.openPercentage(e?100:0)}},m.toggleRight=function(e){if(!v&&m.right.isEnabled){var t=m.getOpenAmount();0===arguments.length&&(e=t>=0),m.content.enableAnimation(),m.openPercentage(e?-100:0)}},m.toggle=function(e){"right"==e?m.toggleRight():m.toggleLeft()},m.close=function(){m.openPercentage(0)},m.getOpenAmount=function(){return m.content&&m.content.getTranslateX()||0},m.getOpenRatio=function(){var e=m.getOpenAmount();return e>=0?e/m.left.width:e/m.right.width},m.isOpen=function(){return 0!==m.getOpenAmount()},m.getOpenPercentage=function(){return 100*m.getOpenRatio()},m.openPercentage=function(e){var t=e/100;if(m.left&&e>=0)m.openAmount(m.left.width*t);else if(m.right&&0>e){{m.right.width}m.openAmount(m.right.width*t)}o.enableClass(0!==e,"menu-open"),c(!1)},m.openAmount=function(e){var t=m.left&&m.left.width||0,n=m.right&&m.right.width||0;return(m.left&&m.left.isEnabled||!(e>0))&&(m.right&&m.right.isEnabled||!(0>e))?l&&e>t?void m.content.setTranslateX(t):s&&-n>e?void m.content.setTranslateX(-n):(m.content.setTranslateX(e),void(e>=0?(l=!0,s=!1,e>0&&(m.right&&m.right.pushDown&&m.right.pushDown(),m.left&&m.left.bringUp&&m.left.bringUp())):(s=!0,l=!1,m.right&&m.right.bringUp&&m.right.bringUp(),m.left&&m.left.pushDown&&m.left.pushDown()))):void m.content.setTranslateX(0)},m.snapToRest=function(e){m.content.enableAnimation(),u=!1;var t=m.getOpenRatio();if(0===t)return void m.openPercentage(0);var n=.3,i=e.gesture.velocityX,o=e.gesture.direction;m.openPercentage(t>0&&.5>t&&"right"==o&&n>i?0:t>.5&&"left"==o&&n>i?100:0>t&&t>-.5&&"left"==o&&n>i?0:.5>t&&"right"==o&&n>i?-100:"right"==o&&t>=0&&(t>=.5||i>n)?100:"left"==o&&0>=t&&(-.5>=t||i>n)?-100:0)},m.enableMenuWithBackViews=function(e){return arguments.length&&($=!!e),$},m.isAsideExposed=function(){return!!v},m.exposeAside=function(e){(m.left&&m.left.isEnabled||m.right&&m.right.isEnabled)&&(m.close(),v!==e&&ionic.trigger("resize",null,window),v=e,m.left&&m.left.isEnabled?m.content.setMarginLeft(v?m.left.width:0):m.right&&m.right.isEnabled&&m.content.setMarginRight(v?m.right.width:0),m.$scope.$emit("$ionicExposeAside",v))},m.activeAsideResizing=function(e){o.enableClass(e,"aside-resizing")},m._endDrag=function(e){c(!1),v||(u&&m.snapToRest(e),d=null,f=null,p=null)},m._handleDrag=function(t){!v&&e.dragContent&&(d?f=t.gesture.touches[0].pageX:(d=t.gesture.touches[0].pageX,f=d),!u&&Math.abs(f-d)>m.dragThresholdX&&(d=f,u=!0,m.content.disableAnimation(),p=m.getOpenAmount()),u&&(m.openAmount(p+(f-d)),c(!0)))},m.canDragContent=function(t){return arguments.length&&(e.dragContent=!!t),e.dragContent},m.edgeThreshold=25,m.edgeThresholdEnabled=!1,m.edgeDragThreshold=function(e){return arguments.length&&(h(e)&&e>0?(m.edgeThreshold=e,m.edgeThresholdEnabled=!0):m.edgeThresholdEnabled=!!e),m.edgeThresholdEnabled},m.isDraggableTarget=function(t){var n=m.edgeThresholdEnabled&&!m.isOpen(),i=t.gesture.startEvent&&t.gesture.startEvent.center&&t.gesture.startEvent.center.pageX,o=!n||i<=m.edgeThreshold||i>=m.content.element.offsetWidth-m.edgeThreshold,a=r.backView(),c=$?!0:!a;if(!c){var s=r.currentView()||{};return a.historyId!==s.historyId}return(e.dragContent||m.isOpen())&&o&&!t.gesture.srcEvent.defaultPrevented&&c&&!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-scroll"))},e.sideMenuContentTranslateX=0;var w=g,b=angular.bind(m,m.close);e.$watch(function(){return 0!==m.getOpenAmount()},function(e){w(),e&&(w=i.registerBackButtonAction(b,S))});var y=n._registerInstance(m,t.delegateHandle,function(){return r.isActiveScope(e)});e.$on("$destroy",function(){y(),w(),m.$scope=null,m.content&&(m.content.element=null,m.content=null),c(!1)}),m.initialize({left:{width:275},right:{width:275}})}]),function(e){function t(e,i,o,r){var a,c,s,l=document.createElement(f[e]||e);for(a in i)if(angular.isArray(i[a]))for(c=0;c<i[a].length;c++)if(i[a][c].fn)for(s=0;s<i[a][c].t;s++)t(a,i[a][c].fn(s,r),l,r);else t(a,i[a][c],l,r);else n(l,a,i[a]);o.appendChild(l)}function n(e,t,n){e.setAttribute(f[t]||t,n)}function i(e,t){var n=e.split(";"),i=n.slice(t),o=n.slice(0,n.length-i.length);return n=i.concat(o).reverse(),n.join(";")+";"+n[0]}function o(e,t){return e/=t/2,1>e?.5*e*e*e:(e-=2,.5*(e*e*e+2))}var r="translate(32,32)",a="stroke-opacity",c="round",s="indefinite",u="750ms",d="none",f={a:"animate",an:"attributeName",at:"animateTransform",c:"circle",da:"stroke-dasharray",os:"stroke-dashoffset",f:"fill",lc:"stroke-linecap",rc:"repeatCount",sw:"stroke-width",t:"transform",v:"values"},h={v:"0,32,32;360,32,32",an:"transform",type:"rotate",rc:s,dur:u},p={sw:4,lc:c,line:[{fn:function(e,t){return{y1:"ios"==t?17:12,y2:"ios"==t?29:20,t:r+" rotate("+(30*e+(6>e?180:-180))+")",a:[{fn:function(){return{an:a,dur:u,v:i("0;.1;.15;.25;.35;.45;.55;.65;.7;.85;1",e),rc:s}},t:1}]}},t:12}]},v={android:{c:[{sw:6,da:128,os:82,r:26,cx:32,cy:32,f:d}]},ios:p,"ios-small":p,bubbles:{sw:0,c:[{fn:function(e){return{cx:24*Math.cos(2*Math.PI*e/8),cy:24*Math.sin(2*Math.PI*e/8),t:r,a:[{fn:function(){return{an:"r",dur:u,v:i("1;2;3;4;5;6;7;8",e),rc:s}},t:1}]}},t:8}]},circles:{c:[{fn:function(e){return{r:5,cx:24*Math.cos(2*Math.PI*e/8),cy:24*Math.sin(2*Math.PI*e/8),t:r,sw:0,a:[{fn:function(){return{an:"fill-opacity",dur:u,v:i(".3;.3;.3;.4;.7;.85;.9;1",e),rc:s}},t:1}]}},t:8}]},crescent:{c:[{sw:4,da:128,os:82,r:26,cx:32,cy:32,f:d,at:[h]}]},dots:{c:[{fn:function(e){return{cx:16+16*e,cy:32,sw:0,a:[{fn:function(){return{an:"fill-opacity",dur:u,v:i(".5;.6;.8;1;.8;.6;.5",e),rc:s}},t:1},{fn:function(){return{an:"r",dur:u,v:i("4;5;6;5;4;3;3",e),rc:s}},t:1}]}},t:3}]},lines:{sw:7,lc:c,line:[{fn:function(e){return{x1:10+14*e,x2:10+14*e,a:[{fn:function(){return{an:"y1",dur:u,v:i("16;18;28;18;16",e),rc:s}},t:1},{fn:function(){return{an:"y2",dur:u,v:i("48;44;36;46;48",e),rc:s}},t:1},{fn:function(){return{an:a,dur:u,v:i("1;.8;.5;.4;1",e),rc:s}},t:1}]}},t:4}]},ripple:{f:d,"fill-rule":"evenodd",sw:3,circle:[{fn:function(e){return{cx:32,cy:32,a:[{fn:function(){return{an:"r",begin:-1*e+"s",dur:"2s",v:"0;24",keyTimes:"0;1",keySplines:"0.1,0.2,0.3,1",calcMode:"spline",rc:s}},t:1},{fn:function(){return{an:a,begin:-1*e+"s",dur:"2s",v:".2;1;.2;0",rc:s}},t:1}]}},t:2}]},spiral:{defs:[{linearGradient:[{id:"sGD",gradientUnits:"userSpaceOnUse",x1:55,y1:46,x2:2,y2:46,stop:[{offset:.1,"class":"stop1"},{offset:1,"class":"stop2"}]}]}],g:[{sw:4,lc:c,f:d,path:[{stroke:"url(#sGD)",d:"M4,32 c0,15,12,28,28,28c8,0,16-4,21-9"},{d:"M60,32 C60,16,47.464,4,32,4S4,16,4,32"}],at:[h]}]}},g={android:function(t){function i(){var t=o(Date.now()-r,650),u=1,d=0,f=188-58*t,h=182-182*t;a%2&&(u=-1,d=-64,f=128- -58*t,h=182*t);var p=[0,-101,-90,-11,-180,79,-270,-191][a];n(l,"da",Math.max(Math.min(f,188),128)),n(l,"os",Math.max(Math.min(h,182),0)),n(l,"t","scale("+u+",1) translate("+d+",0) rotate("+p+",32,32)"),c+=4.1,c>359&&(c=0),n(s,"t","rotate("+c+",32,32)"),t>=1&&(a++,a>7&&(a=0),r=Date.now()),e.requestAnimationFrame(i)}var r,a=0,c=0,s=t.querySelector("g"),l=t.querySelector("circle");return function(){r=Date.now(),i()}}};l.controller("$ionicSpinner",["$element","$attrs",function(n,i){var o,r;this.init=function(){o=i.icon||e.Platform.platform(),r=v[o],r||(o="ios",r=v.ios);var a=document.createElement("div");return t("svg",{viewBox:"0 0 64 64",g:[v[o]]},a,o),n.html(a.innerHTML),this.start(),o},this.start=function(){g[o]&&g[o](n[0])()}}])}(ionic),l.controller("$ionicTab",["$scope","$ionicHistory","$attrs","$location","$state",function(e,t,n,i,o){this.$scope=e,this.hrefMatchesState=function(){return n.href&&0===i.path().indexOf(n.href.replace(/^#/,"").replace(/\/$/,""))},this.srefMatchesState=function(){return n.uiSref&&o.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()}}]),l.controller("$ionicTabs",["$scope","$element","$ionicHistory",function(e,t,n){var i,o=this,r=null;o.tabs=[],o.selectedIndex=function(){return o.tabs.indexOf(r)},o.selectedTab=function(){return r},o.add=function(e){n.registerHistory(e),o.tabs.push(e)},o.remove=function(e){var t=o.tabs.indexOf(e);if(-1!==t){if(e.$tabSelected)if(o.deselect(e),1===o.tabs.length);else{var n=t===o.tabs.length-1?t-1:t+1;o.select(o.tabs[n])}o.tabs.splice(t,1)}},o.deselect=function(e){e.$tabSelected&&(r=i=null,e.$tabSelected=!1,(e.onDeselect||g)(),e.$broadcast&&e.$broadcast("$ionicHistory.deselect"))},o.select=function(t,a){var c;if(h(t)){if(c=t,c>=o.tabs.length)return;t=o.tabs[c]}else c=o.tabs.indexOf(t);1===arguments.length&&(a=!(!t.navViewName&&!t.uiSref)),r&&r.$historyId==t.$historyId?a&&n.goToHistoryRoot(t.$historyId):i!==c&&(d(o.tabs,function(e){o.deselect(e)}),r=t,i=c,o.$scope&&o.$scope.$parent&&(o.$scope.$parent.$activeHistoryId=t.$historyId),t.$tabSelected=!0,(t.onSelect||g)(),a&&e.$emit("$ionicHistory.change",{type:"tab",tabIndex:c,historyId:t.$historyId,navViewName:t.navViewName,hasNavView:!!t.navViewName,title:t.title,url:t.href,uiSref:t.uiSref}))},o.hasActiveScope=function(){for(var e=0;e<o.tabs.length;e++)if(n.isActiveScope(o.tabs[e]))return!0;return!1}}]),l.controller("$ionicView",["$scope","$element","$attrs","$compile","$rootScope","$ionicViewSwitcher",function(e,t,n,i,o){function r(){var t=f(n.viewTitle)&&"viewTitle"||f(n.title)&&"title";t&&(a(n[t]),$.push(n.$observe(t,a))),f(n.hideBackButton)&&$.push(e.$watch(n.hideBackButton,function(e){d.showBackButton(!e)})),f(n.hideNavBar)&&$.push(e.$watch(n.hideNavBar,function(e){d.showBar(!e)}))}function a(e){f(e)&&e!==v&&(v=e,d.title(v))}function c(){for(var e=0;e<$.length;e++)$[e]();$=[]}function s(t){return t?i(t)(e.$new()):void 0}function l(t){return!!e.$eval(n[t])}var d,h,p,v,g=this,m={},$=[],w=e.$on("ionNavBar.init",function(e,t){e.stopPropagation(),h=t});g.init=function(){w();var n=t.inheritedData("$ionModalController");d=t.inheritedData("$ionNavViewController"),d&&!n&&(e.$on("$ionicView.beforeEnter",g.beforeEnter),e.$on("$ionicView.afterEnter",r),e.$on("$ionicView.beforeLeave",c))},g.beforeEnter=function(t,i){if(i&&!i.viewNotified){i.viewNotified=!0,o.$$phase||e.$digest(),v=f(n.viewTitle)?n.viewTitle:n.title;var r={};for(var a in m)r[a]=s(m[a]);d.beforeEnter(u(i,{title:v,showBack:!l("hideBackButton"),navBarItems:r,navBarDelegate:h||null,showNavBar:!l("hideNavBar"),hasHeaderBar:!!p})),c()}},g.navElement=function(e,t){m[e]=t}}]),l.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())},o=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",o)},template:'<div class="action-sheet-backdrop"><div class="action-sheet-wrapper"><div class="action-sheet" ng-class="{\'action-sheet-has-icons\': $actionSheetHasIcon}"><div class="action-sheet-group action-sheet-options"><div class="action-sheet-title" ng-if="titleText" ng-bind-html="titleText"></div><button class="button action-sheet-option" ng-click="buttonClicked($index)" ng-repeat="b in buttons" ng-bind-html="b.text"></button><button class="button destructive action-sheet-destructive" ng-if="destructiveText" ng-click="destructiveButtonClicked()" ng-bind-html="destructiveText"></button></div><div class="action-sheet-group action-sheet-cancel" ng-if="cancelText"><button class="button" ng-click="cancel()" ng-bind-html="cancelText"></button></div></div></div></div>'}}]),l.directive("ionCheckbox",["$ionicConfig",function(e){return{restrict:"E",replace:!0,require:"?ngModel",transclude:!0,template:'<label class="item item-checkbox"><div class="checkbox checkbox-input-hidden disable-pointer-events"><input type="checkbox"><i class="checkbox-icon"></i></div><div class="item-content disable-pointer-events" ng-transclude></div></label>',compile:function(t,n){var i=t.find("input");d({name:n.name,"ng-value":n.ngValue,"ng-model":n.ngModel,"ng-checked":n.ngChecked,"ng-disabled":n.ngDisabled,"ng-true-value":n.ngTrueValue,"ng-false-value":n.ngFalseValue,"ng-change":n.ngChange},function(e,t){f(e)&&i.attr(t,e)});var o=t[0].querySelector(".checkbox");o.classList.add("checkbox-"+e.form.checkbox())}}}]),l.directive("collectionRepeat",e).factory("$ionicCollectionManager",t);var x="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",A=/height:.*?px;\s*width:.*?px/,E=3;e.$inject=["$ionicCollectionManager","$parse","$window","$$rAF","$rootScope","$timeout"],t.$inject=["$rootScope","$window","$$rAF"],l.directive("ionContent",["$timeout","$controller","$ionicBind","$ionicConfig",function(e,t,n,i){return{restrict:"E",require:"^?ionNavView",scope:!0,priority:800,compile:function(e,o){function r(e,r,c){var s=e.$parent;if(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,c,{$onScroll:"&onScroll",$onScrollComplete:"&onScrollComplete",hasBouncing:"@",padding:"@",direction:"@",scrollbarX:"@",scrollbarY:"@",startX:"@",startY:"@",scrollEventInterval:"@"}),e.direction=e.direction||"y",f(c.padding)&&e.$watch(c.padding,function(e){(a||r).toggleClass("padding",!!e)}),"false"===c.scroll);else if("true"!==o.overflowScroll&&i.scrolling.jsScrolling()){var l={el:r[0],delegateHandle:o.delegateHandle,locking:"true"===(o.locking||"true"),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.direction.indexOf("x")>=0,scrollingY:e.direction.indexOf("y")>=0,scrollEventInterval:parseInt(e.scrollEventInterval,10)||10,scrollingComplete:function(){e.$onScrollComplete({scrollTop:this.__scrollTop,scrollLeft:this.__scrollLeft})}};t("$ionicScroll",{$scope:e,scrollViewOptions:l}),e.$on("$destroy",function(){l.scrollingComplete=g,delete l.el,a=null,r=null,o.$$element=null})}else r.addClass("overflow-scroll")}var a;return e.addClass("scroll-content ionic-scroll"),"false"!=o.scroll?(a=v('<div class="scroll"></div>'),a.append(e.contents()),e.append(a)):e.addClass("scroll-content-false"),{pre:r}}}}]),l.directive("exposeAsideWhen",["$window",function(e){return{restrict:"A",require:"^ionSideMenus",link:function(t,n,i,o){function r(){var t="large"==i.exposeAsideWhen?"(min-width:768px)":i.exposeAsideWhen;o.exposeAside(e.matchMedia(t).matches),o.activeAsideResizing(!1)}function a(){o.activeAsideResizing(!0),c()}var c=ionic.debounce(function(){t.$apply(r)},300,!1);r(),ionic.on("resize",a,e),t.$on("$destroy",function(){ionic.off("resize",a,e)})}}}]);var V="onHold onTap onDoubleTap onTouch onRelease onDrag onDragUp onDragRight onDragDown onDragLeft onSwipe onSwipeUp onSwipeRight onSwipeDown onSwipeLeft".split(" ");V.forEach(function(e){l.directive(e,n(e))}),l.directive("ionHeaderBar",o()).directive("ionHeaderBar",r(!0)).directive("ionFooterBar",r(!1)),l.directive("ionInfiniteScroll",["$timeout",function(e){return{restrict:"E",require:["?^$ionicScroll","ionInfiniteScroll"],template:function(e,t){return t.icon?'<i class="icon {{icon()}} icon-refreshing {{scrollingType}}"></i>':'<ion-spinner icon="{{spinner()}}"></ion-spinner>'},scope:!0,controller:"$ionInfiniteScroll",link:function(t,n,i,o){var r=o[1],a=r.scrollCtrl=o[0],c=r.jsScrolling=!!a;if(c)r.scrollView=a.scrollView;else{var s=ionic.DomUtil.getParentOrSelfWithClass(n[0].parentNode,"overflow-scroll");if(r.scrollEl=s,!s)throw"Infinite scroll must be used inside a scrollable div"}c?(t.scrollingType="js-scrolling",a.$element.on("scroll",r.checkBounds)):r.scrollEl.addEventListener("scroll",r.checkBounds);var l=f(i.immediateCheck)?t.$eval(i.immediateCheck):!0;l&&e(function(){r.checkBounds()})}}}]);var P='<a class="item-content" ng-href="{{$href()}}" target="{{$target()}}"></a>',D='<div class="item-content"></div>';l.directive("ionItem",function(){return{restrict:"E",controller:["$scope","$element",function(e,t){this.$scope=e,this.$element=t}],scope:!0,compile:function(e,t){var n=f(t.href)||f(t.ngHref)||f(t.uiSref),i=n||/ion-(delete|option|reorder)-button/i.test(e.html());if(i){var o=v(n?P:D);o.append(e.contents()),e.append(o),e.addClass("item item-complex")}else e.addClass("item");return function(e,t,n){e.$href=function(){return n.href||n.ngHref},e.$target=function(){return n.target||"_self"};var i=t[0].querySelector(".item-content");i&&e.$on("$collectionRepeatChange",function(){i&&(i.style[ionic.CSS.TRANSFORM]="translate3d(0,0,0)")})}}}});var L='<div class="item-left-edit item-delete enable-pointer-events"></div>';l.directive("ionDeleteButton",function(){return{restrict:"E",require:["^ionItem","^?ionList"],priority:Number.MAX_VALUE,compile:function(e,t){return t.$set("class",(t["class"]||"")+" button icon button-icon",!0),function(e,t,n,i){var o=i[0],r=i[1],a=v(L);a.append(t),o.$element.append(a).addClass("item-left-editable"),r&&r.showDelete()&&a.addClass("visible active")}}}}),l.directive("itemFloatingLabel",function(){return{restrict:"C",link:function(e,t){var n=t[0],i=n.querySelector("input, textarea"),o=n.querySelector(".input-label");if(i&&o){var r=function(){i.value?o.classList.add("has-input"):o.classList.remove("has-input")};i.addEventListener("input",r);var a=v(i).controller("ngModel");a&&(a.$render=function(){i.value=a.$viewValue||"",r()}),e.$on("$destroy",function(){i.removeEventListener("input",r)})}}}});var M='<div class="item-options invisible"></div>';l.directive("ionOptionButton",["$compile",function(){function e(e){e.stopPropagation()}return{restrict:"E",require:"^ionItem",priority:Number.MAX_VALUE,compile:function(t,n){return n.$set("class",(n["class"]||"")+" button",!0),function(t,n,i,o){o.optionsContainer||(o.optionsContainer=v(M),o.$element.append(o.optionsContainer)),o.optionsContainer.append(n),o.$element.addClass("item-right-editable"),n.on("click",e)}}}}]);var N='<div data-prevent-scroll="true" class="item-right-edit item-reorder enable-pointer-events"></div>';l.directive("ionReorderButton",["$parse",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,o){var r=o[0],a=o[1],c=e(i.onReorder);t.$onReorder=function(e,n){c(t,{$fromIndex:e,$toIndex:n})},i.ngClick||i.onClick||i.onclick||(n[0].onclick=function(e){return e.stopPropagation(),!1});var s=v(N);s.append(n),r.$element.append(s).addClass("item-right-editable"),a&&a.showReorder()&&s.addClass("visible active")}}}}]),l.directive("keyboardAttach",function(){return function(e,t){function n(e){if(!ionic.Platform.isAndroid()||ionic.Platform.isFullScreen){var n=e.keyboardHeight||e.detail.keyboardHeight;t.css("bottom",n+"px"),o=t.controller("$ionicScroll"),o&&(o.scrollView.__container.style.bottom=n+a(t[0])+"px")}}function i(){(!ionic.Platform.isAndroid()||ionic.Platform.isFullScreen)&&(t.css("bottom",""),o&&(o.scrollView.__container.style.bottom=""))}ionic.on("native.keyboardshow",n,window),ionic.on("native.keyboardhide",i,window),ionic.on("native.showkeyboard",n,window),ionic.on("native.hidekeyboard",i,window);var o;e.$on("$destroy",function(){ionic.off("native.keyboardshow",n,window),ionic.off("native.keyboardhide",i,window),ionic.off("native.showkeyboard",n,window),ionic.off("native.hidekeyboard",i,window)})}}),l.directive("ionList",["$timeout",function(e){return{restrict:"E",require:["ionList","^?$ionicScroll"],controller:"$ionicList",compile:function(t,n){var i=v('<div class="list">').append(t.contents()).addClass(n.type);return t.append(i),function(t,i,o,r){function a(){function o(e,t){t()&&e.addClass("visible")||e.removeClass("active"),ionic.requestAnimationFrame(function(){t()&&e.addClass("active")||e.removeClass("visible")})}var r=c.listView=new ionic.views.ListView({el:i[0],listEl:i.children()[0],scrollEl:s&&s.element,scrollView:s&&s.scrollView,onReorder:function(t,n,i){var o=v(t).scope();o&&o.$onReorder&&e(function(){o.$onReorder(n,i)})},canSwipe:function(){return c.canSwipeItems()}});t.$on("$destroy",function(){r&&(r.deregister&&r.deregister(),r=null)}),f(n.canSwipe)&&t.$watch("!!("+n.canSwipe+")",function(e){c.canSwipeItems(e)}),f(n.showDelete)&&t.$watch("!!("+n.showDelete+")",function(e){c.showDelete(e)}),f(n.showReorder)&&t.$watch("!!("+n.showReorder+")",function(e){c.showReorder(e)}),t.$watch(function(){return c.showDelete()},function(e,t){if(e||t){e&&c.closeOptionButtons(),c.canSwipeItems(!e),i.children().toggleClass("list-left-editing",e),i.toggleClass("disable-pointer-events",e);var n=v(i[0].getElementsByClassName("item-delete"));o(n,c.showDelete)}}),t.$watch(function(){return c.showReorder()},function(e,t){if(e||t){e&&c.closeOptionButtons(),c.canSwipeItems(!e),i.children().toggleClass("list-right-editing",e),i.toggleClass("disable-pointer-events",e);var n=v(i[0].getElementsByClassName("item-reorder"));o(n,c.showReorder)}})}var c=r[0],s=r[1];e(a)}}}}]),l.directive("menuClose",["$ionicHistory",function(e){return{restrict:"AC",link:function(t,n){n.bind("click",function(){var t=n.inheritedData("$ionSideMenusController");t&&(e.nextViewOptions({historyRoot:!0,disableAnimate:!0,expire:300}),t.close())})}}}]),l.directive("menuToggle",function(){return{restrict:"AC",link:function(e,t,n){e.$on("$ionicView.beforeEnter",function(e,n){if(n.enableBack){var i=t.inheritedData("$ionSideMenusController");i.enableMenuWithBackViews()||t.addClass("hide")}else t.removeClass("hide")}),t.bind("click",function(){var e=t.inheritedData("$ionSideMenusController");e&&e.toggle(n.menuToggle)})}}}),l.directive("ionModal",[function(){return{restrict:"E",transclude:!0,replace:!0,controller:[function(){}],template:'<div class="modal-backdrop"><div class="modal-wrapper" ng-transclude></div></div>'}}]),l.directive("ionModalView",function(){return{restrict:"E",compile:function(e){e.addClass("modal")}}}),l.directive("ionNavBackButton",["$ionicConfig","$document",function(e,t){return{restrict:"E",require:"^ionNavBar",compile:function(n,i){function o(e){return/ion-|icon/.test(e.className)}var r=t[0].createElement("button");for(var a in i.$attr)r.setAttribute(i.$attr[a],i[a]);i.ngClick||r.setAttribute("ng-click","$ionicGoBack($event)"),r.className="button back-button hide buttons "+(n.attr("class")||""),r.innerHTML=n.html()||"";for(var c,s,l,u,d=o(n[0]),f=0;f<n[0].childNodes.length;f++)c=n[0].childNodes[f],1===c.nodeType?o(c)?d=!0:c.classList.contains("default-title")?l=!0:c.classList.contains("previous-title")&&(u=!0):s||3!==c.nodeType||(s=!!c.nodeValue.trim());var h=e.backButton.icon();if(!d&&h&&"none"!==h&&(r.innerHTML='<i class="icon '+h+'"></i> '+r.innerHTML,r.className+=" button-clear"),!s){var p=t[0].createElement("span");p.className="back-text",!l&&e.backButton.text()&&(p.innerHTML+='<span class="default-title">'+e.backButton.text()+"</span>"),!u&&e.backButton.previousTitleText()&&(p.innerHTML+='<span class="previous-title"></span>'),r.appendChild(p)}return n.attr("class","hide"),n.empty(),{pre:function(e,t,n,i){i.navElement("backButton",r.outerHTML),r=null}}}}}]),l.directive("ionNavBar",function(){return{restrict:"E",controller:"$ionicNavBar",scope:!0,link:function(e,t,n,i){i.init()}}}),l.directive("ionNavButtons",["$document",function(e){return{require:"^ionNavBar",restrict:"E",compile:function(t,n){var i="left";/^primary|secondary|right$/i.test(n.side||"")&&(i=n.side.toLowerCase());var o=e[0].createElement("span");o.className=i+"-buttons",o.innerHTML=t.html();var r=i+"Buttons";return t.attr("class","hide"),t.empty(),{pre:function(e,t,n,i){var a=t.parent().data("$ionViewController");a?a.navElement(r,o.outerHTML):i.navElement(r,o.outerHTML),o=null}}}}}]),l.directive("navDirection",["$ionicViewSwitcher",function(e){return{restrict:"A",priority:1e3,link:function(t,n,i){n.bind("click",function(){e.nextDirection(i.navDirection)})}}}]),l.directive("ionNavTitle",["$document",function(e){return{require:"^ionNavBar",restrict:"E",compile:function(t,n){var i="title",o=e[0].createElement("span");
|
|
for(var r in n.$attr)o.setAttribute(n.$attr[r],n[r]);return o.classList.add("nav-bar-title"),o.innerHTML=t.html(),t.attr("class","hide"),t.empty(),{pre:function(e,t,n,r){var a=t.parent().data("$ionViewController");a?a.navElement(i,o.outerHTML):r.navElement(i,o.outerHTML),o=null}}}}}]),l.directive("navTransition",["$ionicViewSwitcher",function(e){return{restrict:"A",priority:1e3,link:function(t,n,i){n.bind("click",function(){e.nextTransition(i.navTransition)})}}}]),l.directive("ionNavView",["$state","$ionicConfig",function(e,t){return{restrict:"E",terminal:!0,priority:2e3,transclude:!0,controller:"$ionicNavView",compile:function(n,i,o){return n.addClass("view-container"),ionic.DomUtil.cachedAttr(n,"nav-view-transition",t.views.transition()),function(t,n,i,r){function a(t){var n=e.$current&&e.$current.locals[s.name];n&&(t||n!==c)&&(c=n,s.state=n.$$state,r.register(n))}var c;o(t,function(e){n.append(e)});var s=r.init();t.$on("$stateChangeSuccess",function(){a(!1)}),t.$on("$viewContentLoading",function(){a(!1)}),a(!0)}}}}]),l.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 o=angular.isFunction(i)?i:e(i);n.on("click",function(e){t.$apply(function(){o(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,c)}}}),l.directive("ionPane",function(){return{restrict:"E",link:function(e,t){t.addClass("pane")}}}),l.directive("ionPopover",[function(){return{restrict:"E",transclude:!0,replace:!0,controller:[function(){}],template:'<div class="popover-backdrop"><div class="popover-wrapper" ng-transclude></div></div>'}}]),l.directive("ionPopoverView",function(){return{restrict:"E",compile:function(e){e.append(v('<div class="popover-arrow">')),e.addClass("popover")}}}),l.directive("ionRadio",function(){return{restrict:"E",replace:!0,require:"?ngModel",transclude:!0,template:'<label class="item item-radio"><input type="radio" name="radio-group"><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.icon&&e.children().eq(2).removeClass("ion-checkmark").addClass(t.icon);var n=e.find("input");return d({name:t.name,value:t.value,disabled:t.disabled,"ng-value":t.ngValue,"ng-model":t.ngModel,"ng-disabled":t.ngDisabled,"ng-change":t.ngChange},function(e,t){f(e)&&n.attr(t,e)}),function(e,t,n){e.getValue=function(){return e.ngValue||n.value}}}}}),l.directive("ionRefresher",[function(){return{restrict:"E",replace:!0,require:["?^$ionicScroll","ionRefresher"],controller:"$ionicRefresher",template:'<div class="scroll-refresher invisible" collection-repeat-ignore><div class="ionic-refresher-content" ng-class="{\'ionic-refresher-with-text\': pullingText || refreshingText}"><div class="icon-pulling" ng-class="{\'pulling-rotation-disabled\':disablePullingRotation}"><i class="icon {{pullingIcon}}"></i></div><div class="text-pulling" ng-bind-html="pullingText"></div><div class="icon-refreshing"><ion-spinner ng-if="showSpinner" icon="{{spinner}}"></ion-spinner><i ng-if="showIcon" class="icon {{refreshingIcon}}"></i></div><div class="text-refreshing" ng-bind-html="refreshingText"></div></div></div>',link:function(e,t,n,i){var o=i[0],r=i[1];o?(t[0].classList.add("js-scrolling"),o._setRefresher(e,t[0],r.getRefresherDomMethods()),e.$on("scroll.refreshComplete",function(){e.$evalAsync(function(){o.scrollView.finishPullToRefresh()})})):r.init()}}}]),l.directive("ionScroll",["$timeout","$controller","$ionicBind",function(e,t,n){return{restrict:"E",scope:!0,controller:function(){},compile:function(e){function i(e,i,r){var a,c;n(e,r,{direction:"@",paging:"@",$onScroll:"&onScroll",scroll:"@",scrollbarX:"@",scrollbarY:"@",zooming:"@",minZoom:"@",maxZoom:"@"}),e.direction=e.direction||"y",f(r.padding)&&e.$watch(r.padding,function(e){o.toggleClass("padding",!!e)}),e.$eval(e.paging)===!0&&o.addClass("scroll-paging"),e.direction||(e.direction="y");var s=e.$eval(e.paging)===!0,l={el:i[0],delegateHandle:r.delegateHandle,locking:"true"===(r.locking||"true"),bouncing:e.$eval(r.hasBouncing),paging:s,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,preventDefault:!0};s&&(l.speedMultiplier=.8,l.bouncing=!1),c=t("$ionicScroll",{$scope:e,scrollViewOptions:l}),a=e.$parent.scrollView=c.scrollView}e.addClass("scroll-view ionic-scroll");var o=v('<div class="scroll"></div>');return o.append(e.contents()),e.append(o),{pre:i}}}}]),l.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,n,i,o){e.side=i.side||"left";var r=o[e.side]=new ionic.views.SideMenu({width:t.width,el:n[0],isEnabled:!0});e.$watch(i.width,function(e){var t=+e;t&&t==e&&r.setWidth(+e)}),e.$watch(i.isEnabled,function(e){r.setIsEnabled(!!e)})}}}}),l.directive("ionSideMenuContent",["$timeout","$ionicGesture","$window",function(e,t,n){return{restrict:"EA",require:"^ionSideMenus",scope:!0,compile:function(i,o){function r(r,a,c,s){function l(e){0!==s.getOpenAmount()?(s.close(),e.gesture.srcEvent.preventDefault(),v=null,g=null):v||(v=ionic.tap.pointerCoord(e.gesture.srcEvent))}function u(e){s.isDraggableTarget(e)&&"x"==p(e)&&(s._handleDrag(e),e.gesture.srcEvent.preventDefault())}function d(e){"x"==p(e)&&e.gesture.srcEvent.preventDefault()}function h(e){s._endDrag(e),v=null,g=null}function p(e){if(g)return g;if(e&&e.gesture){if(v){var t=ionic.tap.pointerCoord(e.gesture.srcEvent),n=Math.abs(t.x-v.x),i=Math.abs(t.y-v.y),o=i>n?"y":"x";return Math.max(n,i)>30&&(g=o),o}v=ionic.tap.pointerCoord(e.gesture.srcEvent)}return"y"}var v=null,g=null;f(o.dragContent)?r.$watch(o.dragContent,function(e){s.canDragContent(e)}):s.canDragContent(!0),f(o.edgeDragThreshold)&&r.$watch(o.edgeDragThreshold,function(e){s.edgeDragThreshold(e)});var m={element:i[0],onDrag:function(){},endDrag:function(){},getTranslateX:function(){return r.sideMenuContentTranslateX||0},setTranslateX:ionic.animationFrameThrottle(function(t){var n=m.offsetX+t;a[0].style[ionic.CSS.TRANSFORM]="translate3d("+n+"px,0,0)",e(function(){r.sideMenuContentTranslateX=t})}),setMarginLeft:ionic.animationFrameThrottle(function(e){e?(e=parseInt(e,10),a[0].style[ionic.CSS.TRANSFORM]="translate3d("+e+"px,0,0)",a[0].style.width=n.innerWidth-e+"px",m.offsetX=e):(a[0].style[ionic.CSS.TRANSFORM]="translate3d(0,0,0)",a[0].style.width="",m.offsetX=0),ionic.trigger("resize",null,window)}),setMarginRight:ionic.animationFrameThrottle(function(e){e?(e=parseInt(e,10),a[0].style.width=n.innerWidth-e+"px",m.offsetX=e):(a[0].style.width="",m.offsetX=0),a[0].style[ionic.CSS.TRANSFORM]="translate3d(0,0,0)"}),enableAnimation:function(){r.animationEnabled=!0,a[0].classList.add("menu-animated")},disableAnimation:function(){r.animationEnabled=!1,a[0].classList.remove("menu-animated")},offsetX:0};s.setContent(m);var $={stop_browser_behavior:!1},w=t.on("tap",l,a,$),b=t.on("dragright",u,a,$),y=t.on("dragleft",u,a,$),S=t.on("dragup",d,a,$),k=t.on("dragdown",d,a,$),C=t.on("release",h,a,$);r.$on("$destroy",function(){m&&(m.element=null,m=null),t.off(y,"dragleft",u),t.off(b,"dragright",u),t.off(S,"dragup",d),t.off(k,"dragdown",d),t.off(C,"release",h),t.off(w,"tap",l)})}return i.addClass("menu-content pane"),{pre:r}}}}]),l.directive("ionSideMenus",["$ionicBody",function(e){return{restrict:"ECA",controller:"$ionicSideMenus",compile:function(t,n){function i(t,n,i,o){o.enableMenuWithBackViews(t.$eval(i.enableMenuWithBackViews)),t.$on("$ionicExposeAside",function(n,i){t.$exposeAside||(t.$exposeAside={}),t.$exposeAside.active=i,e.enableClass(i,"aside-open")}),t.$on("$ionicView.beforeEnter",function(e,n){n.historyId&&(t.$activeHistoryId=n.historyId)}),t.$on("$destroy",function(){e.removeClass("menu-open","aside-open")})}return n.$set("class",(n["class"]||"")+" view"),{pre:i}}}}]),l.directive("ionSlideBox",["$timeout","$compile","$ionicSlideBoxDelegate","$ionicHistory",function(e,t,n,i){return{restrict:"E",replace:!0,transclude:!0,scope:{autoPlay:"=",doesContinue:"@",slideInterval:"@",showPager:"@",pagerClick:"&",disableScroll:"@",onSlideChanged:"&",activeSlide:"=?"},controller:["$scope","$element","$attrs",function(t,o,r){var a=t.$eval(t.doesContinue)===!0,c=f(r.autoPlay)?!!t.autoPlay:!1,s=c?t.$eval(t.slideInterval)||4e3:0,l=new ionic.views.Slider({el:o[0],auto:s,continuous:a,startSlide:t.activeSlide,slidesChanged:function(){t.currentSlide=l.currentIndex(),e(function(){})},callback:function(n){t.currentSlide=n,t.onSlideChanged({index:t.currentSlide,$index:t.currentSlide}),t.$parent.$broadcast("slideBox.slideChanged",n),t.activeSlide=n,e(function(){})}});l.enableSlide(t.$eval(r.disableScroll)!==!0),t.$watch("activeSlide",function(e){f(e)&&l.slide(e)}),t.$on("slideBox.nextSlide",function(){l.next()}),t.$on("slideBox.prevSlide",function(){l.prev()}),t.$on("slideBox.setSlide",function(e,t){l.slide(t)}),this.__slider=l;var u=n._registerInstance(l,r.delegateHandle,function(){return i.isActiveScope(t)});t.$on("$destroy",u),this.slidesCount=function(){return l.slidesCount()},this.onPagerClick=function(e){t.pagerClick({index:e})},e(function(){l.load()})}],template:'<div class="slider"><div class="slider-slides" ng-transclude></div></div>',link:function(e,n,i){function o(){if(!r){var i=e.$new();r=v("<ion-pager></ion-pager>"),n.append(r),r=t(r)(i)}return r}i.$observe("showPager",function(t){t=e.$eval(t),o().toggleClass("hide",!t)});var r}}}]).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 o=function(e){for(var n=t[0].children,i=n.length,o=0;i>o;o++)o==e?n[o].classList.add("active"):n[o].classList.remove("active")};e.pagerClick=function(e){i.onPagerClick(e)},e.numSlides=function(){return new Array(i.slidesCount())},e.$watch("currentSlide",function(e){o(e)})}}}),l.directive("ionSpinner",function(){return{restrict:"E",controller:"$ionicSpinner",link:function(e,t,n,i){var o=i.init();t.addClass("spinner spinner-"+o)}}}),l.directive("ionTab",["$compile","$ionicConfig","$ionicBind","$ionicViewSwitcher",function(e,t,n,i){function o(e,t){return f(t)?" "+e+'="'+t+'"':""}return{restrict:"E",require:["^ionTabs","ionTab"],controller:"$ionicTab",scope:!0,compile:function(r,a){for(var c="<ion-tab-nav"+o("ng-click",a.ngClick)+o("title",a.title)+o("icon",a.icon)+o("icon-on",a.iconOn)+o("icon-off",a.iconOff)+o("badge",a.badge)+o("badge-style",a.badgeStyle)+o("hidden",a.hidden)+o("disabled",a.disabled)+o("class",a["class"])+"></ion-tab-nav>",s=document.createElement("div"),l=0;l<r[0].children.length;l++)s.appendChild(r[0].children[l].cloneNode(!0));var u=s.childElementCount;r.empty();var d,f;return u&&("ION-NAV-VIEW"===s.children[0].tagName&&(d=s.children[0].getAttribute("name"),s.children[0].classList.add("view-container"),f=!0),1===u&&(s=s.children[0]),f||s.classList.add("pane"),s.classList.add("tab-content")),function(o,r,a,l){function f(){w.tabMatchesState()&&$.select(o,!1)}function h(n){n&&u?(b||(g=o.$new(),m=v(s),i.viewEleIsActive(m,!0),$.$element.append(m),e(m)(g),b=!0),i.viewEleIsActive(m,!0)):b&&m&&(t.views.maxCache()>0?i.viewEleIsActive(m,!1):p())}function p(){g&&g.$destroy(),b&&m&&m.remove(),s.innerHTML="",b=g=m=null}var g,m,$=l[0],w=l[1],b=!1;n(o,a,{onSelect:"&",onDeselect:"&",title:"@",uiSref:"@",href:"@"}),$.add(o),o.$on("$destroy",function(){o.$tabsDestroy||$.remove(o),y.isolateScope().$destroy(),y.remove(),y=s=m=null}),r[0].removeAttribute("title"),d&&(w.navViewName=o.navViewName=d),o.$on("$stateChangeSuccess",f),f();var y=v(c);y.data("$ionTabsController",$),y.data("$ionTabController",w),$.$tabsElement.append(e(y)(o)),o.$watch("$tabSelected",h),o.$on("$ionicView.afterEnter",function(){i.viewEleIsActive(m,o.$tabSelected)}),o.$on("$ionicView.clearCache",function(){o.$tabSelected||p()})}}}}]),l.directive("ionTabNav",[function(){return{restrict:"E",replace:!0,require:["^ionTabs","^ionTab"],template:"<a ng-class=\"{'tab-item-active': isTabActive(), 'has-badge':badge, 'tab-hidden':isHidden()}\" "+' ng-disabled="disabled()" 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:"=",hidden:"@",disabled:"&",badgeStyle:"@","class":"@"},compile:function(){return function(e,t,n,i){var o=i[0],r=i[1];t[0].removeAttribute("title"),e.selectTab=function(e){e.preventDefault(),o.select(r.$scope,!0)},n.ngClick||t.on("click",function(t){e.$apply(function(){e.selectTab(t)})}),e.isHidden=function(){return"true"===n.hidden||n.hidden===!0?!0:!1},e.getIconOn=function(){return e.iconOn||e.icon},e.getIconOff=function(){return e.iconOff||e.icon},e.isTabActive=function(){return o.selectedTab()===r.$scope}}}}}]),l.directive("ionTabs",["$ionicTabsDelegate","$ionicConfig","$ionicHistory",function(e,t){return{restrict:"E",scope:!0,controller:"$ionicTabs",compile:function(n){function i(t,n,i,o){function a(e,t){e.stopPropagation();var n=o.selectedTab();n&&n.$emit(e.name.replace("NavView","View"),t)}var c=e._registerInstance(o,i.delegateHandle,o.hasActiveScope);o.$scope=t,o.$element=n,o.$tabsElement=v(n[0].querySelector(".tabs")),t.$watch(function(){return n[0].className},function(e){var n=-1!==e.indexOf("tabs-top"),i=-1!==e.indexOf("tabs-item-hide");t.$hasTabs=!n&&!i,t.$hasTabsTop=n&&!i,t.$emit("$ionicTabs.top",t.$hasTabsTop)}),t.$on("$ionicNavView.beforeLeave",a),t.$on("$ionicNavView.afterLeave",a),t.$on("$ionicNavView.leave",a),t.$on("$destroy",function(){t.$tabsDestroy=!0,c(),o.$tabsElement=o.$element=o.$scope=r=null,delete t.$hasTabs,delete t.$hasTabsTop})}function o(e,t,n,i){i.selectedTab()||i.select(0)}var r=v('<div class="tab-nav tabs">');return r.append(n.contents()),n.append(r).addClass("tabs-"+t.tabs.position()+" tabs-"+t.tabs.style()),{pre:i,post:o}}}}]),l.directive("ionToggle",["$timeout","$ionicConfig",function(e,t){return{restrict:"E",replace:!0,require:"?ngModel",transclude:!0,template:'<div class="item item-toggle"><div ng-transclude></div><label class="toggle"><input type="checkbox"><div class="track"><div class="handle"></div></div></label></div>',compile:function(e,n){var i=e.find("input");return d({name:n.name,"ng-value":n.ngValue,"ng-model":n.ngModel,"ng-checked":n.ngChecked,"ng-disabled":n.ngDisabled,"ng-true-value":n.ngTrueValue,"ng-false-value":n.ngFalseValue,"ng-change":n.ngChange},function(e,t){f(e)&&i.attr(t,e)}),n.toggleClass&&e[0].getElementsByTagName("label")[0].classList.add(n.toggleClass),e.addClass("toggle-"+t.form.toggle()),function(e,t){var n=t[0].getElementsByTagName("label")[0],i=n.children[0],o=n.children[1],r=o.children[0],a=v(i).controller("ngModel");e.toggle=new ionic.views.Toggle({el:n,track:o,checkbox:i,handle:r,onChange:function(){a&&(a.$setViewValue(i.checked),e.$apply())}}),e.$on("$destroy",function(){e.toggle.destroy()})}}}}]),l.directive("ionView",function(){return{restrict:"EA",priority:1e3,controller:"$ionicView",compile:function(e){return e.addClass("pane"),e[0].removeAttribute("title"),function(e,t,n,i){i.init()}}}})}(); |