c.nextTick(e.hide,!0);break;default:if(t.keyCode>=31&&t.keyCode<=90){vari=u.controller("mdSelectMenu").optNodeForKeyboardSearch(t);a.focusedNode=i||a.focusedNode,i&&i.focus()}}}functiond(e){vart,o=c.nodesToArray(a.optionNodes),r=o.indexOf(a.focusedNode);do-1===r?r=0:"next"===e&&r<o.length-1?r++:"prev"===e&&r>0&&r--,t=o[r],t.hasAttribute("disabled")&&(t=n);while(!t&&r<o.length-1&&r>0);t&&t.focus(),a.focusedNode=t}functionl(){d("next")}functions(){d("prev")}functionm(t){t&&"mouseup"==t.type&&t.currentTarget!=u[0]||h.isMultiple||(a.restoreFocus=!0,c.nextTick(function(){e.hide(h.ngModel.$viewValue)},!0))}if(!a.isRemoved){varu=a.selectEl,h=u.controller("mdSelectMenu")||{};returni.addClass("md-clickable"),a.backdrop&&a.backdrop.on("click",t),u.on("keydown",r),u.on("mouseup",m),function(){a.backdrop&&a.backdrop.off("click",t),u.off("keydown",r),u.off("mouseup",m),i.removeClass("md-clickable"),a.isRemoved=!0}}}returnA(),E(r,a),g(a.target),a.hideBackdrop=f(r,i,a),d(r,i,a).then(function(e){returna.alreadyOpen=!0,a.cleanupInteraction=C(),a.cleanupResizing=y(),e},a.hideBackdrop)}functiong(e,n){n=t.isUndefined(n)?"true":"false",e&&e.attr("aria-expanded",n)}functionb(e){vart=e.selectEl.controller("mdSelect");if(t){varn=e.selectEl.controller("mdSelectMenu");t.setLabelText(n.selectedLabels()),t.triggerClose()}}functionE(e,t){e[0].parentNode===t.parent[0]&&t.parent[0].removeChild(e[0])}functionv(e,n,o){vars,m,u=n[0],h=o.target[0].firstElementChild,p=o.parent[0],f=o.selectEl[0],g=o.contentEl[0],b=p.getBoundingClientRect(),E=h.getBoundingClientRect(),v=!1,$={left:b.left+d,top:d,bottom:b.height-d,right:b.width-d-(c.floatingScrollbars()?16:0)},M={top:E.top-$.top,left:E.left-$.left,right:$.right-(E.left+E.width),bottom:$.bottom-(E.top+E.height)},y=b.width-2*d,A=g.scrollHeight>g.offsetHeight,C=f.querySelector("md-option[selected]"),s=f.getElementsByTagName("md-option"),T=f.getElementsByTagName("md-optgroup"),k=r(o.loadingAsync);m=k?g.firstElementChild||g:C?C:T.length?T[0]:s.length?s[0]:g.firstElementChild||g,g.offsetWidth>y&&(g.style["max-width"]=y+"px"),v&&(g.style["min-width"]=E.width+"px"),A&&f.classList.add("md-overflow");varw=m;"MD-OPTGROUP"===(w.tagName||"").toUpperCase()&&(w=s[0]||g.firstElementChild||g,m=w),o.focusedNode=w;varx=f.getBoundingClientRect(),N=a(m);if(m){var_=l.getComputedStyle(m);N.paddingLeft=parseInt(_.paddingLeft,10)||0,N.paddingRight=parseInt(_.paddingRight,10)||0}if(A){varS=g.offsetHeight/2;g.scrollTop=N.top+N.height/2-S,M.top<S?g.scrollTop=Math.min(N.top,g.scrollTop+S-M.top):M.bottom<S&&(g.scrollTop=Math.max(N.top+N.height-x.height,g.scrollTop-S+M.bottom))}varH,D,I,O;v?(H=E.left,D=E.top+E.height,I="50% 0",D+x.height>$.bottom&&(D=E.top-x.height,I="50% 100%")):(H=E.left+N.left-N.paddingLeft+2,D=Math.floor(E.top+E.height/2-N.height/2-N.top+g.scrollTop)+2,I=N.left+E.width/2+"px "+(N.top+N.height/2-g.scrollTop)+"px 0px",O=E.width+N.paddingLeft+N.paddingRight);varR=u.getBoundingClientRect(),P=Math.round(100*Math.min(E.width/x.width,1))/100,L=Math.round(100*Math.min(E.height/x.height,1))/100;return{container:{element:t.element(u),styles:{left:Math.floor(i($.left,H,$.right-R.width)),top:Math.floor(i($.top,D,$.bottom-R.height)),"min-width":O}},dropDown:{element:t.element(f),styles:{transformOrigin:I,transform:o.alreadyOpen?"":c.supplant("scale({0},{1})",[P,L])}}}}var$="$mdSelect.show() expected a target element in options.target but got '{0}'!",M=c.dom.animator;return{parent:"body",themable:!0,onShow:f,onRemove:p,hasBackdrop:!0,disableParentScroll:!0}}functionr(e){returne&&t.isFunction(e.then)}functioni(e,t,n){returnMath.max(e,Math.min(t,n))}functiona(e){returne?{left:e.offsetLeft,top:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}:{left:0,top:0,width:0,height:0}}returno.$inject=["$mdSelect","$mdConstant","$mdUtil","$window","$q","$$rAF","$animateCss","$animate"],e("$mdSelect").setDefaults({methods:["target"],options:o})}vard=8,c=0;t.module("material.components.select",["material.core","material.components.backdrop"]).directive("mdSelect",e).directive("mdSelectMenu",o).directive("mdOpti
m.bottom="auto",m.maxHeight=Math.min(r,o.bottom-t.bottom-i)+"px"),ne.$.ul.css(m),a.nextTick(e,!1)}functiong(){ne.$.root.length&&(c(ne.$.ul),ne.$.ul.detach(),ne.$.root.append(ne.$.ul),s.pin&&s.pin(ne.$.ul,m))}functionb(){e.autofocus&&ne.input.focus()}functionE(){varn=parseInt(e.delay,10)||0;u.$observe("disabled",function(e){J.isDisabled=e}),u.$observe("required",function(e){J.isRequired=null!==e}),e.$watch("searchText",n?a.debounce(D,n):D),e.$watch("selectedItem",w),t.element(l).on("resize",f),e.$on("$destroy",v)}functionv(){t.element(l).off("resize",f),ne.$.ul.remove()}function$(){ne={main:o[0],ul:o.find("ul")[0],input:o.find("input")[0],wrap:o.find("md-autocomplete-wrap")[0],root:document.body},ne.li=ne.ul.getElementsByTagName("li"),ne.snap=M(),ne.$=y(ne)}functionM(){for(vare=o;e.length;e=e.parent())if(t.isDefined(e.attr("md-autocomplete-snap")))returne[0];returnne.wrap}functiony(e){varn={};for(varoine)e.hasOwnProperty(o)&&(n[o]=t.element(e[o]));returnn}functionA(e,t){!e&&t?(f(),ne&&a.nextTick(function(){a.disableScrollAround(ne.ul)},!1)):e&&!t&&a.nextTick(function(){a.enableScrolling()},!1)}functionC(){re=!0}functionT(){re=!1,ae||(J.hidden=!0)}functionk(){ne.input.focus()}functionw(t,n){t&&L(t).then(function(o){e.searchText=o,_(t,n)}),t!==n&&x()}functionx(){t.isFunction(e.itemChange)&&e.itemChange(F(e.selectedItem))}functionN(){t.isFunction(e.textChange)&&e.textChange()}function_(e,t){ie.forEach(function(n){n(e,t)})}functionS(e){-1==ie.indexOf(e)&&ie.push(e)}functionH(e){vart=ie.indexOf(e);-1!=t&&ie.splice(t,1)}functionD(t,n){J.index=B(),t!==n&&L(e.selectedItem).then(function(o){t!==o&&(e.selectedItem=null,t!==n&&N(),q()?Q():(J.loading=!1,J.matches=[],J.hidden=z(),K()))})}functionI(){ae=!1,re||(J.hidden=!0)}functionO(){ae=!0,t.isString(e.searchText)||(e.searchText=""),e.minLength>0||(J.hidden=z(),J.hidden||Q())}functionR(e){switch(e.keyCode){cased.KEY_CODE.DOWN_ARROW:if(J.loading)return;e.stopPropagation(),e.preventDefault(),J.index=Math.min(J.index+1,J.matches.length-1),X(),K();break;cased.KEY_CODE.UP_ARROW:if(J.loading)return;e.stopPropagation(),e.preventDefault(),J.index=J.index<0?J.matches.length-1:Math.max(0,J.index-1),X(),K();break;cased.KEY_CODE.TAB:cased.KEY_CODE.ENTER:if(J.hidden||J.loading||J.index<0||J.matches.length<1)return;e.stopPropagation(),e.preventDefault(),V(J.index);break;cased.KEY_CODE.ESCAPE:e.stopPropagation(),e.preventDefault(),Y(),J.matches=[],J.hidden=!0,J.index=B()}}functionP(){returnt.isNumber(e.minLength)?e.minLength:1}functionL(t){functionn(t){returnt&&e.itemText?e.itemText(F(t)):null}returnh.when(n(t)||t)}functionF(e){if(!e)returnn;vart={};returnJ.itemName&&(t[J.itemName]=e),t}functionB(){returne.autoselect?0:-1}functionz(){returnq()&&J.matches.length?void0:!0}functionj(){returnL(J.matches[J.index])}functionq(){returnt.isDefined(e.searchText)&&e.searchText.length>=P()}functionU(e,t,n){Object.defineProperty(J,e,{get:function(){returnn},set:function(e){varo=n;n=e,t(e,o)}})}functionV(t){a.nextTick(function(){L(J.matches[t]).then(function(e){vart=ne.$.input.controller("ngModel");t.$setViewValue(e),t.$render()})["finally"](function(){e.selectedItem=J.matches[t],J.loading=!1,J.hidden=!0,J.index=0,J.matches=[]})},!1)}functionY(){e.searchText="",V(-1);vart=document.createEvent("CustomEvent");t.initCustomEvent("input",!0,!0,{value:e.searchText}),ne.input.dispatchEvent(t),ne.input.focus()}functionW(n){functiono(t){oe[i]=t,n===e.searchText&&(J.matches=t,J.hidden=z(),e.selectOnMatch&&Z(),K(),f())}varr=e.$parent.$eval(te),i=n.toLowerCase();t.isArray(r)?o(r):r&&a.nextTick(function(){J.loading=!0,r.success&&r.success(o),r.then&&r.then(o),r["finally"]&&r["finally"](function(){J.loading=!1})})}functionK(){j().then(function(e){J.messages=[G(),e]})}functionG(){if(de===J.matches.length)return"";switch(de=J.matches.length,J.matches.length){case0:return"There are no matches available.";case1:return"There is 1 match available.";default:return"There are "+J.matches.length+" matches available."}}functionX(){if(ne.li[J.index]){vare=ne.li[J.ind