angular-material
Version:
This repository publishes the AngularJS Material v1.x library and localized installs using `npm`. You can find the component source-code for this library in the [AngularJS Material repository](https://github.com/angular/material).
7 lines • 142 kB
JavaScript
/*!
* AngularJS Material Design
* https://github.com/angular/material
* @license MIT
* v1.2.0-master-93518bb
*/
!function(f,M,C){"use strict";function e(e,t){if(t.has("$swipe")){e.warn("You are using the ngTouch module. \nAngularJS Material already has mobile click, tap, and swipe support... \nngTouch is not supported with AngularJS Material!")}}function t(e,t){e.decorator("$$rAF",["$delegate",o]),e.decorator("$q",["$delegate",n]),t.theme("default").primaryPalette("indigo").accentPalette("pink").warnPalette("deep-orange").backgroundPalette("grey")}function o(d){return d.throttle=function(e){var t,o,n,r;return function(){t=arguments,r=this,n=e,o||(o=!0,d(function(){n.apply(r,Array.prototype.slice.call(t)),o=!1}))}},d}function n(e){return e.resolve||(e.resolve=e.when),e}function r(d){return{restrict:"A",link:{pre:function(e,t,o){var n=o.mdAutoFocus||o.mdAutofocus||o.mdSidenavFocus;r(d(n)(e)),n&&e.$watch(n,r);function r(e){M.isUndefined(e)&&(e=!0),t.toggleClass("md-autofocus",!!e)}}}}}function d(e,m){function i(){return!0}e&&!M.isArray(e)&&(e=Array.prototype.slice.call(e)),m=!!m;var c=e||[];return{items:function(){return[].concat(c)},count:function(){return c.length},inRange:l,contains:t,indexOf:s,itemAt:function(e){return l(e)?c[e]:null},findBy:function(t,o){return c.filter(function(e){return e[t]===o})},add:function(e,t){if(!e)return-1;M.isNumber(t)||(t=c.length);return c.splice(t,0,e),s(e)},remove:function(e){t(e)&&c.splice(s(e),1)},first:u,last:p,next:M.bind(null,o,!1),previous:M.bind(null,o,!0),hasPrevious:function(e){return!!e&&l(s(e)-1)},hasNext:function(e){return!!e&&l(s(e)+1)}};function l(e){return c.length&&-1<e&&e<c.length}function s(e){return c.indexOf(e)}function t(e){return e&&-1<s(e)}function u(){return c.length?c[0]:null}function p(){return c.length?c[c.length-1]:null}function o(e,t,o,n){o=o||i;for(var r=s(t);;){if(!l(r))return null;var d=r+(e?-1:1),a=null;if(l(d)?a=c[d]:m&&(d=s(a=e?p():u())),null===a||d===n)return null;if(o(a))return a;M.isUndefined(n)&&(n=d),r=d}}}function a(a,t,n){var d={},m={},r={},o={};return e.getResponsiveAttribute=function(e,t){for(var o=0;o<a.MEDIA_PRIORITY.length;o++){var n=a.MEDIA_PRIORITY[o];if(m[d[n]].matches){var r=c(e,t+"-"+n);if(e[r])return e[r]}}return e[c(e,t)]},e.getQuery=function(e){return m[e]},e.watchResponsiveAttributes=function(e,n,r){var d=[];return e.forEach(function(e){var t=c(n,e);for(var o in M.isDefined(n[t])&&d.push(n.$observe(t,M.bind(void 0,r,null))),a.MEDIA)t=c(n,e+"-"+o),M.isDefined(n[t])&&d.push(n.$observe(t,M.bind(void 0,r,o)))}),function(){d.forEach(function(e){e()})}},e;function e(e){var t=d[e];M.isUndefined(t)&&(t=d[e]=function(e){return a.MEDIA[e]||("("!==e.charAt(0)?"("+e+")":e)}(e));var o=r[t];return M.isUndefined(o)&&(o=function(e){var t=m[e];t=t||(m[e]=n.matchMedia(e));return t.addListener(i),r[t.media]=!!t.matches}(t)),o}function i(e){t.$evalAsync(function(){r[e.media]=!!e.matches})}function c(e,t){return o[t]||(o[t]=e.$normalize(t))}}function m(e,t){var n=["data","x"];return e?t?o(e):r(e):{buildList:r,buildSelector:o,hasAttribute:function(e,t){if(!(e=d(e)))return!1;for(var o=r(t),n=0;n<o.length;n++)if(e.hasAttribute(o[n]))return!0;return!1},removeAttribute:function(t,e){if(!(t=d(t)))return;r(e).forEach(function(e){t.removeAttribute(e)})}};function r(o){return(o=M.isArray(o)?o:[o]).forEach(function(t){n.forEach(function(e){o.push(e+"-"+t)})}),o}function o(e){return r(e=M.isArray(e)?e:[e]).map(function(e){return"["+e+"]"}).join(",")}function d(e){if((e=e[0]||e).nodeType)return e}}e.$inject=["$log","$injector"],t.$inject=["$provide","$mdThemingProvider"],o.$inject=["$delegate"],n.$inject=["$delegate"],M.module("material.core",["ngAnimate","material.core.animate","material.core.layout","material.core.interaction","material.core.gestures","material.core.theming"]).config(t).run(e),r.$inject=["$parse"],M.module("material.core").directive("mdAutofocus",r),M.module("material.core").factory("$mdColorUtil",function(){return{rgbaToHex:function(e){return((e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===e.length?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):"").toUpperCase()},hexToRgba:function(e){var t="#"===e[0]?e.substr(1):e,o=t.length/3,n=t.substr(0,o),r=t.substr(o,o),d=t.substr(2*o);return 1==o&&(n+=n,r+=r,d+=d),"rgba("+parseInt(n,16)+","+parseInt(r,16)+","+parseInt(d,16)+",0.1)"},rgbToRgba:function(e){return e.replace(")",", 0.1)").replace("(","a(")},rgbaToRgb:function(e){return e?e.replace("rgba","rgb").replace(/,[^),]+\)/,")"):"rgb(0,0,0)"}}}),M.module("material.core").factory("$mdConstant",function(){var n=document.createElement("div"),r=function(e){var t,o,n=/^(Moz|webkit|ms)(?=[A-Z])/;for(t in e.style)if(o=n.exec(t))return o[0]}(n),e=/webkit/i.test(r),d=/([:\-_]+(.))/g;function t(e){var t=function(e){return e.replace(d,function(e,t,o,n){return n?o.toUpperCase():o})}(r+"-"+e),o=t.charAt(0).toLowerCase()+t.substring(1);return a(n,e)?e:a(n,t)?t:a(n,o)?o:e}function a(e,t){return M.isDefined(e.style[t])}var o={isInputKey:function(e){return 31<=e.keyCode&&e.keyCode<=90},isNumPadKey:function(e){return 3===e.location&&97<=e.keyCode&&e.keyCode<=105},isMetaKey:function(e){return 91<=e.keyCode&&e.keyCode<=93},isFnLockKey:function(e){return 112<=e.keyCode&&e.keyCode<=145},isNavigationKey:function(e){var t=o.KEY_CODE;return-1!=[t.SPACE,t.ENTER,t.UP_ARROW,t.DOWN_ARROW].indexOf(e.keyCode)},hasModifierKey:function(e){return e.ctrlKey||e.metaKey||e.altKey},ELEMENT_MAX_PIXELS:1533917,BEFORE_NG_ARIA:210,KEY_CODE:{COMMA:188,SEMICOLON:186,ENTER:13,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,TAB:9,BACKSPACE:8,DELETE:46},CSS:{TRANSITIONEND:"transitionend"+(e?" webkitTransitionEnd":""),ANIMATIONEND:"animationend"+(e?" webkitAnimationEnd":""),TRANSFORM:t("transform"),TRANSFORM_ORIGIN:t("transformOrigin"),TRANSITION:t("transition"),TRANSITION_DURATION:t("transitionDuration"),ANIMATION_PLAY_STATE:t("animationPlayState"),ANIMATION_DURATION:t("animationDuration"),ANIMATION_NAME:t("animationName"),ANIMATION_TIMING:t("animationTimingFunction"),ANIMATION_DIRECTION:t("animationDirection")},MEDIA:{xs:"(max-width: 599px)","gt-xs":"(min-width: 600px)",sm:"(min-width: 600px) and (max-width: 959px)","gt-sm":"(min-width: 960px)",md:"(min-width: 960px) and (max-width: 1279px)","gt-md":"(min-width: 1280px)",lg:"(min-width: 1280px) and (max-width: 1919px)","gt-lg":"(min-width: 1920px)",xl:"(min-width: 1920px)",landscape:"(orientation: landscape)",portrait:"(orientation: portrait)",print:"print"},MEDIA_PRIORITY:["xl","gt-lg","lg","gt-md","md","gt-sm","sm","gt-xs","xs","landscape","portrait","print"]};return o}),M.module("material.core").config(["$provide",function(e){e.decorator("$mdUtil",["$delegate",function(e){return e.iterator=d,e}])}]),a.$inject=["$mdConstant","$rootScope","$window"],M.module("material.core").factory("$mdMedia",a),M.module("material.core").config(["$provide",function(e){e.decorator("$mdUtil",["$delegate",function(e){return e.prefixer=m,e}])}]),c.$inject=["$document","$timeout","$compile","$rootScope","$$mdAnimate","$interpolate","$log","$rootElement","$window","$$rAF"];var g,A,T=0;if(f.navigator){var i=f.navigator.userAgent||f.navigator.vendor||f.opera;g=i.match(/ipad|iphone|ipod/i),A=i.match(/android/i)}function c(i,m,o,a,e,t,d,n,c,s){var r=t.startSymbol(),l=t.endSymbol(),u="{{"===r&&"}}"===l;document.contains||(document.contains=function(e){return document.body.contains(e)});function p(e,t,o){var n=!1;if(e&&e.length){var r=c.getComputedStyle(e[0]);n=M.isDefined(r[t])&&(!o||r[t]==o)}return n}function E(e){return e?function(e){return-1<String(e).indexOf("px")}(e)||function(e){return-1<String(e).indexOf("%")}(e)?e:e+"px":"0"}var h={dom:{},isIos:g,isAndroid:A,now:f.performance&&f.performance.now?M.bind(f.performance,f.performance.now):Date.now||function(){return(new Date).getTime()},getModelOption:function(e,t){if(e.$options){var o=e.$options;return o.getOption?o.getOption(t):o[t]}},isRtl:function(e){switch(M.isDefined(e)&&e.hasOwnProperty("dir")&&e.dir){case"ltr":return!1;case"rtl":return!0}return"rtl"===i[0].dir||"rtl"===i[0].body.dir},bidi:function(e,t,o,n){var r=!this.isRtl();if(0==arguments.length)return r?"ltr":"rtl";var d=M.element(e);r&&M.isDefined(o)?d.css(t,E(o)):!r&&M.isDefined(n)&&d.css(t,E(n))},bidiProperty:function(e,t,o,n){var r=!this.isRtl(),d=M.element(e);r&&M.isDefined(t)?(d.css(t,E(n)),d.css(o,"")):!r&&M.isDefined(o)&&(d.css(o,E(n)),d.css(t,""))},clientRect:function(e,t,o){var n=b(e);t=b(t||n.offsetParent||document.body);var r=n.getBoundingClientRect(),d=o?t.getBoundingClientRect():{left:0,top:0,width:0,height:0};return{left:r.left-d.left,top:r.top-d.top,width:r.width,height:r.height}},offsetRect:function(e,t){return h.clientRect(e,t,!0)},nodesToArray:function(e){var t,o=[];for(e=e||[],t=0;t<e.length;++t)o.push(e.item(t));return o},getViewportTop:function(){return h.disableScrollAround._count&&h.disableScrollAround._viewPortTop?h.disableScrollAround._viewPortTop:c.scrollY||c.pageYOffset||0},findFocusTarget:function(e,t){var o=this.prefixer("md-autofocus",!0);return n(e,t||o)||n(e,o);function n(e,t){var o,n=e[0].querySelectorAll(t);return n&&n.length&&n.length&&M.forEach(n,function(e){(e=M.element(e)).hasClass("md-autofocus")&&(o=e)}),o}},disableScrollAround:function(e,t,o){if(o=o||{},h.disableScrollAround._count=Math.max(0,h.disableScrollAround._count||0),h.disableScrollAround._count++,h.disableScrollAround._restoreScroll)return h.disableScrollAround._restoreScroll;var m=i[0].body,n=function(){var e=i[0].documentElement,t=e.style.cssText||"",o=m.style.cssText||"",n=h.getViewportTop();h.disableScrollAround._viewPortTop=n;var r=m.clientWidth,d=m.scrollHeight>m.clientHeight+1,a=0<e.scrollTop?e:m;d&&M.element(m).css({position:"fixed",width:"100%",top:-n+"px"});m.clientWidth<r&&(m.style.overflow="hidden");return function(){m.style.cssText=o,e.style.cssText=t,a.scrollTop=n}}(),r=function(e,t){var o,n=M.element(e||m);t.disableScrollMask?o=n:(o=M.element('<div class="md-scroll-mask"> <div class="md-scroll-mask-bar"></div></div>'),n.append(o));function r(e){e.preventDefault()}return o.on("wheel touchmove",r),function(){o.off("wheel touchmove",r),!t.disableScrollMask&&o[0].parentNode&&o[0].parentNode.removeChild(o[0])}}(t,o);return h.disableScrollAround._restoreScroll=function(){--h.disableScrollAround._count<=0&&(delete h.disableScrollAround._viewPortTop,n(),r(),delete h.disableScrollAround._restoreScroll)}},enableScrolling:function(){var e=this.disableScrollAround._restoreScroll;e&&e()},floatingScrollbars:function(){if(this.floatingScrollbars.cached===C){var e=M.element("<div><div></div></div>").css({width:"100%","z-index":-1,position:"absolute",height:"35px","overflow-y":"scroll"});e.children().css("height","60px"),i[0].body.appendChild(e[0]),this.floatingScrollbars.cached=e[0].offsetWidth===e[0].childNodes[0].offsetWidth,e.remove()}return this.floatingScrollbars.cached},forceFocus:function(e){var o=e[0]||e;document.addEventListener("click",function e(t){t.target===o&&t.$focus&&(o.focus(),t.stopImmediatePropagation(),t.preventDefault(),o.removeEventListener("click",e))},!0);var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!1,!0,f,{},0,0,0,0,!1,!1,!1,!1,0,null),t.$material=!0,t.$focus=!0,o.dispatchEvent(t)},createBackdrop:function(e,t){return o(h.supplant('<md-backdrop class="{0}">',[t]))(e)},supplant:function(e,d,t){return t=t||/\{([^{}]*)\}/g,e.replace(t,function(t,e){var o=e.split("."),n=d;try{for(var r in o)o.hasOwnProperty(r)&&(n=n[o[r]])}catch(e){n=t}return"string"==typeof n||"number"==typeof n?n:t})},fakeNgModel:function(){return{$fake:!0,$setTouched:M.noop,$setViewValue:function(e){this.$viewValue=e,this.$render(e),this.$viewChangeListeners.forEach(function(e){e()})},$isEmpty:function(e){return 0===(""+e).length},$parsers:[],$formatters:[],$viewChangeListeners:[],$render:M.noop}},debounce:function(o,n,r,d){var a;return function(){var e=r,t=Array.prototype.slice.call(arguments);m.cancel(a),a=m(function(){a=C,o.apply(e,t)},n||10,d)}},throttle:function(o,n){var r;return function(){var e=arguments,t=h.now();(!r||n<t-r)&&(o.apply(this,e),r=t)}},time:function(e){var t=h.now();return e(),h.now()-t},valueOnUse:function(e,t,o){var n=null,r=Array.prototype.slice.call(arguments),d=3<r.length?r.slice(3):[];Object.defineProperty(e,t,{get:function(){return null===n&&(n=o.apply(e,d)),n}})},nextUid:function(){return""+T++},disconnectScope:function(e){if(e&&e.$root!==e&&!e.$$destroyed){var t=e.$parent;e.$$disconnected=!0,t.$$childHead===e&&(t.$$childHead=e.$$nextSibling),t.$$childTail===e&&(t.$$childTail=e.$$prevSibling),e.$$prevSibling&&(e.$$prevSibling.$$nextSibling=e.$$nextSibling),e.$$nextSibling&&(e.$$nextSibling.$$prevSibling=e.$$prevSibling),e.$$nextSibling=e.$$prevSibling=null}},reconnectScope:function(e){if(e&&e.$root!==e&&e.$$disconnected){var t=e,o=t.$parent;t.$$disconnected=!1,t.$$prevSibling=o.$$childTail,o.$$childHead?(o.$$childTail.$$nextSibling=t,o.$$childTail=t):o.$$childHead=o.$$childTail=t}},getSiblings:function(t,e){var o=e.toUpperCase();return t instanceof M.element&&(t=t[0]),Array.prototype.filter.call(t.parentNode.children,function(e){return t!==e&&e.tagName.toUpperCase()===o}).map(function(e){return M.element(e)})},getClosest:function(e,t,o){if(M.isString(t)){var n=t.toUpperCase();t=function(e){return e.nodeName.toUpperCase()===n}}if(e instanceof M.element&&(e=e[0]),o&&(e=e.parentNode),!e)return null;do{if(t(e))return e}while(e=e.parentNode);return null},elementContains:function(t,o){return(f.Node&&f.Node.prototype&&Node.prototype.contains?M.bind(t,t.contains):M.bind(t,function(e){return t===o||!!(16&this.compareDocumentPosition(e))}))(o)},extractElementByName:function(e,n,t,o){var r=m(e);return!r&&o&&d.warn(h.supplant("Unable to find node '{0}' in element '{1}'.",[n,e[0].outerHTML])),M.element(r||e);function m(e){return function(e){if(e)for(var t=0,o=e.length;t<o;t++)if(e[t].nodeName.toLowerCase()===n)return e[t];return null}(e)||(t?function(e){var t;if(e)for(var o=0,n=e.length;o<n;o++){var r=e[o];if(!t)for(var d=0,a=r.childNodes.length;d<a;d++)t=t||m([r.childNodes[d]])}return t}(e):null)}},initOptionalProperties:function(n,r,d){d=d||{},M.forEach(n.$$isolateBindings,function(e,t){if(e.optional&&M.isUndefined(n[t])){var o=M.isDefined(r[e.attrName]);n[t]=M.isDefined(d[t])?d[t]:o}})},nextTick:function(e,t,o){var n=h.nextTick,r=n.timeout,d=n.queue||[];return d.push({scope:o,callback:e}),null==t&&(t=!0),n.digest=n.digest||t,n.queue=d,r||(n.timeout=m(function(){var e=n.queue,t=n.digest;n.queue=[],n.timeout=null,n.digest=!1,e.forEach(function(e){e.scope&&e.scope.$$destroyed||e.callback()}),t&&a.$digest()},0,!1))},processTemplate:function(e){return u?e:e&&M.isString(e)?e.replace(/\{\{/g,r).replace(/}}/g,l):e},getParentWithPointerEvents:function(e){for(var t=e.parent();p(t,"pointer-events","none");)t=t.parent();return t},getNearestContentElement:function(e){for(var t=e.parent()[0];t&&t!==n[0]&&t!==document.body&&"MD-CONTENT"!==t.nodeName.toUpperCase();)t=t.parentNode;return t},checkStickySupport:function(){var e,t=M.element("<div>");i[0].body.appendChild(t[0]);for(var o=["sticky","-webkit-sticky"],n=0;n<o.length;++n)if(t.css({position:o[n],top:0,"z-index":2}),t.css("position")==o[n]){e=o[n];break}return t.remove(),e},parseAttributeBoolean:function(e,t){return""===e||!!e&&(!1===t||"false"!==e&&"0"!==e)},hasComputedStyle:p,isParentFormSubmitted:function(e){var t=h.getClosest(e,"form"),o=t?M.element(t).controller("form"):null;return!!o&&o.$submitted},animateScrollTo:function(r,d,a){var m=r.scrollTop,i=d-m,c=m<d,l=h.now();s(function e(){var t=(o=a||1e3,n=h.now()-l,function(e,t,o,n){if(n<e)return t+o;var r=(e/=n)*e;return t+o*(r*e*-2+3*r)}(n,m,i,o));var o,n;r.scrollTop=t;(c?t<d:d<t)&&s(e)})},uniq:function(e){if(e)return e.filter(function(e,t,o){return o.indexOf(e)===t})},getInnerHTML:function(e){var t=new XMLSerializer;return Array.prototype.map.call(e.childNodes,function(e){return t.serializeToString(e)}).join("")},getOuterHTML:function(e){return(new XMLSerializer).serializeToString(e)},msie:f.document.documentMode,getTouchAction:function(){for(var e=document.createElement("div"),t=["","webkit","Moz","MS","ms","o"],o=0;o<t.length;o++){var n=t[o],r=n?n+"TouchAction":"touchAction";if(M.isDefined(e.style[r]))return r}},getEventPath:function(e){for(var t=[],o=e.target;o;)t.push(o),o=o.parentElement;return-1===t.indexOf(f)&&-1===t.indexOf(document)&&t.push(document),-1===t.indexOf(f)&&t.push(f),t},sanitize:function(e){return e?e.replace(/[\\^$*+?.()|{}[]/g,"\\$&"):e}};return h.dom.animator=e(h),h;function b(e){return e[0]||e}}function l(n,r,i,d){var a=this.showWarnings;return{expect:m,expectAsync:c,expectWithText:function(e,t){var o=l(e)||"";-1<o.indexOf(d.startSymbol())?c(e,t,function(){return l(e)}):m(e,t,o)},expectWithoutText:function(e,t){var o=l(e);-1<o.indexOf(d.startSymbol())||o||m(e,t,o)},getText:l,hasAriaLabel:s,parentHasAriaLabel:function e(t,o){o=o||1;var n=M.element(t)[0]||t;if(!n.parentNode)return!1;if(r(n.parentNode))return!0;o--;if(o)return e(n.parentNode,o);return!1;function r(e){if(!s(e))return!1;if(e.hasAttribute("role"))switch(e.getAttribute("role").toLowerCase()){case"command":case"definition":case"directory":case"grid":case"list":case"listitem":case"log":case"marquee":case"menu":case"menubar":case"note":case"presentation":case"separator":case"scrollbar":case"status":case"tablist":return!1}switch(e.tagName.toLowerCase()){case"abbr":case"acronym":case"address":case"applet":case"audio":case"b":case"bdi":case"bdo":case"big":case"blockquote":case"br":case"canvas":case"caption":case"center":case"cite":case"code":case"col":case"data":case"dd":case"del":case"dfn":case"dir":case"div":case"dl":case"em":case"embed":case"fieldset":case"figcaption":case"font":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":case"hgroup":case"html":case"i":case"ins":case"isindex":case"kbd":case"keygen":case"label":case"legend":case"li":case"map":case"mark":case"menu":case"object":case"ol":case"output":case"pre":case"presentation":case"q":case"rt":case"ruby":case"samp":case"small":case"source":case"span":case"status":case"strike":case"strong":case"sub":case"sup":case"svg":case"tbody":case"td":case"th":case"thead":case"time":case"tr":case"track":case"tt":case"ul":case"var":return!1}return!0}}};function m(e,t,o){var n=M.element(e)[0]||e;!n||n.hasAttribute(t)&&0!==n.getAttribute(t).length||function(e,t){var o=e.hasChildNodes(),n=!1;if(o)for(var r=e.childNodes,d=0;d<r.length;d++){var a=r[d];1===a.nodeType&&a.hasAttribute(t)&&"none"!==((m=a).currentStyle?m.currentStyle:i.getComputedStyle(m)).display&&(n=!0)}var m;return n}(n,t)||((o=M.isString(o)?o.trim():"").length?e.attr(t,o):a&&r.warn('ARIA: Attribute "',t,'", required for accessibility, is missing on node:',n))}function c(e,t,o){n(function(){m(e,t,o())})}function l(t){t=t[0]||t;for(var e,o=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null),n="";e=o.nextNode();)r(e)||(n+=e.textContent);return n.trim()||"";function r(e){for(;e.parentNode&&(e=e.parentNode)!==t;)if(e.getAttribute&&"true"===e.getAttribute("aria-hidden"))return!0}}function s(e){var t=M.element(e)[0]||e;return!!t.hasAttribute&&(t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")||t.hasAttribute("aria-describedby"))}}function s(){function d(e,t,o,n,r){this.$q=e,this.$templateRequest=t,this.$injector=o,this.$compile=n,this.$controller=r}this.$get=["$q","$templateRequest","$injector","$compile","$controller",function(e,t,o,n,r){return new d(e,t,o,n,r)}],d.prototype.compile=function(e){return e.contentElement?this._prepareContentElement(e):this._compileTemplate(e)},d.prototype._prepareContentElement=function(e){var t=this._fetchContentElement(e);return this.$q.resolve({element:t.element,cleanup:t.restore,locals:{},link:function(){return t.element}})},d.prototype._compileTemplate=function(n){var r=this,e=n.templateUrl,t=n.template||"",o=M.extend({},n.resolve),d=M.extend({},n.locals),a=n.transformTemplate||M.identity;return M.forEach(o,function(e,t){M.isString(e)?o[t]=r.$injector.get(e):o[t]=r.$injector.invoke(e)}),M.extend(o,d),o.$$ngTemplate=e?this.$templateRequest(e):this.$q.when(t),this.$q.all(o).then(function(e){var t=a(e.$$ngTemplate,n),o=n.element||M.element("<div>").html(t.trim()).contents();return r._compileElement(e,o,n)})},d.prototype._compileElement=function(n,r,d){var a=this,m=this.$compile(r),i={element:r,cleanup:r.remove.bind(r),locals:n,link:function(e){if(n.$scope=e,d.controller){var t=M.extend({},n,{$element:r}),o=a._createController(d,t,n);M.isFunction(o.$onDestroy)&&e.$on("$destroy",function(){M.isFunction(o.$onDestroy)&&o.$onDestroy()}),r.data("$ngControllerController",o),r.children().data("$ngControllerController",o),i.controller=o}return m(e)}};return i},d.prototype._createController=function(e,t,o){var n=this.$controller(e.controller,t);return e.bindToController&&M.extend(n,o),e.controllerAs&&(t.$scope[e.controllerAs]=n),M.isFunction(n.$onInit)&&n.$onInit(),n},d.prototype._fetchContentElement=function(e){var t,o=e.contentElement;return t=M.isString(o)?n(o=document.querySelector(o)):(o=o[0]||o,document.contains(o)?n(o):function(){o.parentNode&&o.parentNode.removeChild(o)}),{element:M.element(o),restore:t};function n(e){var t=e.parentNode,o=e.nextElementSibling;return function(){o?t.insertBefore(e,o):t.appendChild(e)}}}}M.module("material.core").factory("$mdUtil",c),M.element.prototype.focus=M.element.prototype.focus||function(){return this.length&&this[0].focus(),this},M.element.prototype.blur=M.element.prototype.blur||function(){return this.length&&this[0].blur(),this},l.$inject=["$$rAF","$log","$window","$interpolate"],M.module("material.core").provider("$mdAria",function(){var r={showWarnings:!0};return{disableWarnings:function(){r.showWarnings=!1},$get:["$$rAF","$log","$window","$interpolate",function(e,t,o,n){return l.apply(r,arguments)}]}}),M.module("material.core").provider("$mdCompiler",s),s.$inject=["$compileProvider"],Y.$inject=["$$MdGestureHandler","$$rAF","$timeout","$mdUtil"];var u,p,E,h,b,v,_,N,k,y,H,w,$,x,S,D,R,I,O={},P=6,j=!(q.$inject=["$mdGesture","$$MdGestureHandler","$mdUtil"]),L=!1,U=null,F=!1;function z(){}function Y(n,e,o,t){var r=t.getTouchAction(),d=void 0!==f.jQuery&&M.element===f.jQuery,a={handler:function(e,t){var o=new n(e);return M.extend(o,t),O[e]=o,a},register:function(e,t,o){var n=O[t.replace(/^\$md./,"")];if(n)return n.registerElement(e,o);throw new Error("Failed to register element with handler "+t+". Available handlers: "+Object.keys(O).join(", "))},isAndroid:t.isAndroid,isIos:t.isIos,isHijackingClicks:(t.isIos||t.isAndroid)&&!d&&!j};function m(o){return function(e,t){t.distance<this.state.options.maxDistance&&this.dispatchEvent(e,o,t)}}return a.isHijackingClicks&&(a.handler("click",{options:{maxDistance:P},onEnd:m("click")}),a.handler("focus",{options:{maxDistance:P},onEnd:function(e,t){t.distance<this.state.options.maxDistance&&Z(e.target)&&(this.dispatchEvent(e,"focus",t),e.target.focus())}}),a.handler("mouseup",{options:{maxDistance:P},onEnd:m("mouseup")}),a.handler("mousedown",{onStart:function(e){this.dispatchEvent(e,"mousedown")}})),a.handler("press",{onStart:function(e,t){this.dispatchEvent(e,"$md.pressdown")},onEnd:function(e,t){this.dispatchEvent(e,"$md.pressup")}}).handler("hold",{options:{maxDistance:6,delay:500},onCancel:function(){o.cancel(this.state.timeout)},onStart:function(e,t){if(!this.state.registeredParent)return this.cancel();this.state.pos={x:t.x,y:t.y},this.state.timeout=o(M.bind(this,function(){this.dispatchEvent(e,"$md.hold"),this.cancel()}),this.state.options.delay,!1)},onMove:function(e,t){r||"touchmove"!==e.type||e.preventDefault();var o=this.state.pos.x-t.x,n=this.state.pos.y-t.y;Math.sqrt(o*o+n*n)>this.options.maxDistance&&this.cancel()},onEnd:function(){this.onCancel()}}).handler("drag",{options:{minDistance:6,horizontal:!0,cancelMultiplier:1.5},onSetup:function(e,t){r&&(this.oldTouchAction=e[0].style[r],e[0].style[r]=t.horizontal?"pan-y":"pan-x")},onCleanup:function(e){this.oldTouchAction?e[0].style[r]=this.oldTouchAction:e[0].style[r]=null},onStart:function(e){this.state.registeredParent||this.cancel()},onMove:function(e,t){var o,n;r||"touchmove"!==e.type||e.preventDefault(),this.state.dragPointer?this.dispatchDragMove(e):(n=this.state.options.horizontal?(o=Math.abs(t.distanceX)>this.state.options.minDistance,Math.abs(t.distanceY)>this.state.options.minDistance*this.state.options.cancelMultiplier):(o=Math.abs(t.distanceY)>this.state.options.minDistance,Math.abs(t.distanceX)>this.state.options.minDistance*this.state.options.cancelMultiplier),o?(this.state.dragPointer=W(e),G(e,this.state.dragPointer),this.dispatchEvent(e,"$md.dragstart",this.state.dragPointer)):n&&this.cancel())},dispatchDragMove:e.throttle(function(e){this.state.isRunning&&(G(e,this.state.dragPointer),this.dispatchEvent(e,"$md.drag",this.state.dragPointer))}),onEnd:function(e,t){this.state.dragPointer&&(G(e,this.state.dragPointer),this.dispatchEvent(e,"$md.dragend",this.state.dragPointer))}}).handler("swipe",{options:{minVelocity:.65,minDistance:10},onEnd:function(e,t){var o;Math.abs(t.velocityX)>this.state.options.minVelocity&&Math.abs(t.distanceX)>this.state.options.minDistance?(o="left"==t.directionX?"$md.swipeleft":"$md.swiperight",this.dispatchEvent(e,o)):Math.abs(t.velocityY)>this.state.options.minVelocity&&Math.abs(t.distanceY)>this.state.options.minDistance&&(o="up"==t.directionY?"$md.swipeup":"$md.swipedown",this.dispatchEvent(e,o))}})}function X(e){this.name=e,this.state={}}function q(e,r,o){if(!L){!F&&e.isHijackingClicks&&(document.addEventListener("click",function(e){var t;t=o.isIos?M.isDefined(e.webkitForce)&&0===e.webkitForce:0===e.clientX&&0===e.clientY;t||e.$material||e.isIonicTap||K(e)?(U=null,"label"===e.target.tagName.toLowerCase()&&(U={x:e.x,y:e.y})):(e.preventDefault(),e.stopPropagation(),U=null)},!0),document.addEventListener("mouseup",t,!0),document.addEventListener("mousedown",t,!0),document.addEventListener("focus",t,!0),F=!0);M.element(document).on("mousedown touchstart pointerdown",function(e){if(u)return;var t=+Date.now();if(p&&!B(e,p)&&t-p.endTime<1500)return;u=W(e),n("start",e)}).on("mousemove touchmove pointermove",function(e){if(!u||!B(e,u))return;G(e,u),n("move",e)}).on("mouseup mouseleave touchend touchcancel pointerup pointercancel",function(e){if(!u||!B(e,u))return;G(e,u),u.endTime=+Date.now(),"pointercancel"!==e.type&&n("end",e);p=u,u=null}).on("$$mdGestureReset",function(){p=u=null})}function t(e){!e.clientX&&!e.clientY||e.$material||e.isIonicTap||K(e)||"mousedown"===e.type&&(Z(e.target)||Z(document.activeElement))||(e.preventDefault(),e.stopPropagation())}function n(e,t){var o;for(var n in O)(o=O[n])instanceof r&&("start"===e&&o.cancel(),o[e](t,u))}}function W(e){var t=V(e),o={startTime:+Date.now(),target:e.target,type:e.type.charAt(0)};return o.startX=o.x=t.pageX,o.startY=o.y=t.pageY,o}function B(e,t){return e&&t&&e.type.charAt(0)===t.type}function K(e){return U&&U.x===e.x&&U.y===e.y}function G(e,t){var o=V(e),n=t.x=o.pageX,r=t.y=o.pageY;t.distanceX=n-t.startX,t.distanceY=r-t.startY,t.distance=Math.sqrt(t.distanceX*t.distanceX+t.distanceY*t.distanceY),t.directionX=0<t.distanceX?"right":t.distanceX<0?"left":"",t.directionY=0<t.distanceY?"down":t.distanceY<0?"up":"",t.duration=+Date.now()-t.startTime,t.velocityX=t.distanceX/t.duration,t.velocityY=t.distanceY/t.duration}function V(e){return(e=e.originalEvent||e).touches&&e.touches[0]||e.changedTouches&&e.changedTouches[0]||e}function Z(e){return!!e&&"-1"!==e.getAttribute("tabindex")&&!e.hasAttribute("disabled")&&(e.hasAttribute("tabindex")||e.hasAttribute("href")||e.isContentEditable||-1!==["INPUT","SELECT","BUTTON","TEXTAREA","VIDEO","AUDIO"].indexOf(e.nodeName))}function Q(e,t,o){this.$timeout=e,this.$mdUtil=t,this.$rootScope=o,this.pointerEvent="MSPointerEvent"in f?"MSPointerDown":"PointerEvent"in f?"pointerdown":null,this.bodyElement=M.element(document.body),this.isBuffering=!1,this.bufferTimeout=null,this.lastInteractionType=null,this.lastInteractionTime=null,this.inputHandler=this.onInputEvent.bind(this),this.bufferedInputHandler=this.onBufferInputEvent.bind(this),this.inputEventMap={keydown:"keyboard",mousedown:"mouse",mouseenter:"mouse",touchstart:"touch",pointerdown:"pointer",MSPointerDown:"pointer"},this.iePointerMap={2:"touch",3:"touch",4:"mouse"},this.initializeEvents(),this.$rootScope.$on("$destroy",this.deregister.bind(this))}function J(e){return e.replace(N,"").replace(k,function(e,t,o,n){return n?o.toUpperCase():o})}function ee(){var e=!!document.querySelector("[md-layouts-disabled]");I.enabled=!e}function te(){return I.enabled=!1,{restrict:"A",priority:"900"}}function oe(n){return["$mdUtil","$interpolate","$log",function(e,t,o){return E=e,h=t,b=o,{restrict:"A",compile:function(e,t){var o;return I.enabled&&(re(n,me(n,t,""),de(e,n,t)),r(null,e),o=r),o||M.noop}}}];function r(e,t){t.addClass(n)}}function ne(e,t,o,n){var r,d=o[0].nodeName.toLowerCase();switch(e.replace(w,"")){case"flex":"md-button"!==d&&"fieldset"!==d||(r="<"+d+" "+e+"></"+d+">","https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers","Markup '{0}' may not work as expected in IE Browsers. Consult '{1}' for details.",n.warn(E.supplant("Markup '{0}' may not work as expected in IE Browsers. Consult '{1}' for details.",[r,"https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers"])))}}function re(e,t,o){var n=t;if(!ae(t)){switch(e.replace(w,"")){case"layout":ie(t,S)||(t=S[0]);break;case"flex":ie(t,x)||isNaN(t)&&(t="");break;case"flex-offset":case"flex-order":t&&!isNaN(+t)||(t="0");break;case"layout-align":var r=function(e){var t,o={main:"start",cross:"stretch"};0!==(e=e||"").indexOf("-")&&0!==e.indexOf(" ")||(e="none"+e);(t=e.toLowerCase().trim().replace($,"-").split("-")).length&&"space"===t[0]&&(t=[t[0]+"-"+t[1],t[2]]);0<t.length&&(o.main=t[0]||o.main);1<t.length&&(o.cross=t[1]||o.cross);D.indexOf(o.main)<0&&(o.main="start");R.indexOf(o.cross)<0&&(o.cross="stretch");return o}(t);t=E.supplant("{main}-{cross}",r);break;case"layout-padding":case"layout-margin":case"layout-fill":case"layout-wrap":case"layout-nowrap":t=""}t!==n&&(o||M.noop)(t)}return t?t.trim():""}function de(e,t,o){return function(e){ae(e)||(o[o.$normalize(t)]=e)}}function ae(e){return-1<(e||"").indexOf(h.startSymbol())}function me(e,t,o){var n=t.$normalize(e);return t[n]?t[n].trim().replace($,"-"):o||null}function ie(t,e,o){t=o&&t?t.replace($,o):t;var n=!1;return t&&e.forEach(function(e){e=o?e.replace($,o):e,n=n||e===t}),n}function ce(e){this._$timeout=e,this._liveElement=this._createLiveElement(),this._announceTimeout=100}function le(o,n){var r,d=[],a={};return r={notFoundError:function(e,t){o.error((t||"")+"No instance found for handle",e)},getInstances:function(){return d},get:function(e){if(!m(e))return null;var t,o,n;for(t=0,o=d.length;t<o;t++)if((n=d[t]).$$mdHandle===e)return n;return null},register:function(t,e){return e?(t.$$mdHandle=e,d.push(t),(o=a[e])&&(o.forEach(function(e){e.resolve(t)}),delete a[e]),function(){var e=d.indexOf(t);-1!==e&&d.splice(e,1)}):M.noop;var o},when:function(e){if(m(e)){var t=n.defer(),o=r.get(e);return o?t.resolve(o):(a[e]===C&&(a[e]=[]),a[e].push(t)),t.promise}return n.reject("Invalid `md-component-id` value.")}};function m(e){return e&&""!==e}}function se(n){return{attach:function(e,t,o){return o=M.extend(function(e){return e.hasClass("md-icon-button")?{isMenuItem:e.hasClass("md-menu-item"),fitRipple:!0,center:!0}:{isMenuItem:e.hasClass("md-menu-item"),dimBackground:!0}}(t),o),n.attach(e,t,o)}}}function ue(n){return{attach:function(e,t,o){return n.attach(e,t,M.extend({center:!0,dimBackground:!1,fitRipple:!0},o))}}}function pe(n){return{attach:function(e,t,o){return n.attach(e,t,M.extend({center:!1,dimBackground:!0,outline:!1,rippleSize:"full"},o))}}}M.module("material.core.gestures",[]).provider("$mdGesture",z).factory("$$MdGestureHandler",function(){var e=void 0!==f.jQuery&&M.element===f.jQuery;return X.prototype={options:{},dispatchEvent:e?function(e,t,o){o=o||u;var n=new M.element.Event(t);n.$material=!0,n.pointer=o,n.srcEvent=e,M.extend(n,{clientX:o.x,clientY:o.y,screenX:o.x,screenY:o.y,pageX:o.x,pageY:o.y,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey}),M.element(o.target).trigger(n)}:function(e,t,o){var n;o=o||u,"click"===t||"mouseup"===t||"mousedown"===t?"function"==typeof f.MouseEvent?n=new MouseEvent(t,{bubbles:!0,cancelable:!0,screenX:Number(e.screenX),screenY:Number(e.screenY),clientX:Number(o.x),clientY:Number(o.y),ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,button:e.button,buttons:e.buttons,relatedTarget:e.relatedTarget||null}):(n=document.createEvent("MouseEvents")).initMouseEvent(t,!0,!0,f,e.detail,o.x,o.y,o.x,o.y,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget||null):"function"==typeof f.CustomEvent?n=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:{}}):(n=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,{});n.$material=!0,n.pointer=o,n.srcEvent=e,o.target.dispatchEvent(n)},onSetup:M.noop,onCleanup:M.noop,onStart:M.noop,onMove:M.noop,onEnd:M.noop,onCancel:M.noop,start:function(e,t){if(!this.state.isRunning){var o=this.getNearestParent(e.target),n=o&&o.$mdGesture[this.name]||{};this.state={isRunning:!0,options:M.extend({},this.options,n),registeredParent:o},this.onStart(e,t)}},move:function(e,t){this.state.isRunning&&this.onMove(e,t)},end:function(e,t){this.state.isRunning&&(this.state.isRunning=!1,this.onEnd(e,t))},cancel:function(e,t){this.onCancel(e,t),this.state={}},getNearestParent:function(e){for(var t=e;t;){if((t.$mdGesture||{})[this.name])return t;t=t.parentNode}return null},registerElement:function(e,t){var o=this;return e[0].$mdGesture=e[0].$mdGesture||{},e[0].$mdGesture[this.name]=t||{},e.on("$destroy",n),o.onSetup(e,t||{}),n;function n(){delete e[0].$mdGesture[o.name],e.off("$destroy",n),o.onCleanup(e,t||{})}}},X}).run(q),z.prototype={disableAll:function(){L=!0},skipClickHijack:function(){return j=!0},setMaxClickDistance:function(e){P=parseInt(e)},$get:["$$MdGestureHandler","$$rAF","$timeout","$mdUtil",function(e,t,o,n){return new Y(e,t,o,n)}]},Q.$inject=["$timeout","$mdUtil","$rootScope"],M.module("material.core.interaction",[]).service("$mdInteraction",Q),Q.prototype.deregister=function(){this.bodyElement.off("keydown mousedown",this.inputHandler),"ontouchstart"in document.documentElement&&this.bodyElement.off("touchstart",this.bufferedInputHandler),this.pointerEvent&&this.bodyElement.off(this.pointerEvent,this.inputHandler)},Q.prototype.initializeEvents=function(){this.bodyElement.on("keydown mousedown",this.inputHandler),"ontouchstart"in document.documentElement&&this.bodyElement.on("touchstart",this.bufferedInputHandler),this.pointerEvent&&this.bodyElement.on(this.pointerEvent,this.inputHandler)},Q.prototype.onInputEvent=function(e){if(!this.isBuffering){var t=this.inputEventMap[e.type];"pointer"===t&&(t=this.iePointerMap[e.pointerType]||e.pointerType),this.lastInteractionType=t,this.lastInteractionTime=this.$mdUtil.now()}},Q.prototype.onBufferInputEvent=function(e){this.$timeout.cancel(this.bufferTimeout),this.onInputEvent(e),this.isBuffering=!0,this.bufferTimeout=this.$timeout(function(){this.isBuffering=!1}.bind(this),650,!1)},Q.prototype.getLastInteractionType=function(){return this.lastInteractionType},Q.prototype.isUserInvoked=function(e){var t=M.isNumber(e)?e:15;return this.lastInteractionTime>=this.$mdUtil.now()-t},M.module("material.core").provider("$$interimElement",function(){return t.$inject=["$document","$q","$rootScope","$timeout","$rootElement","$animate","$mdUtil","$mdCompiler","$mdTheming","$injector","$exceptionHandler"],e.$get=t,e;function e(r){e.$inject=["$$interimElement","$injector"];var o=["onHide","onShow","onRemove"],d={},c={presets:{}},n={setDefaults:function(e){return c.optionsFactory=e.options,c.methods=(e.methods||[]).concat(o),n},addPreset:function(e,t){if((t=t||{}).methods=t.methods||[],t.options=t.options||function(){return{}},/^cancel|hide|show$/.test(e))throw new Error("Preset '"+e+"' in "+r+" is reserved!");if(-1<t.methods.indexOf("_options"))throw new Error("Method '_options' in "+r+" is reserved!");return c.presets[e]={methods:t.methods.concat(o),optionsFactory:t.options,argOption:t.argOption},n},addMethod:function(e,t){return d[e]=t,n},$get:e};return n.addPreset("build",{methods:["controller","controllerAs","resolve","multiple","template","templateUrl","themable","transformTemplate","parent","contentElement"]}),n;function e(e,n){var a,t,o=e(),m={hide:o.hide,cancel:o.cancel,show:function(e){(e=e||{})._options&&(e=e._options);return o.show(M.extend({},t,e))},destroy:function(e){return o.destroy(e)}};return a=c.methods||[],t=i(c.optionsFactory,{}),M.forEach(d,function(e,t){m[t]=e}),M.forEach(c.presets,function(t,o){var n=i(t.optionsFactory,{}),e=(t.methods||[]).concat(a);function r(e){this._options=M.extend({},n,e)}if(M.extend(n,{$type:o}),M.forEach(e,function(t){r.prototype[t]=function(e){return this._options[t]=e,this}}),t.argOption){var d="show"+o.charAt(0).toUpperCase()+o.slice(1);m[d]=function(e){var t=m[o](e);return m.show(t)}}m[o]=function(e){return arguments.length&&t.argOption&&!M.isObject(e)&&!M.isArray(e)?(new r)[t.argOption](e):new r(e)}}),m;function i(e,t){var o={};return o[r]=m,n.invoke(e||function(){return t},{},o)}}}function t(s,u,t,p,E,n,o,h,b,i,c){return function(){var l,r=[],d=[],a=[];return l={show:function(e){var t=new m((e=e||{})||{}),o=e.multiple?u.resolve():u.all(r);e.multiple||(o=o.then(function(){var e=d.concat(a.map(l.cancel));return u.all(e)}));var n=o.then(function(){return t.show().then(function(){a.push(t)}).catch(function(e){return e}).finally(function(){r.splice(r.indexOf(n),1)})});return r.push(n),t.deferred.promise.catch(function(e){return e instanceof Error&&c(e),e}),t.deferred.promise},hide:e(function(o,n){{if((n=n||{}).closeAll)return u.all(a.slice().reverse().map(e));if(n.closeTo!==C)return u.all(a.slice(n.closeTo).map(e))}return e(a[a.length-1]);function e(e){if(!e)return u.when(o);var t=e.remove(o,!1,n||{}).catch(function(e){return e}).finally(function(){d.splice(d.indexOf(t),1)});return a.splice(a.indexOf(e),1),d.push(t),e.deferred.promise}}),cancel:e(function(e,t){var o=a.pop();if(!o)return u.when(e);var n=o.remove(e,!0,t||{}).catch(function(e){return e}).finally(function(){d.splice(d.indexOf(n),1)});return d.push(n),o.deferred.promise.catch(M.noop)}),destroy:function(e){var t=e?null:a.shift(),o=M.element(e).length&&M.element(e)[0].parentNode;if(o){var n=a.filter(function(e){return e.options.element[0]===o});n.length&&(t=n[0],a.splice(a.indexOf(t),1))}return t?t.remove(!1,!1,{$destroy:!0}):u.when(!1)},$injector_:i};function e(t){return function(){var e=arguments;return a.length?t.apply(l,e):r.length?r[0].finally(function(){return t.apply(l,e)}):u.when("No interim elements currently showing up.")}}function m(d){var a,m,i=u.when(!0);return d=function(e){(e=e||{}).template&&(e.template=o.processTemplate(e.template));return M.extend({preserveScope:!1,cancelAutoHide:M.noop,scope:e.scope||t.$new(e.isolateScope),onShow:function(e,t,o){return n.enter(t,o.parent)},onRemove:function(e,t){return t&&n.leave(t)||u.when()}},e)}(d),a={options:d,deferred:u.defer(),show:function(){return u(function(t,o){function n(e){a.deferred.reject(e),o(e)}d.onCompiling&&d.onCompiling(d),function(t){return(t.skipCompile?null:h.compile(t))||u(function(e){e({locals:{},link:function(){return t.element}})})}(d).then(function(e){m=function(e,t){M.extend(e.locals,t);var o=e.link(t.scope);t.element=o,t.parent=function(e,t){var o,n=t.parent;n=M.isFunction(n)?n(t.scope,e,t):M.isString(n)?M.element(s[0].querySelector(n)):M.element(n);if((n||{}).length)return n;E[0]&&E[0].querySelector&&(o=E[0].querySelector(":not(svg) > body"));o=o||E[0];"#comment"===o.nodeName&&(o=s[0].body);return M.element(o)}(o,t),t.themable&&b(o);return o}(e,d),d.cleanupElement=e.cleanup,i=function(o,n,e){var t=n.onShowing||M.noop,r=n.onComplete||M.noop;try{t(n.scope,o,n,e)}catch(e){return u.reject(e)}return u(function(e,t){try{u.when(n.onShow(n.scope,o,n)).then(function(){r(n.scope,o,n),function(){var e,t=M.noop;d.hideDelay&&(e=p(l.hide,d.hideDelay),t=function(){p.cancel(e)});d.cancelAutoHide=function(){t(),d.cancelAutoHide=C}}(),e(o)},t)}catch(e){t(e.message)}})}(m,d,e.controller).then(t,n)}).catch(n)})},remove:function(e,t,o){if(!m)return u.when(!1);return(d=M.extend(d||{},o||{})).cancelAutoHide&&d.cancelAutoHide(),d.element.triggerHandler("$mdInterimElementRemove"),!0===d.$destroy?c(d.element,d).then(function(){t&&r(e)||n(e)}):(u.when(i).finally(function(){c(d.element,d).then(function(){t?r(e):n(e)},r)}),a.deferred.promise);function n(e){a.deferred.resolve(e)}function r(e){a.deferred.reject(e)}}};function c(n,r){var d=r.onRemoving||M.noop;return u(function(e,t){try{var o=u.when(r.onRemove(r.scope,n,r)||!0);d(n,o),r.$destroy?(e(n),!r.preserveScope&&r.scope&&o.then(function(){r.scope.$destroy()})):o.then(function(){!r.preserveScope&&r.scope&&r.scope.$destroy(),e(n)},t)}catch(e){t(e.message)}})}}}}}),w=/(-gt)?-(sm|md|lg|print)/g,$=/\s+/g,x=["grow","initial","auto","none","noshrink","nogrow"],S=["row","column"],D=["","start","center","end","stretch","space-around","space-between"],R=["","start","center","end","stretch"],I={enabled:!0,breakpoints:[]},_=M.module("material.core.layout",["ng"]),N=/^((?:x|data)[:\-_])/i,k=/([:\-_]+(.))/g,y=["layout","flex","flex-order","flex-offset","layout-align"],H=["show","hide","layout-padding","layout-margin"],M.forEach(["","xs","gt-xs","sm","gt-sm","md","gt-md","lg","gt-lg","xl","print"],function(o){M.forEach(y,function(e){var t=o?e+"-"+o:e;_.directive(J(t),function(d){return["$mdUtil","$interpolate","$log",function(e,t,o){return E=e,h=t,b=o,{restrict:"A",compile:function(e,t){var o;return I.enabled&&(ne(d,0,e,b),re(d,me(d,t,""),de(0,d,t)),o=n),o||M.noop}}}];function n(e,t,o){var n=function(o,n){var r;return function(e){var t=re(n,e||"");M.isDefined(t)&&(r&&o.removeClass(r),r=t?n+"-"+t.trim().replace($,"-"):n,o.addClass(r))}}(t,d),r=o.$observe(o.$normalize(d),n);n(me(d,o,"")),e.$on("$destroy",function(){r()})}}(t))}),M.forEach(H,function(e){var t=o?e+"-"+o:e;_.directive(J(t),oe(t))})}),_.provider("$$mdLayout",function(){return{$get:M.noop,validateAttributeValue:re,validateAttributeUsage:ne,disableLayouts:function(e){I.enabled=!0!==e}}}).directive("mdLayoutCss",te).directive("ngCloak",(v="ng-cloak",["$timeout",function(o){return{restrict:"A",priority:-10,compile:function(e){return I.enabled?(e.addClass(v),function(e,t){o(function(){t.removeClass(v)},10,!1)}):M.noop}}}])).directive("layoutWrap",oe("layout-wrap")).directive("layoutNowrap",oe("layout-nowrap")).directive("layoutNoWrap",oe("layout-no-wrap")).directive("layoutFill",oe("layout-fill")).config(ee),ce.$inject=["$timeout"],M.module("material.core").service("$mdLiveAnnouncer",ce),ce.prototype.announce=function(e,t){t=t||"polite";var o=this;o._liveElement.textContent="",o._liveElement.setAttribute("aria-live",t),o._$timeout(function(){o._liveElement.textContent=e},o._announceTimeout,!1)},ce.prototype._createLiveElement=function(){var e=document.createElement("div");return e.classList.add("md-visually-hidden"),e.setAttribute("role","status"),e.setAttribute("aria-atomic","true"),e.setAttribute("aria-live","polite"),document.body.appendChild(e),e},M.module("material.core.meta",[]).provider("$$mdMeta",function(){var n=M.element(document.head),r={};function d(e){if(r[e])return!0;var t=document.getElementsByName(e)[0];return!!t&&(r[e]=M.element(t),!0)}var e={setMeta:function(e,t){if(d(e),r[e])r[e].attr("content",t);else{var o=M.element('<meta name="'+e+'" content="'+t+'"/>');n.append(o),r[e]=o}return function(){r[e].attr("content",""),r[e].remove(),delete r[e]}},getMeta:function(e){if(!d(e))throw Error("$$mdMeta: could not find a meta tag with the name '"+e+"'");return r[e].attr("content")}};return M.extend({},e,{$get:function(){return e}})}),le.$inject=["$log","$q"],M.module("material.core").factory("$mdComponentRegistry",le),se.$inject=["$mdInkRipple"],M.module("material.core").factory("$mdButtonInkRipple",se),ue.$inject=["$mdInkRipple"],M.module("material.core").factory("$mdCheckboxInkRipple",ue),pe.$inject=["$mdInkRipple"],M.module("material.core").factory("$mdListInkRipple",pe),Te.$inject=["$scope","$element","rippleOptions","$window","$timeout","$mdUtil","$mdColorUtil"],Ae.$inject=["$mdButtonInkRipple","$mdCheckboxInkRipple"],M.module("material.core").provider("$mdInkRipple",function(){var r=!1;return{disableInkRipple:function(){r=!0},$get:["$injector",function(n){return{attach:function(e,t,o){return r||t.controller("mdNoInk")?M.noop:n.instantiate(Te,{$scope:e,$element:t,rippleOptions:o})}}}]}}).directive("mdInkRipple",Ae).directive("mdNoInk",_e).directive("mdNoBar",_e).directive("mdNoStretch",_e);var Ee,he,be,fe,Me,ge;function Ae(n,r){return{controller:M.noop,link:function(e,t,o){o.hasOwnProperty("mdInkRippleCheckbox")?r.attach(e,t):n.attach(e,t)}}}function Te(e,t,o,n,r,d,a){this.$window=n,this.$timeout=r,this.$mdUtil=d,this.$mdColorUtil=a,this.$scope=e,this.$element=t,this.options=o,this.mousedown=!1,this.ripples=[],this.timeout=null,this.lastRipple=null,d.valueOnUse(this,"container",this.createContainer),this.$element.addClass("md-ink-ripple"),(t.controller("mdInkRipple")||{}).createRipple=M.bind(this,this.createRipple),(t.controller("mdInkRipple")||{}).setColor=M.bind(this,this.color),this.bindEvents()}function ve(e,t){(e.mousedown||e.lastRipple)&&(e.mousedown=!1,e.$mdUtil.nextTick(M.bind(e,t),!1))}function _e(){return{controller:M.noop}}function Ne(n){return{attach:function(e,t,o){return n.attach(e,t,M.extend({center:!1,dimBackground:!0,outline:!1,rippleSize:"full"},o))}}}function ke(e){return e.replace(/-[a-z]/g,function(e){return e.charAt(1).toUpperCase()})}Te.prototype.color=function(e){var t,o,n=this;return M.isDefined(e)&&(n._color=n._parseColor(e)),n._color||n._parseColor(n.inkRipple())||n._parseColor((t=n.options&&n.options.colorElement?n.options.colorElement:[],(o=t.length?t[0]:n.$element[0])?n.$window.getComputedStyle(o).color:"rgb(0,0,0)"))},Te.prototype.calculateColor=function(){return this.color()},Te.prototype._parseColor=function(e,t){t=t||1;var o=this.$mdColorUtil;if(e)return 0===e.indexOf("rgba")?e.replace(/\d?\.?\d*\s*\)\s*$/,(.1*t).toString()+")"):0===e.indexOf("rgb")?o.rgbToRgba(e):0===e.indexOf("#")?o.hexToRgba(e):void 0},Te.prototype.bindEvents=function(){this.$element.on("mousedown",M.bind(this,this.handleMousedown)),this.$element.on("mouseup touchend",M.bind(this,this.handleMouseup)),this.$element.on("mouseleave",M.bind(this,this.handleMouseup)),this.$element.on("touchmove",M.bind(this,this.handleTouchmove))},Te.prototype.handleMousedown=function(e){if(!this.mousedown)if(e.hasOwnProperty("originalEvent")&&(e=e.originalEvent),this.mousedown=!0,this.options.center)this.createRipple(this.container.prop("clientWidth")/2,this.container.prop("clientWidth")/2);else if(e.srcElement!==this.$element[0]){var t=this.$element[0].getBoundingClientRect(),o=e.clientX-t.left,n=e.clientY-t.top;this.createRipple(o,n)}else this.createRipple(e.offsetX,e.offsetY)},Te.prototype.handleMouseup=function(){this.$timeout(function(){ve(this,this.clearRipples)}.bind(this))},Te.prototype.handleTouchmove=function(){ve(this,this.deleteRipples)},Te.prototype.deleteRipples=function(){for(var e=0;e<this.ripples.length;e++)this.ripples[e].remove()},Te.prototype.clearRipples=function(){for(var e=0;e<this.ripples.length;e++)this.fadeInComplete(this.ripples[e])},Te.prototype.createContainer=function(){var e=M.element('<div class="md-ripple-container"></div>');return this.$element.append(e),e},Te.prototype.clearTimeout=function(){this.timeout&&(this.$timeout.cancel(this.timeout),this.timeout=null)},Te.prototype.isRippleAllowed=function(){var e=this.$element[0];do{if(!e.tagName||"BODY"===e.tagName)break;if(e&&M.isFunction(e.hasAttribute)){if(e.hasAttribute("disabled"))return!1;if("false"===this.inkRipple()||"0"===this.inkRipple())return!1}}while(e=e.parentNode);return!0},Te.prototype.inkRipple=function(){return this.$element.attr("md-ink-ripple")},Te.prototype.createRipple=function(e,t){if(this.isRippleAllowed()){var o,n,r,d=this,a=d.$mdColorUtil,m=M.element('<div class="md-ripple"></div>'),i=this.$element.prop("clientWidth"),c=this.$element.prop("clientHeight"),l=2*Math.max(Math.abs(i-e),e),s=2*Math.max(Math.abs(c-t),t),u=(o=this.options.fitRipple,n=l,r=s,o?Math.max(n,r):Math.sqrt(Math.pow(n,2)+Math.pow(r,2))),p=this.calculateColor();m.css({left:e+"px",top:t+"px",background:"black",width:u+"px",height:u+"px",backgroundColor:a.rgbaToRgb(p),borderColor:a.rgbaToRgb(p)}),this.lastRipple=m,this.clearTimeout(),this.timeout=this.$timeout(function(){d.clearTimeout(),d.mousedown||d.fadeInComplete(m)},157.5,!1),this.options.dimBackground&&this.container.css({backgroundColor:p}),this.container.append(m),this.ripples.push(m),m.addClass("md-ripple-placed"),this.$mdUtil.nextTick(function(){m.addClass("md-ripple-scaled md-ripple-active"),d.$timeout(function(){d.clearRipples()},450,!1)},!1)}},Te.prototype.fadeInComplete=function(e){this.lastRipple===e&&(this.timeout||this.mousedown)||this.removeRipple(e)},Te.prototype.removeRipple=function(e){var t=this;this.ripples.indexOf(e)<0||(this.ripples.splice(this.ripples.indexOf(e),1),e.removeClass("md-ripple-active"),e.addClass("md-ripple-remove"),0===this.ripples.length&&this.container.css({backgroundColor:""}),this.$timeout(function(){t.fadeOutComplete(e)},450,!1))},Te.prototype.fadeOutComplete=function(e){e.remove(),this.lastRipple=null},Ne.$inject=["$mdInkRipple"],M.module("material.core").factory("$mdTabInkRipple",Ne),M.module("material.core.theming.palette",[]).constant("$mdColorPalette",{red:{50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828